mirror of
https://github.com/itflow-org/itflow
synced 2026-11-23 12:57:24 +00:00
Calendar: every agent has a color picked in Account Preferences or Admin Users, and their booked tickets and assigned events are drawn in it with their first name beside the time; events are assigned to agents from New Event, Edit and the quick look, with contacts and anyone else under Invite; Left behind under the calendar lists open tickets booked on a day that has gone, to drag back on; a 7 days view moves a day at a time and bookings at the same time sit side by side; Holidays shows the SLA closure days; what the calendar shows is kept to the account, and To schedule with Everyone lists everyone's unbooked tickets; database 3.8.4 adds user_settings.user_config_calendar_color and user_config_calendar_state; 26.11.9 changelog entries
This commit is contained in:
30
admin/database_updates/3.8.4.php
Normal file
30
admin/database_updates/3.8.4.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* ITFlow - Database update to version 3.8.4 (from 3.8.3)
|
||||
* Included by admin/database_updates.php - do not access directly
|
||||
*
|
||||
* The calendar, per agent (functions/calendar.php):
|
||||
* user_settings.user_config_calendar_color - the colour their booked work and events are drawn
|
||||
* in, '#rrggbb'; NULL is one worked out from their user id (calendarAgentColor())
|
||||
* user_settings.user_config_calendar_state - what they last had shown on the calendar page
|
||||
* (calendars, sources, whose, view), as JSON, so every device opens the same way
|
||||
*
|
||||
* 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('user_settings', 'user_config_calendar_color')) {
|
||||
mysqli_query($mysqli, "ALTER TABLE `user_settings` ADD `user_config_calendar_color` varchar(7) DEFAULT NULL AFTER `user_config_calendar_first_day`");
|
||||
}
|
||||
|
||||
if (!$itflow_column('user_settings', 'user_config_calendar_state')) {
|
||||
mysqli_query($mysqli, "ALTER TABLE `user_settings` ADD `user_config_calendar_state` text DEFAULT NULL AFTER `user_config_calendar_color`");
|
||||
}
|
||||
@@ -109,6 +109,9 @@ $value = function ($key) use ($form) {
|
||||
} ?>
|
||||
<div class="form-text">What they can see and change. <a href="roles.php" target="_blank">Roles <i class="fas fa-external-link-alt small"></i></a></div>
|
||||
</div>
|
||||
<?php if (!$is_new) { ?>
|
||||
<?= calendarAgentColorField($form_user_id, 'col-12') ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -205,6 +205,7 @@ if (isset($_POST['edit_user'])) {
|
||||
mysqli_query($mysqli, "UPDATE users SET user_name = '" . escapeSql($name) . "', user_email = '" . escapeSql($email) . "', user_role_id = " . intval($role['role_id']) . " WHERE user_id = $user_id");
|
||||
$force_mfa = !empty($_POST['force_mfa']) ? 1 : 0;
|
||||
mysqli_query($mysqli, "INSERT INTO user_settings SET user_id = $user_id, user_config_force_mfa = $force_mfa ON DUPLICATE KEY UPDATE user_config_force_mfa = $force_mfa");
|
||||
calendarAgentColorSave($user_id, $_POST);
|
||||
|
||||
// An admin sees every client - their rules are left as they were, in case the role changes back
|
||||
if (!intval($role['role_is_admin']) && isset($_POST['client_permission_shown'])) {
|
||||
|
||||
Reference in New Issue
Block a user