I made a modification to the /include/class.tickets.php file so that the staff_id does not get overwritten to 0 when a staff member closes out a ticket.

As a result, this allows us to see who actually worked on a ticket. However, as a result of this mod I have seen it cause one issue. The "My Tickets" count at the top is not updated. See, since we have an actual number in the staff_id it is counting even closed tickets as a part of the count. We would like it to just ONLY the open tickets for a particular user.

I edited /include/staff/tickets.inc.php and uncommented $status='Open'

case 'assigned':

//$status='Open'; //

$staffId=$thisuser->getId();

break;

For some reason, I must be missing something since the number hasn't changed and still includes the users' closed tickets as well.

Any help would be greatly appreciated.

hoffmana,

See the latter part of my MOD on 'Assign to column'. Start reading around the bolded "include/class.ticket.php" section.

Edit: Sorry, forgot to include the link:

http://sudobash.net/?p=158

Thank you for your response. That worked for me!

4 days later

Any idea how to get the Open ticket number to be correct too?

For example, it shows Open (85) at the top

But when I click it shows "Showing 1 - 20 of 20"

Thanks in advance

Any idea how to get the Open ticket number to be correct too?

For example, it shows Open (85) at the top

But when I click it shows "Showing 1 - 20 of 20"

Thanks in advance

In scp/tickets.php what do you have for the open portion of your 'quick stats':

$sql='SELECT count(open.ticket_id) as open

This is what I have...

$sql='SELECT count(open.ticket_id) as open, count(answered.ticket_id) as answered '.

16 days later

In scp/tickets.php what do you have for the open portion of your 'quick stats':

$sql='SELECT count(open.ticket_id) as open

Any ideas on this? It's been awhile since I posted. This is confusing people since the Open tickets shown in the header is not accurate.

Hmm, well that all looks ok. What do you have for your entire $sql for the quick stats?

Mine: (which may include changes for MODs - I'm not sure at this point)

$sql='SELECT count(open.ticket_id) as open, count(answered.ticket_id) as answered '.

',count(overdue.ticket_id) as overdue, count(assigned.ticket_id) as assigned '.

' FROM '.TICKET_TABLE.' ticket '.

'LEFT JOIN '.TICKET_TABLE.' open ON open.ticket_id=ticket.ticket_id AND open.status=\'Open\' AND open.isanswered=0 '.

'LEFT JOIN '.TICKET_TABLE.' answered ON answered.ticket_id=ticket.ticket_id AND answered.status=\'Open\' AND answered.isanswered=1 '.

'LEFT JOIN '.TICKET_TABLE.' overdue ON overdue.ticket_id=ticket.ticket_id AND overdue.status=\'Open\' AND overdue.isoverdue=1 '.

'LEFT JOIN '.TICKET_TABLE.' assigned ON assigned.ticket_id=ticket.ticket_id AND open.status=\'Open\' AND assigned.staff_id='.db_input($thisuser->getId());

Thanks for getting back to me on this. Here is what I have for the quick stats:

/*quick stats...*/

$sql='SELECT count(open.ticket_id) as open, count(answered.ticket_id) as answered '.

',count(overdue.ticket_id) as overdue, count(assigned.ticket_id) as assigned '.

' FROM '.TICKET_TABLE.' ticket '.

'LEFT JOIN '.TICKET_TABLE.' open ON open.ticket_id=ticket.ticket_id AND open.status=\'open\' AND open.isanswered=0 '.

'LEFT JOIN '.TICKET_TABLE.' answered ON answered.ticket_id=ticket.ticket_id AND answered.status=\'open\' AND answered.isanswered=1 '.

'LEFT JOIN '.TICKET_TABLE.' overdue ON overdue.ticket_id=ticket.ticket_id AND overdue.status=\'open\' AND overdue.isoverdue=1 '.

'LEFT JOIN '.TICKET_TABLE.' assigned ON assigned.ticket_id=ticket.ticket_id AND ticket.status=\'open\' AND assigned.staff_id='.db_input($thisuser->getId());

// 'LEFT JOIN '.TICKET_TABLE.' assigned ON assigned.ticket_id=ticket.ticket_id AND assigned.staff_id='.db_input($thisuser->getId());

Are you able to run the following from either a mysql prompt or a phpmysql install?

SELECT count(ticket_id) from ost_ticket where `status`='open' AND isanswered=0;

If so does that number match what you are seeing in your "Open(#)" ?

Yes, I just ran that query on the database and it returned the number that we see from Open(#).

Yes, I just ran that query on the database and it returned the number that we see from Open(#).

Ok, then I'd think it would actually be the other number that is wrong then. The "Showing 1 of 20" or w/e the terminology is there. Can you confirm whether or not you ACTUALLY have X tickets open? Does it match the "Showing" statement or the "Open" statement?

I'm not really sure where that X number is coming from.

When I click the Open button, it displays "Showing 1 - 25 of 25 Open Tickets"

Then the list shows the 25 tickets that are in fact open in the system. There is only 1 page. Not sure why it displays 80 tickets being open in the header.

I'm not really sure where that X number is coming from.

When I click the Open button, it displays "Showing 1 - 25 of 25 Open Tickets"

Then the list shows the 25 tickets that are in fact open in the system. There is only 1 page. Not sure why it displays 80 tickets being open in the header.

I'm thinking you actually have 80 tickets open then. If you run this do you get 80 results (then check them randomly to make sure they are open).

SELECT ticket_id from ost_ticket where `status`='open' AND isanswered=0;

Thats got to be reporting only whats open right now and you said that matches the "Open(#)". In that case, I'm afraid you may have dozens of tickets that are open and "hidden" to you right now :(

I think I noticed what is going on here. When I logged into the Administrator account I saw the 80 tickets that were showing up as Open. It appears that a user (such as myself) only see certain tickets and that is why I only saw the 25. Is this the way the system was supposed to work? It just does not seem to make any sense that a staff member would see those 80 tickets from the top of the interface but have no way of actually seeing them.

Nope, thats not normal.

Right after the quick stats code you posted earlier do you have the following:

if(!$thisuser->isAdmin()){

$sql.=' WHERE ticket.dept_id IN('.implode(',',$thisuser->getDepts()).')';

}

haha, that's good to know :)

here is what I have right after the quick stats code:

if(!$thisuser->isAdmin()){

$sql.=' WHERE ticket.dept_id IN('.implode(',',$thisuser->getDepts()).') OR ticket.staff_id='.db_input($thisuser->getId());

}

Ok, it looks like for 1.6 ST that is the correct code. I'm moving on down the code to see where that gets used again in 1.6ST. I'll let you know as soon as I find something else.

Hmm,

If you go to Admin Panel > Settings, do you have "Show answered tickets" set to on?

'Show answered tickets on open queue' is not checked. Should it be?

Write a Reply...