Tickets: booked work has an end - the Schedule window has How long from 15 minutes to a day and an Agent picker that gives the ticket to someone else and takes it off the old agent's calendar; New Ticket's Schedule and a recurring ticket's Book the work for take a length; the calendar draws each booking at its length and dragging its bottom edge changes it after asking; the booking email, calendar file, ticket and guest page show the end; the double-booking warning lists the agent's tickets and timed events that overlap the booking instead of anything within two hours; database 3.8.2 adds tickets.ticket_schedule_end and recurring_tickets.recurring_ticket_schedule_minutes; 26.11.9 changelog entries

This commit is contained in:
johnnyq
2026-11-17 20:50:59 -05:00
parent 1c4c8be8de
commit 512ac75c73
18 changed files with 350 additions and 76 deletions

View File

@@ -870,14 +870,15 @@ function getTicketCalendarUid($ticket_id) {
}
/*
* The calendar file sent with a ticket's "scheduled" email - the visit, an hour
* long, in the instance timezone - for the recipient to add to their calendar.
* The calendar file sent with a ticket's "scheduled" email - the visit, to $end
* (an hour long without one), in the instance timezone - for the recipient to
* add to their calendar.
* Published rather than sent as a meeting request: the support mailbox is not
* an organiser people should be accepting invitations from, and an "Accepted:"
* reply would arrive there as a new ticket. Rescheduling sends it again with the
* same UID and a higher SEQUENCE, which moves the one already added.
*/
function createiCalStr($datetime, $title, $description, $location, $uid = null) {
function createiCalStr($datetime, $title, $description, $location, $uid = null, $end = null) {
global $config_timezone;
if (empty($uid)) {
$uid = date('Y-m-d-H-i-s') . "@" . ($_SERVER['SERVER_NAME'] ?? 'itflow');
@@ -885,7 +886,7 @@ function createiCalStr($datetime, $title, $description, $location, $uid = null)
return icsCalendar(['method' => 'PUBLISH', 'invite' => true], [[
'uid' => $uid,
'start' => $datetime,
'end' => date('Y-m-d H:i:s', strtotime($datetime) + CALENDAR_TICKET_MINUTES * 60),
'end' => !empty($end) && strtotime($end) > strtotime($datetime) ? date('Y-m-d H:i:s', strtotime($end)) : date('Y-m-d H:i:s', strtotime($datetime) + CALENDAR_TICKET_MINUTES * 60),
'summary' => $title,
'description' => $description,
'location' => $location,