Bugzilla – Attachment 183965 Details for
Bug 36135
Add tool to batch modify holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36135: (follow-up) Fix suspension search and other improvements
Bug-36135-follow-up-Fix-suspension-search-and-othe.patch (text/plain), 13.22 KB, created by
Jason Robb
on 2025-07-10 17:36:24 UTC
(
hide
)
Description:
Bug 36135: (follow-up) Fix suspension search and other improvements
Filename:
MIME Type:
Creator:
Jason Robb
Created:
2025-07-10 17:36:24 UTC
Size:
13.22 KB
patch
obsolete
>From 89241633afa1f4f8750bfe0c22eac3c7620ae1e6 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 9 Jul 2025 19:51:33 +0000 >Subject: [PATCH] Bug 36135: (follow-up) Fix suspension search and other > improvements > >This patch tries to fix the hold suspension search by copying the code >from the expiration date search function. > >The patch also makes these changes: > >- Change page title to use i18n functions >- Add specific breadcrumb for results page >- Update headings between search and results page >- Correct table settings (definition was missing from > columns_settings.yml >- Correct capitalization (e.g. "Pickup location" instead of "Pickup > Location" >- Use include files for displaying title and patron in update results >- Add subtitle and medium to title in search results >- Remove quotes from DataTables option names >- Add hold date to the search results view. > - Without a specified default sort, the table will sort the first > column. Since the first column is checkboxes, we ought to explicitly > set a default sorting column. I thought hold date seemed like a > better default than title. > >Signed-off-by: Jason Robb <jrobb@sekls.org> >--- > admin/columns_settings.yml | 55 +++++++------ > .../en/modules/tools/batch_modify_holds.tt | 81 ++++++++++++------- > 2 files changed, 84 insertions(+), 52 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 0e95c12999b..0aa17cb1760 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -1992,31 +1992,7 @@ modules: > columnname: suspend > - > columnname: print_slip >- holds_to_modify: >- default_display_length: 20 >- columns: >- - >- columnname: checkbox >- cannot_be_toggled: 1 >- cannot_be_modified: 1 >- - >- columnname: expiration_date >- - >- columnname: title >- - >- columnname: barcode >- - >- columnname: patron >- - >- columnname: status >- - >- columnname: pickup_library >- - >- columnname: suspended >- - >- columnname: suspended_until >- - >- columnname: notes >+ > modified_holds: > default_display_length: 20 > columns: >@@ -2469,6 +2445,35 @@ modules: > - > columnname: batch_patron_edit_debarredcomment > >+ batch_hold_modification: >+ holds_to_modify: >+ default_display_length: 20 >+ columns: >+ - >+ columnname: batch_hold_edit_selections >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ - >+ columnname: batch_hold_edit_hold_date >+ - >+ columnname: batch_hold_edit_expiration_date >+ - >+ columnname: batch_hold_edit_title >+ - >+ columnname: batch_hold_edit_barcode >+ - >+ columnname: batch_hold_edit_patron >+ - >+ columnname: batch_hold_edit_status >+ - >+ columnname: batch_hold_edit_hold_pickup_library >+ - >+ columnname: batch_hold_edit_suspended >+ - >+ columnname: batch_hold_edit_suspended_until >+ - >+ columnname: batch_hold_edit_note >+ > logviewer: > logst: > default_display_length: 20 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt >index 4850a8a01a3..21953f3faeb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt >@@ -8,9 +8,11 @@ > [% USE TablesSettings %] > [% USE To %] > [% PROCESS 'html_helpers.inc' %] >- >+[% PROCESS 'i18n.inc' %] > [% INCLUDE 'doc-head-open.inc' %] >-<title>Batch modify holds › Tools › Koha</title> >+[% FILTER collapse %] >+ <title> [% t("Batch modify holds") | html %] › [% t("Tools") | html %] › [% t("Koha") | html %] </title> >+[% END %] > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.css("css/humanmsg.css") | $raw %] > </head> >@@ -25,12 +27,15 @@ > [% WRAPPER breadcrumb_item %] > <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> > [% END %] >- [% IF ( view == 'form' || view == 'report' ) %] >+ [% IF ( view == 'report' ) %] > [% WRAPPER breadcrumb_item %] > <a href="/cgi-bin/koha/tools/batch_modify_holds.pl">Batch modify holds</a> > [% END %] >- [% ELSE %] > [% WRAPPER breadcrumb_item bc_active= 1 %] >+ <span>Modified holds</span> >+ [% END %] >+ [% ELSE %] >+ [% WRAPPER breadcrumb_item %] > <span>Batch modify holds</span> > [% END %] > [% END %] >@@ -41,8 +46,8 @@ > <div class="row"> > <div class="col-sm-10 col-sm-push-2 order-sm-1"> > <main> >- <h1>Batch modify holds</h1> > [% IF view == "cud-form" %] >+ <h1>Batch modify holds</h1> > <div id="modify_holds_search"> > <form method="get" action="/cgi-bin/koha/tools/batch_modify_holds.pl" id="modify_holds_form"> > <fieldset class="rows"> >@@ -101,6 +106,7 @@ > </div> > <!-- /#modify_holds_search --> > [% ELSIF view == "report" %] >+ <h1>Modified holds</h1> > <div id="modified_holds_results-wrapper"> > <div id="modified_holds_results" class="page-section"> > <table id="modified_holds"> >@@ -108,12 +114,12 @@ > <tr> > <th>Title</th> > <th>Patron</th> >- <th>Pickup Location</th> >+ <th>Pickup location</th> > <th>Priority</th> >- <th>Expiration Date</th> >+ <th>Expiration date</th> > <th>Status</th> > <th>Suspended</th> >- <th>Suspended Until</th> >+ <th>Suspended until</th> > <th>Notes</th> > <!-- Add other columns as needed --> > </tr> >@@ -121,8 +127,8 @@ > <tbody> > [% FOREACH hold IN updated_holds_obj %] > <tr> >- <td>[% hold.biblio.title | html %]</td> >- <td>[% hold.borrower.firstname | html %] [% hold.borrower.surname | html %]</td> >+ <td>[% INCLUDE 'biblio-title.inc' biblio=hold.biblio link = 1 %]</td> >+ <td>[% INCLUDE 'patron-title.inc' invert_name=1 patron=hold.borrower hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]</td> > <td>[% hold.branch.branchname | html %]</td> > <td>[% hold.priority | html %]</td> > <td>[% hold.expirationdate | $KohaDates %]</td> >@@ -247,6 +253,7 @@ > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'select2.inc' %] >+ [% INCLUDE 'js-biblio-format.inc' %] > [% INCLUDE 'js-patron-format.inc' %] > [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] > <script> >@@ -347,7 +354,7 @@ > } > > function search_holds(modify_holds_form){ >- var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'holds_to_modify', 'json' ) | $raw %]; >+ var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'batch_hold_modification', 'holds_to_modify', 'json' ) | $raw %]; > var searchpattern = ""; > var filters = { > "me.expirationdate": function(){ >@@ -410,12 +417,20 @@ > } > }, > "me.suspend_until": function(){ >- var suspend_until_from = modify_holds_form.find("#suspend_until_from").val(); >- var suspend_until_to = modify_holds_form.find("#suspend_until_to").val(); >- >- searchpattern += suspend_until_from && suspend_until_to ? _("suspend date between ")+ suspend_until_from +" and "+suspend_until_to : ""; >+ var suspend_until_from = modify_holds_form.find("#suspend_until_from").val(); >+ var suspend_until_to = modify_holds_form.find("#suspend_until_to").val(); > >- return suspend_until_from && suspend_until_to ? {"-between": [suspend_until_from, suspend_until_to]} : ""; >+ if (suspend_until_from && suspend_until_to){ >+ searchpattern += _("suspend date between ") + suspend_until_from + " and " + suspend_until_to + " "; >+ return {"-between": [suspend_until_from, suspend_until_to]}; >+ } >+ else if (suspend_until_from && !suspend_until_to){ >+ searchpattern += _("suspend date from ") + suspend_until_from + " "; >+ return {">=": suspend_until_from }; >+ } else if (!suspend_until_from && suspend_until_to){ >+ searchpattern += _("suspend date to ") + suspend_until_to + " "; >+ return {"<=": suspend_until_to }; >+ } > }, > "me.notes": function(){ > var holdnotes = modify_holds_form.find("#holdnotes").val(); >@@ -430,19 +445,22 @@ > } > > var holds_modify_table = $("#holds_to_modify").kohaTable({ >- "ajax": { >+ ajax: { > "url": "/api/v1/holds" > }, >- "embed": [ >+ embed: [ > "biblio", > "item", > "pickup_library", > "patron" > ], >- "destroy": true, >- "autoWidth": false, >- "processing": true, >- "columns": [ >+ destroy: true, >+ autoWidth: false, >+ processing: true, >+ order: [ >+ [1, 'asc'] >+ ], >+ columns: [ > { > "data": "hold_id", > "name": "checkbox", >@@ -451,6 +469,16 @@ > return '<input class="selection" type="checkbox" value="'+ encodeURIComponent(data) +'"/>' > } > }, >+ { >+ "data": "hold_date", >+ "name": "hold_date", >+ "type": "date", >+ "title": _("Hold date"), >+ "orderable": true, >+ "render": function( data, type, row, meta ) { >+ return $date(data); >+ } >+ }, > { > "data": "expiration_date", > "name": "expiration_date", >@@ -462,13 +490,12 @@ > } > }, > { >- "data": "biblio.title", >- "name": "title", >+ "data": "biblio.title:biblio.subtitle:biblio.medium", > "title": _("Title"), >+ "searchable": true, > "orderable": true, >- "render": function( data, type, row, meta ) { >- return '<a href="/cgi-bin/koha/catalogue/detail.pl?' + >- 'biblionumber=' + encodeURIComponent( row.biblio_id ) + '">' + escape_str( data ) + '</a>'; >+ "render": function(data, type, row, meta) { >+ return $biblio_to_html(row.biblio, { link: 1 }); > } > }, > { >-- >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 36135
:
163021
|
163022
|
163023
|
163024
|
163529
|
163530
|
163540
|
163541
|
163542
|
163543
|
163544
|
163796
|
164037
|
164051
|
164057
|
164058
|
164059
|
164060
|
164061
|
164062
|
164063
|
177518
|
177519
|
177959
|
177960
|
177961
|
177962
|
177963
|
177964
|
177965
|
177966
|
177967
|
177968
|
177969
|
177975
|
177976
|
177981
|
177982
|
178154
|
178155
|
178156
|
178157
|
178158
|
178159
|
178160
|
178161
|
178162
|
178163
|
178164
|
178165
|
178166
|
178167
|
178954
|
179028
|
179029
|
179030
|
179031
|
179032
|
179033
|
179034
|
179035
|
179036
|
179037
|
179038
|
179039
|
179040
|
179041
|
179042
|
179081
|
179082
|
181049
|
183151
|
183294
|
183295
|
183296
|
183297
|
183298
|
183299
|
183300
|
183305
|
183306
|
183307
|
183308
|
183771
|
183893
|
183924
|
183959
|
183960
|
183961
|
183962
|
183963
|
183964
| 183965