diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 9e440aae..a9bf33f9 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -640,6 +640,26 @@ if ( defined('HESK_DEMO') ) $ticket['ip'] = '127.0.0.1'; } +// If an email address is tied to this ticket, check if there are any others +$recentTickets = NULL; +if($ticket['email'] != '') { + $recentTicketsSql = hesk_dbQuery("SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` + WHERE `email` = '".hesk_dbEscape($ticket['email'])."' AND `trackid` <> '".hesk_dbEscape($trackingID)."' ORDER BY `lastchange` DESC LIMIT 5"); + while ($recentRow = hesk_dbFetchAssoc($recentTicketsSql)) { + if ($recentTickets === NULL) { + $recentTickets = array(); + } + array_push($recentTickets, $recentRow); + } + + foreach ($recentTickets as $recentTicket) { + $thisTicketStatusRS = hesk_dbQuery("SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".intval($recentTicket['status'])); + $theStatusRow = hesk_dbFetchAssoc($thisTicketStatusRS); + $recentTicket['statusText'] = $hesklang[$theStatusRow['ShortNameContentKey']]; + $recentTicket['statusColor'] = $theStatusRow['TextColor']; + } +} + /* Print admin navigation */ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ?> @@ -789,6 +809,17 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); + +
+ + +
+ +