Bugzilla – Attachment 140907 Details for
Bug 31579
Improve reserve/request.pl to avoid mistakes with pick up locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31579: Improve reserve/request.pl to avoid mistakes with pick up locations
Bug-31579-Improve-reserverequestpl-to-avoid-mistak.patch (text/plain), 5.97 KB, created by
geraud.frappier
on 2022-09-23 13:42:19 UTC
(
hide
)
Description:
Bug 31579: Improve reserve/request.pl to avoid mistakes with pick up locations
Filename:
MIME Type:
Creator:
geraud.frappier
Created:
2022-09-23 13:42:19 UTC
Size:
5.97 KB
patch
obsolete
>From 7944797f585002626d8ce1b17dcdcc4d57217467 Mon Sep 17 00:00:00 2001 >From: "geraudmj2@gmail.com" <geraud@inlibro.com> >Date: Thu, 22 Sep 2022 15:04:14 -0400 >Subject: [PATCH] Bug 31579: Improve reserve/request.pl to avoid mistakes with > pick up locations >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Reported-by: Géraud Frappier <geraud.frappier@inlibro.com> > > In the place hold page reserve/request.pl, there are two sections. > One is the "Hold details" section which allow for record hold. The other is "Place a hold on a specific item" which speaks for itself. > The pick-up location by default is the signed-in user (the employee). > But it is different from the "Allowed pick-up location" for the item which defaults to the homebranch. > The wording should be "Pick-up location", btw, the "Allowed" states there's a list, not that the user should select it. > > This patch will resolve this problem. > > To test: > 1) Go in System preferences and find the "UseBranchTransfertLimits". > 2) Change the value of "Don't enforce" to "Enforce". > 3) Come back on the menu and search a catalog. > 4) Click on "Place a hold" and enter the name of a patron. > 5) In the sections Hold details change the value of "pickup at" by choosing an other library. > 6) Observe that the web page is refreshed, but in the second section the list of "allowed pickup locations" didn't changed. > 7) Apply the patch. > 8) Redo 3-4-5-6. > 9) See that the values of the list of "Allowed pickup locations" has changed to the library you have chosen. >--- > .../prog/en/modules/reserve/request.tt | 33 ++++++++++++------- > 1 file changed, 22 insertions(+), 11 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 eb37dbc00e..6b37f28bee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -743,12 +743,16 @@ > </td> > <td> > [% IF (itemloo.pickup_locations_count > 0) %] >+ [% UNLESS ( multi_hold ) %] > <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;" > data-item-id="[% itemloo.itemnumber | html %]" > data-patron-id="[% patron.borrowernumber | html %]" > data-pickup-location-source="item"> >- [% IF (itemloo.default_pickup_location) %] >- <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option> >+ [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %] >+ [% ELSE %] >+ [% IF (itemloo.default_pickup_location) %] >+ <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option> >+ [% END %] > [% END %] > </select> > [% END %] >@@ -1269,7 +1273,6 @@ > var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); > $.fn.select2.defaults.set("width", "100%" ); > $.fn.select2.defaults.set("dropdownAutoWidth", true ); >- > $(document).ready(function() { > $('#cancellation-reason-fieldset').hide(); > $('.rank-request').on('change', function() { >@@ -1293,7 +1296,6 @@ > }); > } > >- > function ToggleHoldsToPlace() { > if ( $("#requestany").prop('checked') ) { > $("#holds_to_place_count").prop('disabled', false); >@@ -1307,13 +1309,14 @@ > }); > > [% IF Koha.Preference('UseBranchTransferLimits') %] >- $("#pickup").on('change', function(){ >- var pickup = $("#pickup").val(); >- var url = "?pickup=" + pickup; >- url += "&borrowernumber=" + borrowernumber; >- url += "&biblionumber=" + biblionumbers[0]; >- window.location.replace(url); >- }); >+ $("#pickup").on('change', function(){ >+ $(".pickup_locations option:selected").text('Le nouveau texte à afficher'); >+ var pickup = $("#pickup").val(); >+ var url = "?pickup=" + pickup; >+ url += "&borrowernumber=" + borrowernumber; >+ url += "&biblionumber=" + biblionumbers[0]; >+ window.location.replace(url); >+ }); > [% END %] > > var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, { >@@ -1424,6 +1427,14 @@ > $(".pickup_locations").each(function () { > $(this).pickup_locations_dropdown(); > }); >+ >+ const pickup_location_code = window.location.search.substring(1).split('&').filter(tableau => tableau.split('=')[0] == 'pickup'); >+ >+ if(pickup_location_code.length > 0 ){ >+ $(".pickup_locations").val(pickup_location_code[0].split('=')[1]); >+ } >+ >+ > }); > > function check( table ) { >-- >2.34.1
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 31579
:
140907
|
140917
|
140997
|
141007
|
141033
|
144634
|
154550
|
158100
|
158104