From 853fbf0ba74d0202b005abfab693427e5a6d9b5b Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 5 Sep 2023 16:23:10 -0400 Subject: [PATCH] Ticket Notifications now are clickable and will go to the ticket details --- post/ticket.php | 6 +++--- top_nav.php | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/post/ticket.php b/post/ticket.php index 453204d3..2ffadb7e 100644 --- a/post/ticket.php +++ b/post/ticket.php @@ -221,7 +221,7 @@ if (isset($_POST['assign_ticket'])) { if ($session_user_id != $assigned_to && $assigned_to != 0) { // App Notification - mysqli_query($mysqli,"INSERT INTO notifications SET notification_type = 'Ticket', notification = 'Ticket $ticket_prefix_escaped$ticket_number - Subject: $ticket_subject_escaped has been assigned to you by $session_name', notification_client_id = $client_id, notification_user_id = $assigned_to"); + mysqli_query($mysqli,"INSERT INTO notifications SET notification_type = 'Ticket', notification = 'Ticket $ticket_prefix_escaped$ticket_number - Subject: $ticket_subject_escaped has been assigned to you by $session_name', notification_action = 'ticket.php?ticket_id=$ticket_id', notification_client_id = $client_id, notification_user_id = $assigned_to"); // Email Notification if (!empty($config_smtp_host)) { @@ -394,13 +394,13 @@ if (isset($_POST['add_ticket_reply'])) { // Notification for assigned ticket user if ($session_user_id != $ticket_assigned_to && $ticket_assigned_to != 0) { - mysqli_query($mysqli,"INSERT INTO notifications SET notification_type = 'Ticket', notification = '$session_name updated Ticket $ticket_prefix_escaped$ticket_number - Subject: $ticket_subject_escaped that is assigned to you', notification_client_id = $client_id, notification_user_id = $ticket_assigned_to"); + mysqli_query($mysqli,"INSERT INTO notifications SET notification_type = 'Ticket', notification = '$session_name updated Ticket $ticket_prefix_escaped$ticket_number - Subject: $ticket_subject_escaped that is assigned to you', notification_action = 'ticket.php?ticket_id=$ticket_id', notification_client_id = $client_id, notification_user_id = $ticket_assigned_to"); } // Notification for user that opened the ticket if ($session_user_id != $ticket_created_by && $ticket_created_by != 0) { - mysqli_query($mysqli,"INSERT INTO notifications SET notification_type = 'Ticket', notification = '$session_name updated Ticket $ticket_prefix_escaped$ticket_number - Subject: $ticket_subject_escaped that you opened', notification_client_id = $client_id, notification_user_id = $ticket_created_by"); + mysqli_query($mysqli,"INSERT INTO notifications SET notification_type = 'Ticket', notification = '$session_name updated Ticket $ticket_prefix_escaped$ticket_number - Subject: $ticket_subject_escaped that you opened', notification_action = 'ticket.php?ticket_id=$ticket_id', notification_client_id = $client_id, notification_user_id = $ticket_created_by"); } // Logging diff --git a/top_nav.php b/top_nav.php index fa4155b5..28851c00 100644 --- a/top_nav.php +++ b/top_nav.php @@ -60,16 +60,17 @@ $notification_id = intval($row['notification_id']); $notification_type = nullable_htmlentities($row['notification_type']); $notification = nullable_htmlentities($row['notification']); + $notification_action = nullable_htmlentities($row['notification_action']); $notification_timestamp = date('M d g:ia',strtotime($row['notification_timestamp'])); $notification_client_id = intval($row['notification_client_id']); - if($notification_client_id > 0){ - $notification_link = "client_overview.php?client_id=$notification_client_id"; + if(!empty($notification_action)){ + $notification_action = $notification_action; } else { - $notification_link = "#"; + $notification_action = "#"; } ?>