From b007f58ee099db1e466c55fbc150f2055c47d78a Mon Sep 17 00:00:00 2001 From: opencode Date: Tue, 24 Mar 2026 18:59:40 +0000 Subject: [PATCH] Fix review comments from PR #4445 - Fix string interpolation in data-href attributes (use double quotes for PHP variable interpolation) - Add missing name attributes to message_config.php form inputs (msg_uid, msg_pwd, msg_src) - Fix HTML tag mismatch in profile.php ( to ) - Add modal-dlg class to buttons for proper modal dialog handling - Add missing IDs for delete/generate_barcodes buttons in item_kits/manage.php - Fix esc() wrapping around lang() calls where inappropriate - Fix disabled attribute rendering in dinner_tables.php - Fix date format bug in daterangepicker.php (use timeformat instead of dateformat for time component) - Fix JavaScript selector fallback logic in bs-tab_anchor_linking.js - Add Bootstrap guard in bs-tooltips.js to prevent errors when Bootstrap JS is not loaded --- app/Views/attributes/manage.php | 2 +- app/Views/cashups/manage.php | 4 ++-- app/Views/configs/message_config.php | 18 +++++++++--------- app/Views/expenses/manage.php | 2 +- app/Views/expenses_categories/manage.php | 2 +- app/Views/giftcards/manage.php | 2 +- app/Views/home/profile.php | 2 +- app/Views/item_kits/manage.php | 6 +++--- app/Views/items/manage.php | 6 +++--- app/Views/partial/daterangepicker.php | 2 +- app/Views/partial/dinner_tables.php | 2 +- app/Views/people/manage.php | 4 ++-- app/Views/sales/register.php | 4 ++-- app/Views/taxes/tax_rates.php | 2 +- public/js/bs-tab_anchor_linking.js | 11 +++++++---- public/js/bs-tooltips.js | 7 +++++-- 16 files changed, 41 insertions(+), 35 deletions(-) diff --git a/app/Views/attributes/manage.php b/app/Views/attributes/manage.php index 41e2a2355..857d24474 100644 --- a/app/Views/attributes/manage.php +++ b/app/Views/attributes/manage.php @@ -27,7 +27,7 @@ echo view('configs/config_header', $title_info);
-
diff --git a/app/Views/cashups/manage.php b/app/Views/cashups/manage.php index 7e236840a..0c3f2994c 100644 --- a/app/Views/cashups/manage.php +++ b/app/Views/cashups/manage.php @@ -49,8 +49,8 @@ echo view('configs/config_header', $title_info); false, 'selected_printer' => 'takings_printer']) ?>
-
diff --git a/app/Views/giftcards/manage.php b/app/Views/giftcards/manage.php index 26be29b7e..9231a6bd6 100644 --- a/app/Views/giftcards/manage.php +++ b/app/Views/giftcards/manage.php @@ -26,7 +26,7 @@ echo view('configs/config_header', $title_info);
-
diff --git a/app/Views/home/profile.php b/app/Views/home/profile.php index 0d9932d65..48f506e60 100644 --- a/app/Views/home/profile.php +++ b/app/Views/home/profile.php @@ -14,7 +14,7 @@ $grav_url = 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . diff --git a/app/Views/item_kits/manage.php b/app/Views/item_kits/manage.php index e259a823d..8f4c33740 100644 --- a/app/Views/item_kits/manage.php +++ b/app/Views/item_kits/manage.php @@ -34,17 +34,17 @@ echo view('configs/config_header', $title_info);
-
- -
diff --git a/app/Views/items/manage.php b/app/Views/items/manage.php index 25820033e..4dab4a403 100644 --- a/app/Views/items/manage.php +++ b/app/Views/items/manage.php @@ -81,10 +81,10 @@ echo view('configs/config_header', $title_info);
- -
@@ -97,7 +97,7 @@ echo view('configs/config_header', $title_info); - diff --git a/app/Views/partial/daterangepicker.php b/app/Views/partial/daterangepicker.php index 05bdd1fe3..a2d3be042 100644 --- a/app/Views/partial/daterangepicker.php +++ b/app/Views/partial/daterangepicker.php @@ -121,7 +121,7 @@ $('#daterangepicker').daterangepicker({ "ranges": { "": [ - "", + "", "" ], "": [ diff --git a/app/Views/partial/dinner_tables.php b/app/Views/partial/dinner_tables.php index 442a8800c..364e295ed 100644 --- a/app/Views/partial/dinner_tables.php +++ b/app/Views/partial/dinner_tables.php @@ -21,7 +21,7 @@ foreach ($dinner_tables as $table_key => $table) {
. - > + >
diff --git a/app/Views/people/manage.php b/app/Views/people/manage.php index 025a5d0f9..b5475d3a2 100644 --- a/app/Views/people/manage.php +++ b/app/Views/people/manage.php @@ -38,11 +38,11 @@ echo view('configs/config_header', $title_info);
- - diff --git a/app/Views/sales/register.php b/app/Views/sales/register.php index 23501f892..2b459508b 100644 --- a/app/Views/sales/register.php +++ b/app/Views/sales/register.php @@ -163,10 +163,10 @@ helper('url');
- -
diff --git a/app/Views/taxes/tax_rates.php b/app/Views/taxes/tax_rates.php index 0524fc1ae..2e8abf7d0 100644 --- a/app/Views/taxes/tax_rates.php +++ b/app/Views/taxes/tax_rates.php @@ -19,7 +19,7 @@
-
diff --git a/public/js/bs-tab_anchor_linking.js b/public/js/bs-tab_anchor_linking.js index 6b9f12083..c574cbb85 100644 --- a/public/js/bs-tab_anchor_linking.js +++ b/public/js/bs-tab_anchor_linking.js @@ -2,15 +2,18 @@ let url = location.href.replace(/\/$/, ""); if (location.hash) { const hash = url.split("#"); - const currentTab = document.querySelector('#configs-list-tab button[href="#' + hash[1] + '"]' || '#configs-dropdown a[href="#' + hash[1] + '"]'); - const curTab = new bootstrap.Tab(currentTab); - curTab.show(); + const selector = '#configs-list-tab button[data-bs-target="#' + hash[1] + '"], #configs-dropdown a[href="#' + hash[1] + '"]'; + const currentTab = document.querySelector(selector); + if (currentTab) { + const curTab = new bootstrap.Tab(currentTab); + curTab.show(); + } url = location.href.replace(/\/#/, "#"); history.replaceState(null, null, url); } // Change url based on selected tab -const selectableTabList = [].slice.call(document.querySelectorAll('button[data-bs-toggle="tab"]' || 'a[data-bs-toggle="tab"]')); +const selectableTabList = [].slice.call(document.querySelectorAll('button[data-bs-toggle="tab"], a[data-bs-toggle="tab"]')); selectableTabList.forEach((selectableTab) => { const selTab = new bootstrap.Tab(selectableTab); selectableTab.addEventListener("click", function () { diff --git a/public/js/bs-tooltips.js b/public/js/bs-tooltips.js index 638371369..965e698a6 100644 --- a/public/js/bs-tooltips.js +++ b/public/js/bs-tooltips.js @@ -1,3 +1,6 @@ // Bootstrap 5 - Initialize all tooltips on a page - from https://getbootstrap.com/docs/5.3/components/tooltips/#enable-tooltips -const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]') -const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)) +if (window.bootstrap && typeof window.bootstrap.Tooltip === 'function') { + document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach((tooltipTriggerEl) => { + new bootstrap.Tooltip(tooltipTriggerEl); + }); +}