Bugzilla – Attachment 153743 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.64 KB, created by
Caroline Cyr La Rose
on 2023-07-20 18:59:52 UTC
(
hide
)
Description:
Bug 32890: Add DataTables to curbside pickups
Filename:
MIME Type:
Creator:
Caroline Cyr La Rose
Created:
2023-07-20 18:59:52 UTC
Size:
11.64 KB
patch
obsolete
>From e5d77d35e7c0c0ab287a75bbb65276f02368f12f 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> >--- > 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 90fb5354722..33e2f9ca7c5 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 e1eec439a8c..4191ca2cb53 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' %] > <title>Curbside pickups › Circulation › Koha</title> >@@ -61,7 +62,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 %] >@@ -188,20 +189,20 @@ > <div id="to-be-staged" role="tabpanel" class="tab-pane"> > [% END %] > [% 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> >@@ -243,21 +244,21 @@ > <div id="staged-and-ready" role="tabpanel" class="tab-pane"> > [% END %] > [% 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> >@@ -311,21 +312,21 @@ > <div id="patron-is-outside" role="tabpanel" class="tab-pane"> > [% END %] > [% 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> >@@ -379,7 +380,7 @@ > <div id="delivered-today" role="tabpanel" class="tab-pane"> > [% END %] > [% IF delivered_today.count %] >- <table class="table table-striped"> >+ <table id="delivered_todayt" class="table table-striped"> > <thead> > <tr> > <th>Deliver date/time</th> >@@ -391,7 +392,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> >@@ -506,6 +507,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 %]; >@@ -662,6 +665,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