You can see the username of the staff memeber who has been assigned the ticket.
You can see the username of the staff member who has closed the ticket.
You need to change a few things in
osticket_root/include/staff/tickets.inc.php
Remember to take a backup of your original tickets.inc.php file before you start. I've done very little testing. It's working well for me so far. I'll update this post if I find problems.
Let me know how you go.
Attached to this post are two zip files. They have a picture of the final result in each.
I had a lot of trouble trying to attach jpg of gif files to this post. It didn't matter how small I made the pictures they wouldn't upload.
Phase1: Extend the SQL
Step1:
Look for
$qselect = 'SELECT DISTINCT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,ticket.staff_id,subject,name,email,dept_name '.
',ticket.status,ticket.source,isoverdue,isanswered,ticket.created,pri.* ,count(attach.attach_id) as attachments ';
Replace with
$qselect = 'SELECT DISTINCT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,ticket.staff_id,ticket.subject,ticket.name,ticket.email,dept_name '.
',ticket.status,ticket.source,isoverdue,isanswered,ticket.created,pri.* ,count(attach.attach_id) as attachments ';
Step2:
Look For
//Ok..lets roll...create the actual query
//ADD attachment,priorities and lock crap
$qselect.=' ,count(attach.attach_id) as attachments, IF(ticket.reopened is NULL,ticket.created,ticket.reopened) as effective_date';
Replace with
//Ok..lets roll...create the actual query
//ADD attachment,priorities and lock crap
$qselect.=' ,count(attach.attach_id) as attachments, IF(ticket.reopened is NULL,ticket.created,ticket.reopened) as effective_date';
//Does Assigned To stuff
$qselect.=' ,IF(staff_table.username is NULL,"unassigned",staff_table.username) as username';
//Does Closed By stuff
$qselect.=' ,IF(response.staff_name is NULL,"Closed. No reply",response.staff_name) as closed_by';
Step3:
Look For
$qfrom.=' LEFT JOIN '.TICKET_PRIORITY_TABLE.' pri ON ticket.priority_id=pri.priority_id '.
' LEFT JOIN '.TICKET_LOCK_TABLE.' tlock ON ticket.ticket_id=tlock.ticket_id AND tlock.expire>NOW() '.
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE.' attach ON ticket.ticket_id=attach.ticket_id ';
Replace With
$qfrom.=' LEFT JOIN '.TICKET_PRIORITY_TABLE.' pri ON ticket.priority_id=pri.priority_id '.
' LEFT JOIN '.TICKET_LOCK_TABLE.' tlock ON ticket.ticket_id=tlock.ticket_id AND tlock.expire>NOW() '.
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE.' attach ON ticket.ticket_id=attach.ticket_id '.
' LEFT JOIN '.STAFF_TABLE.' staff_table ON ticket.staff_id=staff_table.staff_id'.
' LEFT JOIN '.TICKET_RESPONSE_TABLE.' response ON (ticket.ticket_id=response.ticket_id )';
Phase 2: Modify the html table data
Step1:
Look for
<th width="180" >From</th>
Replace with
<th width="180" >From</th>
<?php if($status!='closed'){?>
<th width="70">Assigned To</th>
<?php }else{ ?>
<th width="70">Closed By</th>
<?php } ?>
Step2:
Look For
<td nowrap><?=Format:($row,22,strpos($row,'@'))?> </td>
Replace with
<td nowrap><?=Format:($row,22,strpos($row,'@'))?> </td>
<?php if($status!='closed'){?>
<td nowrap><?=Format:($row,22)?> </td>
<?php }else{ ?>
<td nowrap><?=Format:($row,22)?> </td>
<?php } ?>
I had a lot of trouble trying to upload jpg or gif files. So I zipped the jpg instead. The final views are in the attached zip files.
I haven't done much testing. Working well for me so far.
Remember to take a backup of your original tickets.inc.php file before you start.
[open_ticket_assignedto.zip](https://forum.osticket.com/assets/files/migrated/7/13170fb240193f7d7d03bca6b3fd73e.zip)
[closed_ticket_closedby.zip](https://forum.osticket.com/assets/files/migrated/4/e8fdfc3a4bd881de3d3b8c5c478b962.zip)