Beispiel #1
0
 /**
  * processAction
  * Update the record previously selected
  * @return unknown_type
  */
 public function processAction()
 {
     $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
     $form = $this->getForm("/admin/reviews/process");
     $request = $this->getRequest();
     // 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/banks/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/banks/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', 'reviews', 'admin');
     }
     if ($form->isValid($request->getPost())) {
         // Get the id
         $id = $this->getRequest()->getParam('review_id');
         // Set the new values
         if (is_numeric($id)) {
             $this->reviews = Reviews::getbyId($id);
         }
         // Get the values posted
         $params = $form->getValues();
         $id = Reviews::saveData($params);
         $redirector->gotoUrl("/admin/reviews/edit/id/{$id}");
     } else {
         $this->view->form = $form;
         $this->view->title = $this->translator->translate("Details of the reviews");
         $this->view->description = $this->translator->translate("Here you can check the submitted information.");
         return $this->render('applicantform');
     }
 }