diff --git a/admin/backup.php b/admin/backup.php index e94798681..80eba6e6b 100644 --- a/admin/backup.php +++ b/admin/backup.php @@ -148,7 +148,7 @@ if (!empty($_SESSION['backup_master_key_reveal'])) { 0 ? escapeHtml(backupFormatBytes($backup['backup_size'])) : '-' ?> - +
diff --git a/agent/dashboard.php b/agent/dashboard.php index beaed8672..3daefae8c 100644 --- a/agent/dashboard.php +++ b/agent/dashboard.php @@ -784,7 +784,7 @@ if ($user_config_dashboard_technical_enable == 1) { "> - + diff --git a/agent/invoice.php b/agent/invoice.php index 5eda4ba35..2427cd8c8 100644 --- a/agent/invoice.php +++ b/agent/invoice.php @@ -349,7 +349,7 @@ if (isset($_GET['invoice_id'])) {

INVOICE

-
+
diff --git a/agent/invoices.php b/agent/invoices.php index b84b5f4e6..7c39b75e4 100644 --- a/agent/invoices.php +++ b/agent/invoices.php @@ -396,12 +396,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - + - + diff --git a/agent/modals/invoice/invoice_payments.php b/agent/modals/invoice/invoice_payments.php index 9ea0ebaef..54d9994ce 100644 --- a/agent/modals/invoice/invoice_payments.php +++ b/agent/modals/invoice/invoice_payments.php @@ -43,7 +43,7 @@ ob_start(); diff --git a/agent/post/quote.php b/agent/post/quote.php index bc5aa4ba8..fd08febdf 100644 --- a/agent/post/quote.php +++ b/agent/post/quote.php @@ -820,7 +820,7 @@ if (isset($_GET['export_quote_pdf'])) { //Set Badge color based off of quote status if ($quote_status == "Sent") { - $quote_badge_color = "warning text-white"; + $quote_badge_color = "warning"; } elseif ($quote_status == "Viewed") { $quote_badge_color = "primary"; } elseif ($quote_status == "Accepted") { diff --git a/agent/quote.php b/agent/quote.php index 199c7e258..d45bc5f05 100644 --- a/agent/quote.php +++ b/agent/quote.php @@ -103,7 +103,7 @@ if (isset($_GET['quote_id'])) { //Set Badge color based off of quote status if ($quote_status == "Sent") { - $quote_badge_color = "warning text-white"; + $quote_badge_color = "warning"; } elseif ($quote_status == "Viewed") { $quote_badge_color = "primary"; } elseif ($quote_status == "Accepted") { @@ -259,7 +259,7 @@ if (isset($_GET['quote_id'])) {

QUOTE

-
+
diff --git a/agent/quotes.php b/agent/quotes.php index f33bd3082..a07019f1f 100644 --- a/agent/quotes.php +++ b/agent/quotes.php @@ -171,7 +171,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); } if ($quote_status == "Sent") { - $quote_badge_color = "warning text-white"; + $quote_badge_color = "warning"; } elseif ($quote_status == "Viewed") { $quote_badge_color = "primary"; } elseif ($quote_status == "Accepted") { @@ -203,7 +203,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); diff --git a/agent/recurring_invoice.php b/agent/recurring_invoice.php index 8ae82a531..0ddb42318 100644 --- a/agent/recurring_invoice.php +++ b/agent/recurring_invoice.php @@ -227,7 +227,7 @@ if (isset($_GET['recurring_invoice_id'])) {

RECURRING INVOICE

-
+
- +
diff --git a/agent/recurring_invoices.php b/agent/recurring_invoices.php index 935dc1573..7ba8daab6 100644 --- a/agent/recurring_invoices.php +++ b/agent/recurring_invoices.php @@ -245,7 +245,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); diff --git a/agent/transactions.php b/agent/transactions.php index a83fa583c..9c9e31a11 100644 --- a/agent/transactions.php +++ b/agent/transactions.php @@ -519,7 +519,7 @@ if ($account_filter) { - + diff --git a/client/quotes.php b/client/quotes.php index 59b0ffae3..bc084818f 100644 --- a/client/quotes.php +++ b/client/quotes.php @@ -49,7 +49,7 @@ $quotes_sql = mysqli_query($mysqli, "SELECT quote_amount, quote_date, quote_id, } if ($quote_status == "Sent") { - $quote_badge_color = "warning text-white"; + $quote_badge_color = "warning"; } elseif ($quote_status == "Viewed") { $quote_badge_color = "primary"; } elseif ($quote_status == "Accepted") { @@ -70,7 +70,7 @@ $quotes_sql = mysqli_query($mysqli, "SELECT quote_amount, quote_date, quote_id, diff --git a/client/unpaid_invoices.php b/client/unpaid_invoices.php index 9c9106947..874107dd3 100644 --- a/client/unpaid_invoices.php +++ b/client/unpaid_invoices.php @@ -119,7 +119,7 @@ $balance = $invoice_amounts - $amount_paid; } if ($invoice_status == "Sent") { - $invoice_badge_color = "warning text-white"; + $invoice_badge_color = "warning"; } elseif ($invoice_status == "Viewed") { $invoice_badge_color = "info"; } elseif ($invoice_status == "Partial") { diff --git a/css/itflow_custom.css b/css/itflow_custom.css index c1eeb4156..2636b75e7 100644 --- a/css/itflow_custom.css +++ b/css/itflow_custom.css @@ -594,3 +594,25 @@ a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):not(.page-li .theme-teal .nav-pills { --bs-nav-pills-link-active-color: #000; } + +/* --- Theme swatch colours ----------------------------------------------- + admin/settings_theme.php renders each choice as . AdminLTE 3 defined those; v4 does not, so every swatch + on the theme picker rendered with no colour at all - you could not see + what you were selecting. Same accent hexes the themes themselves use. */ +.text-black { color: #000000 !important; } +.text-blue { color: #007bff !important; } +.text-cyan { color: #17a2b8 !important; } +.text-fuchsia { color: #f012be !important; } +.text-gray { color: #6c757d !important; } +.text-green { color: #28a745 !important; } +.text-indigo { color: #6610f2 !important; } +.text-lightblue { color: #3c8dbc !important; } +.text-maroon { color: #d81b60 !important; } +.text-navy { color: #001f3f !important; } +.text-olive { color: #3d9970 !important; } +.text-orange { color: #fd7e14 !important; } +.text-pink { color: #e83e8c !important; } +.text-purple { color: #6f42c1 !important; } +.text-red { color: #dc3545 !important; } +.text-teal { color: #20c997 !important; } diff --git a/functions/app.php b/functions/app.php index df45126dc..b835e97be 100644 --- a/functions/app.php +++ b/functions/app.php @@ -39,7 +39,7 @@ function getAssetIcon($asset_type) { function getInvoiceBadgeColor($invoice_status) { if ($invoice_status == "Sent") { - $invoice_badge_color = "warning text-white"; + $invoice_badge_color = "warning"; } elseif ($invoice_status == "Viewed") { $invoice_badge_color = "info"; } elseif ($invoice_status == "Partial") { diff --git a/functions/sanitize.php b/functions/sanitize.php index 64cd31878..ed8f90711 100644 --- a/functions/sanitize.php +++ b/functions/sanitize.php @@ -169,6 +169,28 @@ function escapeCsvFormula($value) { * existed there were four separate implementations and one of them interpolated * raw. */ +/** + * Map a flashAlert type onto a real Bootstrap contextual class. + * + * flashAlert() is called with more type names than Bootstrap has classes - + * 'error', 'alert' and a typo'd 'errpr' among them - so interpolating the raw + * value produced alert-error / alert-alert, which style nothing at all. + */ +function alertStyleClass($type) { + + $alert_classes = [ + 'success' => 'success', + 'info' => 'info', + 'warning' => 'warning', + 'alert' => 'warning', + 'error' => 'danger', + 'errpr' => 'danger', + 'danger' => 'danger', + ]; + + return $alert_classes[$type] ?? 'secondary'; +} + function alertMessageHtml($message) { $allowed_tags = [ diff --git a/guest/guest_view_invoice.php b/guest/guest_view_invoice.php index f885cf79b..3046f8959 100644 --- a/guest/guest_view_invoice.php +++ b/guest/guest_view_invoice.php @@ -217,7 +217,7 @@ if ($balance > 0) {

INVOICE

-
+
- + diff --git a/agent/ticket.php b/agent/ticket.php index fc13735e7..9902bdae3 100644 --- a/agent/ticket.php +++ b/agent/ticket.php @@ -573,7 +573,7 @@ if (isset($_GET['ticket_id'])) { data-modal-url="modals/ticket/ticket_priority.php?id=" > - + diff --git a/agent/ticket_kanban.php b/agent/ticket_kanban.php index cab8a3818..770bfcdf9 100644 --- a/agent/ticket_kanban.php +++ b/agent/ticket_kanban.php @@ -153,7 +153,7 @@ $kanban = array_values($statuses); - + diff --git a/agent/ticket_list.php b/agent/ticket_list.php index d50cc48b3..c5c691605 100644 --- a/agent/ticket_list.php +++ b/agent/ticket_list.php @@ -391,7 +391,7 @@ if ($tickets) { data-modal-url="modals/ticket/ticket_priority.php?id=" > - +
diff --git a/client/includes/header.php b/client/includes/header.php index 5156c3635..898388bfd 100644 --- a/client/includes/header.php +++ b/client/includes/header.php @@ -157,9 +157,9 @@ header("X-Frame-Options: DENY"); // Legacy $_SESSION['alert_type'] = "info"; } ?> -
+
- +
- + - +
diff --git a/guest/guest_view_quote.php b/guest/guest_view_quote.php index 731529fff..716fe0eb7 100644 --- a/guest/guest_view_quote.php +++ b/guest/guest_view_quote.php @@ -92,7 +92,7 @@ $currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY); //Set Badge color based off of quote status if ($quote_status == "Sent") { - $quote_badge_color = "warning text-white"; + $quote_badge_color = "warning"; } elseif ($quote_status == "Viewed") { $quote_badge_color = "primary"; } elseif ($quote_status == "Accepted") { @@ -150,7 +150,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie

QUOTE

-
+
diff --git a/includes/inc_alert_feedback.php b/includes/inc_alert_feedback.php index 79c683d5c..53df7810f 100644 --- a/includes/inc_alert_feedback.php +++ b/includes/inc_alert_feedback.php @@ -20,21 +20,13 @@ if (!empty($_SESSION['alert_message'])) { $alert_type = $_SESSION['alert_type'] ?? 'success'; - // flashAlert() is called with more type names than toastr ever defined - - // 'danger' (19 sites), 'alert' (4) and a typo'd 'errpr' (1) all resolved to - // an undefined toastr method, threw, and showed the user nothing at all. - // Everything maps onto a real style here; anything unrecognised still shows. - $alert_styles = [ - 'success' => 'text-bg-success', - 'info' => 'text-bg-info', - 'warning' => 'text-bg-warning', - 'alert' => 'text-bg-warning', - 'error' => 'text-bg-danger', - 'errpr' => 'text-bg-danger', - 'danger' => 'text-bg-danger', - ]; - $alert_style = $alert_styles[$alert_type] ?? 'text-bg-secondary'; - $alert_dark_text = in_array($alert_type, ['warning', 'alert', 'info'], true); + // One mapping for both renderers - see alertStyleClass() in + // functions/sanitize.php. flashAlert() is called with more type names than + // Bootstrap has classes ('danger', 'alert' and a typo'd 'errpr' among + // them), and an unmapped value used to resolve to nothing at all. + $alert_style = 'text-bg-' . alertStyleClass($alert_type); + // text-bg-info and text-bg-warning are the two Bootstrap pairs with dark text + $alert_dark_text = in_array(alertStyleClass($alert_type), ['warning', 'info'], true); // Escaping lives in one place now - see alertMessageHtml() in functions/sanitize.php $alert_safe_message = alertMessageHtml($_SESSION['alert_message']); diff --git a/setup/index.php b/setup/index.php index d8acaa977..4fc13a0ae 100644 --- a/setup/index.php +++ b/setup/index.php @@ -658,7 +658,7 @@ if (isset($_POST['add_telemetry'])) { ?>
- +