From 425b06e5504883b7774228055797adadf7f56b6b Mon Sep 17 00:00:00 2001 From: wrongecho Date: Wed, 4 Dec 2024 16:43:09 +0000 Subject: [PATCH 1/3] Add time tracking for bulk ticket replies - TT for bulk replies - Encourage the correct time format using a placeholder and pattern (client-side validation only) --- post/user/ticket.php | 3 ++- ticket_bulk_reply_modal.php | 7 +++++++ ticket_reply_edit_modal.php | 3 +-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/post/user/ticket.php b/post/user/ticket.php index d484e6d6e..9b42c07cf 100644 --- a/post/user/ticket.php +++ b/post/user/ticket.php @@ -1019,6 +1019,7 @@ // POST variables $ticket_reply = mysqli_escape_string($mysqli, $_POST['bulk_reply_details']); $ticket_status = intval($_POST['bulk_status']); + $ticket_reply_time_worked = sanitizeInput($_POST['time']); $private_note = intval($_POST['bulk_private_reply']); if ($private_note == 1) { $ticket_reply_type = 'Internal'; @@ -1046,7 +1047,7 @@ $client_id = intval($row['ticket_client_id']); // Add reply - mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_time_worked = '00:01:00', ticket_reply_type = '$ticket_reply_type', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id"); + mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_time_worked = '$ticket_reply_time_worked', ticket_reply_type = '$ticket_reply_type', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id"); $ticket_reply_id = mysqli_insert_id($mysqli); diff --git a/ticket_bulk_reply_modal.php b/ticket_bulk_reply_modal.php index 2e2b2fa57..6e73ff76f 100644 --- a/ticket_bulk_reply_modal.php +++ b/ticket_bulk_reply_modal.php @@ -35,6 +35,13 @@ +
+
+ + +
+
+
diff --git a/ticket_reply_edit_modal.php b/ticket_reply_edit_modal.php index 4d6e8ce3a..6769fcb75 100644 --- a/ticket_reply_edit_modal.php +++ b/ticket_reply_edit_modal.php @@ -29,11 +29,10 @@
-
- +
From 7afa1760f38f3317d8242aff0e58cc6ae4b8e01b Mon Sep 17 00:00:00 2001 From: wrongecho Date: Wed, 4 Dec 2024 16:49:51 +0000 Subject: [PATCH 2/3] Add time tracking for bulk ticket replies - TT for bulk replies - Encourage the correct time format using a placeholder, pattern and required field (client-side validation only - still results in server error if you intentionally break it, for now) --- ticket_bulk_reply_modal.php | 2 +- ticket_reply_edit_modal.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ticket_bulk_reply_modal.php b/ticket_bulk_reply_modal.php index 6e73ff76f..76377e6c1 100644 --- a/ticket_bulk_reply_modal.php +++ b/ticket_bulk_reply_modal.php @@ -38,7 +38,7 @@
- +
diff --git a/ticket_reply_edit_modal.php b/ticket_reply_edit_modal.php index 6769fcb75..b1306b5c6 100644 --- a/ticket_reply_edit_modal.php +++ b/ticket_reply_edit_modal.php @@ -32,7 +32,7 @@
- +
From 4213a33652ba36775dead2b5c9d2814d07cd311b Mon Sep 17 00:00:00 2001 From: wrongecho Date: Wed, 4 Dec 2024 21:14:35 +0000 Subject: [PATCH 3/3] TT for bulk resolve too --- post/user/ticket.php | 3 ++- ticket_bulk_resolve_modal.php | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/post/user/ticket.php b/post/user/ticket.php index 9b42c07cf..7eaa39745 100644 --- a/post/user/ticket.php +++ b/post/user/ticket.php @@ -901,6 +901,7 @@ // POST variables $details = mysqli_escape_string($mysqli, $_POST['bulk_details']); + $ticket_reply_time_worked = sanitizeInput($_POST['time']); $private_note = intval($_POST['bulk_private_note']); if ($private_note == 1) { $ticket_reply_type = 'Internal'; @@ -930,7 +931,7 @@ // Update ticket & insert reply mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 4, ticket_resolved_at = NOW() WHERE ticket_id = $ticket_id"); - mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$details', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id"); + mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$details', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '$ticket_reply_time_worked', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id"); // Logging logAction("Ticket", "Resolve", "$session_name resolved $ticket_prefix$ticket_number - $ticket_subject", $client_id, $ticket_id); diff --git a/ticket_bulk_resolve_modal.php b/ticket_bulk_resolve_modal.php index 052bd1dc3..f2a455653 100644 --- a/ticket_bulk_resolve_modal.php +++ b/ticket_bulk_resolve_modal.php @@ -15,6 +15,13 @@
+
+
+ + +
+
+