Bugzilla – Attachment 118216 Details for
Bug 27932
Add GET /biblios/:biblio_id/pickup_locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27932: Visual feedback on overridden pickup locations when placing hold
Bug-27932-Visual-feedback-on-overridden-pickup-loc.patch (text/plain), 4.82 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-12 21:01:56 UTC
(
hide
)
Description:
Bug 27932: Visual feedback on overridden pickup locations when placing hold
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-12 21:01:56 UTC
Size:
4.82 KB
patch
obsolete
>From ca3af62a332db7c20b4b376f51c9c2d4df4543d4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 12 Mar 2021 18:01:28 -0300 >Subject: [PATCH] Bug 27932: Visual feedback on overridden pickup locations > when placing hold > >--- > .../prog/en/modules/reserve/request.tt | 50 ++++++++++++++++--- > reserve/request.pl | 2 +- > 2 files changed, 45 insertions(+), 7 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 957f0bec6fe..cdf8b396d35 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -415,12 +415,13 @@ > </li> > <li> > <label for="pickup">Pickup at:</label> >- <select name="pickup" size="1" id="pickup"> >- [% UNLESS ( multi_hold ) %] >- [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %] >- [% ELSE %] >- [% PROCESS options_for_libraries libraries => Branches.all({ selected => pickup, search_params => { pickup_location => 1 } }) %] >- [% END %] >+ [% UNLESS ( multi_hold ) %] >+ <select name="pickup" size="1" id="pickup" data-biblio-id="[% biblio.biblionumber | html %]" data-patron-id="[% patron.borrowernumber | html %]"> >+ <option selected="selected" value="[% pickup | html %]">[% Branches.GetName(pickup) | html %]</option> >+ [% ELSE %] >+ <select name="pickup" size="1" id="pickup" data-patron-id="[% patron.borrowernumber | html %]"> >+ [% PROCESS options_for_libraries libraries => Branches.all({ selected => pickup, search_params => { pickup_location => 1 } }) %] >+ [% END %] > </select> > </li> > >@@ -1208,6 +1209,43 @@ > templateResult: display_pickup_location > }); > }); >+ $("#pickup").each( function () { >+ var this_dropdown = $(this); >+ var patron_id = $(this).data('patron-id'); >+ var biblio_id = $(this).data('biblio-id'); >+ >+ this_dropdown.select2({ >+ allowClear: false, >+ ajax: { >+ url: '/api/v1/biblios/' + encodeURIComponent(biblio_id) + '/pickup_locations', >+ delay: 300, // wait 300 milliseconds before triggering the request >+ dataType: 'json', >+ data: function (params) { >+ var search_term = (params.term === undefined) ? '' : params.term; >+ var query = { >+ "q": JSON.stringify({"name":{"-like":search_term+'%'}}), >+ "_order_by": "name", >+ "patron_id": patron_id >+ }; >+ return query; >+ }, >+ processResults: function (data) { >+ var results = []; >+ data.forEach( function ( pickup_location ) { >+ results.push( >+ { >+ "id": pickup_location.library_id.escapeHtml(), >+ "text": pickup_location.name.escapeHtml(), >+ "needs_override": pickup_location.needs_override >+ } >+ ); >+ }); >+ return { "results": results }; >+ } >+ }, >+ templateResult: display_pickup_location >+ }); >+ }); > }); > > function check() { >diff --git a/reserve/request.pl b/reserve/request.pl >index 1751a0aa921..b7b09f77acf 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -67,7 +67,7 @@ my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( > ); > > my $showallitems = $input->param('showallitems'); >-my $pickup = $input->param('pickup'); >+my $pickup = $input->param('pickup') || C4::Context->userenv->{'branch'}; > > my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; > >-- >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 27932
:
118168
|
118169
|
118172
|
118173
|
118216
|
119715
|
119716