mirror of
https://github.com/itflow-org/itflow
synced 2026-11-21 11:57:25 +00:00
Assign an unassigned ticket to the first agent who replies where the client can see it, as Assign to me would, with internal notes, bulk replies and already assigned tickets left alone, and a switch under Admin Settings Tickets Assigning to turn it off (db 4.0.9)
This commit is contained in:
@@ -216,6 +216,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u
|
||||
- Linking: Link - along the top of a record's page, on its tabs and in quick looks - opens a list right under it instead of a window. What's linked already is ticked: tick to link, untick to unlink, and it's saved when you click Done or anywhere else, with one message for what changed. It covers documents, files, assets, contacts, licenses, credentials, vendors, services, locations, domains and certificates, a contact's assets and credentials and an asset's credentials, a project's and a service's tickets, a ticket's services and its related tickets. A document's or file's Link lists every kind it can be linked to, in groups. Tickets are no longer added to a project by typing their numbers - tick them in the list (open ones and those closed in the last 90 days), or change the project on the ticket.
|
||||
- Sign-in codes: the 6-digit code - signing in with two-step sign-in, setting it up (yours, or a contact's in the client portal), and the code emailed for a shared link - goes in six boxes, three and three. Paste or let your phone or password manager fill it, "123 456" too, and it goes as soon as the sixth digit is in - no need to click the button. A wrong code turns the boxes red. On the sign-in page Remember this browser now comes before the code, so tick it first.
|
||||
- Browser autofill: Chrome, Edge and other Chromium browsers no longer offer your own name, email, phone or address in forms about clients - a new client's contact, a contact, a location - and Bitwarden, 1Password, LastPass and Dashlane no longer offer your ITFlow login in a credential's username and password, or anywhere else you type someone else's details or secrets, nor ask to save them. Your own profile, password change and two-step sign-in still work with your password manager.
|
||||
- Tickets: the first technician to reply to a ticket nobody is assigned to - with a public note, an email reply or a text reply - is assigned it, as Assign to me would, and the message after sending says so. An internal note doesn't assign it, so a ticket can be looked into, or someone @mentioned on it, without taking it, and a ticket already assigned keeps its technician. Admin > Settings > Tickets > Assigning switches it off - for a shop where someone answers new tickets before handing them on.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -427,6 +428,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u
|
||||
- Link picker: `functions/link_picker.php` (`linkPickerButton()`, `linkPickerSource()`, `linkPickerOptions()`, `linkPickerSave()`, `LINK_PICKER_OWN` for the links that aren't `LINK_RELATIONS` pairs), `js/link_picker.js`, and `agent/ajax.php` `link_picker` (GET: the options, linked ones selected) and `link_picker_save` (POST `add[]` and `remove[]`; `flash=1` keeps the message for the page it reloads). It opens the select picker on a hidden multiple `<select>`: in `js/itflow_select.js` a picker's `.anchor` puts the panel under that element, and closing fires `itflow:close`. With no `to`, the options are grouped by kind and their values are `type:id`. The link windows (`agent/modals/link/link.php` and its one-pair wrappers, `contact_link_asset.php`, `contact_link_credential.php`, `asset_link_credential.php`, `project_link_ticket.php`, `service_link_ticket.php`, `ticket_link_service.php`, `ticket_link.php`) and the handlers only they posted to (`link_items`, `link_tickets`, `link_service_tickets`, `link_ticket_services`, `link_ticket_to_project`, `link_contact_to_asset`, `link_contact_to_credential`, `link_asset_to_credential`) are gone; the unlink handlers stay. `js/ajax_modal.js` keeps a window's URL in `data-modal-url`, so a quick look loads again in place after a change, and `js/tab_fold.js` exposes `window.itflowTabFold()`.
|
||||
- Code boxes: `otpCodeInput()` in `functions/user.php` draws a 6-digit code field (options: id, label, class, autofocus, submit, invalid) and `js/otp_input.js` (loaded by `includes/footer.php`, `client/includes/footer.php`, `login.php`, `agent/user/mfa_enforcement.php` and `guest/share.php`) lays the one see-through input over six `.itflow-otp-slot` boxes - typing, paste and autofill go to the input, the boxes only show it. Non-digits are stripped (a pasted "123 456" fills them all), the caret stays at the end, a value set from script redraws them (the input's own `value` property), and the `is-invalid` class on the input turns them red until the next digit. `data-otp-submit` sends the form with `requestSubmit()` and its first submit button once the sixth digit is in; `window.itflowOtp(input)` does one added later. One with `autofocus` is focused (without scrolling) when its modal opens (`shown.bs.modal`), and on load when the browser skipped it - a page opened at a `#fragment`. `login.php` (agent and client steps), `agent/user/includes/mfa_setup.php`, `client/profile.php` and `guest/share.php` use it; `.itflow-mfa-code` is gone.
|
||||
- Autofill: `js/autofill_off.js` (loaded by `includes/footer.php` on agent and admin pages, not the guest portal) gives every input, textarea and select whose autocomplete is missing, `off` or `new-password` an unrecognised `autocomplete="itflow-none"` (Chromium offers no autofill or past entries for one, where it ignores `off` for names and addresses) - `new-password` on password fields, so the saved ITFlow login isn't offered - plus `data-1p-ignore`, `data-lpignore`, `data-bwignore` and `data-form-type="other"`, and marks it `data-autofill-off`. Fields added later are done by a `MutationObserver`, which also puts it back when a script sets `autocomplete="off"` again (`js/autocomplete.js`). Left alone: `current-password`, `username`, `one-time-code`, any other real autofill value, and anything inside `[data-autofill]` - `#profileForm` and `#passwordForm` in Your account.
|
||||
- First reply assigns: database 4.0.9 adds `settings.config_ticket_reply_assigns` (on to start with), read by `ticketReplyAssigns()` in `functions/ticket_fields.php` (on before the update). In `add_ticket_reply` (`agent/post/ticket.php`), a Public reply on a ticket with `ticket_assigned_to = 0` calls `ticketChangeAssignee($ticket_id, $session_user_id)` after the first response is set - so moving New to Open sends no "ticket assigned" message - with its internal note, history, audit and `ticket_assign` custom action. Bulk replies, AI notes and the no-response resolve leave the assignee alone.
|
||||
|
||||
## [26.11.8]
|
||||
|
||||
|
||||
19
admin/database_updates/4.0.9.php
Normal file
19
admin/database_updates/4.0.9.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* ITFlow - Database update to version 4.0.9 (from 4.0.8)
|
||||
* Included by admin/database_updates.php - do not access directly
|
||||
*
|
||||
* settings.config_ticket_reply_assigns - a reply the client sees on a ticket nobody
|
||||
* is assigned to makes it the replying agent's (agent/post/ticket.php, add_ticket_reply).
|
||||
* On to start with; Admin > Settings > Tickets switches it off.
|
||||
*
|
||||
* Re-runnable: the column is only added where it isn't there yet.
|
||||
*/
|
||||
|
||||
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
|
||||
|
||||
if (!mysqli_num_rows(mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'settings' AND COLUMN_NAME = 'config_ticket_reply_assigns'"))) {
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ticket_reply_assigns` tinyint(1) NOT NULL DEFAULT 1 AFTER `config_ticket_moving_columns`");
|
||||
}
|
||||
@@ -3,7 +3,8 @@
|
||||
/*
|
||||
* Admin > Settings > Tickets (admin/settings_ticket.php):
|
||||
* edit_ticket_settings saves the numbering, email and text to ticket, who hears of a
|
||||
* new ticket and whether AI triages it, what a quick ticket starts with, the timer
|
||||
* 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
|
||||
* number already in use, an email address that isn't one or a closing time
|
||||
* out of range comes back to the page saying so - nothing is saved. Billable
|
||||
@@ -21,6 +22,7 @@ if (isset($_POST['edit_ticket_settings'])) {
|
||||
$before = settingsCurrent(array_merge(['config_ticket_prefix', 'config_ticket_next_number', 'config_ticket_email_parse', 'config_ticket_email_parse_unknown_senders',
|
||||
'config_ticket_new_ticket_notification_email', 'config_ticket_timer_autostart', 'config_ticket_default_billable', 'config_ticket_autoclose_hours',
|
||||
'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'] : [],
|
||||
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',
|
||||
@@ -41,6 +43,10 @@ if (isset($_POST['edit_ticket_settings'])) {
|
||||
foreach (['config_ticket_email_parse', 'config_ticket_email_parse_unknown_senders', 'config_ticket_timer_autostart', 'config_ticket_ordering', 'config_ticket_moving_columns'] as $switch) {
|
||||
$after[$switch] = empty($_POST[$switch]) ? 0 : 1;
|
||||
}
|
||||
// Assigning a ticket to the first agent to reply - once the database has it
|
||||
if (array_key_exists('config_ticket_reply_assigns', $before)) {
|
||||
$after['config_ticket_reply_assigns'] = empty($_POST['config_ticket_reply_assigns']) ? 0 : 1;
|
||||
}
|
||||
// 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) {
|
||||
|
||||
@@ -67,6 +67,12 @@ echo settingsPageStart('ticket');
|
||||
<?php } ?>
|
||||
<?= settingsSectionEnd() ?>
|
||||
|
||||
<?php if (version_compare((string) CURRENT_DATABASE_VERSION, '4.0.9', '>=')) { ?>
|
||||
<?= settingsSectionStart('assigning', 'Assigning', 'Who a ticket goes to when nobody has picked it up.') ?>
|
||||
<?= settingsSwitch('config_ticket_reply_assigns', ticketReplyAssigns() ? 1 : 0, ['help' => 'The agent who replies to a ticket nobody is assigned to - by email, by text or as a public note - is assigned it, as Assign to me would. An internal note doesn\'t assign it, so a ticket can be looked at, or someone @mentioned on it, without taking it. A ticket already assigned keeps its agent.']) ?>
|
||||
<?= settingsSectionEnd() ?>
|
||||
<?php } ?>
|
||||
|
||||
<?= settingsSectionStart('time', 'Time and billing', 'How time on a ticket starts, and whether it bills.') ?>
|
||||
<?= settingsSwitch('config_ticket_timer_autostart', $config_ticket_timer_autostart, ['help' => 'The timer runs from opening a ticket, rather than from pressing start.']) ?>
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
|
||||
@@ -1223,9 +1223,17 @@ if (isset($_POST['add_ticket_reply'])) {
|
||||
setTicketFirstResponse($ticket_id);
|
||||
}
|
||||
|
||||
// Nobody had it - a reply the client sees makes it this agent's, as Assign to me
|
||||
// would (Admin > Settings > Tickets). Not an internal note: a ticket can be
|
||||
// triaged, or someone @mentioned on it, without taking it
|
||||
$taken = false;
|
||||
if ($ticket_reply_type === 'Public' && !intval($row['ticket_assigned_to']) && ticketReplyAssigns()) {
|
||||
[$taken] = ticketChangeAssignee($ticket_id, $session_user_id);
|
||||
}
|
||||
|
||||
triggerCustomAction($ticket_reply_type === 'Internal' ? 'ticket_reply_agent_internal' : 'reply_reply_agent_public', $ticket_id);
|
||||
|
||||
$reference_html = "<strong>" . escapeHtml(ticketReference($row)) . "</strong>";
|
||||
$reference_html = "<strong>" . escapeHtml(ticketReference($row)) . "</strong>" . ($taken ? ' (now assigned to you)' : '');
|
||||
if ($ticket_reply_type === 'Internal') {
|
||||
flashAlert("Internal note added to ticket $reference_html" . ($told ? " - <strong>" . escapeHtml(ticketMentionNames($told)) . "</strong> " . (count($told) === 1 ? 'was' : 'were') . " told" : ''));
|
||||
} elseif ($texted) {
|
||||
|
||||
1
db.sql
1
db.sql
@@ -3835,6 +3835,7 @@ CREATE TABLE `settings` (
|
||||
`config_ticket_default_view` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`config_ticket_ordering` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`config_ticket_moving_columns` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`config_ticket_reply_assigns` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`config_cron_last_dispatch_at` datetime DEFAULT NULL,
|
||||
`config_cron_alert_email` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`config_cron_alert_to` varchar(500) DEFAULT NULL,
|
||||
|
||||
@@ -280,6 +280,8 @@ function settingsFields() {
|
||||
'config_quick_ticket_primary' => ['page' => 'ticket', 'section' => 'Quick tickets', 'label' => 'Start on the client\'s primary contact', 'words' => 'quick ticket primary contact'] + $on_off,
|
||||
'config_quick_ticket_open_tickets' => ['page' => 'ticket', 'section' => 'Quick tickets', 'label' => 'Show the contact\'s open tickets', 'words' => 'quick ticket open tickets duplicate'] + $on_off,
|
||||
'config_quick_ticket_email_client' => ['page' => 'ticket', 'section' => 'Quick tickets', 'label' => 'Email the contact that it was opened', 'words' => 'quick ticket email contact created'] + $on_off,
|
||||
'config_ticket_reply_assigns' => ['page' => 'ticket', 'section' => 'Assigning', 'label' => 'Assign an unassigned ticket to the first agent to reply',
|
||||
'words' => 'assign assigned first reply respond responder take own technician unassigned automatic'] + $on_off,
|
||||
'config_ticket_default_billable' => ['page' => 'ticket', 'section' => 'Time and billing', 'label' => 'New tickets are billable', 'words' => 'billable default bill'] + $on_off,
|
||||
'config_ticket_timer_autostart' => ['page' => 'ticket', 'section' => 'Time and billing', 'label' => 'Start the timer on opening a ticket', 'words' => 'timer autostart time tracking'] + $on_off,
|
||||
'config_ticket_autoclose_hours' => ['page' => 'ticket', 'section' => 'Closing', 'label' => 'Close resolved tickets after', 'words' => 'auto close autoclose resolved hours'],
|
||||
|
||||
@@ -74,6 +74,23 @@ function ticketChangePriority($ticket_id, $priority) {
|
||||
return [true, "Priority updated from <strong>$original_priority</strong> to <strong>$priority_sql</strong>"];
|
||||
}
|
||||
|
||||
/*
|
||||
* Whether a reply the client sees, on a ticket nobody is assigned to, assigns it to
|
||||
* the agent who sent it - Admin > Settings > Tickets, config_ticket_reply_assigns.
|
||||
* On until database 4.0.9 adds the switch.
|
||||
*/
|
||||
function ticketReplyAssigns() {
|
||||
global $mysqli;
|
||||
static $on = null;
|
||||
if ($on === null) {
|
||||
$on = true;
|
||||
if (version_compare(defined('CURRENT_DATABASE_VERSION') ? (string) CURRENT_DATABASE_VERSION : '0', '4.0.9', '>=')) {
|
||||
$on = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT config_ticket_reply_assigns FROM settings WHERE company_id = 1"))[0] ?? 1) === 1;
|
||||
}
|
||||
}
|
||||
return $on;
|
||||
}
|
||||
|
||||
/*
|
||||
* Assign to an agent, or to no one with 0. A New ticket that gets an agent
|
||||
* becomes Open. Returns [ok, message].
|
||||
|
||||
Reference in New Issue
Block a user