Bugzilla – Attachment 140953 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), 9.77 KB, created by
Nick Clemens (kidclamp)
on 2022-09-23 15:52:37 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-09-23 15:52:37 UTC
Size:
9.77 KB
patch
obsolete
>From f9077ac101d2fb35b66d9e23582ec14d64636402 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 23 Sep 2022 15:30:03 +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 >--- > .../prog/en/modules/reserve/request.tt | 90 ++++++++++--------- > 1 file changed, 48 insertions(+), 42 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 beaed01f15..8a0a2fdf1e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -536,28 +536,6 @@ > <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> >@@ -570,19 +548,51 @@ > <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" /> > </li> > >+ >+ <li id="non_priority_list_item"> >+ <label for="non_priority">Non priority hold:</label> >+ <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> >+ </ol> >+ <fieldset class="rows"> >+ <legend> >+ <label for="requestany"> >+ Hold next available item >+ </label> >+ </legend> >+ [% 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 %]" /> >+ <ol> >+ > <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 %]" /> >+ <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> >@@ -591,13 +601,9 @@ > [% ELSE %] > <input type="hidden" name="holds_to_place_count" value="1" /> > [% END %] >+ </ol> >+ </fieldset> > >- <li id="non_priority_list_item"> >- <label for="non_priority">Non priority hold:</label> >- <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> >- </ol> > > <fieldset class="action"> > [% IF ( patron.borrowernumber ) %] >@@ -1285,9 +1291,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(); >@@ -1523,10 +1529,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