public function Show($parameters) { $view = new Zend_View(); $view->addScriptPath('../library/Shineisp/Custom/views'); $limit = 10; $id = null; $ns = new Zend_Session_Namespace(); $languageID = Languages::get_language_id($ns->lang); $translator = Shineisp_Registry::getInstance()->Zend_Translate; if (!empty($parameters['category']) && is_numeric($parameters['category'])) { $id = $parameters['category']; } if (!empty($parameters['limit']) && is_numeric($parameters['limit'])) { $limit = $parameters['limit']; } // Get the products $view->wiki = Wiki::get_items($limit, $id); return $view->render('wikilist.phtml'); }
/** * editAction * Get a record and populate the application form * @return unknown_type */ public function editAction() { $this->getHelper('layout')->setLayout('1column'); $form = $this->getForm('/tickets/process'); $id = $this->getRequest()->getParam('id'); if (!empty($id) && is_numeric($id)) { $isp = Shineisp_Registry::get('ISP'); $fields = "DATE_FORMAT(t.date_open, '%d/%m/%Y %H:%i:%s') as creationdate, t.sibling_id, DATE_FORMAT(t.date_close, '%d/%m/%Y %H:%i:%s') as expiringdate, \n\t\t\tt.subject, t.description, t.status_id as status_id, t.vote as vote, s.status as status, c.email as email, CONCAT(c.firstname, ' ', c.lastname) as customer, c.company as company, (DATEDIFF(t.date_close, t.date_open)) as days"; $rs = $this->tickets->getAllInfo($id, $fields, true); if (!empty($rs[0])) { if (!empty($rs[0]['sibling_id'])) { $rs[0]['sibling'] = Tickets::getAllInfo($rs[0]['sibling_id'], $fields, true); } $this->view->headTitle()->prepend($rs[0]['customer']); $this->view->headTitle()->prepend($rs[0]['subject']); $form->populate($rs[0]); $this->view->record = $rs[0]; $this->view->isp = $isp; $this->view->adminavatar = Shineisp_Commons_Gravatar::get_gravatar($isp->email, 80); $this->view->customeravatar = Shineisp_Commons_Gravatar::get_gravatar($rs[0]['email'], 80); $this->view->notes = Tickets::Notes($id, "note_id, admin as adminreply, vote as vote, DATE_FORMAT(date_post, '%d/%m/%Y %H:%i:%s') as date_post,CONCAT(c.firstname, ' ', c.lastname) as customer, c.company as company, note", true); $this->view->summary = $rs[0]; $status = $rs[0]['status_id']; if ($status == Statuses::id('closed', 'tickets') || $status == Statuses::id('solved', 'tickets')) { $this->view->canreply = false; } else { $this->view->canreply = true; } $this->view->name = $rs[0]['subject']; } $this->view->id = $id; $this->view->title = $this->translator->translate('Ticket'); $this->getHelper('layout')->setLayout('2columns-right'); $this->view->placeholder("right")->append($this->view->partial('partials/wikisidebar.phtml', array('items' => Wiki::get_items(5)))); } $this->view->title = $this->translator->translate("Ticket"); $this->view->description = $this->translator->translate("Here you can write down your problem. Remember to be clear and analytic in order to explain the problem that has been occurred."); $this->view->dnsdatagrid = $this->dnsGrid(); $this->view->form = $form; $this->_helper->viewRenderer('customform'); }