/** * processAction * Update the record previously selected * @return unknown_type */ public function processAction() { $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); $form = $this->getForm("/admin/productsattributes/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/productsattributes/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/productsattributes/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null))); try { // Check if we have a POST request if (!$request->isPost()) { return $this->_helper->redirector('list', 'productsattributes', 'admin'); } if ($form->isValid($request->getPost())) { $params = $request->getParams(); $id = $params['attribute_id']; $code = $params['code']; $label = $params['label']; $type = $params['type']; $prefix = $params['prefix']; $suffix = $params['suffix']; $is_system_var = $params['system']; $description = $params['description']; $position = $params['position']; $is_visible_on_front = $params['is_visible_on_front']; $active = $params['active']; $system = $params['system']; $system_var = $params['system_var']; $defaultvalue = $params['defaultvalue']; $is_required = $params['is_required']; $is_comparable = $params['is_comparable']; $on_product_listing = !empty($params['on_product_listing']) && $params['on_product_listing'] == 1 ? true : false; $language_id = $params['language_id']; $id = ProductsAttributes::addNew($id, $code, $label, $type, $language_id, $position, $active, $prefix, $suffix, $description, $is_visible_on_front, $is_system_var, $system_var, $defaultvalue, $is_required, $is_comparable, $on_product_listing); if ($id === false) { $this->_helper->redirector('list', 'productsattributes', 'admin', array('mex' => "There was an error during the saving process. Check all the parameters.", 'status' => 'danger')); } $this->_helper->redirector('edit', 'productsattributes', '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("Hosting Plan Feature details"); $this->view->description = $this->translator->translate("Here you can fix the hosting plan feature details."); return $this->render('applicantform'); } } catch (Exception $e) { $this->_helper->redirector('edit', 'productsattributes', 'admin', array('id' => $id, 'mex' => $e->getMessage(), 'status' => 'danger')); } }