@@ -, +, @@ on staff and OPAC. - check that you are warned if you exceed "Holds per record (count)" (circulation rules) for this record, - check also maxReserves system preference. - check that can't exceed "Holds per record (count)" for this record, - check also maxReserves system preference. --- .../prog/en/modules/reserve/request.tt | 34 ++-- .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 160 +++++++++--------- koha-tmpl/opac-tmpl/bootstrap/less/opac.less | 3 + opac/opac-reserve.pl | 187 ++++++++++----------- reserve/placerequest.pl | 32 ++-- 5 files changed, 196 insertions(+), 220 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -22,6 +22,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() { [% IF AutoResumeSuspendedHolds %] @@ -148,19 +150,23 @@ function checkMultiHold() { }); } }); - $("input[name=checkitem]").click(function() { - onechecked = 0; - $("input[name=checkitem]").each(function() { - if(this.checked){ - onechecked = 1; - } - }); - if(onechecked == 1){ + $("input[name=checkitem]").click(function() { + numchecked = 0; + $("input[name=checkitem]").each(function() { + if(this.checked){ + numchecked++; + } + }); + if(numchecked > 0){ $("#requestany").removeAttr("checked"); - } else { - $("#requestany").attr("checked","checked"); - } - }); + } else { + $("#requestany").attr("checked","checked"); + } + + if (remainingHolds - numchecked < 0) { + alert(MSG_EXCEEDED_HOLDS_PER_RECORD); + } + }); $(".clear-date").on("click",function(e){ e.preventDefault(); @@ -512,9 +518,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 @@ -124,20 +124,18 @@
- -
[% FOREACH bibitemloo IN bibitemloop %]
+

[% IF ( bibitemloo.holdable ) %] - - - - - - + + [% END # / bibitemloo.holdable %] @@ -204,7 +202,7 @@

  • [% UNLESS ( bibitemloo.holdable ) %] - [% FOREACH branchloo IN bibitemloo.branchloop %] [% IF ( branchloo.selected ) %] @@ -214,7 +212,7 @@ [% END %] [% ELSE %] - [% FOREACH branchloo IN bibitemloo.branchloop %] [% IF ( branchloo.selected ) %] @@ -261,10 +259,8 @@
  • - [% IF bibitemloo.itemholdable %] - [% END # / IF bibitemloo.itemholdable %] - [% IF bibitemloo.itemholdable %] + [% IF bibitemloo.remaining_holds_for_record > 1 %] + [% SET count = 1 %] +
    + + +
    + [% ELSE %] + + [% END %] + @@ -307,9 +315,9 @@ [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
    Select a specific item:
    [% IF ( itemLoo.available ) %] - + [% ELSE %] - Cannot be put on hold [% END %] @@ -383,7 +391,6 @@
    - [% END # / IF ( bibitemloo.itemholdable )%]
    [% END # / IF ( bibitemloo.holdable ) %] @@ -406,6 +413,7 @@