From 65fa40c36da0ae593f0e4776cfed1114f220d758 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 4 Dec 2024 17:24:32 +0000 Subject: [PATCH] Bug 38635: Improve place hold confirmation page in the OPAC This patch makes some markup and style changes to the hold confirmation page in the OPAC with the intention of making the interface clearer and less cluttered. The "Place hold on" label for each title's checkbox has been hidden from sighted users and visually grouped with the title information. The checkbox itself is now hidden if only 1 hold is being placed. The title is now a inside a
in order to take advantage of the fact that when fieldset has a "disabled" property the form controls contained within are all disabled. When placing multiple holds at once, unchecking the checkbox next to a title will disable that title's form fields and give it a "disabled" appearance. Some Bootstrap grid markup has been added in order to improve the page's responsive behavior. This update includes some indentation changes, so ignore whitespace when viewing the diff. Unrelated: Incorrect classes have been fixed on a few alerts. Also, CSS related to a long-removed 3rd party service "iDreamBooks" has been removed. To test, apply the patch and rebuild the OPAC CSS. - Log in to the OPAC as a user who can place holds. - Perform a catalog search which will return multiple results. - Next to one of those results, find a title which can be placed on hold and click the "Place hold" link. - On the hold confirmation page you should see the title of your hold and the standard controls. There should be no checkbox next to the title. - Return to the search results page and check the checkbox for at least two items which are available to be place on hold. Click the "Place hold" button in the search results toolbar. - On the hold confirmation page you should see the titles you selected, each with a checkbox next to the title. - Uncheck one of the checkboxes. The details for that title should switch to "disabled" appearance. You should be unable to change the pickup location or click the "Show more options" link. - Re-check the checkbox and click the "Show more options" link to expand more fields. - Uncheck the checkbox again. The expanded section should collapse. - Confirm that single and multiple holds are placed correctly. Test with various additional settings like expiration date or specific item to confirm that these options still work. Sponsored-by: Athens County Public Libraries --- .../opac-tmpl/bootstrap/css/src/opac.scss | 51 +- .../bootstrap/en/modules/opac-reserve.tt | 916 +++++++++--------- 2 files changed, 479 insertions(+), 488 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 2cfe371927..b67e2246f6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2315,16 +2315,11 @@ nav { } } -#holds { - margin: 0 auto; - max-width: 800px; -} - .holdrow { border-bottom: 1px solid #CCC; clear: both; margin-bottom: .5em; - padding: 0 1em 1em 1em; + padding: 1em 0; fieldset { border: 0; @@ -2348,6 +2343,7 @@ nav { .toggle-hold-options { background-color: #EEE; clear: both; + color: #01547C; display: block; font-weight: bold; margin: 1em 0; @@ -2358,41 +2354,28 @@ nav { clear: both; } -#idreambooksreadometer { - float: right; +.holdbiblio { + border: 1px solid #DDD; + display: flex; + float: none; + font-size: 1rem; + font-weight: bold; + gap: 1rem; + margin: .5rem 0; + padding: 1rem; } -.idreambookslegend { - font-size: small; -} +.holdrow[disabled] { + opacity: .8; -.idreambookssummary { - a { - color: #707070; - text-decoration: none; - } - - img { - vertical-align: middle; + .holdcontrols * { + pointer-events: none; } } -.idbresult { - color: #29ADE4; - margin: .5em; - padding: .5em; - text-align: center; - img { - padding-right: 6px; - vertical-align: middle; - } - - a, - a:visited { - color: #29ADE4; - text-decoration: none; - } +.confirmjs_hold { + display: block; } .js-show { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 78db93ddbb..27a7e2c20e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -27,488 +27,500 @@
-

Placing a hold

- [% IF ( message ) %] -
-

Sorry, you cannot place holds.

