--- 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 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 @@   +