Bugzilla – Attachment 178160 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: Fix QA issues and add improvements
0007-Bug-36135-Fix-QA-issues-and-add-improvements.patch (text/plain), 16.39 KB, created by
Emmi Takkinen
on 2025-02-18 06:34:25 UTC
(
hide
)
Description:
Bug 36135: Fix QA issues and add improvements
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2025-02-18 06:34:25 UTC
Size:
16.39 KB
patch
obsolete
>From fe31bff55039df3d258a2969f9ff95164599c137 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Thu, 28 Mar 2024 08:19:20 +0200 >Subject: [PATCH 07/14] Bug 36135: Fix QA issues and add improvements > >This patch: > >- Fixes issues reported by qa-tool >- Adds info about how many holds were modified >- Add title and barcode columns to table of >modified holds >- Adds div with class "page-section" to >"Modify holds" table > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../en/modules/tools/batch_modify_holds.tt | 128 +++++++++--------- > tools/batch_modify_holds.pl | 5 +- > 2 files changed, 69 insertions(+), 64 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 07d3cba20e..f8829ca8c5 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 >@@ -48,15 +48,12 @@ > <span class="hint">NOTE! Column patron_expiration_date is used as a main filter for expiration date field. Otherwise column expirationdate is used.</span> > <ol> > <li> >- <label for="suspend_until">Expiration date:</label> >- <li> >- <label for="expirationdate_from">From</label> >- <input type="text" size="10" id="from" name="expirationdate_from" class="flatpickr" data-date_to="to" /> >- </li> >- <li> >- <label for="expirationdate_to">To</label> >- <input type="text" size="10" id="to" name="expirationdate_to" class="flatpickr"/> >- </li> >+ <label for="expirationdate_from">Expiration date from:</label> >+ <input type="text" size="10" id="expirationdate_from" name="expirationdate_from" class="flatpickr" data-date_to="to" /> >+ </li> >+ <li> >+ <label for="expirationdate_to">Expiration date to:</label> >+ <input type="text" size="10" id="expirationdate_to" name="expirationdate_to" class="flatpickr"/> > </li> > <li> > <label for="branchcodes">Libraries:</label> >@@ -82,15 +79,12 @@ > </select> > </li> > <li> >- <label for="suspend_until">Suspended until:</label> >- <li> >- <label for="suspend_until_from">From</label> >- <input type="text" size="10" id="from" name="suspend_until_from" class="flatpickr" data-date_to="to" /> >- </li> >- <li> >- <label for="suspend_until_to">To</label> >- <input type="text" size="10" id="to" name="suspend_until_to" class="flatpickr"/> >- </li> >+ <label for="suspend_until_from">Suspended until from:</label> >+ <input type="text" size="10" id="suspend_until_from" name="suspend_until_from" class="flatpickr" data-date_to="to" /> >+ </li> >+ <li> >+ <label for="suspend_until_to">Suspended until to:</label> >+ <input type="text" size="10" id="suspend_until_to" name="suspend_until_to" class="flatpickr"/> > </li> > <li> > <label for="reservenotes">Hold note:</label> >@@ -108,7 +102,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><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> >@@ -120,7 +114,7 @@ > <th> </th> > <th>Expiration date</th> > <th>Patron expiration date</th> >- <th>Title</title> >+ <th>Title</th> > <th>Barcode</th> > <th>Status</th> > <th>Hold pickup library</th> >@@ -131,12 +125,16 @@ > </thead> > <tbody> > [% FOREACH hold IN holds %] >- <tr [% IF hold.found %]class="highlighted-row"[% END %]> >+ [% IF hold.found %] >+ <tr class="highlighted-row"> >+ [% ELSE %] >+ <tr> >+ [% 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><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">[% hold.biblio.title | html %]</a></td> >+ <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% hold.itemnumber | uri %]&biblionumber=[% hold.biblionumber | uri %]&bi=[% hold.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 >@@ -158,43 +156,45 @@ > </table> <!-- /#holds --> > </div> <!-- /.page-section --> > <h2>Modify holds</h2> >- <table id="hold_modifies"> >- <thead> >- <tr> >- <th>New expiration date</th> >- <th>New pickup library</th> >- <th>Suspend holds</th> >- <th>Suspend until</th> >- <th>New reserve note</th> >- </tr> >- </thead> >- <tbody> >- <tr> >- <td> >- <input type="text" id="new_expiration_date" name="new_expiration_date" class="flatpickr" data-flatpickr-futuredate="true"/> >- </td> >- <td> >- <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> >- <select id="new_suspend_status" name="new_suspend_status"> >- <option value="" selected="selected"></option> >- <option value="not_suspended">Not suspended</option> >- <option value="suspend">Suspend</option> >- </select> >- </td> >- <td> >- <input type="text" id="new_suspend_date" name="new_suspend_date" class="flatpickr" data-flatpickr-futuredate="true"/> >- </td> >- <td> >- <input type="text" id="new_reserve_note" name="new_reserve_note"/> >- </td> >- </tr> >- </tbody> >- </table> <!-- /#hold_modifies --> >+ <div class="page-section"> >+ <table id="hold_modifies"> >+ <thead> >+ <tr> >+ <th>New expiration date</th> >+ <th>New pickup library</th> >+ <th>Suspend holds</th> >+ <th>Suspend until</th> >+ <th>New reserve note</th> >+ </tr> >+ </thead> >+ <tbody> >+ <tr> >+ <td> >+ <input type="text" id="new_expiration_date" name="new_expiration_date" class="flatpickr" data-flatpickr-futuredate="true"/> >+ </td> >+ <td> >+ <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> >+ <select id="new_suspend_status" name="new_suspend_status"> >+ <option value="" selected="selected"></option> >+ <option value="not_suspended">Not suspended</option> >+ <option value="suspend">Suspend</option> >+ </select> >+ </td> >+ <td> >+ <input type="text" id="new_suspend_date" name="new_suspend_date" class="flatpickr" data-flatpickr-futuredate="true"/> >+ </td> >+ <td> >+ <input type="text" id="new_reserve_note" name="new_reserve_note"/> >+ </td> >+ </tr> >+ </tbody> >+ </table> <!-- /#hold_modifies --> >+ </div> > <fieldset class="action"> > <input type="hidden" name="op" value="cud-modify"/> > <input type="submit" class="btn btn-primary" value="Modify selected holds"/> >@@ -209,13 +209,15 @@ > [% END %] > [% ELSIF view == 'report' %] > <div class="dialog message"> >- Holds have been modified! >+ [% updated_holds.count | html %] holds have been modified! > </div> > <div class="page-section"> > <table id="holds"> > <thead> > <tr> > <th>Expiration date</th> >+ <th>Title</th> >+ <th>Barcode</th> > <th>Hold pickup library</th> > <th>Suspended</th> > <th>Suspended until</th> >@@ -226,6 +228,8 @@ > [% FOREACH hold IN updated_holds %] > <tr> > <td>[% hold.expirationdate | $KohaDates %]</td> >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">[% hold.biblio.title | html %]</a></td> >+ <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% hold.itemnumber | uri %]&biblionumber=[% hold.biblionumber | uri %]&bi=[% hold.biblionumber | uri %]#item[% hold.itemnumber | uri %]">[% hold.item.barcode | html %]</a></td> > <td>[% Branches.GetName( hold.branchcode ) | html %]</td> > <td>[% IF hold.suspend == 0 %]No[% ELSE %]Yes[% END %]</td> > <td>[% hold.suspend_until | $KohaDates %]</td> >@@ -309,7 +313,7 @@ > } > if( ( !new_suspend_status || new_suspend_status == "not_suspended") && new_suspend_date ){ > e.preventDefault(); >- alert(_('You have to suspend holds if new suspend until date is set.')); >+ alert(_("You have to suspend holds if new suspend until date is set.")); > return false; > } > >diff --git a/tools/batch_modify_holds.pl b/tools/batch_modify_holds.pl >index 0762ad1f3f..8d3f29a59a 100755 >--- a/tools/batch_modify_holds.pl >+++ b/tools/batch_modify_holds.pl >@@ -120,7 +120,7 @@ if ( $op eq 'form' ) { > > my $holds = Koha::Holds->search( > $search_params, >- { join => ["item"] } >+ { join => [ "item", "biblio" ] } > ); > > $template->param( >@@ -139,7 +139,8 @@ if ( $op eq 'cud-modify' ) { > > @hold_ids = $input->multi_param('hold_id'); > >- my $holds_to_update = Koha::Holds->search( { reserve_id => { -in => \@hold_ids } } ); >+ my $holds_to_update = >+ Koha::Holds->search( { reserve_id => { -in => \@hold_ids } }, { join => [ "item", "biblio" ] } ); > > while ( my $hold = $holds_to_update->next ) { > >-- >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