Bugzilla – Attachment 120905 Details for
Bug 28338
Validate item holdability and pickup location separately
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28338: Default to holding branch to save clicks
Bug-28338-Default-to-holding-branch-to-save-clicks.patch (text/plain), 4.29 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-05-12 20:14:37 UTC
(
hide
)
Description:
Bug 28338: Default to holding branch to save clicks
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-05-12 20:14:37 UTC
Size:
4.29 KB
patch
obsolete
>From d4c383f5b90c0296a31a7126943b8340dabeb650 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 12 May 2021 17:02:27 -0300 >Subject: [PATCH] Bug 28338: Default to holding branch to save clicks > >This patch makes request.pl pass the holding library object to the >template, if it is a valid pickup location for the item. This way, the >template can set a good default to save clicks. > >To test: >1. Have "Hold pickup library match" set to "Item's home library" >2. Have a record with items in three different branches. For example: > - item1: homebranch: MPL, holdingbranch: MPL > - item2: homebranch: FPL, holdingbranch: FPL > - item3: homebranch: CPL, holdingbranch: IPT >3. Have FPL marked as 'No' for pickup location >4. On the record, open the page for placing a hold for a patron > (acevedo?) >=> SUCCESS: You are presented the regular hold placing page, with an >extra column on the items for pickup location setting >=> SUCCESS: The item2 (on FPL) cannot be selected, there's a clear message >about not having valid pickup locations >=> FAIL: The other ones don't have anything pre-selected on the >dropdowns >5. Apply this patch >6. Repeat 4 (go back to the record, etc) >=> SUCCESS: Nothing changed BUT the item with holding branch = MPL has >it set by default in the dropdown. >=> SUCCESS: IPT is not a valid pickup location for item3, so not set by >default in this case. >7. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 6 +++++- > reserve/request.pl | 6 +++++- > 2 files changed, 10 insertions(+), 2 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 7b6fbf77b57..3a0b8546c02 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -726,7 +726,11 @@ > [% IF (itemloo.pickup_locations_count > 0) %] > <select name="item_pickup" class="pickup_locations" > data-item-id="[% itemloo.itemnumber | html %]" >- data-patron-id="[% patron.borrowernumber | html %]"></select> >+ data-patron-id="[% patron.borrowernumber | html %]"> >+ [% IF (itemloo.default_pickup_location) %] >+ <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option> >+ [% END %] >+ </select> > [% END %] > </td> > </tr> >diff --git a/reserve/request.pl b/reserve/request.pl >index b570818b759..f9847ada773 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -578,10 +578,14 @@ foreach my $biblionumber (@biblionumbers) { > ) > { > # Send the pickup locations count to the UI, the pickup locations will be pulled using the API >- $item->{pickup_locations_count} = $item_object->pickup_locations({ patron => $patron })->count; >+ my $pickup_locations = $item_object->pickup_locations({ patron => $patron }); >+ $item->{pickup_locations_count} = $pickup_locations->count; > if ( $item->{pickup_locations_count} > 0 ) { > $num_available++; > $item->{available} = 1; >+ # pass the holding branch for use as default >+ my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next; >+ $item->{default_pickup_location} = $default_pickup_location; > } > else { > $item->{available} = 0; >-- >2.31.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 28338
:
120896
|
120905
|
120908
|
120920
|
120921
|
120931
|
120932
|
120938
|
120939