From 40aaddd09b3a8f749ecc578aafa5481e2222862a Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sun, 17 Sep 2023 18:55:44 -0400 Subject: [PATCH] Update cron to Create notification of tickets pending assignment --- cron.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cron.php b/cron.php index c6f098c9..6b00933e 100644 --- a/cron.php +++ b/cron.php @@ -202,6 +202,22 @@ foreach ($warranty_alert_array as $day) { // Logging mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron', log_action = 'Task', log_description = 'Cron created notifications for asset warranties expiring'"); +// Notify of Tickets Pending Assignment +// Get Ticket Pending Assignment +$sql_tickets_pending_assignment = mysqli_query($mysqli,"SELECT ticket_id FROM tickets + WHERE ticket_status = 'Pending-Assignment'" +); + +$tickets_pending_assignment = mysqli_num_rows($sql_tickets_pending_assignment); + +if($tickets_pending_assignment > 0){ + + mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Ticket', notification = 'There are $ticket_pending_assignment Tickets pending Assignment', notification_action = 'tickets.php?status=Pending-Assignment'"); + + // Logging + mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron', log_action = 'Task', log_description = 'Cron created notifications for tickets that are pending assignment'"); +} + // Scheduled tickets // Get scheduled tickets for today