From e40bbac24f13e7f6ba83e3b765a0e0f5acebe94c 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 Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../prog/en/modules/reserve/request.tt | 741 +++++++++--------- 1 file changed, 368 insertions(+), 373 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 5f1edf5bc9..51cbb01ca9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -99,6 +99,9 @@ .icon-set-lowest::before { content: "\f04e"; } + :disabled{ + opacity:0.5 + } [% END %] @@ -623,50 +626,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 %] +
@@ -690,6 +695,7 @@ [% END %] +
[% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %] @@ -755,7 +761,10 @@ [% END %] - +
+ +
+
[% END %] @@ -776,369 +785,361 @@ [% END %] -
    - [% UNLESS Koha.Preference('item-level_itypes') %] -
  1. - Item type: - [% biblio_info.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_info.biblioitem.publicationyear ) %] +
  3. + Publication year: + [% biblio_info.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 # /FOREACH biblioloo %] +
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_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 ) %] + + + + [% 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_info.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) || Koha.Preference('AllowHoldPolicyOverride') %] + + [% END %] + + [% UNLESS ( noItemTypeImages ) %] + [% IF ( itemloo.itemtype.image_location) %]
[% END %] [% END %] - - [% END # /IF force_hold_level %] -
- [% IF (itemloo.pickup_locations_count > 0) || Koha.Preference('AllowHoldPolicyOverride') %] - - [% 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 %] - - [% 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 %] + [% END # /IF itemloo.nocancel %] + [% ELSE %] + Not on hold + [% END # /IF itemloo.reservedate %] - [% IF ( itemloo.itemlost ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %] - [% 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.damaged ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %] - [% END %] + [% IF ( itemloo.itemlost ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %] + [% END %] - [% IF ( itemloo.withdrawn ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %] - [% END %] + [% IF ( itemloo.damaged ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | 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 hiddencount %] -
-

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

-
- [% END # /IF hiddencount %] - - [% ELSE # /UNLESS multi_hold %] -
- Hold details -
- - - - [% FOREACH biblioloo IN biblioloop %] - - [% UNLESS biblioloo.none_avail %] - - - - [% END %] - [% END %] + [% IF ( itemloo.withdrawn ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %] + [% END %] - - - - - - [% UNLESS Koha.Preference('item-level_itypes') %] - - [% END %] - - - - [% FOREACH biblioloo IN biblioloop %] - [% IF ( biblioloo.warn ) %] - - [% ELSE %] - - [% END %] - - + + [% END # / UNLESS itemloo.hide %] + [% END # /FOREACH itemloo %] + +
 Pickup locationTitleItem typePriorityInformation
- [% UNLESS ( biblioloo.warn ) %] - - [% END %] - - [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %] - +
+ + [% IF hiddencount %] + +

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

+
+ [% END # /IF hiddencount %] + + [% ELSE # /UNLESS multi_hold %] +
+ Hold details +
+ + + + [% FOREACH biblioloo IN biblioloop %] + + [% UNLESS biblioloo.none_avail %] + + + [% END %] -
-
    -
  • - [% biblioloo.title | html %] - [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %] -
  • - [% IF ( biblioloo.publicationyear ) %] + [% END %] + + + + + + + [% UNLESS Koha.Preference('item-level_itypes') %] + + [% END %] + + + + [% FOREACH biblioloo IN biblioloop %] + [% IF ( biblioloo.warn ) %] + + [% ELSE %] + + [% END %] + + + - [% UNLESS Koha.Preference('item-level_itypes') %] - - [% END %] - - [% END %] - [% IF ( biblioloo.alreadyres ) %] -
      - [% ELSE %] - [% IF ( biblioloo.none_avail || biblioloo.noitems ) %] +
    + - - [% END # /FOREACH biblioloo %] -
     Pickup locationTitleItem typePriorityInformation
    + [% UNLESS ( biblioloo.warn ) %] + + [% END %] + + [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %] + + [% END %] + +
    • - Publication year: [% biblioloo.publicationyear | html %] + [% biblioloo.title | html %] + [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
    • + [% IF ( biblioloo.publicationyear ) %] +
    • + Publication year: [% biblioloo.publicationyear | html %] +
    • + [% END %] +
    + [% IF ( biblioloo.warn ) %] + [% END %] - - [% IF ( biblioloo.warn ) %] - - [% END %] -
    - [% biblioloo.itemtype.translated_description | html %] [% biblioloo.rank | html %] - [% IF ( biblioloo.checked_previously ) %] - Patron has previously checked out this title
    + [% UNLESS Koha.Preference('item-level_itypes') %] +
    + [% biblioloo.itemtype.translated_description | html %] + [% biblioloo.rank | html %] + [% IF ( biblioloo.checked_previously ) %] + Patron has previously checked out this title
    + [% END %] + [% IF ( biblioloo.alreadyres ) %]
      + [% ELSE %] + [% IF ( biblioloo.none_avail || biblioloo.noitems ) %] +
        + [% END %] [% END %] - [% END %] - - [% IF ( biblioloo.alreadyres ) %] -
      • - [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] already has a hold on this item -
      • - [% END %] - [% IF ( biblioloo.none_avail || biblioloo.noitems ) %] -
      • No items are available to be placed on hold
      • - [% END %] - [% IF ( biblioloo.alreadyres ) %] -
      - [% ELSE %] + [% IF ( biblioloo.alreadyres ) %] +
    • + [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] already has a hold on this item +
    • + [% END %] [% IF ( biblioloo.none_avail || biblioloo.noitems ) %] +
    • No items are available to be placed on hold
    • + [% END %] + + [% IF ( biblioloo.alreadyres ) %]
    + [% ELSE %] + [% IF ( biblioloo.none_avail || biblioloo.noitems ) %] + + [% END %] [% END %] - [% END %] -
    - +
+ +
+ [% IF ( patron AND patron.borrowernumber ) %] + [% IF ( override_required ) %] + + [% ELSIF ( no_bibs_available ) %] + + [% ELSIF ( none_available ) %] + + [% ELSE %] + + [% END %] + [% END # /IF patron %] +
- [% END # /UNLESS multi_hold %] + [% 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 %] @@ -1604,22 +1605,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.39.5