Bugzilla – Attachment 190120 Details for
Bug 41335
Toggling the hold options does not always work in opac-reserve
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41335: Adjust toggling hold options, preselect lone item
Bug-41335-Adjust-toggling-hold-options-preselect-l.patch (text/plain), 5.01 KB, created by
Marcel de Rooy
on 2025-12-03 15:22:44 UTC
(
hide
)
Description:
Bug 41335: Adjust toggling hold options, preselect lone item
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-12-03 15:22:44 UTC
Size:
5.01 KB
patch
obsolete
>From d52933411f3316bac879c2d59b008e68b6a6338f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 1 Dec 2025 15:05:17 +0100 >Subject: [PATCH] Bug 41335: Adjust toggling hold options, preselect lone item >Content-Type: text/plain; charset=utf-8 > >By default hold options are collapsed. In the following cases they >are expanded: >- one of the hold dates is made mandatory via OPACMandatoryHoldDates >- an item level hold is forced for this biblio (at least one item is > controlled by a circ rule where opacitemholds == F [Forced] ) > >When DisplayMultiItemHolds is enabled, item selection for specific items >is done via checkboxes; no item is preselected unless there is only one. >Otherwise an item is selected via radio buttons. The first one is >preselected. > >Test plan: >Verify in steps 2 to 4 that the above rules are respected. >[1] Enable DisplayMultiItemHolds and OPACAllowHoldDateInFuture. >[2] Place hold on biblio with only one item where record and item level are allowed. >[3] Place hold on biblio with multiple items where item level is forced. >[4] Place hold on biblio with multiple items where item level is not forced. >[5] Toggle OPACMandatoryHoldDates (between no hold dates and another value) and repeat 2-4 >[6] Disable DisplayMultiItemHolds and repeat 2-5 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../bootstrap/en/modules/opac-reserve.tt | 18 +++++++++++------- > 1 file changed, 11 insertions(+), 7 deletions(-) > >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 3c3c64d686..3d74110dcb 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -418,7 +418,7 @@ > <td class="copynumber"> > <input > disabled="disabled" >- type="radio" >+ type="[% reserve_input_type | html %]" > aria-label="Cannot be put on hold" > class="checkitem" > name="checkitem" >@@ -578,17 +578,17 @@ > toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options")); > }); > }); >- if( $(".holddatefrom").prop('required') || $(".futuredate").prop('required') ) $(".toggle-hold-options").click(); >+ if( $(".holddatefrom").prop('required') || $(".futuredate").prop('required') ) $(".toggle-hold-options").trigger('click'); > > // Hides all 'specific copy' table rows on load. > $(".copiesrow").hide(); > > [% FOREACH bibitemloo IN bibitemloop %] > [% IF bibitemloo.force_hold %] >- if( $("#to[% bibitemloo.biblionumber | html %]").parent(":hidden").length ) >- $("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click(); >- $("#reqspecific_[% bibitemloo.biblionumber | html %]").click(); >- $("#copiesrow_[% bibitemloo.biblionumber | html %]").show(); >+ if( $("#hold-options-[% bibitemloo.biblionumber | html %]").is(":hidden") ) >+ $("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").trigger('click'); >+ $("#reqspecific_[% bibitemloo.biblionumber | html %]").prop('checked','checked'); >+ $("#copiesrow_[% bibitemloo.biblionumber | html %]").css('display',''); > [% END %] > [% END %] > >@@ -692,7 +692,7 @@ > // If required hold note is empty, make it visible > if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) { > if( !$("#hold-options-"+biblioNum).is(':visible')) { >- $("#toggle-hold-options-"+biblioNum).click(); >+ $("#toggle-hold-options-"+biblioNum).trigger('click'); > } > } > >@@ -754,7 +754,11 @@ > $(this).DataTable({ > dom: "t", > initComplete: function() { >+ // Only select first radio button (if any) > this.find("input:radio").first().prop("checked", true ); >+ // If there is only one checkbox, select that one >+ if( this.find("tr.holdable input:checkbox").length == 1 ) >+ this.find("tr.holdable input:checkbox").prop("checked", true ); > }, > paging: false > }); >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41335
:
190118
| 190120