Bugzilla – Attachment 181946 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: Fix modals for item level moves
Bug-31698-Fix-modals-for-item-level-moves.patch (text/plain), 8.53 KB, created by
Lucas Gass (lukeg)
on 2025-05-05 20:53:14 UTC
(
hide
)
Description:
Bug 31698: Fix modals for item level moves
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-05-05 20:53:14 UTC
Size:
8.53 KB
patch
obsolete
>From b5a0e6ef6085b1aec2245b50087d677915676f31 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 5 May 2025 16:42:31 +0000 >Subject: [PATCH] Bug 31698: Fix modals for item level moves > >--- > .../prog/en/modules/reserve/request.tt | 56 +++++++++---------- > reserve/request.pl | 2 +- > 2 files changed, 29 insertions(+), 29 deletions(-) > >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 6e82b1bfdcd..3d042fe3dfb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1490,39 +1490,36 @@ > <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> > </div> > <div class="modal-body"> >- <div id="move_hold_item_selection"> >- <h3>1. Review holds to move</h3> >- <table class="table table-striped"> >- <thead> >- <tr> >- <th>Hold ID</th> >- <th>Original hold</th> >- <th>Problem</th> >- </tr> >- </thead> >- <tbody> </tbody> >- </table> >- </div> >- <hr /> > <div id="move_hold_item_search" class="alert alert-danger" style="display:none;"></div> > <form id="itemSearchForm"> > <div id="move_hold_item_searchform"> >- <h3>2. Enter the item barcode of new hold target: </h3> >- <fieldset class="action"> >+ <h3>Enter the item barcode of new hold target: </h3> >+ <fieldset class="action d-flex"> > <input type="text" class="form-control" name="external_id" id="external_id" required /> >- <button type="submit" class="btn btn-default mt-3">Search</button> >+ <button type="submit" class="btn btn-default">Search</button> > </fieldset> > </div> > </form> > <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" /> >+ <input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber | html %]" /> > <div id="itemResultMessage" class="mt-3"> </div> >- <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> >- <input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber %]" /> >+ <div id="move_hold_item_selection"> >+ <h3>Review holds to move</h3> >+ <table class="table table-striped"> >+ <thead> >+ <tr> >+ <th></th> >+ <th>Hold ID</th> >+ <th>Original hold</th> >+ <th>Problem</th> >+ </tr> >+ </thead> >+ <tbody> </tbody> >+ </table> > </div> >+ <button id="move_hold_item_confirm" type="submit" class="btn btn-primary" disabled="disabled">Move selected holds</button> > </form> > </div> > <div class="modal-footer"> >@@ -1570,7 +1567,7 @@ > [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-move_hold_biblio" /> > <button type="submit" class="btn btn-primary mt-3">Move selected holds</button> >- <input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber %]" /> >+ <input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber | html %]" /> > </div> > </form> > </div> >@@ -1898,6 +1895,7 @@ > $(document).ready(function() { > $("#itemSearchForm").on("submit", function (event) { > event.preventDefault(); >+ $('#move_hold_item_confirm').prop('disabled' , true ); > > let externalID = $("#external_id").val(); > let apiUrl = `/api/v1/items?external_id=${encodeURIComponent(externalID)}`; >@@ -1967,9 +1965,9 @@ > $(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(); >+ $('#move_hold_item_confirm').prop( 'disabled' , false ); > } else { >- $('#move_hold_item_confirm').hide(); >+ $('#move_hold_item_confirm').prop( 'disabled' , true ); > } > }); > >@@ -2111,6 +2109,7 @@ > > $('.move_hold_item').click(function(e) { > e.preventDefault(); >+ $('#move_hold_item_confirm').prop('disabled' , true ); > if($('.holds_table .select_hold:checked').length) { > $('#itemResultMessage').empty(); > $('#move_hold_item_selection table tbody').empty(); >@@ -2122,9 +2121,10 @@ > let item_level_hold = $(this).data('item_level_hold'); > let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); > let found_status = $(this).data('found'); >- $('#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><td>${error_message}</td></tr>`) > if ( item_level_hold ) { >- $('#move_hold_item_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); >+ $('#move_hold_item_selection table').append(`<tr><td><input type="checkbox" name="move_hold_id" value="${reserve_id}" checked/></td><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><td>${error_message}</td></tr>`) >+ } else { >+ $('#move_hold_item_selection table').append(`<tr><td><input type="checkbox" name="move_hold_id" value="${reserve_id}" checked/></td><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><td>${error_message}</td></tr>`) > } > }); > } >diff --git a/reserve/request.pl b/reserve/request.pl >index 30142834f39..9440c0add0b 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -112,7 +112,7 @@ if ( $op eq 'cud-move' ) { > ); > } > } elsif ( $op eq 'cud-move_hold_item' or $op eq 'cud-move_hold_biblio' ) { >- my @hold_ids = $input->multi_param('hold_id'); >+ my @hold_ids = $input->multi_param('move_hold_id'); > my $original_biblionumber = $input->param('original_biblionumber'); > my @moving_holds = Koha::Holds->search( > { reserve_id => \@hold_ids }, >-- >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