function Display($value, $params, $context, $id) { if (is_array($context['ticket'])) { $source = $context['ticket']['source']; } else { $source = $context['ticket']->source; } return SupportSource::get_source_title($source); }
static function load() { if (self::$loaded) { return; } $path = JPATH_SITE . DS . "components" . DS . "com_fss" . DS . "plugins" . DS . "ticketsource" . DS; $files = JFolder::files($path, ".php\$"); foreach ($files as $file) { $id = pathinfo($file, PATHINFO_FILENAME); $class = "Ticket_Source_" . $id; require_once $path . DS . $file; if (class_exists($class)) { self::$plugins[$id] = new $class(); self::$plugins[$id]->id = $id; } } self::$loaded = true; }
function display($tpl = NULL) { SupportSource::load(); FSS_Helper::StylesAndJS(array('ticket_list')); // check sorting, and if sorted disable groupings if (JFactory::getApplication()->getUserStateFromRequest("fss_admin.ordering", "ordering", "") != "") { SupportUsers::setSetting('group_products', 0); SupportUsers::setSetting('group_departments', 0); SupportUsers::setSetting('group_cats', 0); SupportUsers::setSetting('group_group', 0); SupportUsers::setSetting('group_pri', 0); } $this->checkCreateCancel(); $this->processBatch(); $this->setupMerge(); $this->getLimits(); if (FSS_Input::getCmd("what") == "search") { return $this->searchTickets(); } return $this->listTickets(); }
</label> <div class="controls"> <a class="btn btn-default btn-small" href="<?php echo FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=new&type=registered'); ?> "><?php echo JText::_("REGISTERED_USER"); ?> </a> <a class="btn btn-default btn-small" href="<?php echo FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=new&type=unregistered'); ?> "><?php echo JText::_("UNREGISTERED_USER"); ?> </a> <div style="line-height: 25px;display: inline-block;"> </div> </div> </div> </div> <?php } ?> <?php foreach (SupportSource::getOverview_Appends() as $html) { ?> <?php }
continue; } ?> <li class="fss_module_support_item"> <a href="<?php echo FSSRoute::_('index.php?option=com_fss&view=admin_support&tickets=' . $status->id); ?> "> <?php echo $status->title . " (" . $counts[$status->id] . ")"; ?> </a> </li> <?php } foreach (SupportSource::getMainMenu_Module_Admin_ListItems() as $item) { ?> <li class="fss_module_support_item"> <a href="<?php echo FSSRoute::_($item->link); ?> "> <?php echo $item->name . " (" . $item->count . ")"; ?> </a> </li> <?php } ?> </ul>
function doDisplayTicket() { if (!FSS_Permission::auth("fss.ticket.view", "com_fss.support_user")) { return FSS_Helper::NoPerm(); } if (!$this->GetTicket()) { return; } $this->readonly = false; SupportSource::doUser_View_Redirect($this->ticket); $this->redirectMergedTickets(); $this->getCCInfo(); // update lang code on ticket $lang = JFactory::getLanguage()->getTag(); $db = JFactory::getDBO(); $qry = "UPDATE #__fss_ticket_ticket SET lang = '" . FSSJ3Helper::getEscaped($db, $lang) . "' WHERE id = " . $this->ticket['id']; $db->setQuery($qry); $db->Query(); $what = FSS_Input::getCmd('what'); if ($what == "print") { return parent::display("print"); } $this->FixTicketStatus(); FSS_Helper::IncludeModal(); parent::display(); }
static function &getTicketCount($foradmin = true, $current_handler_only = false) { $key = 0; if ($foradmin) { $key += 1; } if ($current_handler_only) { $key += 2; } if (empty(self::$counts)) { self::$counts = array(); } if (!array_key_exists($key, self::$counts)) { $db = JFactory::getDBO(); $query = "SELECT count( * ) AS count, ticket_status_id FROM #__fss_ticket_ticket as t WHERE 1 "; $query .= " AND " . SupportUsers::getAdminWhere(); if ($foradmin) { $query .= " AND " . SupportSource::admin_list_sql(); } else { $query .= " AND " . SupportSource::user_list_sql(); } if ($current_handler_only) { $query .= " AND admin_id = " . JFactory::getUser()->id; } $query .= " GROUP BY ticket_status_id"; $db->setQuery($query); $rows = $db->loadAssocList(); $out = array(); FSS_Ticket_Helper::GetStatusList(); foreach (FSS_Ticket_Helper::$status_list as $status) { $out[$status->id] = 0; } if (count($rows) > 0) { foreach ($rows as $row) { $out[$row['ticket_status_id']] = $row['count']; } } // work out counts for allopen, closed, all, archived $archived = FSS_Ticket_Helper::GetStatusID("def_archive"); $out['archived'] = 0; if (array_key_exists($archived, $out)) { $out['archived'] = $out[$archived]; } $allopen = FSS_Ticket_Helper::GetStatusIDs("is_closed", true); $out['allopen'] = 0; foreach ($allopen as $id) { if (array_key_exists($id, $out)) { $out['allopen'] += $out[$id]; } } $allclosed = FSS_Ticket_Helper::GetClosedStatus(); $out['allclosed'] = 0; foreach ($allclosed as $id) { if (array_key_exists($id, $out)) { $out['allclosed'] += $out[$id]; } } $all = FSS_Ticket_Helper::GetStatusIDs("def_archive", true); $out['all'] = 0; foreach ($all as $id) { if (array_key_exists($id, $out)) { $out['all'] += $out[$id]; } } self::$counts[$key] = $out; } return self::$counts[$key]; }
<a href='<?php echo FSSRoute::_('index.php?option=com_fss&view=ticket&layout=support&tickets=all'); ?> '> <?php echo '<span>' . JText::sprintf("SA_ALL", $this->count['all']) . '</span>'; ?> </a> </li> <?php } ?> <?php foreach (SupportSource::getUser_Tabs() as $tab) { ?> <li class="<?php if ($tab->active) { echo "active"; } ?> "> <a href='<?php echo strpos($tab->link, 'index.php') === FALSE ? $tab->link : FSSRoute::_($tab->link); ?> '> <?php echo $tab->tabname; ?> </a>
function updateSource($new_source) { if ($new_source == $this->source) { return true; } $old_source = $this->source; $db = JFactory::getDBO(); $qry = "UPDATE #__fss_ticket_ticket SET source = '" . FSSJ3Helper::getEscaped($db, $new_source) . "' WHERE id = {$this->id}"; $db->setQuery($qry); $db->Query(); $this->updateLastUpdated(); $new_source_title = SupportSource::get_source_title($new_source); $old_source_title = SupportSource::get_source_title($old_source); $this->addAuditNote("Source changed from '" . $old_source_title . "' to '" . $new_source_title . "'"); $this->source = $new_source; SupportActions::DoAction_Ticket("updateSource", $this, array('old_source' => $old_source, 'new_source' => $new_source)); }
"> <a href='<?php echo FSSRoute::_('index.php?option=com_fss&view=admin_support&tickets=all'); ?> '> <?php echo FSS_Helper::TicketCountSpan($this->count['all'], "all", JText::sprintf("SA_ALL", $this->count['all'])); ?> </a> </li> <?php } ?> <?php foreach (SupportSource::get_tabs() as $tab) { ?> <li class="<?php if ($tab->active) { echo "active"; } ?> "> <a href='<?php echo FSSRoute::_($tab->link); ?> '> <?php echo $tab->tabname; ?> </a>
function &getTicketCount() { $user = JFactory::getUser(); $userid = $user->get('id'); if (empty(self::$ticket_counts)) { self::$ticket_counts = array(); } if (array_key_exists($userid, self::$ticket_counts)) { $this->_counts = self::$ticket_counts[$userid]; return $this->_counts; } $uidlist = $this->getUIDS($userid); $tidlist = $this->getTIDS($userid); $db = JFactory::getDBO(); $query = "SELECT count( * ) AS count, ticket_status_id FROM #__fss_ticket_ticket WHERE (user_id IN (" . implode(", ", $uidlist) . ") OR id IN ( " . implode(", ", $tidlist) . ")) "; $query .= " AND " . SupportSource::user_list_sql(); $query .= " GROUP BY ticket_status_id"; $db->setQuery($query); $rows = $db->loadAssocList(); $out = array(); FSS_Ticket_Helper::GetStatusList(); foreach (FSS_Ticket_Helper::$status_list as $status) { $out[$status->id] = 0; } if (count($rows) > 0) { foreach ($rows as $row) { $out[$row['ticket_status_id']] = $row['count']; } } // work out counts for allopen, closed, all, archived $archived = FSS_Ticket_Helper::GetStatusID("def_archive"); if (array_key_exists($archived, $out)) { $out['archived'] = $out[$archived]; } else { $out['archived'] = 0; } $allopen = FSS_Ticket_Helper::GetStatusIDs("is_closed", true); $out['open'] = 0; foreach ($allopen as $id) { if (array_key_exists($id, $out)) { $out['open'] += $out[$id]; } } $allclosed = FSS_Ticket_Helper::GetClosedStatus(); $out['closed'] = 0; foreach ($allclosed as $id) { if (array_key_exists($id, $out)) { $out['closed'] += $out[$id]; } } $all = FSS_Ticket_Helper::GetStatusIDs("def_archive"); $out['all'] = 0; foreach ($rows as $row) { if ($row['ticket_status_id'] != $all) { $out['all'] += $row['count']; } } $this->_counts = $out; self::$ticket_counts[$userid] = $out; return $this->_counts; }
<a href="<?php echo FSSRoute::_('index.php?option=com_fss&view=admin_support&tickets=' . $status->id); ?> "> <?php echo $status->title; ?> (<?php echo $counts[$status->id]; ?> ) </a> </h4> <?php } foreach (SupportSource::getMainMenu_ListItems() as $item) { ?> <h4 class="margin-mini"> <a href="<?php echo FSSRoute::_($item->link); ?> "> <?php echo $item->name; ?> (<?php echo $item->count; ?> ) </a> </h4>