diff --git a/CHANGELOG.md b/CHANGELOG.md index 60f87d9bf..3d672387c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,6 +118,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - 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. - Notifications: Admin > Settings > Notifications has Emails and notices to your team - switch off the bell notice or the email an agent gets when someone else assigns them a ticket or recurring ticket, or the copy of a client's reply that goes to the agents helping on a ticket (the agent it is assigned to is still emailed). All on to start with, as before. From Mountaineer IT's build of ITFlow. - Calendar and Dispatch: onsite work is easy to spot - a booking with a visit has an orange Onsite strip with a car across the top, an orange edge on the calendar's Month view and an orange line along the top on Dispatch's Week. Remote work looks as before. From Mountaineer IT's build of ITFlow. +- Dispatch: the Schedule window lists the contact's other open tickets under the ticket - with who has each and when it is booked - so a duplicate is noticed before work is booked on it. Merge beside one keeps one ticket and closes the other with a note pointing to it, as the ticket's own Merge does, with a reason and the choice to move its replies over. A booking on the ticket closed is taken off first, so its agent and the client are sent the cancellation. From Mountaineer IT's build of ITFlow. ### Bug Fixes @@ -256,6 +257,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - 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. +- Dispatch: `ajax.php` `dispatch_contact_tickets=` (`dispatchContactTickets()` - up to 15, newest first, the same client) and `dispatch_merge` (`dispatchMerge()` - Support at Modify; both tickets open and reachable, the same client; `ticketCancelSchedule()` on a booked child first). `ticketMergeInto()` moved from `agent/post/ticket.php` to `functions/ticket.php`, unchanged but for its uploads path, so both use it. From Mountaineer IT's build of ITFlow. - Database 3.9.1: `config_notify_assigned_app`, `config_notify_assigned_email` and `config_notify_helper_replies` in `settings` (default 1), read by `ticketTeamNotifyOn($key)` in `functions/ticket.php` (on before the update). `ticketMailAssigned()` and `ticketHelpersMailReplied()` send nothing when theirs is off - unless `emailCapturing()`, so the email preview still shows them - and every "assigned to you" bell notice checks `assigned_app`: `add_ticket`, `edit_ticket`, `bulk_assign_ticket`, the ticket and recurring ticket assign fields (`functions/ticket_fields.php`), bulk-assigning recurring tickets, a portal ticket from a template, and the API's ticket and recurring ticket create. From Mountaineer IT's build of ITFlow. ## [26.11.8] diff --git a/agent/ajax.php b/agent/ajax.php index 328ea0de7..9692ac848 100644 --- a/agent/ajax.php +++ b/agent/ajax.php @@ -2743,11 +2743,14 @@ if (isset($_POST['calendar_move'])) { * POST dispatch_assign=1 ticket_id agent_id give it to the agent, not booked * POST dispatch_event_move=1 event_id start end all_day from to a one-off event to another time or agent * POST dispatch_state=1 view hidden weekends what this agent had on Dispatch + * GET dispatch_contact_tickets= its contact's other open tickets, for the Schedule window + * POST dispatch_merge=1 child_id parent_id comment move_replies merge a duplicate there * Times come and go on the viewer's clock (functions/user_timezone.php). Looking takes * Support at View; changing anything but your own view takes Modify. */ -if (isset($_GET['dispatch_queue']) || isset($_GET['dispatch_items']) || isset($_GET['dispatch_workload']) || isset($_GET['dispatch_week']) - || isset($_POST['dispatch_book']) || isset($_POST['dispatch_unbook']) || isset($_POST['dispatch_assign']) || isset($_POST['dispatch_event_move']) || isset($_POST['dispatch_state'])) { +if (isset($_GET['dispatch_queue']) || isset($_GET['dispatch_items']) || isset($_GET['dispatch_workload']) || isset($_GET['dispatch_week']) || isset($_GET['dispatch_contact_tickets']) + || isset($_POST['dispatch_book']) || isset($_POST['dispatch_unbook']) || isset($_POST['dispatch_assign']) || isset($_POST['dispatch_event_move']) || isset($_POST['dispatch_state']) + || isset($_POST['dispatch_merge'])) { header('Content-Type: application/json'); $fail = function ($message, $code = 400) { @@ -2783,6 +2786,10 @@ if (isset($_GET['dispatch_queue']) || isset($_GET['dispatch_items']) || isset($_ echo json_encode(dispatchWeekStats($agent_list($_GET['agents'] ?? ''), intval($_GET['first_day'] ?? 0) === 1 ? 1 : 0)); exit; } + if (isset($_GET['dispatch_contact_tickets'])) { + echo json_encode(dispatchContactTickets($_GET['dispatch_contact_tickets'])); + exit; + } validateCSRFToken(); if (isset($_POST['dispatch_state'])) { @@ -2814,6 +2821,11 @@ if (isset($_GET['dispatch_queue']) || isset($_GET['dispatch_items']) || isset($_ $ok ? print(json_encode(['ok' => true, 'message' => $message])) : $fail($message); exit; } + if (isset($_POST['dispatch_merge'])) { + [$ok, $message] = dispatchMerge($_POST['child_id'] ?? 0, $_POST['parent_id'] ?? 0, (string) ($_POST['comment'] ?? ''), !empty($_POST['move_replies'])); + $ok ? print(json_encode(['ok' => true, 'message' => $message])) : $fail($message); + exit; + } if (isset($_POST['dispatch_event_move'])) { [$ok, $message] = dispatchEventMove($_POST['event_id'] ?? 0, (string) ($_POST['start'] ?? ''), (string) ($_POST['end'] ?? ''), !empty($_POST['all_day']), $_POST['from'] ?? 0, $_POST['to'] ?? 0); diff --git a/agent/dispatch.php b/agent/dispatch.php index e45a1bd19..7da1397c5 100644 --- a/agent/dispatch.php +++ b/agent/dispatch.php @@ -155,6 +155,8 @@ $tell_client = intval($config_ticket_client_general_notifications) === 1;