Order Tickets by LastMessage for Staff in My Tickets Page of osTicket v1.6 RC5

Since the article I wrote about the modification Order Tickets by LastMessage in My Tickets Page of osTicket v1.6 RC5 that actually for client-side, then I realized this MyTickets page also belongs to the staff panel. So, if you want to customize the My Tickets page for staff-side, you may apply the following modification I made.

  1. Open \include\staff\tickets.inc.php file, and find this code:

    172
    
    $sortOptions=array('date'=>'ticket.created','ID'=>'ticketID','pri'=>'priority_urgency','dept'=>'dept_name');

    then replace with this following code:

    172
    
    $sortOptions=array('date'=>'ticket.created','ID'=>'ticketID','lastresp'=>'lastresponse','lastmsg'=>'lastmessage','pri'=>'priority_urgency','dept'=>'dept_name');

    Find again this code:

    192
    
    $order_by =$order_by?$order_by:'priority_urgency,ticket.created';

    then replace with this following code:

    192
    193
    
    // $order_by =$order_by?$order_by:'priority_urgency,ticket.created';
    $order_by =$order_by?$order_by:'ticket.lastmessage';

    Find again this code:

    200
    201
    
    $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 ';

    then replace with this following code:

    200
    201
    
    $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, ticket.lastresponse, ticket.lastmessage ';

    Find again this code:

    375
    376
    
    	        <th width="70">
                    <a href="tickets.php?sort=date&order=<?=$negorder?><?=$qstr?>" title="Sort By Date <?=$negorder?>">Date</a></th>

    then replace with this following code:

    375
    376
    377
    378
    379
    380
    
    	        <th width="70">
                    <a href="tickets.php?sort=date&order=<?=$negorder?><?=$qstr?>" title="Sort By Date <?=$negorder?>">Date</a></th>
                    <th>
                    <a href="tickets.php?sort=lastresp&order=<?=$negorder?><?=$qstr?>" title="Sort by Last Response <?=$negorder?>">Last Response</a></th>
                    <th>
                    <a href="tickets.php?sort=lastmsg&order=<?=$negorder?><?=$qstr?>" title="Sort by Last Message <?=$negorder?>">Last Message</a></th>

    Find again this code:

    414
    
                    <td align="center" nowrap><?=Format::db_date($row['created'])?></td>

    then replace with this following code:

    414
    415
    416
    
                    <td align="center" nowrap><?=Format::db_date($row['created'])?></td>
                    <td nowrap>&nbsp;<?=Format::db_date($row['lastresponse'])?></td>
                    <td nowrap>&nbsp;<?=Format::db_date($row['lastmessage'])?></td>

Have a nice code!

Share

309 viewsPrint This Post Print This Post

Comments

  1. Jim says:

    this is great !

    works fine with my site !

    thanks you very much

Speak Your Mind

*


*