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) { + + +
 
+ + + +