Bugzilla – Attachment 185107 Details for
Bug 40589
Add table settings to recalls pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40589: Add table settings to recalls pages
Bug-40589-Add-table-settings-to-recalls-pages.patch (text/plain), 22.98 KB, created by
Owen Leonard
on 2025-08-04 17:14:05 UTC
(
hide
)
Description:
Bug 40589: Add table settings to recalls pages
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-08-04 17:14:05 UTC
Size:
22.98 KB
patch
obsolete
>From abd5d33264758a98ffecd9a5955477fc6ce72978 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 1 Aug 2025 11:01:16 +0000 >Subject: [PATCH] Bug 40589: Add table settings to recalls pages > >To test, apply the patch restart services. > >- Enable recalls if necessary. >- You should create some recalls data to test with: > - Place multiple recalls from the OPAC. > - Go to Circulation -> Recalls queue and use the "Actions" menu to > mark multiple recalls as overdue. > - Check in multiple titles with recalls. > - Cancel multiple recalls or complete some recalls by checking them > out to the patron who requested them. >- Page to test: > - Recalls queue > - Recalls to pull > - Overdue recalls > - Recalls awaiting pickup > - Old recalls > - Checkout page, recalls tab > - Patron details page, recalls tab >- Test each modified page to confirm that DataTables features work > correctly: Filtering, paging, sorting, export, column configuration. >- Go to Administration -> Table settings -> Circulation -> Recalls and > change the table configuration in some way for each recall table. > - View each recalls page to confirm that those defaults are shown. > (You may need to use your browser's developer tools to delete saved > table configuration in local storage). > >Sponsored-by: Athens County Public Libraries >--- > admin/columns_settings.yml | 205 ++++++++++++++++++ > .../prog/en/includes/recalls.inc | 25 ++- > .../prog/en/modules/circ/circulation.tt | 1 + > .../prog/en/modules/members/moremember.tt | 1 + > .../prog/en/modules/members/recallshistory.tt | 4 + > .../en/modules/recalls/recalls_old_queue.tt | 4 + > .../en/modules/recalls/recalls_overdue.tt | 6 +- > .../prog/en/modules/recalls/recalls_queue.tt | 6 +- > .../en/modules/recalls/recalls_to_pull.tt | 6 +- > .../en/modules/recalls/recalls_waiting.tt | 16 +- > koha-tmpl/intranet-tmpl/prog/js/recalls.js | 25 ++- > 11 files changed, 272 insertions(+), 27 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 380a48d3ba8..0a18bbba4bb 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -1467,6 +1467,32 @@ modules: > - > columnname: patron > >+ recalls-table: >+ default_display_length: 20 >+ columns: >+ - columnname: completed >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 >+ - >+ columnname: title >+ - >+ columnname: requested_by >+ - >+ columnname: placed_on >+ - >+ columnname: expires_on >+ - >+ columnname: pickup_location >+ - >+ columnname: status >+ - >+ columnname: due_date >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ > holdshistory: > holdshistory-table: > default_display_length: 20 >@@ -1529,6 +1555,33 @@ modules: > - > columnname: return_date > >+ recallshistory: >+ recallshistory-table: >+ default_display_length: 20 >+ columns: >+ - columnname: completed >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 >+ - >+ columnname: title >+ - >+ columnname: requested_by >+ - >+ columnname: placed_on >+ - >+ columnname: expires_on >+ - >+ columnname: pickup_location >+ - >+ columnname: status >+ - >+ columnname: due_date >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ > patron-lists: > patron-list-table: > default_display_length: 20 >@@ -1786,6 +1839,32 @@ modules: > - > columnname: patron > >+ recalls-table: >+ default_display_length: 20 >+ columns: >+ - columnname: completed >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 >+ - >+ columnname: title >+ - >+ columnname: requested_by >+ - >+ columnname: placed_on >+ - >+ columnname: expires_on >+ - >+ columnname: pickup_location >+ - >+ columnname: status >+ - >+ columnname: due_date >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ > table_borrowers: > columns: > - >@@ -2289,6 +2368,132 @@ modules: > columnname: patron > - > columnname: booking_dates >+ recalls: >+ recalls-old-queue: >+ columns: >+ - >+ columnname: completed >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 >+ - >+ columnname: title >+ - >+ columnname: requested_by >+ - >+ columnname: placed_on >+ - >+ columnname: expires_on >+ - >+ columnname: pickup_location >+ - >+ columnname: status >+ >+ recalls-overdue: >+ columns: >+ - >+ columnname: completed >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 >+ - >+ columnname: checkbox >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ - >+ columnname: title >+ - >+ columnname: requested_by >+ - >+ columnname: placed_on >+ - >+ columnname: expires_on >+ - >+ columnname: pickup_location >+ - >+ columnname: status >+ - >+ columnname: due_date >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ >+ recalls-queue: >+ columns: >+ - >+ columnname: completed >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 >+ - >+ columnname: checkbox >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ - >+ columnname: title >+ - >+ columnname: requested_by >+ - >+ columnname: placed_on >+ - >+ columnname: expires_on >+ - >+ columnname: pickup_location >+ - >+ columnname: status >+ - >+ columnname: due_date >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ >+ recalls-to-pull: >+ columns: >+ - >+ columnname: items_to_pull >+ - >+ columnname: items_available >+ - >+ columnname: patrons_with_recalls >+ - >+ columnname: firstpatron >+ - >+ columnname: title >+ - >+ columnname: libraries >+ - >+ columnname: callnumbers >+ - >+ columnname: copynumbers >+ - >+ columnname: enumeration >+ - >+ columnname: itemtypes >+ - >+ columnname: locations >+ - >+ columnname: earliest_recall_date >+ - >+ columnname: action >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ >+ recalls-waiting: >+ columns: >+ - >+ columnname: available_since >+ - >+ columnname: title >+ - >+ columnname: requested_by >+ - >+ columnname: pickup_location >+ - >+ columnname: action >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 > > opac: > biblio-detail: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >index a4f8fece616..8ab5b7771aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >@@ -4,22 +4,23 @@ > <table id="recalls-table"> > <thead> > <tr> >- [% IF checkboxes %]<th class="recall-checkbox no-sort"> </th>[% END %] >- <th class="recall-title anti-the">Title</th> >- [% UNLESS specific_patron %]<th class="recall-patron">Requested by</th>[% END %] >- <th class="recall-date">Placed on</th> >- <th class="recall-expiry">Expires on</th> >- <th class="recall-branch">Pickup location</th> >- <th class="recall-status">Status</th> >- [% UNLESS viewing_old %]<th class="recall-duedate">Due date</th>[% END %] >- [% UNLESS viewing_old %]<th class="recall-actions no-sort"> </th>[% END %] >+ <th data-colname="completed" class="recall-completed no-sort no-export"></th> >+ [% IF checkboxes %]<th data-colname="checkbox" class="recall-checkbox no-sort no-export"> </th>[% END %] >+ <th data-colname="title" class="recall-title anti-the">Title</th> >+ [% UNLESS specific_patron %]<th data-colname="requested_by" class="recall-patron">Requested by</th>[% END %] >+ <th data-colname="placed_on" class="recall-date">Placed on</th> >+ <th data-colname="expires_on" class="recall-expiry">Expires on</th> >+ <th data-colname="pickup_location" class="recall-branch">Pickup location</th> >+ <th data-colname="status" class="recall-status">Status</th> >+ [% UNLESS viewing_old %]<th data-colname="due_date" class="recall-duedate">Due date</th>[% END %] >+ [% UNLESS viewing_old %]<th data-colname="actions" class="recall-actions no-sort no-export"> </th>[% END %] > </tr> > </thead> > > <tbody> > [% FOREACH recall IN recalls %] >- [% SET tr_class = recall.completed ? 'old' : '' %] >- <tr class="[% tr_class | html %]"> >+ <tr> >+ <td class="recall-completed"> [% recall.completed | html %] </td> > [% IF checkboxes %] > <td class="recall-checkbox"> > [% IF recall.completed %] >@@ -90,7 +91,7 @@ > [% IF recall.completed %] > > [% ELSE %] >- <div class="btn-group"> >+ <div class="btn-group dropup"> > <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Actions </button> > <ul class="dropdown-menu dropdown-menu-end"> > [% IF ( recall.requested or recall.overdue ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 1ca767f7295..1dfda480cbe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1122,6 +1122,7 @@ > table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'relatives-issues-table', 'json' ) | $raw %] > table_settings_holds_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'holds-table', 'json' ) | $raw %] > table_settings_bookings_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'bookings-table', 'json' ) | $raw %] >+ let table_settings_recalls = [% TablesSettings.GetTableSettings('circ', 'circulation', 'recalls-table', 'json') | $raw %]; > CAN_user_circulate_manage_bookings = [% CAN_user_circulate_manage_bookings | $raw %] > patron_borrowernumber = [% patron.borrowernumber | $raw %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index cdb10f8e48b..e68935be316 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -804,6 +804,7 @@ > table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %] > table_settings_holds_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'holds-table', 'json' ) | $raw %] > table_settings_bookings_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'bookings-table', 'json' ) | $raw %] >+ let table_settings_recalls = [% TablesSettings.GetTableSettings('members', 'moremember', 'recalls-table', 'json') | $raw %]; > CAN_user_circulate_manage_bookings = [% CAN_user_circulate_manage_bookings | $raw %] > patron_borrowernumber = [% patron.borrowernumber | $raw %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >index f705ddda984..efd0ccfd62d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >@@ -3,6 +3,7 @@ > [% USE Koha %] > [% USE Branches %] > [% USE Asset %] >+[% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -51,6 +52,9 @@ > [% END %] > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >+ <script> >+ let table_settings_recalls = [% TablesSettings.GetTableSettings('members', 'recallshistory', 'recallshistory-table', 'json') | $raw %]; >+ </script> > [% Asset.js("js/recalls.js") | $raw %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt >index 0ff965b3f64..ed665624ad1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE Asset %] >+[% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -42,6 +43,9 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >+ <script> >+ let table_settings = [% TablesSettings.GetTableSettings('circ', 'recalls', 'recalls-old-queue', 'json') | $raw %]; >+ </script> > [% Asset.js("js/recalls.js") | $raw %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt >index 66ad4cf2896..6447a115a33 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE Asset %] >+[% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -38,7 +39,7 @@ > <form method="post" action="/cgi-bin/koha/recalls/recalls_overdue.pl"> > [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-cancel_multiple_recalls" /> >- <input type="checkbox" id="select_all" /> <span id="select_all_text">Select all</span> >+ <input type="checkbox" id="select_all" /> <label for="select_all" id="select_all_text">Select all</label> > [% INCLUDE 'recalls.inc' %] > <fieldset class="action"> > <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button> >@@ -56,6 +57,9 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >+ <script> >+ let table_settings = [% TablesSettings.GetTableSettings('circ', 'recalls', 'recalls-overdue', 'json') | $raw %]; >+ </script> > [% Asset.js("js/recalls.js") | $raw %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt >index b67294627ed..ba9ab5b3446 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE Asset %] >+[% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -38,7 +39,7 @@ > <form method="post" action="/cgi-bin/koha/recalls/recalls_queue.pl"> > [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-cancel_multiple_recalls" /> >- <input type="checkbox" id="select_all" /> <span id="select_all_text">Select all</span> >+ <input type="checkbox" id="select_all" /> <label for="select_all" id="select_all_text">Select all</label> > [% INCLUDE 'recalls.inc' %] > <fieldset class="action"> > <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button> >@@ -56,6 +57,9 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >+ <script> >+ let table_settings = [% TablesSettings.GetTableSettings('circ', 'recalls', 'recalls-queue', 'json') | $raw %]; >+ </script> > [% Asset.js("js/recalls.js") | $raw %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >index dba569bc1df..9f0a9895cf5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >@@ -5,6 +5,7 @@ > [% USE Branches %] > [% USE ItemTypes %] > [% USE Asset %] >+[% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -151,9 +152,12 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function () { >+ let table_settings = [% TablesSettings.GetTableSettings('circ', 'recalls', 'recalls-to-pull', 'json') | $raw %]; > $("#recalls-table").kohaTable({ > pagingType: "full_numbers", >- }); >+ }, >+ table_settings >+ ); > > $(".cancelreturn").click(function () { > return confirmDelete(_("Are you sure you want to remove this recall and return the item to its home library?")); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >index b17717d23de..9dc3cf3df5a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE Asset %] >+[% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -45,15 +46,15 @@ > [% WRAPPER tab_panel tabname="recallswaiting" bt_active= 1 %] > [% IF ( recalls ) %] > <table id="recallswaiting-table"> >- <thead >- ><tr> >+ <thead> >+ <tr> > <th class="recall-waitingdate">Available since</th> > <th class="recall-title anti-the">Title</th> > <th class="recall-patron">Requested by</th> > <th class="recall-library">Pickup location</th> > <th class="recall-action no-sort"> </th> >- </tr></thead >- > >+ </tr> >+ </thead> > <tbody> > [% FOREACH recall IN recalls %] > <tr> >@@ -156,10 +157,13 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function () { >+ let table_settings = [% TablesSettings.GetTableSettings('circ', 'recalls', 'recalls-waiting', 'json') | $raw %]; > $("#recallswaiting-table, #recallsover-table").kohaTable({ > autoWidth: false, >- pagingType: "full_numbers", >- }); >+ columnDefs: [{ type: "title-string", targets: ["title-string"] }], >+ }, >+ table_settings >+ ) > > $(".revert_recall").click(function (e) { > return confirmDelete(_("Are you sure you want to revert this recall's status from Waiting?")); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/recalls.js b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >index e32a943cd16..995d7d5ed5c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/recalls.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >@@ -1,4 +1,4 @@ >-/* global APIClient __ confirmDelete */ >+/* global APIClient __ confirmDelete table_settings_recalls */ > $(document).ready(function () { > const client = APIClient.recall; > >@@ -133,12 +133,25 @@ $(document).ready(function () { > } > }); > >- $("#recalls-table").kohaTable({ >- order: [[1, "asc"]], >- pagingType: "full_numbers", >+ let table = $("#recalls-table").kohaTable( >+ { >+ bKohaColumnsUseNames: true, >+ // order: [[1, "asc"]], >+ }, >+ table_settings_recalls >+ ); >+ >+ let table_dt = table.DataTable(); >+ $("#hide_old").on("change", function () { >+ let old = $(this).prop("checked"); >+ table_dt >+ .columns(0) >+ .search(old ? "" : 0) >+ .draw(); > }); > >- $("#cancel_selected").click(function () { >+ $("#cancel_selected").click(function (e) { >+ e.preventDefault(); > if ($("input[name='recall_ids']:checked").length > 0) { > return confirmDelete( > __("Are you sure you want to remove the selected recall(s)?") >@@ -148,7 +161,7 @@ $(document).ready(function () { > } > }); > >- $("#select_all").click(function () { >+ $("#select_all").on("change", function () { > if ($("#select_all").prop("checked")) { > $("input[name='recall_ids']").prop("checked", true); > } else { >-- >2.39.5
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 40589
: 185107