/** * processAction * Update the record previously selected * @return unknown_type */ public function processAction() { $form = $this->getForm("/admin/purchases/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', 'purchases', 'admin'); } if ($form->isValid($request->getPost())) { $id = PurchaseInvoices::saveAll($this->getRequest()->getParam('purchase_id'), $request->getPost()); $this->_helper->redirector('edit', 'purchases', 'admin', array('id' => $id, 'mex' => $this->translator->translate('The task requested has been executed successfully.'), 'status' => 'success')); } else { $this->view->form = $form; $this->view->title = $this->translator->translate("Purchase Invoice Edit"); $this->view->description = $this->translator->translate("Here you can edit the selected purchase."); return $this->render('applicantform'); } }