/** * editAction * Get a record and populate the application form * @return unknown_type */ public function editAction() { $form = $this->getForm('/admin/notes/process'); $id = $this->getRequest()->getParam('id'); $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))); if (!empty($id) && is_numeric($id)) { $rs = Notes::getById($id, null, true); if (!empty($rs[0])) { $form->populate($rs[0]); $this->view->buttons[] = array("url" => "/admin/notes/confirm/id/{$id}", "label" => $this->translator->translate('Delete'), "params" => array('css' => null)); } } $this->view->mex = $this->getRequest()->getParam('mex'); $this->view->mexstatus = $this->getRequest()->getParam('status'); $this->view->title = $this->translator->translate("Note edit"); $this->view->description = $this->translator->translate("Here you can edit a note."); $this->view->form = $form; $this->render('applicantform'); }