Bugzilla – Attachment 2218 Details for
Bug 4850
CheckReserves does not respect holds circulation policies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for Bug 4850
0001-Fixes-bug-4850-CheckReserves-not-respecting-BranchI.patch (text/plain), 2.64 KB, created by
Ian Walls
on 2010-06-04 15:47:01 UTC
(
hide
)
Description:
Patch for Bug 4850
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2010-06-04 15:47:01 UTC
Size:
2.64 KB
patch
obsolete
>From d545f9badfd97795273b8ffaf830c73fe8c40d2c Mon Sep 17 00:00:00 2001 >From: Ian Walls <ian.walls@bywatersolutions.com> >Date: Thu, 3 Jun 2010 22:21:13 +0000 >Subject: [PATCH] Fixes bug 4850: CheckReserves not respecting BranchItemRules > CheckReserves now consults GetBranchItemRules to see if the item has any > circulation policies against it's being held. If so, CheckReserves returns > ( 0, 0 ). >Content-Type: text/plain; charset="utf-8" > >Note that this only checks for "No Holds Allowed"; options for "From Home >Library" and "From Any Library" are not differentiated by this patch. >--- > C4/Reserves.pm | 13 ++++++++++--- > 1 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 65b97dd..51e4ab3 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -824,15 +824,18 @@ sub CheckReserves { > my ( $item, $barcode ) = @_; > my $dbh = C4::Context->dbh; > my $sth; >+ my $item_type_control = (C4::Context->preference('item-level_itypes')) ? "items.itype" : "biblioitems.itemtype"; > my $select = " > SELECT items.biblionumber, > items.biblioitemnumber, > itemtypes.notforloan, > items.notforloan AS itemnotforloan, >- items.itemnumber >+ items.itemnumber, >+ items.homebranch, >+ $item_type_control > FROM items > LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber >- LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype >+ LEFT JOIN itemtypes ON $item_type_control = itemtypes.itemtype > "; > > if ($item) { >@@ -844,7 +847,7 @@ sub CheckReserves { > $sth->execute($barcode); > } > # note: we get the itemnumber because we might have started w/ just the barcode. Now we know for sure we have it. >- my ( $biblio, $bibitem, $notforloan_per_itemtype, $notforloan_per_item, $itemnumber ) = $sth->fetchrow_array; >+ my ( $biblio, $bibitem, $notforloan_per_itemtype, $notforloan_per_item, $itemnumber, $homebranch, $itemtype ) = $sth->fetchrow_array; > > return ( 0, 0 ) unless $itemnumber; # bail if we got nothing. > >@@ -852,6 +855,10 @@ sub CheckReserves { > # execpt where items.notforloan < 0 : This indicates the item is holdable. > return ( 0, 0 ) if ( $notforloan_per_item > 0 ) or $notforloan_per_itemtype; > >+ # if circulation policies say "No Holds Allowed" on this item, it cannot be reserved >+ my $branchitemrule = C4::Circulation::GetBranchItemRule($homebranch, $itemtype); >+ return ( 0, 0 ) unless ($branchitemrule->{'holdallowed'}); >+ > # Find this item in the reserves > my @reserves = _Findgroupreserve( $bibitem, $biblio, $itemnumber ); > >-- >1.5.6.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 4850
: 2218