From e491eb7204c2e6c60ff7282a064498bc97ec9f7f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 28 Aug 2024 16:40:07 +0000 Subject: [PATCH] Bug 37761: Use tab WRAPPER for circulation curbside pickups tabs The tabs on Circulation -> Curbside pickups look broken because they were not updated to use the tab WRAPPER markup. This patch revises the template so that the tabs look correct and makes additional changes to ensure that the correct tab is preselected. To test: - Apply the patch and enable the CurbsidePickup system preference if necessary. - Properly testing requires testing data. You can run this command to REPLACE your curbside pickup data with sample data: bash <(curl -s https://gitlab.com/-/snippets/2572579/raw/main/test_curbside_pickups.sh) - Go to Circulation -> Curbside pickups. - Confirm that the tabs look correct. The first tab should be active by default. - Confirm that the right content is displayed when you click each tab. - Under the "Schedule pickup" tab, search for a patron. - After you submit the search the page should reload and the "Schedule pickup" tab should be open. Sponsored-by: Athens County Public Libraries Signed-off-by: Jonathan Druart --- .../prog/en/modules/circ/curbside_pickups.tt | 282 ++++++++---------- 1 file changed, 131 insertions(+), 151 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/curbside_pickups.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/curbside_pickups.tt index f1d1e84efd7..0b888f0737c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/curbside_pickups.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/curbside_pickups.tt @@ -148,51 +148,49 @@ [% SET staged_and_ready = curbside_pickups.filter_by_staged_and_ready %] [% SET patron_outside = curbside_pickups.filter_by_patron_outside %] [% SET delivered_today = curbside_pickups.filter_by_delivered %] -
- - -
- [% IF !tab OR tab == 'to-be-staged' %] -
- [% ELSE %] -
+ [% WRAPPER tab_item tabname= "schedule-pickup" bt_active = schedule_pickup_active %] + Schedule pickup [% END %] + [% END # /WRAPPER tabs_nav %] + + [% WRAPPER tab_panels %] + [% WRAPPER tab_panel tabname="to-be-staged" bt_active= to_be_staged_active %] [% IF to_be_staged.count %] @@ -241,15 +239,10 @@
[% ELSE %] - There are no pickups to be staged. +
There are no pickups to be staged.
[% END %] -
- - [% IF tab == "staged-and-ready" %] -
- [% ELSE %] -
- [% END %] + [% END # /tab_panel %] + [% WRAPPER tab_panel tabname="staged-and-ready" bt_active = staged_and_ready_active %] [% IF staged_and_ready.count %] @@ -312,15 +305,10 @@
[% ELSE %] - There are no pickups staged and ready. +
There are no pickups staged and ready.
[% END %] -
- - [% IF tab == "patron-is-outside" %] -
- [% ELSE %] -
- [% END %] + [% END # /tab_panel %] + [% WRAPPER tab_panel tabname="patron-is-outside" bt_active = patron_is_outside_active %] [% IF patron_outside.count %] @@ -383,15 +371,10 @@
[% ELSE %] - There are no patrons waiting outside. +
There are no patrons waiting outside.
[% END %] -
- - [% IF tab == "delivered-today" %] -
- [% ELSE %] -
- [% END %] + [% END # /tab_panel %] + [% WRAPPER tab_panel tabname="delivered-today" bt_active = delivered_today_active %] [% IF delivered_today.count %] @@ -410,98 +393,95 @@ [% PROCESS patron_info %] - + + + [% END %] [% END %] - [% END %] - -
- [% FOREACH c IN cp.checkouts %] - [% IF date.format(c.issuedate, format = '%Y-%m-%d') == today_iso %] - [% c.item.biblio.title | html %] ([% c.item.biblio.author | html %], [% c.item.barcode | html %])
+ [% FOREACH c IN cp.checkouts %] + [% IF date.format(c.issuedate, format = '%Y-%m-%d') == today_iso %] + [% c.item.biblio.title | html %] ([% c.item.biblio.author | html %], [% c.item.barcode | html %])
+ [% END %] [% END %] - [% END %] -
- [% ELSE %] - No pickups have been delivered today. - [% END %] -
- - [% IF tab == "schedule-pickup" %] -
- [% ELSE %] -
- [% END %] - [% IF !patron || ( patron && existing_curbside_pickups.count >= 1 ) %] - [% IF existing_curbside_pickups.count >= 1 %] -
- [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %]) already has a scheduled pickup for this library. -
- [% END %] -
- -
-
Search a patron
- + + + [% ELSE %] +
There have not been any deliveries today.
+ [% END # /IF delivered_today.count %] + [% END # /tab_panel %] + [% WRAPPER tab_panel tabname="schedule-pickup" bt_active = schedule_pickup_active %] + [% IF !patron || ( patron && existing_curbside_pickups.count >= 1 ) %] + [% IF existing_curbside_pickups.count >= 1 %] +
+ [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %]) already has a scheduled pickup for this library. +
+ [% END %] +
+
+ +
+
+ +
-
- [% ELSE %] - [% SET waiting_holds = patron.holds.search( found => 'W', branchcode => Branches.GetLoggedInBranchcode ) %] - [% IF !policy.enable_waiting_holds_only || waiting_holds.count > 0 %] -
- [% INCLUDE 'csrf-token.inc' %] -
- - - -
    -
  1. - - [% INCLUDE 'patron-title.inc' patron=patron %] - -
  2. - -
  3. - -
    - -
    -
  4. - -
  5. - - -
  6. - -
  7. - -
  8. - - -
  9. -
-
- -
- -
-
[% ELSE %] -
The patron does not have waitings holds.
+ [% SET waiting_holds = patron.holds.search( found => 'W', branchcode => Branches.GetLoggedInBranchcode ) %] + [% IF !policy.enable_waiting_holds_only || waiting_holds.count > 0 %] +
+ [% INCLUDE 'csrf-token.inc' %] +
+ + + +
    +
  1. + + [% INCLUDE 'patron-title.inc' patron=patron %] + +
  2. + +
  3. + +
    + +
    +
  4. + +
  5. + + +
  6. + +
  7. + +
  8. + + +
  9. +
+
+ +
+ +
+
+ [% ELSE %] +
The patron does not have waitings holds.
+ [% END %] [% END %] - [% END %] -
-
-
+ [% END # /tab_panel %] + [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %] + [% IF Koha.Preference('CircSidebar') %]
-- 2.34.1