From 6ef84c45472ed4eb90acdbca4d6abd6a9aae272f Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 15 Aug 2026 17:29:17 -0400 Subject: [PATCH] Feature: Add Ticket Canned Responses --- admin/canned_responses.php | 135 ++++++++++++++++++ admin/database_updates/2.6.9.php | 27 ++++ admin/includes/side_nav.php | 6 + .../canned_response/canned_response_add.php | 58 ++++++++ .../canned_response/canned_response_edit.php | 72 ++++++++++ admin/post/canned_response.php | 67 +++++++++ agent/ajax.php | 31 ++++ agent/ticket.php | 88 +++++++++++- db.sql | 22 ++- 9 files changed, 504 insertions(+), 2 deletions(-) create mode 100644 admin/canned_responses.php create mode 100644 admin/database_updates/2.6.9.php create mode 100644 admin/modals/canned_response/canned_response_add.php create mode 100644 admin/modals/canned_response/canned_response_edit.php create mode 100644 admin/post/canned_response.php diff --git a/admin/canned_responses.php b/admin/canned_responses.php new file mode 100644 index 000000000..26ad113e9 --- /dev/null +++ b/admin/canned_responses.php @@ -0,0 +1,135 @@ + + +
+
+

Canned Responses

+
+ +
+
+
+
+
+ +
+
+ + +
+
+ +
+
+ +
+
+
+
+ + "> + + + + + + + + + + + + + + + + + +
+ + Response + + + + Ticket Category + + Action
+
+ +
+
+ + + +
+
+
+
+
+ + + + All ticket categories + + + +
+
+ +
+
+ + Canned Responses and + // picked from a dropdown on the ticket reply form. + // + // canned_response_category_id is a ticket category (categories.category_id where + // category_type = 'Ticket'), or 0 for one that offers itself on every ticket + // whatever its category. + + mysqli_query($mysqli, "CREATE TABLE IF NOT EXISTS `canned_responses` ( + `canned_response_id` int(11) NOT NULL AUTO_INCREMENT, + `canned_response_name` varchar(200) NOT NULL, + `canned_response_body` longtext DEFAULT NULL, + `canned_response_category_id` int(11) NOT NULL DEFAULT 0, + `canned_response_created_at` datetime NOT NULL DEFAULT current_timestamp(), + `canned_response_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), + `canned_response_archived_at` datetime DEFAULT NULL, + PRIMARY KEY (`canned_response_id`), + KEY `canned_response_category_id` (`canned_response_category_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"); diff --git a/admin/includes/side_nav.php b/admin/includes/side_nav.php index 87f8d23a5..57c932da1 100644 --- a/admin/includes/side_nav.php +++ b/admin/includes/side_nav.php @@ -124,6 +124,12 @@

Ticket Templates

+