• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

osTicket> Show 0 Opened Tickets

Oct26
2010
Written by Scott Rowley

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';
}
}
}
Posted in osTicket - Tagged mod, modification, osTicket, ticket
« osTicket> Transfer/Assign with no comment
» osTicket> Show “Closed Ticket” note

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top