Recurring tickets and events can repeat on a weekday, such as the third Wednesday or the last Friday, instead of the same date: monthly, quarterly, twice-yearly and yearly recurring tickets and monthly and yearly events get Repeats on once a date is picked, moving the next run or an event's start keeps the same kind of weekday, the recurring tickets list, events and invitations say which, and subscribed calendars get it as an RRULE BYDAY; the API takes repeat_on and event_repeat_by_day; database 3.8.3 adds recurring_tickets.recurring_ticket_by_day and calendar_events.event_repeat_by_day; 26.11.9 changelog entries

This commit is contained in:
johnnyq
2026-11-17 20:51:53 -05:00
parent 512ac75c73
commit d69015e2c7
23 changed files with 413 additions and 26 deletions

View File

@@ -0,0 +1,29 @@
<?php
/*
* ITFlow - Database update to version 3.8.3 (from 3.8.2)
* Included by admin/database_updates.php - do not access directly
*
* Repeats by weekday - "the third Wednesday", "the last Friday" (functions/by_day.php):
* recurring_tickets.recurring_ticket_by_day - the rule for monthly to yearly recurring tickets
* calendar_events.event_repeat_by_day - the rule for monthly and yearly events
* Both hold an RFC 5545 BYDAY value ("3WE", "-1FR"); NULL is the same date each time, as before.
*
* 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('recurring_tickets', 'recurring_ticket_by_day')) {
mysqli_query($mysqli, "ALTER TABLE `recurring_tickets` ADD `recurring_ticket_by_day` varchar(5) DEFAULT NULL AFTER `recurring_ticket_frequency`");
}
if (!$itflow_column('calendar_events', 'event_repeat_by_day')) {
mysqli_query($mysqli, "ALTER TABLE `calendar_events` ADD `event_repeat_by_day` varchar(5) DEFAULT NULL AFTER `event_repeat_interval`");
}