-
    - [% IF ( GNA ) %] -
  • - According to our records, we don't have up-to-date contact information. Please contact the library. - [% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %] - [% IF ( Koha.Preference('OPACPatronDetails') ) %](Please note: there may be a delay in restoring your account if you submit online.)[% END %] -
  • - [% END %] +
    +
    +

    Placing a hold

    + [% IF ( message ) %] +
    +

    Sorry, you cannot place holds.

    +
      + [% IF ( GNA ) %] +
    • + According to our records, we don't have up-to-date contact information. Please contact the library. + [% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %] + [% IF ( Koha.Preference('OPACPatronDetails') ) %](Please note: there may be a delay in restoring your account if you submit online.)[% END %] +
    • + [% END %] - [% IF ( lost ) %] -
    • - Your library card has been marked as lost or stolen.
      - If this is an error, please take your library card to the circulation desk at your local library and the error will be corrected. -
    • - [% END %] + [% IF ( lost ) %] +
    • + Your library card has been marked as lost or stolen.
      + If this is an error, please take your library card to the circulation desk at your local library and the error will be corrected. +
    • + [% END %] - [% IF ( debarred ) %] -
    • - Your account has been frozen. - [% IF debarred_comment %] - Comment:
      - - - [% IF debarred_comment.search('OVERDUES_PROCESS') %] - Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %] - [% ELSE %] - [% FOR restriction IN logged_in_user.restrictions %] -
      - [%- restriction.type.display_text | html -%][%- IF restriction.comment -%]: [% restriction.comment | html_line_break %], frozen until: - - [%- IF restriction.expiration -%] - [%- restriction.expiration | $KohaDates -%] - [%- ELSE -%] - Indefinite - [%- END -%] - + [% IF ( debarred ) %] +
    • + Your account has been frozen. + [% IF debarred_comment %] + Comment:
      + + + [% IF debarred_comment.search('OVERDUES_PROCESS') %] + Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %] + [% ELSE %] + [% FOR restriction IN logged_in_user.restrictions %] +
      + [%- restriction.type.display_text | html -%][%- IF restriction.comment -%]: [% restriction.comment | html_line_break %], frozen until: + + [%- IF restriction.expiration -%] + [%- restriction.expiration | $KohaDates -%] + [%- ELSE -%] + Indefinite + [%- END -%] + + [% END %] +
      + [% END %] [% END %] -
    - [% END %] - [% END %] - - + + + [% END %] + + [% IF debarred_date && debarred_date != '9999-12-31' %] + End date: + [% debarred_date | $KohaDates %] + [% END %] +
    Usually the reason for freezing an account is old overdues or damage fees. If shows your account to be clear, please contact the library. Go to your charges page + [% END %] - [% IF debarred_date && debarred_date != '9999-12-31' %] - End date: - [% debarred_date | $KohaDates %] + [% IF ( too_much_oweing ) %] +
  • + You have unpaid fines. Amount: [% too_much_oweing | $Price %]. +
  • [% END %] -
    Usually the reason for freezing an account is old overdues or damage fees. If shows your account to be clear, please contact the library. Go to your charges page - - [% END %] - [% IF ( too_much_oweing ) %] -
  • - You have unpaid fines. Amount: [% too_much_oweing | $Price %]. -
  • - [% END %] + [% IF ( too_many_reserves ) %] +
  • + Sorry, you cannot place more than [% too_many_reserves | html %] holds. +
  • + [% END %] - [% IF ( too_many_reserves ) %] -
  • - Sorry, you cannot place more than [% too_many_reserves | html %] holds. -
  • - [% END %] + [% IF ( bad_biblionumber ) %] +
  • + ERROR: No record found for record ID [% bad_biblionumber | html %]. +
  • + [% END %] - [% IF ( bad_biblionumber ) %] -
  • - ERROR: No record found for record ID [% bad_biblionumber | html %]. -
  • - [% END %] + [% IF ( no_items_selected ) %] +
  • + You must select at least one item. +
  • + [% END %] - [% IF ( no_items_selected ) %] -
  • - You must select at least one item. -
  • - [% END %] + [% IF ( no_branch_selected ) %] +
  • + You must select a library for pickup. +
  • + [% END %] - [% IF ( no_branch_selected ) %] -
  • - You must select a library for pickup. -
  • - [% END %] + [% IF ( no_biblionumber ) %] +
  • + ERROR: No record ID specified. +
  • + [% END %] - [% IF ( no_biblionumber ) %] -
  • - ERROR: No record ID specified. -
  • - [% END %] + [% IF ( bad_data ) %] +
  • + ERROR: Internal error: incomplete hold request. +
  • + [% END %] - [% IF ( bad_data ) %] -
  • - ERROR: Internal error: incomplete hold request. -
  • - [% END %] + [% IF ( expired_patron ) %] +
  • + Your library card has expired. Please contact your librarian if you wish to renew your card. +
  • + [% END %] - [% IF ( expired_patron ) %] -
  • - Your library card has expired. Please contact your librarian if you wish to renew your card. -
  • + [% IF ( no_pickup_locations ) %] +
  • + None of the libraries are available for pickup location. +
  • + [% END %] +
