示例#1
0
 /**
  * editAction
  * Get a record and populate the application form 
  * @return unknown_type
  */
 public function editAction()
 {
     $form = $this->getForm('/admin/taxes/process');
     //* GUEST - ALE - 20130322: Rimosso setLabel in quanto il campo non e' presente nella form
     //
     $id = $this->getRequest()->getParam('id');
     // 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/taxes/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/taxes/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null)));
     if (!empty($id) && is_numeric($id)) {
         $rs = Taxes::find($id, null, true);
         if (!empty($rs[0])) {
             $form->populate($rs[0]);
             $this->view->buttons[] = array("url" => "/admin/taxes/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("Tax edit");
     $this->view->description = $this->translator->translate("Here you can edit the tax percentage data.");
     $this->view->form = $form;
     $this->render('applicantform');
 }