--- tickets.inc.php (original copy)
+++ tickets.inc.php (modified copy)
@@ -197,7 +197,7 @@
$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.status,ticket.source,ticket.lastresponse,ticket.lastmessage,isoverdue,isanswered,ticket.created,pri.* ,count(attach.attach_id) as attachments ';
$qfrom=' FROM '.TICKET_TABLE.' ticket '.
' LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id ';
@@ -370,22 +370,35 @@
|
}?>
-
+ |
Ticket |
Date |
- Subject |
-
+ | Subject |
+
Department |
-
+ |
Priority |
- From |
+ From |
+ Last Responder |
$class = "row1";
$total=0;
if($tickets_res && ($num=db_num_rows($tickets_res))):
while ($row = db_fetch_array($tickets_res)) {
+ if (NULL == $row['lastresponse']) {
+ $last_responder = "None";
+ } elseif (strtotime($row['lastresponse']) > strtotime($row['lastmessage'])) {
+ $responder_qry = "SELECT `staff_name` FROM ".TICKET_RESPONSE_TABLE." WHERE ticket_id='".$row['ticket_id']."' ORDER BY `created` DESC LIMIT 1";
+ $responder_res = db_query($responder_qry);
+ if (db_num_rows($responder_res) > 0) {
+ $responder = db_fetch_row($responder_res);
+ $last_responder = $responder[0];
+ }
+ } else {
+ $last_responder = Format::truncate($row['name'],22,strpos($row['name'],'@'));
+ }
$tag=$row['staff_id']?'assigned':'openticket';
$flag=null;
if($row['lock_id'])
@@ -418,6 +431,7 @@
=Format::truncate($row['dept_name'],30)?> |
=$row['priority_desc']?> |
=Format::truncate($row['name'],22,strpos($row['name'],'@'))?> |
+ =$last_responder?> |
$class = ($class =='row2') ?'row1':'row2';