From 594bf9e38f8a21718135df5473b05370e02a540f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 12 Dec 2025 11:29:16 +0000 Subject: [PATCH] Bug 41439: Add column visibility toggles to circulation rules table The circulation rules table has become excessively wide with 40+ columns, making it difficult to navigate and use. This patch adds column visibility toggle buttons that allow users to focus on specific rule categories. Changes: - Add data-colname attributes to all table headers and footers for robust column identification - Add toggle buttons for: Checkouts, Due dates, Fines, Renewals, Holds, Article requests, Recalls, and Show all - Group columns into logical categories based on their function - Use column name selectors instead of fragile index-based selection for maintainability - Default to showing only Checkout columns on page load for a cleaner initial view - Highlight the active button to indicate current view - Disable search functionality (not appropriate for this table) - Handle dynamic column visibility based on system preferences (UnseenRenewals, ArticleRequests, UseRecalls) Test plan: 1. Navigate to Administration > Circulation and fine rules 2. Observe the table now shows only checkout-related columns by default with the "Checkouts" button highlighted 3. Click different category buttons (Fines, Renewals, Holds, etc.) and verify only relevant columns are shown 4. Verify the active button is highlighted in blue 5. Click "Show all" to display all columns 6. Verify the layout works with different system preference combinations (enable/disable ArticleRequests, UseRecalls, UnseenRenewals) 7. Verify column visibility persists correctly when system preferences are changed --- .../prog/en/modules/admin/smart-rules.tt | 353 +++++++++++++----- 1 file changed, 258 insertions(+), 95 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index bd0526017da..b0ce725734d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -117,58 +117,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + [% IF Koha.Preference('UnseenRenewals') %] - + [% END %] - - - - - - - - - - - - + + + + + + + + + + + + [% IF Koha.Preference('ArticleRequests') %] - + [% END %] - + [% IF Koha.Preference('UseRecalls') %] - - - - - - + + + + + + [% END %] - + @@ -598,58 +598,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + [% IF Koha.Preference('UnseenRenewals') %] - + [% END %] - - - - - - - - - - - - + + + + + + + + + + + + [% IF Koha.Preference('ArticleRequests') %] - + [% END %] - + [% IF Koha.Preference('UseRecalls') %] - - - - - - + + + + + + [% END %] - +
 Patron category Item typeActionsNoteCurrent checkouts allowedCurrent on-site checkouts allowedLoan periodDays modeUnitHard due dateDecreased loan period for high holds (day)Fine amountFine charging intervalWhen to chargeFine/suspension grace periodOverdue fines cap (amount)Cap fine at replacement priceExpired hold chargeSuspension in days (day)Max. suspension duration (day)Suspension charging intervalRenewals allowed (count) Patron category Item typeActionsNoteCurrent checkouts allowedCurrent on-site checkouts allowedLoan periodDays modeUnitHard due dateDecreased loan period for high holds (day)Fine amountFine charging intervalWhen to chargeFine/suspension grace periodOverdue fines cap (amount)Cap fine at replacement priceExpired hold chargeSuspension in days (day)Max. suspension duration (day)Suspension charging intervalRenewals allowed (count)Unseen renewals allowed (count)Unseen renewals allowed (count)Renewal periodNo renewal beforeNo automatic renewal beforeAutomatic renewalNo automatic renewal afterNo automatic renewal after (hard limit)Holds allowed (total)Holds allowed (daily)Holds per record (count)On shelf holds allowedOPAC item level holdsHolds pickup period (day)Renewal periodNo renewal beforeNo automatic renewal beforeAutomatic renewalNo automatic renewal afterNo automatic renewal after (hard limit)Holds allowed (total)Holds allowed (daily)Holds per record (count)On shelf holds allowedOPAC item level holdsHolds pickup period (day)Article requestsArticle requestsRental discount (%)Rental discount (%)Recalls allowed (total)Recalls per record (count)On shelf recalls allowedRecall due date interval (day)Recall overdue fine amountRecall pickup period (day)Recalls allowed (total)Recalls per record (count)On shelf recalls allowedRecall due date interval (day)Recall overdue fine amountRecall pickup period (day)ActionsActions
 Patron category Item type NoteCurrent checkouts allowedCurrent on-site checkouts allowedLoan periodDays modeUnitHard due dateDecreased loan period for high holds (day)Fine amountFine charging intervalCharge when?Fine/suspension grace periodOverdue fines cap (amount)Cap fine at replacement priceExpired hold chargeSuspension in days (day)Max. suspension duration (day)Suspension charging intervalRenewals allowed (count) Patron category Item type NoteCurrent checkouts allowedCurrent on-site checkouts allowedLoan periodDays modeUnitHard due dateDecreased loan period for high holds (day)Fine amountFine charging intervalCharge when?Fine/suspension grace periodOverdue fines cap (amount)Cap fine at replacement priceExpired hold chargeSuspension in days (day)Max. suspension duration (day)Suspension charging intervalRenewals allowed (count)Unseen renewals allowed (count)Unseen renewals allowed (count)Renewal periodNo renewal beforeNo automatic renewal beforeAutomatic renewalNo automatic renewal afterNo automatic renewal after (hard limit)Holds allowed (total)Holds allowed (daily)Holds per record (count)On shelf holds allowedOPAC item level holdsHolds pickup period (day)Renewal periodNo renewal beforeNo automatic renewal beforeAutomatic renewalNo automatic renewal afterNo automatic renewal after (hard limit)Holds allowed (total)Holds allowed (daily)Holds per record (count)On shelf holds allowedOPAC item level holdsHolds pickup period (day)Article requestsArticle requestsRental discount (%)Rental discount (%)Recalls allowed (total)Recalls per record (count)On shelf recalls allowedRecall due date interval (day)Recall overdue fine amountRecall pickup period (day)Recalls allowed (total)Recalls per record (count)On shelf recalls allowedRecall due date interval (day)Recall overdue fine amountRecall pickup period (day)  
@@ -1441,11 +1441,68 @@ [% INCLUDE 'datatables.inc' %] [% INCLUDE 'calendar.inc' %] [% INCLUDE 'format_price.inc' %] +