with all columns and annotations necessary to // render the full page // Impose visibility constraints // ------------------------------------------------------------ //filter if limited visibility or if unlimited visibility and in a queue $ignoreVisibility = $queue->ignoreVisibilityConstraints($thisstaff); if (!$ignoreVisibility || //limited visibility ($ignoreVisibility && ($queue->isAQueue() || $queue->isASubQueue())) //unlimited visibility + not a search ) $tickets->filter($thisstaff->getTicketsVisibility()); // do not show children tickets unless agent is doing a search if ($queue->isAQueue() || $queue->isASubQueue()) $tickets->filter(Q::any( array('ticket_pid' => null, 'flags__hasbit' => TICKET::FLAG_LINKED))); // Make sure the cdata materialized view is available TicketForm::ensureDynamicDataView(); // Anpassung Anfang: Fälligkeitsampel $tickets->values('sla'); $tickets->values('duedate'); $tickets->values('est_duedate'); $tickets->values('status__state'); // Anpassung Ende: Fälligkeitsampel // Identify columns of output $columns = $queue->getColumns(); // Figure out REFRESH url — which might not be accurate after posting a // response // Remove some variables from query string. $qsFilter = ['id']; if (isset($_REQUEST['a']) && ($_REQUEST['a'] !== 'search')) $qsFilter[] = 'a'; $refresh_url = Http::refresh_url($qsFilter); // Establish the selected or default sorting mechanism if (isset($_GET['sort']) && is_numeric($_GET['sort'])) { $sort = $_SESSION['sort'][$queue->getId()] = array( 'col' => (int) $_GET['sort'], 'dir' => (int) $_GET['dir'], ); } elseif (isset($_GET['sort']) // Drop the leading `qs-` && (strpos($_GET['sort'], 'qs-') === 0) && ($sort_id = substr($_GET['sort'], 3)) && is_numeric($sort_id) && ($sort = QueueSort::lookup($sort_id)) ) { $sort = $_SESSION['sort'][$queue->getId()] = array( 'queuesort' => $sort, 'dir' => (int) $_GET['dir'], ); } elseif (isset($_SESSION['sort'][$queue->getId()])) { $sort = $_SESSION['sort'][$queue->getId()]; } elseif ($queue_sort = $queue->getDefaultSort()) { $sort = $_SESSION['sort'][$queue->getId()] = array( 'queuesort' => $queue_sort, 'dir' => (int) $_GET['dir'] ?? 0, ); } // Handle current sorting preferences $sorted = false; foreach ($columns as $C) { // Sort by this column ? if (isset($sort['col']) && $sort['col'] == $C->id) { $tickets = $C->applySort($tickets, $sort['dir']); $sorted = true; } } //Anpassung Anfang: Fälligkeitsampel if (isset($sort['col']) && $sort['col'] == 9 && $sorted == false) { $tickets->order_by('est_duedate', (($sort['dir'])?'DESC':'ASC')); $sorted = true; } //Anpassung Ende: Fälligkeitsampel // Apply queue sort if it's not already sorted by a column if (!$sorted) { // Apply queue sort-dropdown selected preference if (isset($sort['queuesort'])) $sort['queuesort']->applySort($tickets, $sort['dir']); else // otherwise sort by created DESC $tickets->order_by('-created'); } // Apply pagination // Anpassung Anfang: Abteilungsauswahl if(!$ds->isEnabled()) { // Anpassung Ende: Abteilungsauswahl $page = (isset($_GET['p']) && is_numeric($_GET['p']))?$_GET['p']:1; $pageNav = new Pagenate(PHP_INT_MAX, $page, PAGE_LIMIT); $tickets = $pageNav->paginateSimple($tickets); // Anpassung Anfang: Abteilungsauswahl } // Anpassung Ende: Abteilungsauswahl if (isset($tickets->extra['tables'])) { // Creative twist here. Create a new query copying the query criteria, sort, limit, // and offset. Then join this new query to the $tickets query and clear the // criteria, sort, limit, and offset from the outer query. $criteria = clone $tickets; $criteria->limit(500); $criteria->annotations = $criteria->related = $criteria->aggregated = $criteria->annotations = $criteria->ordering = []; $tickets->constraints = $tickets->extra = []; $criteria->extra(array('select' => array('relevance' => 'Z1.relevance'))); $tickets = $tickets->filter(['ticket_id__in' => $criteria->values_flat('ticket_id')]); $tickets->order_by(new SqlCode('relevance'), QuerySet::DESC); # Index hint should be used on the $criteria query only $tickets->clearOption(QuerySet::OPT_INDEX_HINT); } $tickets->distinct('ticket_id'); $Q = $queue->getBasicQuery(); if ($Q->constraints) { if (count($Q->constraints) > 1) { foreach ($Q->constraints as $value) { if (!$value->constraints) $empty = true; } } } if (($Q->extra && isset($Q->extra['tables'])) || !$Q->constraints || $empty) { $skipCount = true; $count = '-'; } // Anpassung Anfang: Abteilungsauswahl if($ds->isEnabled()) { $tickets->values('dept_id'); $ds->setCurrentQueue($queue); $ds->printSelector(clone $tickets); // Prüfen, ob die ausgewählte Abteilung überhaupt in dieser Queue angezeigt wird if(($dsId=$ds->getCurrentDept())) { $tickets->filter(array('dept_id'=>$dsId)); } $count = $tickets->count(); // Apply pagination $page = (isset($_GET['p']) && is_numeric($_GET['p']))?$_GET['p']:1; $pageNav = new Pagenate(PHP_INT_MAX, $page, PAGE_LIMIT); $tickets = $pageNav->paginateSimple($tickets); } else // Anpassung Ende: Abteilungsauswahl $count = $count ?? $queue->getCount($thisstaff); $pageNav->setTotal($count, true); $pageNav->setURL('tickets.php', $args); ?>

