Bugzilla – Attachment 177965 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: Add several new features
Bug-36135-Add-several-new-features.patch (text/plain), 8.04 KB, created by
Lucas Gass (lukeg)
on 2025-02-12 18:29:07 UTC
(
hide
)
Description:
Bug 36135: Add several new features
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-02-12 18:29:07 UTC
Size:
8.04 KB
patch
obsolete
>From d2d97ae0589c03761be824664eace999f5b3baf9 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Mon, 25 Mar 2024 09:56:25 +0200 >Subject: [PATCH] Bug 36135: Add several new features > >This patch adds following new features to batch >modify holds tool. > >- Do not automatically select login library as search param >- Add biblios title and items barcode to found holds table >- Add count of found holds at top of the table >- Add ability to do not change pick up library >- Display those hold rows with some found status in different >color > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../en/modules/tools/batch_modify_holds.tt | 28 ++++++++++++------- > tools/batch_modify_holds.pl | 7 +++-- > 2 files changed, 23 insertions(+), 12 deletions(-) > >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 2b7220a5ee8..07d3cba20e7 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 >@@ -61,7 +61,7 @@ > <li> > <label for="branchcodes">Libraries:</label> > <select name="branchcodes" id="branchcodes" multiple="multiple"> >- [% PROCESS options_for_libraries libraries => Branches.all() %] >+ [% PROCESS options_for_libraries libraries => Branches.all(selected => "") %] > </select> > </li> > <li> >@@ -108,6 +108,7 @@ > <form action="/cgi-bin/koha/tools/batch_modify_holds.pl" method="post" id="process"> > [% INCLUDE 'csrf-token.inc' %] > [% IF holds.count %] >+ <div><p>Found [% holds.count | html %][% IF holds.count > 1 %] holds [% ELSE %] hold [% END %]to modify.</p><div> > <div class="page-section"> > <div class="btn-toolbar selections-toolbar"> > <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a> >@@ -119,6 +120,8 @@ > <th> </th> > <th>Expiration date</th> > <th>Patron expiration date</th> >+ <th>Title</title> >+ <th>Barcode</th> > <th>Status</th> > <th>Hold pickup library</th> > <th>Suspended</th> >@@ -128,10 +131,12 @@ > </thead> > <tbody> > [% FOREACH hold IN holds %] >- <tr> >+ <tr [% IF hold.found %]class="highlighted-row"[% END %]> > <td><input type="checkbox" name="hold_id" value="[% hold.reserve_id | html %]"/></td> > <td>[% hold.expirationdate | $KohaDates %]</td> > <td>[% hold.patron_expiration_date | $KohaDates %]</td> >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.item.biblio.biblionumber | uri %]">[% hold.item.biblio.title | html %]</a></td> >+ <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% hold.itemnumber | uri %]&biblionumber=[% hold.item.biblio.biblionumber | uri %]&bi=[% hold.item.biblio.biblionumber | uri %]#item[% hold.itemnumber | uri %]">[% hold.item.barcode | html %]</a></td> > <td class="found_status" data-found="[% hold.found | html %]"> > [% IF hold.found == "T" %] > In transit >@@ -169,8 +174,9 @@ > <input type="text" id="new_expiration_date" name="new_expiration_date" class="flatpickr" data-flatpickr-futuredate="true"/> > </td> > <td> >- <select name="new_pickup_loc" id="new_pickup_loc"> >- [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ selected => hold.branchcode }) %] >+ <select id="new_pickup_loc" name="new_pickup_loc"> >+ <option value="" selected="selected"></option> >+ [% PROCESS options_for_libraries libraries => Branches.pickup_locations(selected = "") %] > </select> > </td> > <td> >@@ -206,10 +212,6 @@ > Holds have been modified! > </div> > <div class="page-section"> >- <div class="btn-toolbar selections-toolbar"> >- <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a> >- <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a> >- </div> > <table id="holds"> > <thead> > <tr> >@@ -282,6 +284,7 @@ > $("#process").on('submit', function(e) { > var reserve_ids = $("input[type=checkbox][name='hold_id']:checked"); > >+ var new_pickup_loc = $("#new_pickup_loc").val(); > var new_suspend_status = $("#new_suspend_status").val(); > var new_suspend_date = $("#new_suspend_date").val(); > >@@ -290,11 +293,16 @@ > alert(_("Please select at least one hold to process.")); > return false; > } >- if( new_suspend_status ){ >+ if( new_pickup_loc || new_suspend_status ){ > reserve_ids.each(function(){ > if($(this).parents("tr").children(".found_status").data("found") != ""){ > e.preventDefault(); >- alert(_("One or more holds have found status and can't be suspended.")); >+ if( new_suspend_status ){ >+ alert(_("One or more holds have found status and can't be suspended.")); >+ } >+ if( new_pickup_loc ){ >+ alert(_("One or more holds have found status and their pick up location can't be changed.")); >+ } > return false; > } > }) >diff --git a/tools/batch_modify_holds.pl b/tools/batch_modify_holds.pl >index b69b8dd80ac..0762ad1f3fb 100644 >--- a/tools/batch_modify_holds.pl >+++ b/tools/batch_modify_holds.pl >@@ -118,7 +118,10 @@ if ( $op eq 'form' ) { > } > } > >- my $holds = Koha::Holds->search($search_params); >+ my $holds = Koha::Holds->search( >+ $search_params, >+ { join => ["item"] } >+ ); > > $template->param( > holds => $holds, >@@ -144,7 +147,7 @@ if ( $op eq 'cud-modify' ) { > $hold->expirationdate($new_expiration_date)->store; > } > >- unless ( $hold->branchcode eq $new_pickup_loc ) { >+ if ( $new_pickup_loc && ( $hold->branchcode ne $new_pickup_loc ) ) { > $hold->branchcode($new_pickup_loc)->store; > } > >-- >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