/** * editAction * Get a record and populate the application form * @return unknown_type */ public function editAction() { $form = $this->getForm('/domains/process'); $id = $this->getRequest()->getParam('id'); if (!empty($id) && is_numeric($id)) { if (!empty($this->customer['customer_id']) && is_numeric($this->customer['customer_id'])) { $customer_id = $this->customer['customer_id']; } // Get these fields before editing the form // the field autorenew has been aliased in order to create a flat array and not a multidimentional array as proposed by the Doctrine engine $fields = "domain_id, registrars_id, CONCAT('http://www.', d.domain, '.', ws.tld) as Domain, d.authinfocode as authinfocode, \n\t\t\tp.product_id as product_id, d.domain as domainame, ws.tld as tld, d.autorenew as autorenew, \n\t\t\tDATE_FORMAT(d.creation_date, '%d/%m/%Y') as Starting, (DATEDIFF(expiring_date, CURRENT_DATE)) as Days, \n\t\t\tDATE_FORMAT(d.expiring_date, '%d/%m/%Y') as Termination, s.status as Status"; $rs = $this->domains->getAllInfo($id, $customer_id, $fields, true); if (empty($rs)) { $this->_helper->redirector('index', 'domains', 'default', array('mex' => 'forbidden', 'status' => 'danger')); } $form->populate($rs[0]); if ($rs[0]['autorenew']) { $this->view->autorenew = true; } else { $this->view->autorenew = false; } // Some useful values $this->view->name = $rs[0]['domainame'] . "." . $rs[0]['tld']; $this->view->days = $rs[0]['Days']; $this->view->domain_id = $id; $this->view->productid = $rs[0]['product_id']; // Show the list of the messages attached to this domain $this->view->messages = Messages::getbyDomainId($id); $this->view->tags = Tags::findConnectionbyDomainID($id); $this->view->is_maintained = $rs[0]['registrars_id']; $this->view->customerid = $customer_id; $this->view->authinfocode = $rs[0]['authinfocode']; $this->view->id = $id; $this->view->orders = array('records' => domains::Orders($id), 'edit' => array('controller' => 'orders', 'action' => 'edit')); $this->view->services = array('records' => domains::Services($id), 'edit' => array('controller' => 'services', 'action' => 'edit')); $this->view->tasks = array('records' => DomainsTasks::getTasksbyDomainID($id)); // Hide these fields and values inside the vertical grid object unset($rs[0]['autorenew']); unset($rs[0]['authinfocode']); unset($rs[0]['note']); unset($rs[0]['domainame']); unset($rs[0]['tld']); // Sent the data to the datagrid $this->view->datagrid = array('records' => $rs); $this->view->dnsgrid = array('records' => Dns_Zones::getZones($id, true), 'delete' => array('controller' => 'domains', 'action' => 'deletednszone')); } $this->view->mex = $this->getRequest()->getParam('mex'); $this->view->mexstatus = $this->getRequest()->getParam('status'); $this->view->title = $this->translator->translate("Domain"); $this->view->description = $this->translator->translate("Here you can edit your own domain parameters."); $this->view->form = $form; $this->_helper->viewRenderer('customform'); }
/** * editAction * Get a record and populate the application form * @return unknown_type */ public function editAction() { $form = $this->getForm('/admin/domains/process'); $this->view->title = $this->translator->translate("Domain Edit"); $this->view->description = $this->translator->translate("Here you can edit your own domain parameters."); $id = $this->getRequest()->getParam('id'); if (!empty($id) && is_numeric($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/confirm/id/{$id}", "label" => $this->translator->translate('Delete'), "params" => array('css' => null)), array("url" => "/admin/domains/list", "label" => $this->translator->translate('List'), "params" => array('css' => null)), array("url" => "/admin/domains/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null)), array("url" => "/admin/domains/newevent/id/{$id}", "label" => $this->translator->translate('Calendar Event'), "params" => array('css' => null))); try { $rs = $this->domains->find($id, null); if (!empty($rs[0])) { $rs[0]['creation_date'] = Shineisp_Commons_Utilities::formatDateOut($rs[0]['creation_date']); $rs[0]['expiring_date'] = Shineisp_Commons_Utilities::formatDateOut($rs[0]['expiring_date']); $rs[0]['status_id'] = $rs[0]['Statuses']['status_id']; // Domains NicHandles $rs[0]['owner'] = DomainsNichandle::getProfile($id); $rs[0]['admin'] = DomainsNichandle::getProfile($id, "admin"); $rs[0]['tech'] = DomainsNichandle::getProfile($id, "tech"); $rs[0]['billing'] = DomainsNichandle::getProfile($id, "billing"); $form->populate($rs[0]); if (!empty($rs[0]['DomainsTlds']['WhoisServers'])) { $this->view->title = $rs[0]['domain'] . "." . $rs[0]['DomainsTlds']['WhoisServers']['tld']; $this->view->titlelink = "http://" . $rs[0]['domain'] . "." . $rs[0]['DomainsTlds']['WhoisServers']['tld']; $this->view->icon = "fa fa-globe"; } $this->view->owner_datagrid = domains::ownerGrid($id); $this->view->actions = Registrars::getActions($rs[0]['registrars_id']); } } catch (Exception $e) { die($e->getMessage()); } $this->view->id = $id; // Get all the messages attached to the domain $this->view->messages = Messages::getbyDomainId($id); } $this->view->mex = $this->getRequest()->getParam('mex'); $this->view->mexstatus = $this->getRequest()->getParam('status'); $this->view->dns_datagrid = Domains::dnsGrid(); $this->view->form = $form; $this->view->services_datagrid = array('records' => domains::Services($id), 'edit' => array('controller' => 'services', 'action' => 'edit')); $this->view->orders_datagrid = array('records' => domains::Orders($id), 'edit' => array('controller' => 'orders', 'action' => 'edit')); $this->render('applicantform'); }