Add a 0 IN ticket_client_id for no client tickets so agents that are restricted to certain clients and still view no clients in tickets list by using a , also restrict change clients on tickets for restricted agents

This commit is contained in:
johnnyq
2026-02-14 15:06:17 -05:00
parent 616635f951
commit ccaf15268c
6 changed files with 29 additions and 20 deletions

View File

@@ -2,9 +2,15 @@
require_once '../../../includes/modal_header.php';
// Ticket client access overide
$access_permission_query_overide = '';
if (!empty($client_access_string)) {
$access_permission_query_overide = "AND ticket_client_id IN (0,$client_access_string)";
}
$ticket_id = intval($_GET['id']);
$sql = mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN clients ON client_id = ticket_client_id WHERE ticket_id = $ticket_id $access_permission_query LIMIT 1");
$sql = mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN clients ON client_id = ticket_client_id WHERE ticket_id = $ticket_id $access_permission_query_overide LIMIT 1");
$row = mysqli_fetch_assoc($sql);
$client_id = intval($row['client_id']);