public function gravatar($email, $width = 60) { if (!is_numeric($width)) { $width = 60; } if (Shineisp_Commons_Utilities::isEmail($email)) { return Shineisp_Commons_Gravatar::get_gravatar($email, $width); } return false; }
/** * 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'); }
public function Avatar($email, $width = "50", $attrs = array()) { return Shineisp_Commons_Gravatar::get_gravatar($email, $width, 'mm', 'g', true, $attrs); }
/** * editAction * Get a record and populate the application form * @return unknown_type */ public function editAction() { $form = $this->getForm('/admin/tickets/process'); $id = $this->getRequest()->getParam('id'); $this->view->title = $this->translator->translate("Edit Ticket"); $this->view->description = $this->translator->translate("Here you can handle the ticket support."); // 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/tickets/list/", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/tickets/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null))); if (!empty($id) && is_numeric($id)) { $this->view->buttons[] = array("url" => "/admin/tickets/setstatus/id/{$id}/statusid/" . Statuses::id('closed', 'tickets'), "label" => $this->translator->translate('Set as closed'), "params" => array('css' => array('btn btn-primary'))); $this->view->buttons[] = array("url" => "/admin/tickets/setstatus/id/{$id}/statusid/" . Statuses::id('solved', 'tickets'), "label" => $this->translator->translate('Set as solved'), "params" => array('css' => array('btn btn-success'))); $this->view->buttons[] = array("url" => "/admin/tickets/confirm/id/{$id}", "label" => $this->translator->translate('Delete'), "params" => array('css' => array('btn btn-danger'))); $form->populate(array('datetime' => date('d/m/Y H:i:s'), 'ticket_id' => $id)); $fields = "DATE_FORMAT(t.date_open, '%d/%m/%Y') as date_open, user_id, sibling_id, category_id as category, CONCAT(d.domain, '.', ws.tld) as domain, DATE_FORMAT(t.date_close, '%d/%m/%Y') as date_close, t.subject, t.description, t.status_id, s.status, c.email as email, c.customer_id as customer_id, CONCAT(c.firstname, ' ', c.lastname) as fullname, c.company as company, (DATEDIFF(t.date_close, t.date_open)) as days"; $rs = $this->tickets->getAllInfo($id, $fields, true); if (!empty($rs[0])) { $form->populate(array('datetime' => date('d/m/Y H:i:s'), 'ticket_id' => $id) + $rs[0]); $siblings = Tickets::getListbyCustomerId($rs[0]['customer_id'], true, true); unset($siblings[$id]); $form->getElement('sibling_id')->setMultiOptions($siblings); if (!empty($rs[0]['sibling_id'])) { $rs[0]['sibling'] = $this->tickets->getAllInfo($rs[0]['sibling_id'], $fields, true); } $this->view->record = $rs[0]; $this->view->siblings = $siblings; $this->view->customerid = $rs[0]['customer_id']; $isp = Isp::getActiveISP(); $this->view->customeravatar = Shineisp_Commons_Gravatar::get_gravatar($rs[0]['email'], 50); $this->view->notes = Tickets::Notes($id, "c.customer_id, tn.note_id, t.ticket_id, note_id as id, admin as adminreply, DATE_FORMAT(date_post, '%d/%m/%Y %H:%i:%s') as date_post, note as reply", true); // Header Information $this->view->title = "Edit Ticket: " . $rs[0]['subject']; $userlink = "<a href='/admin/customers/edit/id/" . $rs[0]['customer_id'] . "'>" . $rs[0]['fullname'] . "</a>"; if (!empty($rs[0]['company'])) { $userlink .= " [<a href='/admin/customers/edit/id/" . $rs[0]['customer_id'] . "'>" . $rs[0]['company'] . "</a>]"; } $description[] = $this->translator->_("Support Ticket from %s", $userlink); $description[] = TicketsCategories::getName($rs[0]['category']); $description[] = $this->translator->_("Opened on %s", $rs[0]['date_open']); if (!empty($rs[0]['date_close'])) { $description[] = $this->translator->_("Closed on %s", $rs[0]['date_close']); } if (!empty($rs[0]['domain'])) { $description[] = "<a target=\"blank\" href=\"http://www." . $rs[0]['domain'] . "\">" . $rs[0]['domain'] . "</a>"; } $this->view->description = implode(" - ", $description); // Hide these fields and values inside the vertical grid object unset($rs[0]['parent']); unset($rs[0]['description']); $this->view->data = array('records' => $rs); } } $this->view->form = $form; $this->render('applicantform'); }