From 32a2cde309f89a51576507a20bda261208edfc89 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 16 May 2018 18:15:42 -0400 Subject: [PATCH] Update ticket_list --- inc/ticket_list.inc.php | 47 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/inc/ticket_list.inc.php b/inc/ticket_list.inc.php index 117a6e53..793870e1 100644 --- a/inc/ticket_list.inc.php +++ b/inc/ticket_list.inc.php @@ -16,11 +16,15 @@ if (!defined('IN_SCRIPT')) { } /* List of staff */ -if (!isset($admins)) { - $admins = array(); - $res2 = hesk_dbQuery("SELECT `id`,`name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` ORDER BY `name` ASC"); - while ($row = hesk_dbFetchAssoc($res2)) { - $admins[$row['id']] = $row['name']; +// List of staff and check their permissions +$admins = array(); +$can_assign_to = array(); +$res2 = hesk_dbQuery("SELECT `id`,`name`,`isadmin`,`heskprivileges` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."users` ORDER BY `name` ASC"); +while ($row = hesk_dbFetchAssoc($res2)) { + $admins[$row['id']] = $row['name']; + + if ($row['isadmin'] || strpos($row['heskprivileges'], 'can_view_tickets') !== false) { + $can_assign_to[$row['id']] = $row['name']; } } @@ -430,6 +434,9 @@ if ($total > 0) { + + 0) { + + + + @@ -449,6 +467,25 @@ if ($total > 0) { + + +
 
+ + + +