@@ -, +, @@ on staff and OPAC. --- .../prog/en/modules/reserve/request.tt | 16 +- .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 188 ++++++++++----------- koha-tmpl/opac-tmpl/bootstrap/less/opac.less | 3 + opac/opac-reserve.pl | 183 +++++++++----------- reserve/placerequest.pl | 34 ++-- 5 files changed, 201 insertions(+), 223 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -25,6 +25,8 @@ var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo [% END %][% END %][% END %] }; var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items."); +var MSG_EXCEEDED_HOLDS_PER_RECORD = _("Patron has exceeded the number of holds for this record."); +var remainingHolds = "[% remaining_holds_for_record %]"; $(document).ready(function() { function ToggleHoldsToPlace() { @@ -149,17 +151,21 @@ function checkMultiHold() { } }); $("input[name=checkitem]").click(function() { - onechecked = 0; + numchecked = 0; $("input[name=checkitem]").each(function() { if(this.checked){ - onechecked = 1; + numchecked = 1; } }); - if(onechecked == 1){ + if(numchecked > 0){ $("#requestany").prop("checked", false); } else { $("#requestany").prop("checked",true); } + + if (remainingHolds - numchecked < 0) { + alert(MSG_EXCEEDED_HOLDS_PER_RECORD); + } }); $(".clear-date").on("click",function(e){ @@ -495,9 +501,9 @@ function checkMultiHold() { Hold must be record level [% ELSIF ( itemloo.available ) %] - + [% ELSIF ( itemloo.override ) %] - + [% ELSE %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -134,20 +134,18 @@ - - [% FOREACH bibitemloo IN bibitemloop %] + [% IF ( bibitemloo.holdable ) %] - - - - - - Place a hold on + + + + Place a hold on + [% END # / bibitemloo.holdable %] @@ -214,11 +212,11 @@ Pick up location: [% UNLESS ( bibitemloo.holdable ) %] - + [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] [% ELSE %] - + [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] [% END # / UNLESS bibitemloo.holdable %] @@ -273,29 +271,39 @@ [% END # / IF OpacHoldNotes %] - [% IF bibitemloo.itemholdable %] - - - [% IF NOT bibitemloo.force_hold %] - Next available item - - [% END %] - A specific item + + + Next available item - - [% END # / IF bibitemloo.itemholdable %] + A specific item + + - [% IF bibitemloo.itemholdable %] + [% IF bibitemloo.remaining_holds_for_record > 1 %] + [% SET count = 1 %] + + Holds to place (count) + + [% WHILE count <= bibitemloo.remaining_holds_for_record %] + [% count %] + [% SET count = count + 1 %] + [% END %] + + + [% ELSE %] + + [% END %] + Select a specific item: @@ -319,9 +327,9 @@ [% IF ( itemLoo.available ) %] - + [% ELSE %] - [% END %] @@ -395,7 +403,6 @@ [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%] - [% END # / IF ( bibitemloo.itemholdable )%] [% END # / IF ( bibitemloo.holdable ) %] @@ -418,6 +425,7 @@
[% IF ( bibitemloo.holdable ) %] - - - - - - Place a hold on + + + + Place a hold on + [% END # / bibitemloo.holdable %] @@ -214,11 +212,11 @@ Pick up location: [% UNLESS ( bibitemloo.holdable ) %] - + [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] [% ELSE %] - + [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] [% END # / UNLESS bibitemloo.holdable %] @@ -273,29 +271,39 @@ [% END # / IF OpacHoldNotes %] - [% IF bibitemloo.itemholdable %] - - - [% IF NOT bibitemloo.force_hold %] - Next available item - - [% END %] - A specific item + + + Next available item - - [% END # / IF bibitemloo.itemholdable %] + A specific item + + - [% IF bibitemloo.itemholdable %] + [% IF bibitemloo.remaining_holds_for_record > 1 %] + [% SET count = 1 %] + + Holds to place (count) + + [% WHILE count <= bibitemloo.remaining_holds_for_record %] + [% count %] + [% SET count = count + 1 %] + [% END %] + + + [% ELSE %] + + [% END %] + Select a specific item: @@ -319,9 +327,9 @@ [% IF ( itemLoo.available ) %] - + [% ELSE %] - [% END %] @@ -395,7 +403,6 @@ [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%] - [% END # / IF ( bibitemloo.itemholdable )%]