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

@@ -0,0 +1,30 @@
<?php
/*
* ITFlow - Database update to version 3.8.2 (from 3.8.1)
* Included by admin/database_updates.php - do not access directly
*
* Booked work has an end (functions/ticket.php, ticketSetSchedule()):
* tickets.ticket_schedule_end - when the booked work ends, in company time;
* NULL is the usual length after the start (CALENDAR_TICKET_MINUTES)
* recurring_tickets.recurring_ticket_schedule_minutes - how long each ticket a
* recurring ticket books is booked for
*
* Re-runnable: each column is added only where it isn't there yet.
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
$itflow_column = function ($table, $column) use ($mysqli) {
$result = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '$table' AND COLUMN_NAME = '$column' LIMIT 1");
return $result && mysqli_num_rows($result) > 0;
};
if (!$itflow_column('tickets', 'ticket_schedule_end')) {
mysqli_query($mysqli, "ALTER TABLE `tickets` ADD `ticket_schedule_end` datetime DEFAULT NULL AFTER `ticket_schedule`");
}
if (!$itflow_column('recurring_tickets', 'recurring_ticket_schedule_minutes')) {
mysqli_query($mysqli, "ALTER TABLE `recurring_tickets` ADD `recurring_ticket_schedule_minutes` int(11) NOT NULL DEFAULT 60 AFTER `recurring_ticket_schedule_onsite`");
}