From 134c401b8319c80807dfd9032a254511b1d139eb Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 13 Feb 2024 00:26:42 +0000 Subject: [PATCH] Bug 15565: Place multiple holds on one or more records in OPAC --- .../bootstrap/en/modules/opac-reserve.tt | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 58f1397012c..76e8f50e1f5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -395,7 +395,7 @@ [% END %] - + [% ELSE %] [% SET unholdable_items = 1 %] [% IF ( itemLoo.checkout ) %] @@ -658,7 +658,9 @@ $(".confirmjs:checked").each(function() { var biblioNum = $(this).val(); biblionumbers += biblioNum + "/"; - selections += biblioNum + "/"; + let select_bib = biblioNum; + let select_pickup; + let select_items = []; // If required hold note is empty, make it visible if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) { @@ -684,23 +686,31 @@ // If the 'specific copy' radio button is checked if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) { // Find the selected copy - var item = $(".checkitem_" + biblioNum + ":checked"); - if ($(item).size() == 0) { + var items = $(".checkitem_" + biblioNum + ":checked"); + if ($(items).size() == 0) { alert(MSG_NO_ITEM_SELECTED); badBib = biblioNum; return false; } else { - selections += $(item).val(); + items.each( function(index,el){ + select_items.push( $(el).val() ); + }); } } - selections += "/"; // Add the pickup location var branchSel = $("#branch_" + biblioNum); if (branchSel.size() > 0) { - selections += $(branchSel).val(); + select_pickup = $(branchSel).val(); + } + if ( select_items.length > 0 ){ + select_items.forEach( function(item_value,index){ + selections += select_bib + "/" + item_value + "/" + select_pickup + "/"; + }); + } + else { + selections += select_bib + "/" + "/" + select_pickup + "/"; } - selections += "/"; return true; }); -- 2.30.2