Bugzilla – Attachment 176646 Details for
Bug 32890
Add DataTables to curbside pickups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32890: Add DataTables to curbside pickups
Bug-32890-Add-DataTables-to-curbside-pickups.patch (text/plain), 11.82 KB, created by
Jonathan Druart
on 2025-01-16 12:00:36 UTC
(
hide
)
Description:
Bug 32890: Add DataTables to curbside pickups
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-01-16 12:00:36 UTC
Size:
11.82 KB
patch
obsolete
>From 8f04463acc1c53084533b67fc62c97ed07a28d38 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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. > >Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 cf3beff5585..00acc416b08 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -1750,6 +1750,56 @@ modules: > - > columnname: status > >+ 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 ac46f7e8c64..bd0ec1e7ab2 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 >@@ -7,6 +7,7 @@ > [% USE raw %] > [% USE To %] > [% PROCESS 'i18n.inc' %] >+[% USE TablesSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>[% FILTER collapse %] >@@ -66,7 +67,7 @@ > [% END %] > > [% BLOCK patron_info %] >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% cp.borrowernumber | uri %]">[% cp.patron.firstname | html %] [% cp.patron.surname | html %] ([% cp.patron.cardnumber | html %])</a> >+ [% INCLUDE 'patron-title.inc' patron=cp.patron invert_name = 1 hide_patron_infos_if_needed=1 %] > [% IF cp.notes %] > <br/> > <span>Notes: </span>[% cp.notes | html %] >@@ -192,20 +193,20 @@ > [% WRAPPER tab_panels %] > [% WRAPPER tab_panel tabname="to-be-staged" bt_active= to_be_staged_active %] > [% IF to_be_staged.count %] >- <table class="table table-striped"> >+ <table id="to_be_stagedt" class="table table-striped"> > <thead> > <tr> > <th>Pickup date/time</th> > <th>Patron</th> > <th>Items for pickup</th> >- <th>Action</th> >+ <th class="NoSort noExport">Action</th> > </tr> > </thead> > <tbody> > [% FOREACH cp IN to_be_staged %] > [% UNLESS cp.staged_datetime %] > <tr class="[% class | html %]"> >- <td>[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %]</td> >+ <td data-order="[% cp.scheduled_pickup_datetime | html %]">[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %]</td> > <td> > [% PROCESS patron_info %] > </td> >@@ -244,21 +245,21 @@ > [% END # /tab_panel %] > [% WRAPPER tab_panel tabname="staged-and-ready" bt_active = staged_and_ready_active %] > [% IF staged_and_ready.count %] >- <table class="table table-striped"> >+ <table id="staged_and_readyt" class="table table-striped"> > <thead> > <tr> > <th>Pickup date/time</th> > <th>Patron</th> > <th>Items for pickup</th> > <th>Staged by</th> >- <th>Action</th> >+ <th class="NoSort noExport">Action</th> > </tr> > </thead> > <tbody> > [% FOREACH cp IN staged_and_ready %] > [% IF cp.staged_datetime && !cp.arrival_datetime %] > <tr class="[% class | html %]"> >- <td>[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %]</td> >+ <td data-order="[% cp.scheduled_pickup_datetime | html %]">[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %]</td> > <td> > [% PROCESS patron_info %] > </td> >@@ -310,21 +311,21 @@ > [% END # /tab_panel %] > [% WRAPPER tab_panel tabname="patron-is-outside" bt_active = patron_is_outside_active %] > [% IF patron_outside.count %] >- <table class="table table-striped"> >+ <table id="patron_is_outsidet" class="table table-striped"> > <thead> > <tr> > <th>Pickup date/time</th> > <th>Patron</th> > <th>Items for pickup</th> > <th>Staged by</th> >- <th>Action</th> >+ <th class="NoSort noExport">Action</th> > </tr> > </thead> > <tbody> > [% FOREACH cp IN patron_outside %] > [% IF cp.arrival_datetime && !cp.delivered_datetime %] > <tr class="[% class | html %]"> >- <td>[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %]</td> >+ <td data-order="[% cp.scheduled_pickup_datetime | html %]">[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %]</td> > <td> > [% PROCESS patron_info %] > </td> >@@ -376,7 +377,7 @@ > [% END # /tab_panel %] > [% WRAPPER tab_panel tabname="delivered-today" bt_active = delivered_today_active %] > [% IF delivered_today.count %] >- <table class="table table-striped"> >+ <table id="delivered_todayt" class="table table-striped"> > <thead> > <tr> > <th>Deliver date/time</th> >@@ -388,7 +389,7 @@ > [% FOREACH cp IN delivered_today %] > [% IF cp.delivered_datetime %] > <tr class="[% class | html %]"> >- <td>[% cp.delivered_datetime | $KohaDates with_hours = 1 %]</td> >+ <td data-order="[% cp.delivered_datetime | html %]">[% cp.delivered_datetime | $KohaDates with_hours = 1 %]</td> > <td> > [% PROCESS patron_info %] > </td> >@@ -501,6 +502,8 @@ > <script>dayjs.extend(window.dayjs_plugin_customParseFormat)</script> > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'js-patron-format.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > <script> > let pickups = [% To.json(curbside_pickups.unblessed) | $raw %]; > let policy = [% To.json(policy.unblessed) | $raw %]; >@@ -661,6 +664,21 @@ > > set_interval_if_needed(); > >+ >+ let dt_settings = []; >+ dt_settings.push( [% TablesSettings.GetTableSettings('circ', 'curbside_pickups', 'to_be_stagedt', 'json') | $raw %] ); >+ dt_settings.push( [% TablesSettings.GetTableSettings('circ', 'curbside_pickups', 'staged_and_readyt', 'json') | $raw %] ); >+ dt_settings.push( [% TablesSettings.GetTableSettings('circ', 'curbside_pickups', 'patron_is_outsidet', 'json') | $raw %] ); >+ dt_settings.push( [% TablesSettings.GetTableSettings('circ', 'curbside_pickups', 'delivered_todayt', 'json') | $raw %] ); >+ >+ let dt_tables = new Array("to_be_stagedt", "staged_and_readyt", "patron_is_outsidet", "delivered_todayt"); >+ dt_tables.forEach(function( id, index ){ >+ KohaTable( id , { >+ "autoWidth": false >+ }, dt_settings[ index ] ); >+ }); >+ >+ > }); > > let refresh_interval_id = 0; >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32890
:
153740
|
153743
|
167542
| 176646