Bugzilla – Attachment 20488 Details for
Bug 10314
CanItemBeReserved does not respect the holds policies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 10314 - CanItemBeReserved does not respect the holds policies
PASSED-QA-Bug-10314---CanItemBeReserved-does-not-r.patch (text/plain), 3.00 KB, created by
Katrin Fischer
on 2013-08-20 05:51:22 UTC
(
hide
)
Description:
[PASSED QA] Bug 10314 - CanItemBeReserved does not respect the holds policies
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-08-20 05:51:22 UTC
Size:
3.00 KB
patch
obsolete
>From d35e8a416a894c7e3c4eefaca73bd76cb5f50ff9 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 22 May 2013 16:12:43 -0400 >Subject: [PATCH] [PASSED QA] Bug 10314 - CanItemBeReserved does not respect > the holds policies > >CanItemBeReserved will return 1 as long as the circulation rules have a >non-zero number of holds allowed and the patron hasn't reached his or >her "Holds allowed" count. However, the subroutine completely ignores >the holds policies which would contravene reserving the item even if the >patron has not reached the maximum holds allowed count. > >Test Plan: >1) Place an item on hold for a patron >2) Clear any existing hold policies >3) Set the appropriate circ rule so that the patron should be allowed >4) Attempt to place am item-level hold for this item/patron, it should succeed >5) Create a hold policy rule that would stop this patron from placing > a hold on this item >6) Attempt to place an item-level hold on this item/patron, it should > fail, but instead it will succeed >7) Apply this patch >8) Repeat step 6, this time you should be unable to place a specific > hold on this item > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Testing notes on last patch in series. >--- > C4/Reserves.pm | 30 ++++++++++++++++++++++++++++-- > 1 file changed, 28 insertions(+), 2 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index d6812f1..32846ce 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -447,8 +447,34 @@ sub CanItemBeReserved{ > # we retrieve borrowers and items informations # > my $item = GetItem($itemnumber); > my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber); >- >- # we retrieve user rights on this itemtype and branchcode >+ >+ >+ # Before we check too see if the borrower has exceed the >+ # maximum number of holds allowed for this itemtype, >+ # we need to check to see if *any* holds are allowed >+ # for this patron/itemtype as determined by the holds policy >+ my $holds_policy = GetBranchItemRule( >+ $controlbranch eq "ItemHomeLibrary" >+ ? $item->{homebranch} >+ : $borrower->{branchcode}, >+ >+ $item->{itype} >+ ); >+ >+ if ( $holds_policy->{holdallowed} == 0 ) { >+ >+ # If holdallowed is 0, we can quit right here >+ return 0; >+ } >+ elsif ( $holds_policy->{holdallowed} == 1 ) { >+ >+ # If it's 1, then only patrons from the item's home library may put this book on hold. >+ return 0 unless ( $borrower->{'branchcode'} eq $item->{'homebranch'} ); >+ } >+ >+ # If we've gotten this far, the holds policy does not prevent the patron >+ # from placing this hold. We now need to see if the patron has exceeded >+ # the maximum number of holds allowed for this itemtype based on the patrons > my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed > FROM issuingrules > WHERE (categorycode in (?,'*') ) >-- >1.7.9.5
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 10314
:
18345
|
18346
|
18485
|
18486
|
20231
|
20488
|
20489
|
20490
|
40761
|
40762