From c153fef5f4187ada3ee76a68b22dd999f35ae16e Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 17 Nov 2026 22:35:01 -0500 Subject: [PATCH] Dispatch: a drag over an agent's empty time on Day opens New Ticket assigned to that agent with Schedule filled in from the time dragged over, and saving it books the work and returns to Dispatch on that day; New Ticket takes assigned_to, schedule, schedule_minutes and return_to to start with; 26.11.9 changelog entries --- CHANGELOG.md | 2 ++ agent/dispatch.php | 2 +- agent/js/dispatch.js | 18 ++++++++++++++++++ agent/modals/ticket/ticket_add.php | 17 +++++++++++++---- agent/post/ticket.php | 5 +++++ 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8258c0fd..590a779d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,6 +115,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Projects: a project's tickets can be kept apart from the service desk - switch on Keep project tickets apart under Admin > Settings > Projects. A ticket in a project is then left off the tickets list's Open, Unassigned, Needs reply and other views - it has a Projects view of its own - and out of the dashboard's unassigned count, the count beside Tickets in the menu and the Dispatch queue, and has no SLA: the project's dates are what count. It stays under Mine, Mentioned me, Closed and All, in Dispatch's Workload and on the calendar and Dispatch, drawn in the project's calendar color with the project named under it and, on the calendar, a dot in the agent's color. A ticket taken out of its project gets its SLA back counted from then, so it isn't overdue at once - and so do they all when the setting is switched off. Off when you update, so nothing changes until you switch it on, and on for a new ITFlow. From Mountaineer IT's build of ITFlow. - Offices: if you work from more than one place, list the others under Admin > Settings > Company Details, Offices - each with its name, address, phone and email, and who works there. An agent's office can also be picked in Admin > Users, and given with an invite. A new trip starts from the driver's office, From offers every office, and changing the driver on a new trip moves From to theirs unless you typed it. Emails about a ticket show the office of the agent on it - the one assigned, else the one sending - at the foot: its address, and its phone and email, or the main office's phone and the ticket email address when it has none. Invoices, quotes and contracts keep the main address. Removing an office puts those who worked there back in the main one. With no other office, nothing changes. From Mountaineer IT's build of ITFlow. - Invoices: tick invoices on the invoices list and Bulk Action can now Mark Sent, Send by Email, Mark Paid, Cancel or Delete them - beside Set Category. Each does to every invoice ticked what its button on the invoice does, and only to those that button would be offered for: Mark Sent takes drafts, Send by Email drafts and unpaid invoices whose client has a primary or billing contact, Mark Paid unpaid invoices - one payment each of what is still owed, with the date, method, reference and account you pick and, if you like, one receipt to each client listing what was paid - Cancel all but paid and cancelled ones, and Delete all but those with a payment on a reconciled statement. The window lists which invoices it will do and which it leaves alone and why, and the message after says the same. An agent who can take payments but not change invoices can tick invoices to Mark Paid. Any number can be ticked, up to a page of 500. From Mountaineer IT's build of ITFlow. +- Dispatch: drag down an agent's column over empty time on Day to raise a new ticket there - New Ticket opens assigned to that agent, with Schedule filled in from the time dragged over, and saving it books the work and brings you back to Dispatch on that day. A plain click on the board still does nothing. From Mountaineer IT's build of ITFlow. ### Bug Fixes @@ -252,6 +253,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Card fees: `billingCardFeeLine($item)` (named `BILLING_CARD_FEE_NAME`, a description starting "For paying by card on ", no product - as `billingCardFeeAdd()` writes it) and `billingWithoutCardFees($items)` (the lines without them, and what they came to). `add_invoice_copy` and `add_invoice_recurring` leave those lines off and take them off the amount they copy. - Tickets: `ticketNewGuestKeys($ticket_id)` gives a ticket a new `ticket_url_key` and its tasks' client approvals (`approval_scope` client) a new `approval_url_key`; `change_client_ticket` calls it when the client changes. - Invoices: `functions/invoice_actions.php`. `invoiceMarkSent()`, `invoiceCancel()` and `invoiceDelete()` are what `mark_invoice_sent`, `cancel_invoice` and `delete_invoice` did inline, now shared with the bulk actions. `invoiceBulkActions()`, `invoiceBulkCan()` (Sales at Modify; Send by Email with mail set up; Mark Paid `billingMoneyCan('take')`; Delete Sales at Delete), `invoiceBulkRemember()` / `invoiceBulkRecall()` (the ticked ids in `$_SESSION['invoice_bulk']` under a 16-hex key, the newest 5 sets, up to `INVOICE_BULK_MAX` - posted by `js/invoice_bulk.js` to `agent/ajax.php` `invoice_bulk_set`, so the window's address and form carry the key), `invoiceBulkWhyNot()` / `invoiceBulkPlan()`, `invoiceBulkEmail()` (Quick Send's path) and `invoiceBulkPay()` (Add Payment's), `invoiceBulkRun()` (each invoice read again before it is changed; Mark Paid under `GET_LOCK('itflow_invoice_pay_')`; receipts by client and currency through `billingPaymentEmail()`) and `invoiceBulkMessage()`. The window is `agent/modals/invoice/invoice_bulk.php`, saved by `invoice_bulk` in `agent/post/invoice.php`; history and audit lines end "(bulk)", with one Bulk Edit audit line a run. From Mountaineer IT's build of ITFlow. +- Dispatch: Day's calendars are `selectable` for agents who can book (`selectMinDistance` 5, not all-day) and `select` opens `modals/ticket/ticket_add.php` with `assigned_to`, `schedule` (the viewer's clock, as the window takes it) and `schedule_minutes`, and `return_to=dispatch`. New Ticket now takes those three to start with (`ticketScheduleLengths()` keeps a length that isn't one of its own), and `add_ticket` with `return_to=dispatch` redirects to `dispatch.php?date=` the booked day. From Mountaineer IT's build of ITFlow. ## [26.11.8] diff --git a/agent/dispatch.php b/agent/dispatch.php index 84a0003dd..e45a1bd19 100644 --- a/agent/dispatch.php +++ b/agent/dispatch.php @@ -123,7 +123,7 @@ $tell_client = intval($config_ticket_client_general_notifications) === 1;
- +
diff --git a/agent/js/dispatch.js b/agent/js/dispatch.js index 4518cbb3c..16d5679d0 100644 --- a/agent/js/dispatch.js +++ b/agent/js/dispatch.js @@ -551,6 +551,24 @@ openModal(props.modal); } }, + // A drag over empty time: New Ticket for this agent, booked for the time dragged over - + // a drag, not a click; saving it comes back here on that day + selectable: canEdit, + selectMirror: true, + selectMinDistance: 5, + selectAllow: function (info) { + return !info.allDay; + }, + select: function (info) { + cal.unselect(); + const params = new URLSearchParams({ + assigned_to: String(agentId), + schedule: ymd(info.start) + 'T' + hm(info.start), + schedule_minutes: String(Math.round((info.end - info.start) / 60000)), + return_to: 'dispatch' + }); + openModal('modals/ticket/ticket_add.php?' + params.toString()); + }, // From the queue - a booking from another agent's column comes in by eventReceive drop: function (info) { if (!queueEl.contains(info.draggedEl)) { diff --git a/agent/modals/ticket/ticket_add.php b/agent/modals/ticket/ticket_add.php index 35a4707a1..eed7e6408 100644 --- a/agent/modals/ticket/ticket_add.php +++ b/agent/modals/ticket/ticket_add.php @@ -15,6 +15,12 @@ enforceUserPermission('module_support', 2); $client_id = intval($_GET['client_id'] ?? 0); $contact_id = intval($_GET['contact_id'] ?? 0); +// From a drag over empty time on Dispatch: that agent, booked for that time on the viewer's own +// clock, for that long - and back to Dispatch once it is saved +$prefill_assigned_to = isset($_GET['assigned_to']) && preg_match('/^\d+$/', (string) $_GET['assigned_to']) ? intval($_GET['assigned_to']) : intval($session_user_id); +$prefill_schedule = preg_match('/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/', (string) ($_GET['schedule'] ?? '')) ? (string) $_GET['schedule'] : ''; +$prefill_schedule_minutes = $prefill_schedule !== '' ? ticketScheduleMinutesValue($_GET['schedule_minutes'] ?? 0) : CALENDAR_TICKET_MINUTES; +$return_to = ($_GET['return_to'] ?? '') === 'dispatch' ? 'dispatch' : ''; $project_id = intval($_GET['project_id'] ?? 0); $asset_id = intval($_GET['asset_id'] ?? 0); $location_id = intval($_GET['location_id'] ?? 0); @@ -65,6 +71,9 @@ ob_start();
+ + + @@ -211,7 +220,7 @@ ob_start(); while ($row = mysqli_fetch_assoc($sql)) { $user_id = intval($row['user_id']); $user_name = escapeHtml($row['user_name']); ?> - + @@ -249,10 +258,10 @@ ob_start();
- +