Bugzilla – Attachment 134492 Details for
Bug 30579
When placing item level hold, some options that are not used are not disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30579: Group next available hold options, and disable when item is chosen
Bug-30579-Group-next-available-hold-options-and-di.patch (text/plain), 10.31 KB, created by
Nick Clemens (kidclamp)
on 2022-05-03 10:22:48 UTC
(
hide
)
Description:
Bug 30579: Group next available hold options, and disable when item is chosen
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-05-03 10:22:48 UTC
Size:
10.31 KB
patch
obsolete
>From cdf0a425045340f977d982a09d732755fa948dba Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >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 > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us> >--- > .../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 9ae668e72e..e9cbc21e48 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -467,53 +467,13 @@ > <label for="holdnotes">Notes:</label> > <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea> > </li> >- <li> >- <label for="pickup">Pickup at:</label> >- <select name="pickup" id="pickup" >- data-biblio-id="[% biblio.biblionumber | html %]" >- data-patron-id="[% patron.borrowernumber | html %]" >- data-pickup-location-source="biblio"> >- [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %] >- </select> >- </li> >- [% IF Koha.Preference('AllowHoldItemTypeSelection') %] >- <li> >- <label for="itemtype">Request specific item type:</label> >- <select name="itemtype" id="itemtype"> >- <option value="">Any item type</option> >- [%- FOREACH itemtype IN available_itemtypes %] >- <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option> >- [%- END %] >- </select> >- </li> >- [% END %] > [% IF ( reserve_in_future ) %] > <li> > <label for="from">Hold starts on date:</label> > <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" /> > </li> > [% END %] >- <li> >- <label for="requestany">Hold next available item </label> >- [% IF force_hold_level == 'item' %] >- <input type="checkbox" id="requestany" name="request" disabled="true" /> >- [% ELSIF force_hold_level == 'record' %] >- <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/> >- <input type="hidden" name="request" value="Any"/> >- [% ELSE %] >- <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" /> >- [% END %] >- <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" /> >- </li> > >- [% IF remaining_holds_for_record > 1 %] >- <li> >- <label for="holds_to_place_count">Holds to place (count)</label> >- <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" maxlength="[% remaining_holds_for_record | html %]" value="1" /> >- </li> >- [% ELSE %] >- <input type="hidden" name="holds_to_place_count" value="1" /> >- [% END %] > > <li> > <label for="to">Hold expires on date:</label> >@@ -524,6 +484,52 @@ > <input name="non_priority" id="non_priority" type="checkbox" /> > <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span> > </li> >+ <fieldset> >+ <legend> >+ <label for="requestany"> >+ Hold next available item >+ [% IF force_hold_level == 'item' %] >+ <input type="checkbox" id="requestany" name="request" disabled="true" /> >+ [% ELSIF force_hold_level == 'record' %] >+ <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/> >+ <input type="hidden" name="request" value="Any"/> >+ [% ELSE %] >+ <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" /> >+ [% END %] >+ <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" /> >+ </label> >+ </legend> >+ <ol> >+ <li> >+ <label for="pickup">Pickup at:</label> >+ <select name="pickup" id="pickup" >+ data-biblio-id="[% biblio.biblionumber | html %]" >+ data-patron-id="[% patron.borrowernumber | html %]" >+ data-pickup-location-source="biblio"> >+ [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %] >+ </select> >+ </li> >+ [% IF Koha.Preference('AllowHoldItemTypeSelection') %] >+ <li> >+ <label for="itemtype">Request specific item type:</label> >+ <select name="itemtype" id="itemtype"> >+ <option value="">Any item type</option> >+ [%- FOREACH itemtype IN available_itemtypes %] >+ <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option> >+ [%- END %] >+ </select> >+ </li> >+ [% END %] >+ [% IF remaining_holds_for_record > 1 %] >+ <li> >+ <label for="holds_to_place_count">Holds to place (count)</label> >+ <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" maxlength="[% remaining_holds_for_record | html %]" value="1" /> >+ </li> >+ [% ELSE %] >+ <input type="hidden" name="holds_to_place_count" value="1" /> >+ [% END %] >+ </ol> >+ </fieldset> > </ol> > <fieldset class="action"> > [% IF ( patron.borrowernumber ) %] >@@ -1249,9 +1255,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(); >@@ -1491,10 +1497,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
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 30579
:
133549
|
133550
|
133574
|
133575
|
133689
|
133690
|
134270
|
134468
|
134469
|
134491
|
134492
|
134493
|
134893
|
134894
|
140951
|
140952
|
140953
|
140954
|
148835
|
148898
|
149271
|
150767
|
150786
|
151483
|
151493
|
151558
|
154881
|
154882
|
154883
|
154886
|
157787
|
157788
|
157789
|
157790
|
157791
|
157792
|
157937
|
157938
|
157939
|
157940
|
157941
|
157942
|
157943
|
163260
|
163261
|
163262
|
163263
|
163264
|
163265
|
163266
|
163267
|
166012
|
166013
|
166014
|
166015
|
166016
|
166017
|
166018
|
166019
|
166034
|
166035
|
166036
|
166037
|
166038
|
166039
|
166040
|
166041
|
166074
|
166075
|
166076
|
166077
|
166078
|
166079
|
166080
|
166081
|
166082
|
166264
|
166265
|
166266
|
166267
|
166268
|
166269
|
166270
|
166271
|
166272
|
166273
|
166274
|
166275