Bugzilla – Attachment 119722 Details for
Bug 27864
Visual feedback on overridden pickup locations when placing biblio-level hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27864: Visual feedback on overridden pickup locations when placing hold
Bug-27864-Visual-feedback-on-overridden-pickup-loc.patch (text/plain), 3.75 KB, created by
Martin Renvoize (ashimema)
on 2021-04-16 12:17:01 UTC
(
hide
)
Description:
Bug 27864: Visual feedback on overridden pickup locations when placing hold
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-04-16 12:17:01 UTC
Size:
3.75 KB
patch
obsolete
>From ccfe150cda7c47773c105830e084e8f6cd9c4a0c 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 27864: Visual feedback on overridden pickup locations > when placing hold > >This patch makes the form for placing a hold, use the API to retrieve >the valid pickup locations for a biblio. > >To test: >1. Try placing a hold on a biblio with several items. >=> SUCCESS: You get a list of valid pickup locations >=> FAIL: There's no sign they are overrides to rules >2. Apply this patch >3. Repeat 1 >=> SUCCESS: Same behavior as before, but there's a sign >+tooltip for overridden ones. >4. Sign off :-D > >Note: styling follow-up coming >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/modules/reserve/request.tt | 37 +++++++++++++++++++ > reserve/request.pl | 2 +- > 2 files changed, 38 insertions(+), 1 deletion(-) > >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 963889cc68..981659fbab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1230,6 +1230,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 dffe1da436..6570f1f29f 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.20.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 27864
:
118232
|
118236
|
119722
|
119723
|
120012
|
120013
|
120014
|
120015
|
120170
|
120243
|
120244
|
120245
|
120341
|
120342