@@ -, +, @@ on staff and OPAC. - check that you are warned if you exceed "Holds per record (count)" - check also maxReserves system preference. - check that can't exceed "Holds per record (count)" for this record. This is enforced by all unticked item checkboxes being disabled after the number of ticked checkboxes equals the 'Holds per record (count)' (circulation rules) value. - check also maxReserves system preference. --- .../prog/en/modules/reserve/request.tt | 16 +- .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 200 +- koha-tmpl/opac-tmpl/bootstrap/less/opac.less | 2644 ++++++++++++++++++++ opac/opac-reserve.pl | 166 +- reserve/placerequest.pl | 32 +- 5 files changed, 2852 insertions(+), 206 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/less/opac.less --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -14,6 +14,7 @@ [% END %] [% INCLUDE 'doc-head-close.inc' %] [% Asset.css("css/datatables.css") | $raw %] + @@ -312,9 +313,9 @@ Hold must be record level [% ELSIF ( itemloo.available ) %] - + [% ELSIF ( itemloo.override ) %] - + [% ELSE %] @@ -729,6 +730,8 @@ [% 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() { @@ -853,17 +856,20 @@ } }); $("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 == 1){ $("#requestany").prop("checked", false); } else { $("#requestany").prop("checked",true); } + if (remainingHolds - numchecked < 0) { + alert(MSG_EXCEEDED_HOLDS_PER_RECORD); + } }); var prev_rank_request; $("select[name=rank-request]").on("focus", function() { --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -145,20 +145,18 @@
- -
[% FOREACH bibitemloo IN bibitemloop %]
+

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

  • [% UNLESS ( bibitemloo.holdable ) %] - [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] [% ELSE %] @@ -299,30 +297,40 @@
  • [% END # / IF OpacHoldNotes %] - [% IF bibitemloo.itemholdable %] - - - [% END # / IF bibitemloo.itemholdable %] + + + - [% IF bibitemloo.itemholdable %] - + [% IF bibitemloo.remaining_holds_for_record > 1 %] + [% SET count = 1 %] +
    + + +
    + [% ELSE %] + + [% END %] + +
    @@ -345,9 +353,9 @@ [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%] -
    Select a specific item:
    Copy number
    [% IF ( itemLoo.available ) %] - + [% ELSE %] - Cannot be put on hold [% END %] @@ -420,9 +428,8 @@
    - [% END # / IF ( bibitemloo.itemholdable )%] -
    + +
    [% END # / IF ( bibitemloo.holdable ) %] @@ -444,6 +451,7 @@