+
+ [% ELSE # /IF message %] + + [% IF ( none_available && multi_hold ) %] +
+ Sorry, none of these titles can be placed on hold. +
[% END %] - [% IF ( no_pickup_locations ) %] -
  • - None of the libraries are available for pickup location. -
  • + [% END # / IF message %] + + [% UNLESS ( message ) %] + [% UNLESS ( none_available ) %] +

    Confirm holds for:[% INCLUDE 'patron-title.inc' patron = logged_in_user %] ([% logged_in_user.cardnumber | html %])

    + [% END # / UNLESS none_available %] + + [% IF ( new_reserves_allowed ) %] +
    + Sorry, you can only place [% new_reserves_allowed | html %] more holds. Please uncheck the checkboxes for the items you wish to not place holds on. +
    [% END %] - -
    - [% ELSE # /IF message %] - - [% IF ( none_available && multi_hold ) %] -
    - Sorry, none of these titles can be placed on hold. -
    - [% END %] - - [% END # / IF message %] - - [% UNLESS ( message ) %] - [% UNLESS ( none_available ) %] -

    Confirm holds for:[% INCLUDE 'patron-title.inc' patron = logged_in_user %] ([% logged_in_user.cardnumber | html %])

    - [% END # / UNLESS none_available %] - - [% IF ( new_reserves_allowed ) %] -
    - Sorry, you can only place [% new_reserves_allowed | html %] more holds. Please uncheck the checkboxes for the items you wish to not place holds on. -
    - [% END %] - -
    - [% INCLUDE 'csrf-token.inc' %] - Hold requests - - - - -
    - - [% FOREACH bibitemloo IN bibitemloop %] -
    - [% IF bibitemloo.forced_hold_level %] -
    - [% IF bibitemloo.forced_hold_level == 'item' %] - You already have at least one item level hold on this title. - All further holds must be item level. - [% ELSE %] - You already have at least one record level hold on this title. - All further holds must be record level. + + + [% INCLUDE 'csrf-token.inc' %] + Hold requests + + + + +
    + + [% FOREACH bibitemloo IN bibitemloop %] +
    + [% IF bibitemloo.forced_hold_level %] +
    + [% IF bibitemloo.forced_hold_level == 'item' %] + You already have at least one item level hold on this title. + All further holds must be item level. + [% ELSE %] + You already have at least one record level hold on this title. + All further holds must be record level. + [% END %] +
    [% END %] -
    - [% END %] - [% IF ( bibitemloo.reserve_charge ) %] -
    - [% IF Koha.Preference('HoldFeeMode') == 'any_time_is_collected' %] - You will be charged a hold fee of [% bibitemloo.reserve_charge | $Price %] when you collect this item - [% ELSE %] - You will be charged a hold fee of [% bibitemloo.reserve_charge | $Price %] for placing this hold + [% IF ( bibitemloo.reserve_charge ) %] +
    + [% IF Koha.Preference('HoldFeeMode') == 'any_time_is_collected' %] + You will be charged a hold fee of [% bibitemloo.reserve_charge | $Price %] when you collect this item + [% ELSE %] + You will be charged a hold fee of [% bibitemloo.reserve_charge | $Price %] for placing this hold + [% END %] +
    [% END %] -
    - [% END %] -

    - [% IF ( bibitemloo.holdable ) %] - - - - - - - - [% END # / bibitemloo.holdable %] - - [% INCLUDE 'biblio-title.inc' biblio=bibitemloo link=> 1%] - - [% IF ( bibitemloo.author ) %], by [% bibitemloo.author | html %][% END %] -

    - - [% UNLESS ( bibitemloo.holdable ) %] - [% IF ( bibitemloo.ageRestricted ) %] -
    Sorry, you are too young to place a hold for this item.
    - [% END %] - [% IF ( bibitemloo.already_reserved ) %] -
    You have already requested this title.
    - [% ELSIF ( bibitemloo.recall ) %] -
    You have already placed a recall on this title.
    - [% ELSE %] - [% IF bibitemloo.alreadypossession %] -
    This title cannot be requested because it's already in your possession.
    - [% ELSIF bibitemloo.tooManyReserves %] -
    This title cannot be requested because you reached the maximum number of holds.
    - [% ELSIF bibitemloo.tooManyHoldsForThisRecord %] -
    This title cannot be requested because you exceeded max holds per record.
    - [% ELSIF bibitemloo.tooManyReservesToday %] -
    This title cannot be requested because you reached the daily hold limit.
    - [% ELSIF bibitemloo.itemAlreadyOnHold %] -
    This title cannot be requested because you already have hold for this item.
    - [% ELSE %] - [% UNLESS ( bibitemloo.bib_available ) %] -
    There are no items that can be placed on hold.
    - [% ELSE %] -
    This title cannot be requested.
    - [% END %] - [% END # / UNLESS bibitemloo.already_patron_possession %] - [% END # / IF bibitemloo.already_reserved %] - [% END # / UNLESS bibitemloo.holdable %] - - [% IF ( bibitemloo.holdable ) %] -
    -
      - - [% UNLESS ( item_level_itypes ) %] -
    • - Item type: - [% IF ( bibitemloo.imageurl ) %][% END %] - [% bibitemloo.translated_description | html %] -
    • - [% END %] + + [% IF ( bibitemloo.holdable ) %] + + - [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %] - [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %] -
    • - Your priority: - [% bibitemloo.rank | html %] -
    • - [% END %] + [% IF ( multi_hold ) %] + + [% ELSE %] + + [% END %] - [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %] -
    • - Number of holds: - [% bibitemloo.reservecount | html %] -
    • - [% END %] + + + + + [% END # / bibitemloo.holdable %] - [% UNLESS ( singleBranchMode ) %] - [% IF ( bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch')) %] -
    • - - [% UNLESS ( bibitemloo.holdable ) %] - - [% ELSE %] - [% SET at_least_one_library_not_available_for_pickup = 0 %] - - [% IF at_least_one_library_not_available_for_pickup %] -
      Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items
      - [% END %] - [% END # / UNLESS bibitemloo.holdable %] -
    • - [% END # / IF bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch') %] - [% END # / UNLESS singleBranchMode %] -
    - - - -
    - -
      - [% IF ( reserve_in_future ) %] -
    • - - - [% INCLUDE 'date-format.inc' %] - -
    • - [% END %] +
      + [% INCLUDE 'biblio-title.inc' biblio=bibitemloo link=> 1%] -
    • - - - [% INCLUDE 'date-format.inc' %] - -
    • - - [% IF Koha.Preference('AllowHoldItemTypeSelection') %] -
    • - - -
    • - [% END %] + [% IF ( bibitemloo.author ) %]by [% bibitemloo.author | html %][% END %] +
      + - [% UNLESS bibitemloo.forced_hold_level && ( bibitemloo.forced_hold_level == 'item' || bibitemloo.forced_hold_level == 'record' ) %] - [% IF Koha.Preference('EnableItemGroupHolds') && bibitemloo.object.item_groups.count %] -
    • - - + [% UNLESS ( bibitemloo.holdable ) %] + [% IF ( bibitemloo.ageRestricted ) %] +
      Sorry, you are too young to place a hold for this item.
      + [% END %] + [% IF ( bibitemloo.already_reserved ) %] +
      You have already requested this title.
      + [% ELSIF ( bibitemloo.recall ) %] +
      You have already placed a recall on this title.
      + [% ELSE %] + [% IF bibitemloo.alreadypossession %] +
      This title cannot be requested because it's already in your possession.
      + [% ELSIF bibitemloo.tooManyReserves %] +
      This title cannot be requested because you reached the maximum number of holds.
      + [% ELSIF bibitemloo.tooManyHoldsForThisRecord %] +
      This title cannot be requested because you exceeded max holds per record.
      + [% ELSIF bibitemloo.tooManyReservesToday %] +
      This title cannot be requested because you reached the daily hold limit.
      + [% ELSIF bibitemloo.itemAlreadyOnHold %] +
      This title cannot be requested because you already have hold for this item.
      + [% ELSE %] + [% UNLESS ( bibitemloo.bib_available ) %] +
      There are no items that can be placed on hold.
      + [% ELSE %] +
      This title cannot be requested.
      + [% END %] + [% END # / UNLESS bibitemloo.already_patron_possession %] + [% END # / IF bibitemloo.already_reserved %] + [% END # / UNLESS bibitemloo.holdable %] + + [% IF ( bibitemloo.holdable ) %] +
      +
        + + [% UNLESS ( item_level_itypes ) %] +
      • + Item type: + [% IF ( bibitemloo.imageurl ) %][% END %] + [% bibitemloo.translated_description | html %]
      • [% END %] - [% END %] - [% IF ( OpacHoldNotes ) %] -
      • -
        - - -
        -
      • - [% END # / IF OpacHoldNotes %] - - [% IF bibitemloo.itemholdable %] - - - [% END # / IF bibitemloo.itemholdable %] -
      - - [% IF bibitemloo.itemholdable %] -
      - - - - - - [% IF ( item_level_itypes ) %] - - [% END %] - - [% UNLESS ( singleBranchMode ) %] - - - [% END %] - [% IF ( itemdata_ccode ) %] - + [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %] + [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %] +
    • + Your priority: + [% bibitemloo.rank | html %] +
    • + [% END %] + + [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %] +
    • + Number of holds: + [% bibitemloo.reservecount | html %] +
    • + [% END %] + + [% UNLESS ( singleBranchMode ) %] + [% IF ( bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch')) %] +
    • + + [% UNLESS ( bibitemloo.holdable ) %] + + [% ELSE %] + [% SET at_least_one_library_not_available_for_pickup = 0 %] + + [% IF at_least_one_library_not_available_for_pickup %] +
      Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items
      + [% END %] + [% END # / UNLESS bibitemloo.holdable %] +
    • + [% END # / IF bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch') %] + [% END # / UNLESS singleBranchMode %] + + + + +
      + +
        + [% IF ( reserve_in_future ) %] +
      • + + + [% INCLUDE 'date-format.inc' %] + +
      • [% END %] -
      - [% IF ( itemdata_enumchron ) %] - + +
    • + + + [% INCLUDE 'date-format.inc' %] + +
    • + + [% IF Koha.Preference('AllowHoldItemTypeSelection') %] +
    • + + +
    • [% END %] - - - - - - - [% SET unholdable_items = 0 %] - [% FOREACH itemLoo IN bibitemloo.itemLoop %] - [% IF ( itemLoo.available ) %] - [% IF ( itemLoo.checkout ) %] - - [% ELSE %] - - [% END %] - - [% ELSE %] - + + [% UNLESS bibitemloo.forced_hold_level && ( bibitemloo.forced_hold_level == 'item' || bibitemloo.forced_hold_level == 'record' ) %] + [% IF Koha.Preference('EnableItemGroupHolds') && bibitemloo.object.item_groups.count %] +
    • + + +
    • [% END %] - [%# copynumber %] - [% IF ( item_level_itypes ) %] - + + [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%] + +
      Select a specific item:
      Copy numberItem typeBarcodeHome libraryLast locationCollectionCall numberVol infoNotesInformation
      - - [% ELSE %] - [% SET unholdable_items = 1 %] - [% IF ( itemLoo.checkout ) %] -
      + [% IF unholdable_items %] + + + [% END %] +
      + [% END # / IF ( bibitemloo.itemholdable )%] +
    +
    + [% END # / IF ( bibitemloo.holdable ) %] +
    + [% END # / FOREACH bibitemloo IN bibitemloop %] + + + [% UNLESS ( none_available ) %] + + [% END %] + + + [% END # / UNLESS message %] + + @@ -582,16 +594,11 @@ // Replace non-JS single-selection with multi-selection capability. $(".reserve_mode").val("multi"); $(".confirm_nonjs").remove(); + $(".confirmjs_hold").each(function(){ - var bib = $(this).attr("title"); + var bib = $(this).data("biblionumber"); var html = " "; - $(this).html(html); - }); - $(".confirmjs_nohold").each(function(){ - var bib = $(this).attr("title"); - var html = ""; + html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Select to place a hold on: ") + " "; $(this).html(html); }); @@ -622,17 +629,18 @@ // On confirmsjs change - $(".confirmjs").change(function(){ + $(".confirmjs").on("change", function(){ var id = suffixOf($(this).attr("id"), "_"); // If I m checked, I enable radio buttons if ( $(this).is(":checked") ) { - $("#reqspecific_" + id).attr("disabled", false); - $("#reqany_" + id).attr("disabled", false); + $("#holdrow_" + id ).attr("disabled", false).removeClass("disabled"); } // Else its are disabled else { - $("#reqspecific_" + id).attr("disabled", "disabled"); - $("#reqany_" + id).attr("disabled", "disabled"); + $("#holdrow_" + id ).attr("disabled", "disabled").addClass("disabled"); + if( $("#hold-options-" + id ).is(":visible") ){ + $("#toggle-hold-options-" + id ).click(); + } } // expand or collaspe the items block toggle_copiesrow(id); -- 2.39.5