/** * processAction * Update the record previously selected * @return unknown_type */ public function processAction() { $request = $this->getRequest(); // Check if we have a POST request if (!$request->isPost()) { return $this->_helper->redirector('index'); } // Get our form and validate it $form = $this->getForm('/admin/domains/process'); if (!$form->isValid($request->getPost())) { // Invalid entries $this->view->form = $form; $this->view->title = $this->translator->translate("Domain process task"); $this->view->description = $this->translator->translate("Here you have to fix the domain parameters set."); return $this->render('applicantform'); // re-render the login form } // Get the values posted $params = $form->getValues(); // Get the id $id = $this->getRequest()->getParam('domain_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/domains/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/domains/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null))); try { $id = Domains::saveAll($id, $params); Domains::saveDnsZones($id, $params); Domains::setAutorenew($id, $params['autorenew'] == 0 ? false : true); DomainsNichandle::setNicHandles($id, $params['owner'], $params['admin'], $params['tech'], $params['billing']); // If the domain status has been set as active // the registrar task record will be set as completed if ($params['status_id'] == Statuses::id("active", 'domains')) { DomainsTasks::setStatusTask($id, Statuses::id("complete", 'domains_tasks')); // Complete } // Save the message note if (!empty($params['message'])) { $message = new Messages(); $message->dateposted = date('Y-m-d H:i:s'); $message->message = $params['message']; $message->isp_id = 1; $message->domain_id = $id; $message->save(); } $this->_helper->redirector('edit', 'domains', 'admin', array('id' => $id, 'mex' => 'The task requested has been executed successfully.', 'status' => 'success')); } catch (Exception $e) { $this->_helper->redirector('list', 'domains', 'admin', array('mex' => $e->getMessage(), 'status' => 'danger')); } }