Mail review stage 7c: emailed and texted replies wait a few seconds on the ticket page with Undo and Send now before they are posted, set in Admin > Settings > Tickets (database 4.3.3); ticket emails sent from another address than the mailbox ITFlow reads ask for replies at that mailbox with Reply-To, which can be turned off there; 26.12.3 changelog

This commit is contained in:
johnnyq
2026-11-30 21:36:09 -05:00
parent 8f68de0f65
commit 20b2d1883e
13 changed files with 264 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
<?php
/*
* ITFlow - Database update to version 4.3.3 (from 4.3.2)
* Included by admin/database_updates.php - do not access directly
*
* Sending an agent's reply (functions/ticket_reply_send.php), set in Admin > Settings > Tickets:
* settings.config_ticket_reply_undo_seconds - how long an emailed or texted reply waits on the ticket page, with
* Undo, before it goes: 0 (at once), 5, 10, 20 or 30 seconds - 10 to start
* settings.config_ticket_reply_to_read - a ticket's email from another address than the mailbox ITFlow reads asks
* for replies at that mailbox (Reply-To) - on to start
*
* Re-runnable: each column is added only where it isn't there.
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
$itflow_reply_send_columns = [
['config_ticket_reply_undo_seconds', "tinyint(3) NOT NULL DEFAULT 10 AFTER `config_ticket_email_relay`"],
['config_ticket_reply_to_read', "tinyint(1) NOT NULL DEFAULT 1 AFTER `config_ticket_reply_undo_seconds`"],
];
foreach ($itflow_reply_send_columns as [$itflow_column, $itflow_definition]) {
$itflow_column_exists = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'settings' AND COLUMN_NAME = '$itflow_column' LIMIT 1");
if (!$itflow_column_exists || mysqli_num_rows($itflow_column_exists) === 0) {
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `$itflow_column` $itflow_definition");
}
}

View File

@@ -2,7 +2,7 @@
/*
* Admin > Settings > Tickets (admin/settings_ticket.php):
* edit_ticket_settings saves the numbering, email to ticket, the emails about a ticket, text to ticket, who hears of a
* edit_ticket_settings saves the numbering, email to ticket, the emails about a ticket (with undo send and Reply-To), text to ticket, who hears of a
* new ticket and whether AI triages it, whether the first agent to reply to an
* unassigned ticket is assigned it, what a quick ticket starts with, the timer
* and billing, the messages to clients, closing and the tickets page. A next
@@ -24,6 +24,7 @@ if (isset($_POST['edit_ticket_settings'])) {
'config_ticket_default_view', 'config_ticket_ordering', 'config_ticket_moving_columns'], aiTriageReady() ? ['config_ticket_ai_triage'] : [],
version_compare((string) CURRENT_DATABASE_VERSION, '4.0.9', '>=') ? ['config_ticket_reply_assigns'] : [],
ticketMailThreadReady() ? ['config_ticket_email_copy', 'config_ticket_email_relay'] : [],
ticketReplySendReady() ? ['config_ticket_reply_undo_seconds', 'config_ticket_reply_to_read'] : [],
settingsColumnExists($mysqli, 'config_ticket_sms_parse') ? ['config_ticket_sms_parse', 'config_ticket_sms_unknown_senders', 'config_ticket_sms_acknowledge'] : [],
ticketStatusReplyReady() ? ['config_ticket_assigned_message'] : [], ticketNoResponseReady() ? ['config_ticket_no_response_message'] : [],
quickTicketReady() ? ['config_quick_ticket_on', 'config_quick_ticket_assign', 'config_quick_ticket_status', 'config_quick_ticket_priority', 'config_quick_ticket_category',
@@ -54,6 +55,14 @@ if (isset($_POST['edit_ticket_settings'])) {
$after[$switch] = empty($_POST[$switch]) ? 0 : 1;
}
}
// Undo send and Reply-To - once the database has them (functions/ticket_reply_send.php)
if (array_key_exists('config_ticket_reply_to_read', $before)) {
$after['config_ticket_reply_to_read'] = empty($_POST['config_ticket_reply_to_read']) ? 0 : 1;
$after['config_ticket_reply_undo_seconds'] = intval($in['config_ticket_reply_undo_seconds']);
if (!isset(TICKET_REPLY_UNDO_CHOICES[$after['config_ticket_reply_undo_seconds']])) {
$errors['config_ticket_reply_undo_seconds'] = 'Pick how long from the list.';
}
}
// Text to ticket - once the database has it
if (array_key_exists('config_ticket_sms_parse', $before)) {
foreach (['config_ticket_sms_parse', 'config_ticket_sms_unknown_senders', 'config_ticket_sms_acknowledge'] as $switch) {

View File

@@ -47,6 +47,21 @@ echo settingsPageStart('ticket');
<?= settingsSectionStart('emails', 'Emails about a ticket', 'Each has the subject <code>[' . escapeHtml($config_ticket_prefix) . '123] Subject</code>, the same from the first to the last, and carries the headers a mail program keeps a conversation together by - so they stay together in the client\'s inbox, and a reply finds its ticket even when its subject was changed.') ?>
<?= settingsSwitch('config_ticket_email_copy', $ticket_mail['copy'] ? 1 : 0, ['help' => 'An email about a ticket goes to its contact with the CCs, and the colleagues who asked for every update, copied in - everyone sees who else has it, and a reply to all reaches them. Off, each gets an email of their own.']) ?>
<?= settingsSwitch('config_ticket_email_relay', $ticket_mail['relay'] ? 1 : 0, ['help' => 'When the client replies - by email, text or in the portal - the people an agent\'s reply would go to get it too, with its files, unless it was already to them. By email, only a reply to one of the ticket\'s emails: anyone can put a ticket number in a subject.']) ?>
<?php if (ticketReplySendReady()) {
$reply_send = ticketReplySendSettings();
$ticket_from = strtolower(trim((string) emailFrom('ticket')['email']));
if (!$reply_send['parse'] || $reply_send['reads'] === '') {
$reply_to_help = 'Nothing to do now - email to ticket isn\'t reading a mailbox.';
} elseif ($reply_send['reads'] === $ticket_from) {
$reply_to_help = 'Nothing to do now - ticket emails are from <strong>' . escapeHtml($ticket_from) . '</strong>, the mailbox ITFlow reads.';
} else {
$reply_to_help = 'Ticket emails are from <strong>' . escapeHtml($ticket_from ?: 'the system mailbox') . '</strong>. On, they ask for replies at <strong>' . escapeHtml($reply_send['reads'])
. '</strong>, the mailbox ITFlow reads (Reply-To), so a reply isn\'t lost on an address nobody reads. Turn it off if ' . escapeHtml($ticket_from ?: 'that address') . ' already comes to that mailbox and you\'d rather clients only saw it.';
} ?>
<?= settingsSelect('config_ticket_reply_undo_seconds', ticketReplyUndoSeconds(), TICKET_REPLY_UNDO_CHOICES, ['icon' => 'fa-undo-alt',
'help' => 'An emailed or texted reply waits this long on the ticket page, with Undo, before it goes - Undo leaves it in the reply box to change. Nothing about it happens until then.']) ?>
<?= settingsSwitch('config_ticket_reply_to_read', $reply_send['reply_to_read'] ? 1 : 0, ['help' => $reply_to_help]) ?>
<?php } ?>
<?= settingsSectionEnd() ?>
<?php } ?>