/** * Create a new record * * @return void */ public function saveTask() { // Check for request forgeries Request::checkToken(); // Incoming $fields = Request::getVar('fields', array(), 'post'); $no_html = Request::getInt('no_html', 0); $tmpl = Request::getVar('component', ''); $row = new Query($this->database); if (!$row->bind($fields)) { if (!$no_html && $tmpl != 'component') { $this->setError($row->getError()); $this->editTask($row); } else { echo $row->getError(); } return; } // Check content if (!$row->check()) { if (!$no_html && $tmpl != 'component') { $this->setError($row->getError()); $this->editTask($row); } else { echo $row->getError(); } return; } // Store new content if (!$row->store()) { if (!$no_html && $tmpl != 'component') { $this->setError($row->getError()); $this->editTask($row); } else { echo $row->getError(); } return; } $row->reorder('folder_id=' . $this->database->Quote($row->folder_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_SAVED')); } else { $this->listTask(); } }
/** * Create a new record * * @return void */ public function saveTask() { // Check for request forgeries Request::checkToken(); // Incoming $fields = Request::getVar('fields', array(), 'post'); $no_html = Request::getInt('no_html', 0); $tmpl = Request::getVar('component', ''); $row = new Query($this->database); if (!$row->bind($fields)) { if (!$no_html && $tmpl != 'component') { $this->setError($row->getError()); $this->editTask($row); } else { echo $row->getError(); } return; } // Check content if (!$row->check()) { if (!$no_html && $tmpl != 'component') { $this->setError($row->getError()); $this->editTask($row); } else { echo $row->getError(); } return; } // Store new content if (!$row->store()) { if (!$no_html && $tmpl != 'component') { $this->setError($row->getError()); $this->editTask($row); } else { echo $row->getError(); } return; } if (!$no_html && $tmpl != 'component') { // Output messsage and redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=tickets&task=display&show=' . $row->id, false)); } else { $this->listTask(); } }