For some reason it was decided that if there are no open tickets then the ticket page should list all the Answered Tickets and then if there are none of those it should show all Closed tickets. This is highly confusing for everyone and we’re going to show you how to make it always show the Open Tickets page even when there are no open tickets.
scp/tickets.php
if($stats['open']) $nav->addSubMenu(array('desc'=>'Open ('.$stats['open'].')','title'=>'Open Tickets', 'href'=>'tickets.php', 'iconclass'=>'Ticket'));
Essentially we want to get rid of the "if" statement and say to always show the “Open page” title/nav. So just modify it to look something like this:
// We don't want an if (there are tickets) we always want the open page up/available. // if($stats['open']) $nav->addSubMenu(array('desc'=>'Open ('.$stats['open'].')','title'=>'Open Tickets', 'href'=>'tickets.php', 'iconclass'=>'Ticket'));
Then remove or comment out the following so that we’ll always see the Open ticket page even if there are 0 open tickets:
include/staff/tickets.inc.php, replace
// This sucks but we need to switch queues on the fly! depending on stats fetched on the parent. if($stats) { if(!$stats['open'] && (!$status || $status=='open')){ if(!$cfg->showAnsweredTickets() && $stats['answered']) { $status='open'; $showanswered=true; $results_type='Answered Tickets'; }elseif(!$stats['answered']) { //no open or answered tickets (+-queue?) - show closed tickets.??? $status='closed'; $results_type='Closed Tickets'; } } }
with
// This sucks but we need to switch queues on the fly! depending on stats fetched on the parent. if($stats) { if(!$stats['open'] && (!$status)){ if(!$cfg->showAnsweredTickets() && $stats['answered']) { $status='open'; $showanswered=true; $results_type='Answered Tickets'; // HACKED // // We want to show the Open tickets page even if there are no open tickets. // }elseif(!$stats['answered']) { //no open or answered tickets (+-queue?) - show closed tickets.??? // $status='closed'; // $results_type='Closed Tickets'; } } }