From 93ffba2a4301122a9121d59c425cfca8ee1dedcc Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 9 Apr 2015 22:08:23 -0400 Subject: [PATCH 1/2] #153 got basic output going. just need to add links and color-coded circles with tooltips --- admin/admin_ticket.php | 31 +++++++++++++++++++++++++++++++ language/en/text.php | 1 + 2 files changed, 32 insertions(+) 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'); + +
  • + + +

    + + +

    + +
  • + diff --git a/language/en/text.php b/language/en/text.php index ef5aa220..ae446105 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -59,6 +59,7 @@ $hesklang['staff_only'] = 'Staff only'; $hesklang['yes_title_case'] = 'Yes'; $hesklang['no_title_case'] = 'No'; $hesklang['autoclose_ticket_status'] = 'When a ticket is closed automatically, change the status to'; +$hesklang['recent_tickets'] = 'Recent tickets'; // ADDED OR MODIFIED IN Mods for HESK 2.1.1 $hesklang['new_article_default_type'] = 'Default Type for New Articles'; From 297afdbf887394ed846024b9f3dbee7af86e2e7d Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 9 Apr 2015 22:33:15 -0400 Subject: [PATCH 2/2] #153 Finish adding basic "recent tickets" information --- admin/admin_ticket.php | 24 ++++++++++++++++-------- language/en/text.php | 1 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index a9bf33f9..5d667208 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -652,11 +652,17 @@ if($ticket['email'] != '') { 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']; + if ($recentTickets !== NULL) { + $recentTicketsWithStatuses = array(); + foreach ($recentTickets as $recentTicket) { + $newRecentTicket = $recentTicket; + $thisTicketStatusRS = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` WHERE `ID` = " . intval($recentTicket['status'])); + $theStatusRow = hesk_dbFetchAssoc($thisTicketStatusRS); + $newRecentTicket['statusText'] = $hesklang[$theStatusRow['ShortNameContentKey']]; + $newRecentTicket['statusColor'] = $theStatusRow['TextColor']; + array_push($recentTicketsWithStatuses, $newRecentTicket); + } + $recentTickets = $recentTicketsWithStatuses; } } @@ -809,13 +815,15 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); - +
  • - - + + '.$recentTicket['trackid'].''; ?>

  • diff --git a/language/en/text.php b/language/en/text.php index ae446105..3020f884 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -60,6 +60,7 @@ $hesklang['yes_title_case'] = 'Yes'; $hesklang['no_title_case'] = 'No'; $hesklang['autoclose_ticket_status'] = 'When a ticket is closed automatically, change the status to'; $hesklang['recent_tickets'] = 'Recent tickets'; +$hesklang['current_status_colon'] = 'Current status: %s'; // %s: status name (i.e. "Resolved", "New", etc.) // ADDED OR MODIFIED IN Mods for HESK 2.1.1 $hesklang['new_article_default_type'] = 'Default Type for New Articles';