SLAs, Tickets and Modules. A priority that * already has an SLA shows its own times, the time to resolve among them * when it has one. */ defined('FROM_GETTING_STARTED') || die("Direct file access is not allowed"); $gs_support = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT config_business_days, config_business_hours_start, config_business_hours_end, config_ticket_prefix, config_ticket_next_number, config_client_portal_enable FROM settings WHERE company_id = 1")) ?: []; $gs_days = array_map('intval', explode(',', (string) ($gs_support['config_business_days'] ?? '1,2,3,4,5'))); if (isset($settings_kept['values']['business_days_kept'])) { // The days ticked, when a save came back - they are sent as a list, which settingsRefuse() doesn't keep $gs_days = array_map('intval', array_filter(explode(',', (string) $settings_kept['values']['business_days_kept']))); } $gs_day_names = [1 => 'Mon', 2 => 'Tue', 3 => 'Wed', 4 => 'Thu', 5 => 'Fri', 6 => 'Sat', 7 => 'Sun']; $gs_slas = []; $gs_sql = mysqli_query($mysqli, "SELECT sla_assignment_priority, sla_name, sla_response_minutes, sla_resolution_minutes FROM sla_assignments JOIN slas ON sla_id = sla_assignment_sla_id WHERE sla_assignment_client_id = 0 AND sla_archived_at IS NULL"); while ($gs_row = mysqli_fetch_assoc($gs_sql)) { $gs_slas[$gs_row['sla_assignment_priority']] = $gs_row; } // A column for the time to resolve, only when an SLA already given has one $gs_show_resolution = (bool) array_filter($gs_slas, function ($sla) { return intval($sla['sla_resolution_minutes']) > 0; }); $gs_use_standard = settingsChecked('standard_slas', true); ?>