/** * Delete one or more records * * @return void */ public function removeTask() { // Check for request forgeries Request::checkToken(['post', 'get']); // Incoming $ids = Request::getVar('id', array()); $ids = !is_array($ids) ? array($ids) : $ids; $no_html = Request::getInt('no_html', 0); $tmpl = Request::getVar('component', ''); // Check for an ID if (count($ids) < 1) { if (!$no_html && $tmpl != 'component') { App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_SUPPORT_ERROR_SELECT_QUERY_TO_DELETE'), 'error'); } return; } $row = new Query($this->database); foreach ($ids as $id) { // Delete message $row->delete(intval($id)); } if (!$no_html && $tmpl != 'component') { // Output messsage and redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_SUPPORT_QUERY_SUCCESSFULLY_DELETED', count($ids))); } else { $this->listTask(); } }
/** * Delete one or more records * * @return void */ public function removeTask() { // Incoming $id = Request::getInt('id', 0); $no_html = Request::getInt('no_html', 0); $tmpl = Request::getVar('component', ''); // Check for an ID if (!$id) { if (!$no_html && $tmpl != 'component') { App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=tickets&task=display', false), Lang::txt('COM_SUPPORT_ERROR_SELECT_QUERY_TO_DELETE'), 'error'); } return; } $row = new Query($this->database); // Delete message $row->delete(intval($id)); if (!$no_html && $tmpl != 'component') { // Output messsage and redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=tickets&task=display', false)); } else { $this->listTask(); } }