Bugzilla – Attachment 60286 Details for
Bug 17453
Inter-site holds improvement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17453: Inter-site holds improvement
Bug-17453-Inter-site-holds-improvement.patch (text/plain), 7.05 KB, created by
Nick Clemens (kidclamp)
on 2017-02-15 20:22:08 UTC
(
hide
)
Description:
Bug 17453: Inter-site holds improvement
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-02-15 20:22:08 UTC
Size:
7.05 KB
patch
obsolete
>From 7dd868bfcd019667255a95b461b997e416884c31 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 18 Oct 2016 14:02:58 +0100 >Subject: [PATCH] Bug 17453: Inter-site holds improvement >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >At the moment users can reserve items and choose any library as a pick up >location, but there is no mechanism to prevent users from reserving items that >are available on the shelf at any given location from reserving the item at the >same location, essentially creating a Fetch and Collect scenario. >This has an impact on staff workloads as they are having to process reservations >and check shelves for items that students can already come and collect from the >open library shelves. >The aim of this enhancement is to decrease the impact on staff workload there >should be a restriction in place that prevents users from requesting items for >collection at a library where the item is currently available. > >Implementation: >We first tried to add a new circulation rule adding a 4th >âNotIfAvailableAtPickupLibraryâ option to "On shelf holds allowed". >That would make the development more flexible. >But in that case we quickly faced non-trivial problematics: >Let's say you have 3 items I1, I2 and I3. The first one has onshelfholds >set to Yes and 2 others has it set to âNotIfAvailableAtPickupLibraryâ. >What would be the expected behavior if a hold is placed at biblio level? >And if a hold is placed at item level for I1? >This second point could be answered by reworking the interface to move >the libraries dropdown list elsewhere (1 list per item) or by adding a >lot of JS code to handle the different situation. But it would be >much more complicated to implement. >So finally I moved back to the simple approach and added a new pref to >handle the behavior globally. > >Test plan: >0/ Switch off OPACHoldsIfAvailableAtPickup >1/ Let's say you have 3 libraries L1, L2, L3, create 2 items owned by L1 >and L2 >2/ Place a biblio level hold. You should only be able to pick it up at >L3 >2/ Place a item level hold. You should only be able to pick it up at >L3 >3/ Create a third items owned by L3 >4/ Now you should not be able to place a hold on this record anymore > >Sponsored-by: University of the Arts London > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >https://bugs.koha-community.org/show_bug.cgi?id=14753 >--- > .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 11 ++++++++++- > opac/opac-reserve.pl | 23 ++++++++++++++++++++++ > 2 files changed, 33 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index c0dd300..7bb7bd2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -219,7 +219,16 @@ > </select> > [% ELSE %] > <select name="branch" id="branch_[% bibitemloo.biblionumber %]"> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] >+ [% FOREACH library IN Branches.all( selected => branch) %] >+ [% SET pickup_available_at = bibitemloo.not_available_at.grep(library.branchcode).size ? 0 : 1 %] >+ [% IF library.selected AND pickup_available_at %] >+ <option value="[% library.branchcode %]" selected="selected" >[% library.branchname %]</option> >+ [% ELSIF pickup_available_at %] >+ <option value="[% library.branchcode %]">[% library.branchname %]</option> >+ [% ELSE %] >+ <option value="[% library.branchcode %]" disabled="disabled" title="At least one item is available at this library">[% library.branchname %]</option> >+ [% END %] >+ [% END %] > </select> > [% END # / UNLESS bibitemloo.holdable %] > </li> >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index f1fe2ff..1ba5ab3 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -278,6 +278,10 @@ if ( $query->param('place_reserve') ) { > $canreserve = 0; > } > >+ unless ( C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) { >+ $canreserve = 0 if Koha::Items->search({ biblionumber => $biblioNum, holdingbranch => $branch })->count; >+ } >+ > my $itemtype = $query->param('itemtype') || undef; > $itemtype = undef if $itemNum; > >@@ -378,6 +382,7 @@ $template->param('item_level_itypes' => $itemLevelTypes); > > foreach my $biblioNum (@biblionumbers) { > >+ my @not_available_at = (); > my $record = GetMarcBiblio($biblioNum); > # Init the bib item with the choices for branch pickup > my %biblioLoopIter; >@@ -520,6 +525,10 @@ foreach my $biblioNum (@biblionumbers) { > $biblioLoopIter{force_hold} = 1 if $hold_allowed eq 'F'; > } > $numCopiesAvailable++; >+ >+ if ( not C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) { >+ push @not_available_at, $itemInfo->{holdingbranch}; >+ } > } > > $itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} ); >@@ -548,6 +557,20 @@ foreach my $biblioNum (@biblionumbers) { > $biblioLoopIter{already_patron_possession} = 1; > } > >+ if ( $biblioLoopIter{holdable} ) { >+ @not_available_at = uniq @not_available_at; >+ $biblioLoopIter{not_available_at} = \@not_available_at ; >+ } >+ >+ unless ( C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) { >+ @not_available_at = uniq @not_available_at; >+ $biblioLoopIter{not_available_at} = \@not_available_at ; >+ # The record is not holdable is not available at any of the libraries >+ if ( Koha::Libraries->search->count == @not_available_at ) { >+ $biblioLoopIter{holdable} = 0; >+ } >+ } >+ > $biblioLoopIter{holdable} &&= CanBookBeReserved($borrowernumber,$biblioNum) eq 'OK'; > > # For multiple holds per record, if a patron has previously placed a hold, >-- >2.1.4
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 17453
:
56623
|
56624
|
56762
|
56994
|
57002
|
57003
|
57004
|
57005
|
59915
|
59916
|
60093
|
60102
|
60285
| 60286 |
60287
|
60288
|
60289
|
60290
|
60291