Bugzilla – Attachment 94490 Details for
Bug 22284
Add ability to define groups of locations for hold pickup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22284: New message, new column and filter pickup locations in reserve/request.tt
Bug-22284-New-message-new-column-and-filter-pickup.patch (text/plain), 7.15 KB, created by
Agustín Moyano
on 2019-10-21 18:07:30 UTC
(
hide
)
Description:
Bug 22284: New message, new column and filter pickup locations in reserve/request.tt
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2019-10-21 18:07:30 UTC
Size:
7.15 KB
patch
obsolete
>From 8dfe5bcfe7102431fc7e7ce18025e35a73fcc2a5 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Thu, 4 Apr 2019 01:10:16 -0300 >Subject: [PATCH] Bug 22284: New message, new column and filter pickup > locations in reserve/request.tt > >This patch adds a new message to 'Hold' column in 'Place a hold on a specific item' table. > >The message is "Cannot place hold from patrons's library". It appears when patron's homebranch is not in item's hold group, and hold_fulfillment_policy is set to 'holdgroup'. > >This patch also adds a new column "Allowed pickup locations" that lists allowed pickup locations per item. > >Finally, the select that displays pickup locations is filtered by allowed pickup locations, when multi_hold is not enabled > >To test: >1) Apply this patch >2) In library groups add a root group and check it as hold group. >3) Add two libraries to the group >4) In circulation and fines rules, in 'Default checkout, hold and return policy', in Hold policy change the value to 'From local hold group' >5) Search a patron from a different library than step 3, select one and click 'search to hold' >6) Search by location for items in any library of step 3 >7) On any item, clic on 'Place hold for ...' >SUCCESS => when the page is loaded, in the 'Place a hold on a specific item', you should see the message "Cannot place hold from patrons's library" in 'Hold' column > => You should see a new column called "Allowed pickup locations" and the message is "Any library" >8) In circulation and fines rules, in 'Default checkout, hold and return policy', in 'Hold policy' change the value again to 'From any library' and change 'Hold pickup library match' to "Item's hold group" >8) Repeat steps 5 to 7 >SUCCESS => when the page is loaded, you should see the "Pickup at" select filtered by libraries in hold group > => You should see in "Allowed pickup locations" a coma separated list of the libraries in item's hold group > => If biblio has an item whose control branch is not in a hold group, you should see the control branch name in "Allowed pickup locations" >9) Sign off > >Sponsored-by: VOKAL >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >--- > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 12 +++++++++++- > reserve/request.pl | 9 +++++++-- > 2 files changed, 18 insertions(+), 3 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 43c0f2aa84..4b3d20c1b4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -424,7 +424,11 @@ > <li> > <label for="pickup">Pickup at:</label> > <select name="pickup" size="1" id="pickup"> >- [% PROCESS options_for_libraries libraries => Branches.all({ selected => pickup, search_params => { pickup_location => 1 } }) %] >+ [% 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 %] > </select> > </li> > >@@ -540,6 +544,7 @@ > <th>Vol no.</th> > [% END %] > <th class="title-string">Information</th> >+ <th class="title-string">Allowed pickup locations</th> > </tr> > </thead> > <tbody> >@@ -576,6 +581,8 @@ > Not holdable > [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %] > Patron is from different library >+ [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %] >+ Cannot place hold from patrons's library > [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %] > Patron already has hold for this item > [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %] >@@ -673,6 +680,9 @@ > <span class="nfl">Not for loan ([% AuthorisedValues.GetByCode( 'NOT_LOAN', itemloo.notforloan ) | html %])</span> > [% END %] > </td> >+ <td> >+ [% itemloo.pickup_locations | html %] >+ </td> > </tr> > [% END # / UNLESS itemloo.hide %] > [% END # /FOREACH itemloo %] >diff --git a/reserve/request.pl b/reserve/request.pl >index c5014820f6..ddac5c8b9c 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -298,7 +298,7 @@ foreach my $biblionumber (@biblionumbers) { > my $force_hold_level; > if ( $patron ) { > { # CanBookBeReserved >- my $canReserve = CanBookBeReserved( $patron->borrowernumber, $biblionumber, $pickup ); >+ my $canReserve = CanBookBeReserved( $patron->borrowernumber, $biblionumber ); > if ( $canReserve->{status} eq 'OK' ) { > > #All is OK and we can continue >@@ -548,7 +548,7 @@ foreach my $biblionumber (@biblionumbers) { > > $item->{'holdallowed'} = $branchitemrule->{'holdallowed'}; > >- my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber, $pickup ); >+ my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber ); > $item->{not_holdable} = $can_item_be_reserved->{status} unless ( $can_item_be_reserved->{status} eq 'OK' ); > > $item->{item_level_holds} = Koha::IssuingRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } ); >@@ -562,6 +562,11 @@ foreach my $biblionumber (@biblionumbers) { > { > $item->{available} = 1; > $num_available++; >+ if($branchitemrule->{'hold_fulfillment_policy'} eq 'any' ) { >+ $item->{pickup_locations} = 'Any library'; >+ } else { >+ $item->{pickup_locations} = join (', ', map { $_->{branchname} } Koha::Items->find($itemnumber)->pickup_locations()); >+ } > > push( @available_itemtypes, $item->{itype} ); > } >-- >2.17.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 22284
:
88138
|
88139
|
88140
|
88141
|
88142
|
88143
|
88144
|
88145
|
88369
|
88561
|
88793
|
88794
|
88795
|
88796
|
88797
|
88798
|
88799
|
88800
|
88801
|
88802
|
88939
|
88940
|
88941
|
88942
|
88943
|
88944
|
88945
|
88946
|
88947
|
88948
|
88949
|
88955
|
88956
|
88957
|
88958
|
88959
|
88960
|
88961
|
88962
|
88963
|
88964
|
88965
|
89060
|
89061
|
89062
|
89063
|
89064
|
89065
|
89066
|
89067
|
89068
|
89069
|
89070
|
89071
|
89072
|
89073
|
89074
|
89075
|
89076
|
89077
|
89078
|
89079
|
89080
|
89081
|
89082
|
89083
|
89084
|
89085
|
89122
|
89123
|
89124
|
89125
|
89126
|
89127
|
89128
|
89129
|
89130
|
89131
|
89132
|
89133
|
89134
|
89135
|
89523
|
89836
|
89837
|
89838
|
89839
|
89840
|
89841
|
89842
|
89843
|
89844
|
89845
|
89846
|
89847
|
89848
|
89849
|
90133
|
90134
|
90197
|
90198
|
90199
|
90200
|
90201
|
90469
|
90525
|
91261
|
91262
|
91263
|
91264
|
91265
|
91266
|
91267
|
91268
|
91269
|
91270
|
91271
|
91272
|
91273
|
91274
|
91275
|
91276
|
91277
|
91278
|
91279
|
91280
|
91282
|
91701
|
91702
|
91703
|
91704
|
91705
|
91706
|
91707
|
91708
|
91709
|
91710
|
91711
|
91712
|
91713
|
91714
|
91715
|
91716
|
91717
|
91718
|
91719
|
91720
|
91721
|
91750
|
91751
|
91752
|
91753
|
91754
|
91755
|
91756
|
91757
|
91758
|
92554
|
92555
|
92556
|
92557
|
92558
|
92559
|
92560
|
92561
|
92562
|
92563
|
92564
|
92565
|
92566
|
92567
|
92568
|
92569
|
92570
|
92571
|
92572
|
92573
|
92574
|
92752
|
92753
|
92754
|
92755
|
92756
|
92757
|
92758
|
92759
|
92760
|
92761
|
92762
|
92763
|
92764
|
92849
|
92850
|
92851
|
92852
|
92853
|
92854
|
92855
|
92856
|
92857
|
92858
|
92859
|
92860
|
92861
|
94483
|
94484
|
94485
|
94486
|
94487
|
94488
|
94489
|
94490
|
94491
|
94492
|
94493
|
94494
|
94495
|
96437
|
96438
|
96439
|
96440
|
96441
|
96442
|
96443
|
96444
|
96445
|
96446
|
96447
|
96448
|
96449
|
96450
|
96544
|
96545
|
96546
|
96547
|
96548
|
96549
|
96550
|
96551
|
96552
|
96553
|
96554
|
96555
|
96556
|
96557
|
96558
|
115202