Bugzilla – Attachment 179290 Details for
Bug 31698
Add ability to move a hold to a new bibliographic record/item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31698: Report errors and failures back to request.tt
Bug-31698-Report-errors-and-failures-back-to-reque.patch (text/plain), 9.04 KB, created by
Lucas Gass (lukeg)
on 2025-03-13 21:36:22 UTC
(
hide
)
Description:
Bug 31698: Report errors and failures back to request.tt
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-03-13 21:36:22 UTC
Size:
9.04 KB
patch
obsolete
>From fcbfc370d7b7e1128d82fb9d19d42755b6680e33 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 13 Mar 2025 21:35:32 +0000 >Subject: [PATCH] Bug 31698: Report errors and failures back to request.tt > >--- > .../prog/en/includes/holds_table.inc | 10 ++- > .../prog/en/modules/reserve/request.tt | 83 ++++++++++++++++--- > 2 files changed, 82 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index 2d65e83dc1f..d031f55dc2e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -49,7 +49,15 @@ > [%- END -%] > [% SET tr_class = hold.suspend ? 'suspend' : '' %] > <tr class="[% tr_class | html %]"> >- <td><input type="checkbox" class="select_hold" data-id="[% hold.reserve_id | html %]" /></td> >+ <td >+ ><input >+ type="checkbox" >+ class="select_hold" >+ data-id="[% hold.reserve_id | html %]" >+ data-item_level_hold="[% hold.item_level_hold | html %]" >+ data-itemnumber="[% hold.itemnumber | html %]" >+ data-biblionumber="[% hold.biblionumber %]" >+ /></td> > <td> > <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" /> > <input type="hidden" name="borrowernumber" value="[% hold.borrowernumber | html %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 03e0b966edb..d00b7b18fa8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -174,6 +174,60 @@ > </div> > [% END %] > >+ [% IF ( hold_move_successes ) %] >+ <div class="alert alert-success"> >+ <p>Moved the following holds:</p> >+ <ul> >+ [% FOREACH hold IN hold_move_successes %] >+ <li> >+ <label>Hold ID: </label> >+ <span>[% hold.hold_id %]</span> >+ <span> - Moved from [%- INCLUDE 'biblio-title.inc' biblio=hold.original_biblio link = 1 -%] to [%- INCLUDE 'biblio-title.inc' biblio=hold.target_biblio link = 1 -%]</span> >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ [% END %] >+ [% IF ( hold_move_failures ) %] >+ <div class="alert alert-warning"> >+ <strong>One or more holds were not moved due to following errors:</strong> >+ <ul> >+ [% FOREACH fail IN hold_move_failures %] >+ <li> >+ <label>Hold ID: </label> >+ <span>[% fail.hold_id %]</span> >+ [% SWITCH fail.error %] >+ [% CASE 'cannotReserveFromOtherBranches' %] >+ <span>Target item cannot be reserved from other branches</span> >+ [% CASE 'ageRestricted' %] >+ <span>The target record and/or items are age restricted</span> >+ [% CASE 'alreadypossession' %] >+ <span>Target item is already checked out to patron</span> >+ [% CASE 'noReservesAllowed' %] >+ <span>No holds are allowed on the target item(s)</span> >+ [% CASE 'tooManyReservesToday' %] >+ <span>Target item has too many holds placed on it today</span> >+ [% CASE 'tooManyReserves' %] >+ <span>Target item has too many holds placed on it</span> >+ [% CASE 'notReservable' %] >+ <span>Target item is not reservable</span> >+ [% CASE 'cannotReserveFromOtherBranches' %] >+ <span>Target item cannot be placed on reserve for this branch</span> >+ [% CASE 'branchNotInHoldGroup' %] >+ <span>Tagret item is not in the local hold group</span> >+ [% CASE 'notforloan' %] >+ <span>Target item is not for loan</span> >+ [% CASE 'damaged' %] >+ <span>Target item is damaged</span> >+ [% CASE %] >+ <span>Error: [% fail.error | html %]</span> >+ [% END %] >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ [% END %] >+ > [% IF ( failed_holds ) %] > <div class="alert alert-warning"> > <strong>One or more holds were not placed due to following errors:</strong> >@@ -1437,12 +1491,12 @@ > </div> > <div class="modal-body"> > <div id="move_hold_item_selection"> >- <h3>Selected holds to move</h3> >- <table> >+ <h3>1. Review holds to move</h3> >+ <table class="table table-striped"> > <thead> > <tr> > <th>Hold ID</th> >- <th>Item barcode ( current hold )</th> >+ <th>Original hold</th> > </tr> > </thead> > <tbody> </tbody> >@@ -1452,19 +1506,21 @@ > <div id="move_hold_item_search" class="alert alert-danger" style="display:none;"></div> > <form id="searchForm"> > <div id="move_hold_item_searchform"> >+ <h3>2. Enter the item barcode of new hold target: </h3> > <fieldset class="action"> >- <h3><label for="external_id">Enter the item barcode of new hold target: </label></h3> > <input type="text" class="form-control" name="external_id" id="external_id" required /> >+ <button type="submit" class="btn btn-default mt-3">Search</button> > </fieldset> >- <button type="submit" class="btn btn-success mt-3">Search</button> > </div> > </form> >- <hr /> > <form id="move_hold_item_form" method="post" action="request.pl"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-move_hold_item" /> > <div id="resultMessage" class="mt-3"> </div> >- <button type="submit" class="btn btn-primary mt-3">Move selected holds</button> >+ <div id="move_hold_item_confirm" style="display:none;"> >+ <h3>3. Confirm moving of holds:</h3> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="op" value="cud-move_hold_item" /> >+ <button type="submit" class="btn btn-primary mt-3">Move selected holds</button> >+ </div> > </form> > </div> > <div class="modal-footer"> >@@ -1826,6 +1882,11 @@ > > $(document).on("change", 'input[name="new_itemnumber"]', function() { > $('input[name="new_itemnumber"]').not(this).prop("checked", false); >+ if ( $('input[name="new_itemnumber"]:checked').length ){ >+ $('#move_hold_item_confirm').show(); >+ } else { >+ $('#move_hold_item_confirm').hide(); >+ } > }); > > $("#always_show_holds").change(function(){ >@@ -1963,9 +2024,11 @@ > $('#moveHoldItemModal').modal('show'); > $('.select_hold:checked').each( function() { > let reserve_id = $(this).data('id'); >+ let reserve_biblionumber = $(this).data('biblionumber'); >+ let reserve_itemnumber = $(this).data('itemnumber'); > let item_level_hold = $(this).data('item_level_hold'); > let found_status = $(this).data('found'); >- $('#move_hold_item_selection table').append(`<tr><td>${reserve_id}</td><td></td></tr>`) >+ $('#move_hold_item_selection table').append(`<tr><td>${reserve_id}</td><td>Biblionumber: <a target="_blank" href="/cgi-bin/koha/reserve/request.pl?biblionumber=${reserve_biblionumber}">${reserve_biblionumber}</a> Itemnumber: <a target="_blank" href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=${reserve_biblionumber}#item${reserve_itemnumber}">${reserve_itemnumber}</a></td></tr>`) > if ( item_level_hold ) { > $('#move_hold_item_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); > } >-- >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 31698
:
179226
|
179235
|
179236
|
179279
|
179287
|
179290
|
179291
|
179292
|
179295
|
179704
|
179711
|
179713
|
181222
|
181223
|
181224
|
181225
|
181226
|
181228
|
181229
|
181230
|
181231
|
181232
|
181233
|
181234
|
181929
|
181930
|
181944
|
181945
|
181946
|
181947
|
181948
|
181951
|
181952
|
181953
|
181954
|
181955
|
181956
|
181957
|
181958
|
181959
|
181960
|
181961
|
181962
|
182639
|
182640
|
182641