Bugzilla – Attachment 178954 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: Batch clear hold notes and use select2 in multiple filters
0001-Bug-36135-Batch-clear-hold-notes-and-use-select2-in-.patch (text/plain), 3.93 KB, created by
Emmi Takkinen
on 2025-03-05 12:16:49 UTC
(
hide
)
Description:
Bug 36135: Batch clear hold notes and use select2 in multiple filters
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2025-03-05 12:16:49 UTC
Size:
3.93 KB
patch
obsolete
>From 8ff7acefbc13d09f94c008fe1979a93cdc0c5605 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Wed, 5 Mar 2025 10:09:02 +0200 >Subject: [PATCH] Bug 36135: Batch clear hold notes and use select2 in multiple > filters > >This patch adds ability to clear hold note from all selected >holds. It also adds select2 to libraries and holds status >filters. >--- > .../prog/en/modules/tools/batch_modify_holds.tt | 14 ++++++++++++++ > tools/batch_modify_holds.pl | 5 +++++ > 2 files changed, 19 insertions(+) > >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 ce5900c01f..d1493f81a1 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 >@@ -136,6 +136,7 @@ > <th>Suspend holds</th> > <th>Suspend until</th> > <th>New hold note</th> >+ <th>Clear hold notes</th> > </tr> > </thead> > <tbody> >@@ -162,6 +163,9 @@ > <td> > <input type="text" id="new_hold_note" name="new_hold_note"/> > </td> >+ <td> >+ <input class="selection" type="checkbox" id="clear_hold_notes" name="clear_hold_notes" value="1"/> >+ </td> > </tr> > </tbody> > </table> <!-- /#modify_holds_options --> >@@ -185,6 +189,7 @@ > [% Asset.js("js/tools-menu.js") | $raw %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'select2.inc' %] > [% INCLUDE 'js-patron-format.inc' %] > [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] > <script> >@@ -192,6 +197,14 @@ > let hold_ids = [% IF updated_holds %] [% updated_holds | $raw %] [% ELSE %] [] [% END %]; > > $(document).ready(function() { >+ >+ // Apply select2 to all select fields having a "multiple" attribute >+ let selectFields = document.querySelectorAll('select[multiple]'); >+ selectFields.forEach((selectField) => { >+ selectField.style.minWidth = '200px'; >+ $(selectField).select2(); >+ }); >+ > //Empty local storage from previous selections > localStorage.removeItem("holds_modify_selections"); > >@@ -493,6 +506,7 @@ > var new_suspend_status = $("#new_suspend_status").val(); > var new_suspend_date = $("#new_suspend_date").val(); > var new_hold_note = $("#new_hold_note").val(); >+ var clear_hold_notes = $("#clear_hold_notes").val(); > > if ( holds_checked.length == 0 ) { > e.preventDefault(); >diff --git a/tools/batch_modify_holds.pl b/tools/batch_modify_holds.pl >index 5d76d8e6f0..9f0da01cae 100755 >--- a/tools/batch_modify_holds.pl >+++ b/tools/batch_modify_holds.pl >@@ -51,6 +51,7 @@ if ( $op eq 'form' ) { > my $new_suspend_status = $input->param('new_suspend_status'); > my $new_suspend_date = $input->param('new_suspend_date'); > my $new_hold_note = $input->param('new_hold_note'); >+ my $clear_hold_notes = $input->param('clear_hold_notes'); > > @hold_ids = $input->multi_param('hold_id'); > >@@ -84,6 +85,10 @@ if ( $op eq 'form' ) { > if ($new_hold_note) { > $hold->reservenotes($new_hold_note)->store; > } >+ >+ if ($clear_hold_notes) { >+ $hold->reservenotes(undef)->store; >+ } > } > > $template->param( >-- >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 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