From e279faa625269b791c23c3c42816eaaa68e2eb37 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 28 Aug 2023 14:42:49 +0000 Subject: [PATCH] Bug 30579: (follow-up) Add fieldsets and style disabled elements This patch surrounds each section with a fieldset which allow enabling/disabling all the elements in one go. CSS is added to make it clear which fields are disabled. Button for item specific is moved form the multi-hold section Javascript is simplified to use the new fieldsets To test: 1 - Repeate test plan on earlier commit 2 - Additionally, search and select multiple records and place hold 3 - Confirm multi-hold placing works :-) Signed-off-by: Emily Lamancusa --- .../prog/en/modules/reserve/request.tt | 550 +++++++++--------- 1 file changed, 277 insertions(+), 273 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 621d7b745d6..8c553815abf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -95,6 +95,9 @@ .icon-set-lowest::before { content: "\f04e"; } + :disabled{ + opacity:0.5 + } [% END %] @@ -569,50 +572,52 @@ [% END %] -
    +
    +
      -
    1. - - -
    2. - - [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
    3. - - + [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
    4. - [% END %] - [% IF remaining_holds_for_record > 1 %] -
    5. - - -
    6. - [% ELSE %] - - [% END %] -
    + + [% IF Koha.Preference('AllowHoldItemTypeSelection') %] +
  1. + + +
  2. + [% END %] + [% IF remaining_holds_for_record > 1 %] +
  3. + + +
  4. + [% ELSE %] + + [% END %] +
-
- [% IF ( patron.borrowernumber ) %] - [% IF ( override_required ) %] - - [% ELSIF ( none_available ) %] - - [% ELSE %] - +
+ [% IF ( patron.borrowernumber ) %] + [% IF ( override_required ) %] + + [% ELSIF ( none_available ) %] + + [% ELSE %] + + [% END %] [% END %] - [% END %] +
@@ -636,6 +641,7 @@ [% END %] +
[% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %] @@ -683,7 +689,10 @@ [% END %] - +
+ +
+
[% END %] @@ -703,236 +712,247 @@ [% END %] +
+
    + [% UNLESS Koha.Preference('item-level_itypes') %] +
  1. + Item type: + [% biblio.itemtype.translated_description | html %] +
  2. + [% END %] -
      - [% UNLESS Koha.Preference('item-level_itypes') %] -
    1. - Item type: - [% biblio_info.itemtype.translated_description | html %] -
    2. - [% END %] - - [% IF ( biblio_info.biblioitem.publicationyear ) %] -
    3. - Publication year: - [% biblio_info.biblioitem.publicationyear | html %] -
    4. - [% END %] -
    + [% IF ( biblio.biblioitem.publicationyear ) %] +
  3. + Publication year: + [% biblio.biblioitem.publicationyear | html %] +
  4. + [% END %] +
- - - - - - [% IF Koha.Preference('item-level_itypes') %] - - [% END %] - - [% IF Koha.Preference('EnableItemGroupHolds') && biblio_info.object.item_groups.count %] - - [% END %] - - - [% IF itemdata_ccode %] - - [% END %] - - - [% IF itemdata_enumchron %] - - [% END %] - - - - - [% SET selected = 0 %] - [% FOREACH itemloo IN biblio_info.itemloop %] - [% UNLESS ( itemloo.hide ) %] - - + + [% END # / UNLESS itemloo.hide %] + [% END # /FOREACH itemloo %] + +
HoldAllowed pickup locationsItem typeBarcodeItem groupHome libraryLast locationCollectionCall numberCopy numberVol no.Information
- [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %] - - - Hold must be record level - - [% ELSIF force_hold_level == 'item_group' %] - - - Hold must be item group level - - [% ELSIF ( itemloo.available ) %] - - [% ELSIF ( itemloo.override ) %] - - - [% ELSE %] - - - [% IF itemloo.not_holdable %] - [% IF itemloo.not_holdable == 'damaged' %] - Item damaged - [% ELSIF itemloo.not_holdable == 'ageRestricted' %] - Age restricted - [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %] - Exceeded max holds per record - [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %] - Daily hold limit reached for patron - [% ELSIF itemloo.not_holdable == 'tooManyReserves' %] - Too many holds - [% ELSIF itemloo.not_holdable == 'notReservable' %] - Not holdable - [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %] - Patron is from different library - [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %] - Cannot place hold from patron's library - [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %] - Patron already has hold for this item - [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %] - Cannot be transferred to pickup library - [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %] - Only pickup locations within the same hold group are allowed - [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %] - No holds are allowed on this item - [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %] - Library is not a pickup location - [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %] - No valid pickup location - [% ELSIF itemloo.not_holdable == 'notforloan' %] - Not for loan - [% ELSE %] - [% itemloo.not_holdable | html %] + + + + + + [% IF Koha.Preference('item-level_itypes') %] + + [% END %] + + [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %] + + [% END %] + + + [% IF itemdata_ccode %] + + [% END %] + + + [% IF itemdata_enumchron %] + + [% END %] + + + + + [% SET selected = 0 %] + [% FOREACH itemloo IN biblio.itemloop %] + [% UNLESS ( itemloo.hide ) %] + + + + [% IF Koha.Preference('item-level_itypes') %] + - [% END %] - - [% END %] - - [% IF Koha.Preference('item-level_itypes') %] - [% END %] - - [% IF Koha.Preference('EnableItemGroupHolds') && biblio_info.object.item_groups.count %] + [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %] + + [% END %] - [% END %] - - - [% IF itemdata_ccode %] - [% END %] - - - [% IF itemdata_enumchron %] + [% IF itemdata_ccode %] + + [% END %] - [% END %] - [% IF ( itemloo.onloan ) %] - + [% IF itemdata_enumchron %] + + [% END %] + [% IF ( itemloo.onloan ) %] + - - [% END # / UNLESS itemloo.hide %] - [% END # /FOREACH itemloo %] - -
HoldAllowed pickup locationsItem typeBarcodeItem groupHome libraryLast locationCollectionCall numberCopy numberVol no.Information
+ [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %] + + + Hold must be record level + + [% ELSIF force_hold_level == 'item_group' %] + + + Hold must be item group level + + [% ELSIF ( itemloo.available ) %] + + [% ELSIF ( itemloo.override ) %] + + + [% ELSE %] + + + [% IF itemloo.not_holdable %] + [% IF itemloo.not_holdable == 'damaged' %] + Item damaged + [% ELSIF itemloo.not_holdable == 'ageRestricted' %] + Age restricted + [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %] + Exceeded max holds per record + [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %] + Daily hold limit reached for patron + [% ELSIF itemloo.not_holdable == 'tooManyReserves' %] + Too many holds + [% ELSIF itemloo.not_holdable == 'notReservable' %] + Not holdable + [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %] + Patron is from different library + [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %] + Cannot place hold from patron's library + [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %] + Patron already has hold for this item + [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %] + Cannot be transferred to pickup library + [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %] + Only pickup locations within the same hold group are allowed + [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %] + No holds are allowed on this item + [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %] + Library is not a pickup location + [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %] + No valid pickup location + [% ELSIF itemloo.not_holdable == 'notforloan' %] + Not for loan + [% ELSE %] + [% itemloo.not_holdable | html %] + [% END %] [% END %] + + [% END # /IF force_hold_level %] + + [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %] + + [% END %] + + [% UNLESS ( noItemTypeImages ) %] + [% IF ( itemloo.itemtype.image_location) %]
[% END %] [% END %] - - [% END # /IF force_hold_level %] -
- [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %] - - [% UNLESS ( noItemTypeImages ) %] - [% IF ( itemloo.itemtype.image_location) %]
[% END %] - [% END %] - [% itemloo.itemtype.translated_description | html %] + [% itemloo.barcode | html %]
- [% itemloo.barcode | html %] - + [% itemloo.object.item_group.description | html %] + - [% itemloo.object.item_group.description | html %] + [% Branches.GetName( itemloo.homebranch ) | html %] - [% Branches.GetName( itemloo.homebranch ) | html %] - - [% Branches.GetName( itemloo.holdingbranch ) | html %] - - [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %] + [% Branches.GetName( itemloo.holdingbranch ) | html %] - [% itemloo.itemcallnumber | html %] - - [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %] - + [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %] + - [% itemloo.enumchron | html %] + [% itemloo.itemcallnumber | html %] - Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] - [% ELSE %] - [% IF ( itemloo.transfertwhen ) %] - In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %], - to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | $KohaDates %] - [% END %] - [% END %] + [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %] + + [% itemloo.enumchron | html %] + + Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] + [% ELSE %] + + [% IF ( itemloo.transfertwhen ) %] + In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %], + to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | $KohaDates %] + [% END %] + [% END %] - [% IF ( itemloo.reservedate ) %] - [% IF ( itemloo.nocancel ) %] - Can't be cancelled when item is in transit - [% ELSE %] - [% IF ( itemloo.waitingdate ) %] - [% IF ( itemloo.canreservefromotherbranches ) %] - Waiting for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %] - [% ELSE %] - Waiting at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %] - [% END %] + [% IF ( itemloo.reservedate ) %] + [% IF ( itemloo.nocancel ) %] + Can't be cancelled when item is in transit [% ELSE %] - [% IF ( itemloo.canreservefromotherbranches ) %] - [% IF itemloo.reservedate %] - On hold for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since + [% IF ( itemloo.waitingdate ) %] + [% IF ( itemloo.canreservefromotherbranches ) %] + Waiting for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %] [% ELSE %] - On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] + Waiting at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %] [% END %] - [% ELSIF itemloo.reservedate %] - On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.reservedate | $KohaDates %] [% ELSE %] - On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] + [% IF ( itemloo.canreservefromotherbranches ) %] + [% IF itemloo.reservedate %] + On hold for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since + [% ELSE %] + On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] + [% END %] + [% ELSIF itemloo.reservedate %] + On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.reservedate | $KohaDates %] + [% ELSE %] + On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] + [% END %] [% END %] - [% END %] - [% END # /IF itemloo.nocancel %] - [% ELSE %] - Not on hold - [% END # /IF itemloo.reservedate %] + [% END # /IF itemloo.nocancel %] + [% ELSE %] + Not on hold + [% END # /IF itemloo.reservedate %] - [% IF itemloo.item_level_holds == "N" %] -
Item level hold not allowed from OPAC - [% ELSIF itemloo.item_level_holds == "F" %] -
Item level hold forced from OPAC - [% END %] + [% IF itemloo.item_level_holds == "N" %] +
Item level hold not allowed from OPAC + [% ELSIF itemloo.item_level_holds == "F" %] +
Item level hold forced from OPAC + [% END %] - [% IF ( itemloo.itemlost ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %] - [% END %] + [% IF ( itemloo.itemlost ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %] + [% END %] - [% IF ( itemloo.damaged ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %] - [% END %] + [% IF ( itemloo.damaged ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %] + [% END %] - [% IF ( itemloo.withdrawn ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %] - [% END %] + [% IF ( itemloo.withdrawn ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %] + [% END %] - [% IF ( itemloo.notforloan ) %] - Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %]) - [% ELSIF ( itemloo.notforloanitype ) %] - Not for loan (Itemtype not for loan) - [% END %] -
+ [% IF ( itemloo.notforloan ) %] + Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %]) + [% ELSIF ( itemloo.notforloanitype ) %] + Not for loan (Itemtype not for loan) + [% END %] +
- [% IF hiddencount %] + [% IF hiddencount %]

- Show all items ([% hiddencount | html %] hidden) + Show all items ([% hiddencount | html %] hidden)

- [% END # /IF hiddencount %] + [% END # /IF hiddencount %] +
+ [% IF ( override_required ) %] + + [% ELSIF ( none_available ) %] + + [% ELSE %] + + [% END %] +
+
+ [% ELSE # /UNLESS multi_hold %]
@@ -1041,32 +1061,22 @@ [% END # /FOREACH biblioloo %]
+
+ [% IF ( patron AND patron.borrowernumber ) %] + [% IF ( override_required ) %] + + [% ELSIF ( no_bibs_available ) %] + + [% ELSIF ( none_available ) %] + + [% ELSE %] + + [% END %] + [% END # /IF patron %] +
[% END # /UNLESS multi_hold %] -
- [% IF ( patron AND patron.borrowernumber ) %] - [% IF ( multi_hold ) %] - [% IF ( override_required ) %] - - [% ELSIF ( no_bibs_available ) %] - - [% ELSIF ( none_available ) %] - - [% ELSE %] - - [% END %] - [% ELSE %] - [% IF ( override_required ) %] - - [% ELSIF ( none_available ) %] - - [% ELSE %] - - [% END %] - [% END %] - [% END # /IF patron %] -
[% END %] @@ -1531,22 +1541,16 @@ function ToggleHoldsToPlace() { if ( $("#requestany").prop('checked') ) { - $("#holds_to_place_count, #pickup-next-avail, #itemtype, #hold_any_btn").prop('disabled', false); + $(".disable_request_any").prop('disabled',true); + $(".enable_request_any").prop('disabled',false); $(".requestspecific,.requestgrp").prop('checked', false); - $(".requestspecific","#requestspecific").prop('disabled',true); - $("#hold_item_btn, #hold_grp_btn, #pickup-item-group").prop("disabled", true ); - $("#hold_any_btn").prop("disabled", false ); } else if( $(".requestspecific").prop('checked') ) { - $(".requestspecific","#requestspecific").prop('disabled',false); - $("#holds_to_place_count, #pickup-item-group, #pickup-next-avail #itemtype, #hold_any_btn").prop('disabled', true); - $("#hold_item_btn").prop("disabled", false ); - $("#hold_any_btn,#hold_grp_btn").prop("disabled", true ); + $(".disable_request_specific").prop('disabled',true); + $(".enable_request_specific").prop('disabled',false); $("#requestany,.requestgrp").prop('checked', false); } else { - $("#holds_to_place_count, #pickup-next-avail, #itemtype, #hold_any_btn").prop('disabled', true); - $("#hold_grp_btn, #pickup-item-group").prop("disabled", false ); - $(".requestspecific","#requestspecific").prop('disabled',true); - $("#hold_any_btn,#hold_item_btn").prop("disabled", true ); + $(".disable_request_group").prop('disabled',true); + $(".enable_request_group").prop('disabled',false); $("#requestany,.requestspecific").prop('checked', false); } } -- 2.30.2