public function delete() { $this->output->set_content_type('application/json'); $url = $this->uri->ruri_to_assoc(3); $task_set_id = isset($url['task_set_id']) ? intval($url['task_set_id']) : 0; if ($task_set_id !== 0) { $this->_transaction_isolation(); $this->db->trans_begin(); $task_set = new Task_set(); $task_set->get_by_id($task_set_id); $task_set_permissions = $task_set->task_set_permission->get(); $task_set_permissions->delete_all(); $task_set->delete(); $this->lang->delete_overlays('task_sets', intval($task_set_id)); if ($this->db->trans_status()) { $this->db->trans_commit(); $this->output->set_output(json_encode(TRUE)); $this->_action_success(); } else { $this->db->trans_rollback(); $this->output->set_output(json_encode(FALSE)); } } else { $this->output->set_output(json_encode(FALSE)); } }