mirror of
https://github.com/itflow-org/itflow
synced 2026-11-30 16:19:00 +00:00
Canned responses stage 1: Admin > Canned Responses on the standard list showing what each says, the ticket categories it is offered on, how often it has gone into a reply and when it last did, searched, filtered by where it is offered (a category or every ticket), sorted by name, use or last use, paged, with Active and Archived tabs; a response can be offered on several ticket categories or on every ticket (migration 3.2.2 moves canned_response_category_id into canned_response_categories, one whose category had been deleted staying on every ticket, and adds canned_response_uses); one shared add and edit window with the placeholders under the editor to click in where the cursor is; Copy, Archive and Restore alongside Delete; [Contact], [First Name], [Client], [Ticket], [Subject], [Ticket Link], [Asset], [Site], [Project], [Agent] (the agent replying), [Date], [Month], [Quarter] and [Year] filled in from the ticket as a response goes into a reply after the client access check, anything else in brackets left for the agent to fill in; the picker lists the ticket's own category first then every ticket's, and each reply records which responses went into it; Admin > Categories counts the canned responses on a ticket category, links to them and moves them on merge through link-table support in categoryKinds(); new functions/canned_response.php and js/canned_response_form.js; changelog updated
This commit is contained in:
40
admin/database_updates/3.2.2.php
Normal file
40
admin/database_updates/3.2.2.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* ITFlow - Database update to version 3.2.2 (from 3.2.1)
|
||||
* Included by admin/database_updates.php - do not access directly
|
||||
*/
|
||||
|
||||
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
|
||||
|
||||
// A canned response for several ticket categories - none is every ticket,
|
||||
// as category 0 was. One whose category has since been deleted was offered
|
||||
// on every ticket, and still is
|
||||
mysqli_query($mysqli, "CREATE TABLE `canned_response_categories` (
|
||||
`canned_response_id` int(11) NOT NULL,
|
||||
`category_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`canned_response_id`,`category_id`),
|
||||
KEY `category_id` (`category_id`),
|
||||
CONSTRAINT `canned_response_categories_ibfk_1` FOREIGN KEY (`canned_response_id`) REFERENCES `canned_responses` (`canned_response_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `canned_response_categories_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci");
|
||||
|
||||
mysqli_query($mysqli, "INSERT INTO `canned_response_categories` (`canned_response_id`, `category_id`)
|
||||
SELECT `canned_response_id`, `canned_response_category_id` FROM `canned_responses`
|
||||
JOIN `categories` ON `category_id` = `canned_response_category_id` AND `category_type` = 'Ticket'
|
||||
WHERE `canned_response_category_id` > 0");
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `canned_responses` DROP KEY `canned_response_category_id`, DROP `canned_response_category_id`");
|
||||
|
||||
// Each time one goes into a reply - who, on which ticket and when
|
||||
mysqli_query($mysqli, "CREATE TABLE `canned_response_uses` (
|
||||
`canned_response_use_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`canned_response_use_canned_response_id` int(11) NOT NULL,
|
||||
`canned_response_use_user_id` int(11) NOT NULL DEFAULT 0,
|
||||
`canned_response_use_ticket_id` int(11) NOT NULL DEFAULT 0,
|
||||
`canned_response_use_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (`canned_response_use_id`),
|
||||
KEY `canned_response_use_canned_response_id` (`canned_response_use_canned_response_id`,`canned_response_use_created_at`),
|
||||
KEY `canned_response_use_user_id` (`canned_response_use_user_id`),
|
||||
CONSTRAINT `canned_response_uses_ibfk_1` FOREIGN KEY (`canned_response_use_canned_response_id`) REFERENCES `canned_responses` (`canned_response_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci");
|
||||
Reference in New Issue
Block a user