getName(); ?> getSupplementalCriteria())) echo sprintf(' ', Format::htmlchars($queue->describeCriteria($crit))); ?>

  • id > 0 && $queue->isOwner($thisstaff)) { ?>
$status ?? null)); }?>
canManageTickets(); if ($canManageTickets) { ?> getLocalHeading()); if ($C->isSortable()) { $args = $_GET; $dir = $sort['col'] != $C->id ?: ($sort['dir'] ? 'desc' : 'asc'); $args['dir'] = $sort['col'] != $C->id ?: (int) !$sort['dir']; $args['sort'] = $C->id; $heading = sprintf('%s', Http::build_query($args), $dir, $heading); } echo sprintf('', $C->getWidth(), $C->id, $heading); // Anpassung Anfang: Fälligkeitsampel if($C->id == 1) { $sortID = 9; $args = $_GET; $dir = $sort['col'] != $sortID ?: ($sort['dir'] ? 'desc' : 'asc'); $args['dir'] = $sort['col'] != $sortID ?: (int) !$sort['dir']; $args['sort'] = $sortID; $heading = ''; if($sort['col'] == $sortID && $dir == 'desc') $heading = ''; elseif($sort['col'] == $sortID && $dir == 'asc') $heading = ''; $heading = sprintf('%s', Http::build_query($args), $dir, $heading); echo sprintf('', '2%', 0, $heading); } // Anpassung Ende: Fälligkeitsampel } ?> '; if ($canManageTickets) { ?> render($T); if ($style = $styles ? 'style="'.$styles.'"' : '') { echo ""; } else { echo ""; } // Anpassung Anfang: Fälligkeitsampel if($C->id == 1 && $status != 'closed') { require_once(INCLUDE_DIR.'class.addfunctions.php'); // gibt es ein Fälligkeitsdatum? $dueDate = $T['duedate'] ? $T['duedate'] : NULL; // wenn nicht, greift ein SLA? if($dueDate == NULL && intval($T['sla']) > 0){$dueDate = $T['est_duedate'];}; $isclosed = (strcasecmp($T['status__state'],'closed') == 0)?1:0; echo ''; } // Anpassung Ende: Fälligkeitsampel } echo ''; } ?>
%s%s
$contents
$contents'.ddl::getDdlGraficCode($dueDate, $T['isoverdue'], $isclosed).'
         '; echo $ferror?Format::htmlchars($ferror):__('Query returned 0 results.'); echo ''; } ?>
0 || $skipCount) { //if we actually had any tickets returned. ?>
showing(); ?> getPageLinks().' '; ?>