Ticket statuses: When the client replies can move a ticket to another status, a Client responded one say, on the built-in statuses as well as your own, falling back to Open when that status is switched off and cleared when it is deleted; a status can count as the first response when an agent moves a ticket nobody has answered into it, quietly or after emailing the contact and watchers a ticket assigned message kept as a public note, counted only when someone got it; the message is set under Messages to clients in Settings Tickets with the canned response placeholders; database 3.7.3 adds ticket_status_reply_status_id, ticket_status_first_response and config_ticket_assigned_message; 26.11.9 changelog entries

This commit is contained in:
johnnyq
2026-11-17 17:52:35 -05:00
parent 0cc24e286e
commit 96eec95fb8
15 changed files with 317 additions and 33 deletions

View File

@@ -0,0 +1,37 @@
<?php
/*
* ITFlow - Database update to version 3.7.3 (from 3.7.2)
* Included by admin/database_updates.php - do not access directly
*
* Ticket statuses (functions/ticket_status.php):
* ticket_statuses.ticket_status_reply_status_id - the status a client's reply moves a ticket in
* this status to (a "Client responded" status, say); 0 does what ticket_status_client_reply says.
* ticket_statuses.ticket_status_first_response - an agent moving a ticket into this status before
* anyone has answered counts as its first response: 0 no, 1 yes, 2 yes once the client has been
* emailed the "ticket assigned" message.
* settings.config_ticket_assigned_message - that message, as typed in Admin > Settings > Tickets;
* NULL is the built-in wording.
*
* Re-runnable: each column is added only where it isn't there yet.
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
$itflow_column = function ($table, $column) use ($mysqli) {
$result = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '$table' AND COLUMN_NAME = '$column' LIMIT 1");
return $result && mysqli_num_rows($result) > 0;
};
if (!$itflow_column('ticket_statuses', 'ticket_status_reply_status_id')) {
mysqli_query($mysqli, "ALTER TABLE `ticket_statuses` ADD `ticket_status_reply_status_id` int(11) NOT NULL DEFAULT 0 AFTER `ticket_status_client_reply`");
}
if (!$itflow_column('ticket_statuses', 'ticket_status_first_response')) {
mysqli_query($mysqli, "ALTER TABLE `ticket_statuses` ADD `ticket_status_first_response` tinyint(1) NOT NULL DEFAULT 0 AFTER `ticket_status_reply_status_id`");
}
if (!$itflow_column('settings', 'config_ticket_assigned_message')) {
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ticket_assigned_message` text DEFAULT NULL AFTER `config_ticket_timer_autostart`");
}