From feba1c38b9905504820c2e95fc0cefe5acd3e0bf Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 20 Jul 2023 14:58:07 +0000 Subject: [PATCH] Bug 32890: Add DataTables to curbside pickups This patch modifies the curbside pickups page in the staff interface so that each table is a DataTable with configurable columns. The patch also replaces the patron name output with patron-title.inc for consistency and to display names 'surname, firstname' for correct column sorting. To test, apply the patch and restart services. - 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. - Test DataTable functionality under each tab: sorting, paging, filtering, column visibility, and export. - Go to Administration -> Table settings -> Circulation -> Curbside pickup - Confirm that changes made to the configuration of each of the 4 curbside pickup tables is correctly applied on the curbside pickups page. --- admin/columns_settings.yml | 50 +++++++++++++++++++ .../prog/en/modules/circ/curbside_pickups.tt | 42 +++++++++++----- 2 files changed, 80 insertions(+), 12 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 90fb535472..33e2f9ca7c 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1432,6 +1432,56 @@ modules: columnname: phone is_hidden: 1 + curbside_pickups: + to_be_stagedt: + columns: + - + columnname: pickup_datetime + - + columnname: patron + - + columnname: items_for_pickup + - + columnname: action + cannot_be_toggled: 1 + cannot_be_modified: 1 + staged_and_readyt: + columns: + - + columnname: pickup_datetime + - + columnname: patron + - + columnname: items_for_pickup + - + columnname: staged_by + - + columnname: action + cannot_be_toggled: 1 + cannot_be_modified: 1 + patron_is_outsidet: + columns: + - + columnname: pickup_datetime + - + columnname: patron + - + columnname: items_for_pickup + - + columnname: staged_by + - + columnname: action + cannot_be_toggled: 1 + cannot_be_modified: 1 + delivered_todayt: + columns: + - + columnname: delivery_datetime + - + columnname: patron + - + columnname: items_checked_out + returns: checkedintable: columns: 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 e1eec439a8..4191ca2cb5 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 @@ -6,6 +6,7 @@ [% USE Asset %] [% USE raw %] [% USE To %] +[% USE TablesSettings %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Curbside pickups › Circulation › Koha @@ -61,7 +62,7 @@ [% END %] [% BLOCK patron_info %] - [% cp.patron.firstname | html %] [% cp.patron.surname | html %] ([% cp.patron.cardnumber | html %]) + [% INCLUDE 'patron-title.inc' patron=cp.patron invert_name = 1 hide_patron_infos_if_needed=1 %] [% IF cp.notes %]
Notes: [% cp.notes | html %] @@ -188,20 +189,20 @@
[% END %] [% IF to_be_staged.count %] - +
- + [% FOREACH cp IN to_be_staged %] [% UNLESS cp.staged_datetime %] - + @@ -243,21 +244,21 @@
[% END %] [% IF staged_and_ready.count %] -
Pickup date/time Patron Items for pickupActionAction
[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %][% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %] [% PROCESS patron_info %]
+
- + [% FOREACH cp IN staged_and_ready %] [% IF cp.staged_datetime && !cp.arrival_datetime %] - + @@ -311,21 +312,21 @@
[% END %] [% IF patron_outside.count %] -
Pickup date/time Patron Items for pickup Staged byActionAction
[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %][% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %] [% PROCESS patron_info %]
+
- + [% FOREACH cp IN patron_outside %] [% IF cp.arrival_datetime && !cp.delivered_datetime %] - + @@ -379,7 +380,7 @@
[% END %] [% IF delivered_today.count %] -
Pickup date/time Patron Items for pickup Staged byActionAction
[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %][% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %] [% PROCESS patron_info %]
+
@@ -391,7 +392,7 @@ [% FOREACH cp IN delivered_today %] [% IF cp.delivered_datetime %] - + @@ -506,6 +507,8 @@ [% INCLUDE 'calendar.inc' %] [% INCLUDE 'js-patron-format.inc' %] + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %]
Deliver date/time
[% cp.delivered_datetime | $KohaDates with_hours = 1 %][% cp.delivered_datetime | $KohaDates with_hours = 1 %] [% PROCESS patron_info %]