/** * processAction * Update the record previously selected * @return unknown_type */ public function processAction() { $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); $form = $this->getForm("/admin/notes/process"); $request = $this->getRequest(); $auth = Zend_Auth::getInstance(); $user = $auth->getIdentity(); // Create the buttons in the edit form $this->view->buttons = array(array("url" => "#", "label" => $this->translator->translate('Save'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/notes/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/notes/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null))); // Check if we have a POST request if (!$request->isPost()) { return $this->_helper->redirector('list', 'notes', 'admin'); } if ($form->isValid($request->getPost())) { $params = $form->getValues(); // Get the id $id = Notes::saveAll($params, $params['note_id'], $user['user_id']); if (is_numeric($id)) { $this->_helper->redirector('edit', 'notes', 'admin', array('id' => $id, 'mex' => $this->translator->translate("The task requested has been executed successfully."), 'status' => 'success')); } else { $redirector->gotoUrl("/admin/notes/list/"); } } else { $this->view->form = $form; $this->view->title = $this->translator->translate("Note edit"); $this->view->description = $this->translator->translate("Here you can edit a note."); return $this->render('applicantform'); } }