From 8221d35cf9f7c2a130cff7366a4e0f78175d19b9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 21 Apr 2022 12:26:04 +0000 Subject: [PATCH] Bug 30579: Group next available hold options, and disable when item is chosen This patch rearranges options that only apply to next available holds and disables them when an item is checked. This is intended to make it more obvious which parts of the form apply to this selection To test: 1 - Apply patches 2 - Confirm you can successfully place single or multiple items on hold 3 - Confirm that when placing a single hold the next available options are grouped 4 - Confirm pickup location, specific item type, and number of holds all work for next available 5 - Confirm item level holds save pickup location correctly --- .../prog/en/modules/reserve/request.tt | 94 ++++++++++--------- 1 file changed, 50 insertions(+), 44 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 9586e5085c..1edbf8f52f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -464,53 +464,13 @@ -
  • - - -
  • - [% IF Koha.Preference('AllowHoldItemTypeSelection') %] -
  • - - -
  • - [% END %] [% IF ( reserve_in_future ) %]
  • [% END %] -
  • - - [% IF force_hold_level == 'item' %] - - [% ELSIF force_hold_level == 'record' %] - - - [% ELSE %] - - [% END %] - -
  • - [% IF remaining_holds_for_record > 1 %] -
  • - - -
  • - [% ELSE %] - - [% END %]
  • @@ -521,6 +481,52 @@ A non priority hold doesn't prevent a current checkout from renewing
  • +
    + + + +
      +
    1. + + +
    2. + [% IF Koha.Preference('AllowHoldItemTypeSelection') %] +
    3. + + +
    4. + [% END %] + [% IF remaining_holds_for_record > 1 %] +
    5. + + +
    6. + [% ELSE %] + + [% END %] +
    +
    [% IF ( patron.borrowernumber ) %] @@ -1245,9 +1251,9 @@ }); function ToggleHoldsToPlace() { if ( $("#requestany").prop('checked') ) { - $("#holds_to_place_count").prop('disabled', false); + $("#holds_to_place_count,#pickup,#itemtype").prop('disabled', false); } else { - $("#holds_to_place_count").prop('disabled', true); + $("#holds_to_place_count,#pickup,#itemtype").prop('disabled', true); } } ToggleHoldsToPlace(); @@ -1487,10 +1493,10 @@ }); if(onechecked == 1){ $("#requestany").prop("checked", false); - $("#holds_to_place_count").prop('disabled', true); + $("#holds_to_place_count,#pickup,#itemtype").prop('disabled', true); } else { $("#requestany").prop("checked",true); - $("#holds_to_place_count").prop('disabled', false); + $("#holds_to_place_count,#pickup,#itemtype").prop('disabled', false); } }); var prev_rank_request; -- 2.30.2