Bugzilla – Attachment 24544 Details for
Bug 10452
AllowHoldsOnDamagedItems should control using damaged items to fulfill holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 10452 - AllowHoldsOnDamagedItems should control using damaged items to fulfill holds
PASSED-QA-Bug-10452---AllowHoldsOnDamagedItems-sho.patch (text/plain), 4.87 KB, created by
Katrin Fischer
on 2014-01-18 14:38:18 UTC
(
hide
)
Description:
[PASSED QA] Bug 10452 - AllowHoldsOnDamagedItems should control using damaged items to fulfill holds
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-01-18 14:38:18 UTC
Size:
4.87 KB
patch
obsolete
>From b405c03711715f7c9c61271ef1ee5e06c14976ca Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 12 Jun 2013 10:09:25 -0400 >Subject: [PATCH] [PASSED QA] Bug 10452 - AllowHoldsOnDamagedItems should > control using damaged items to fulfill holds > >AllowHoldsOnDamagedItems will stop item-specific holds from being placed >on damaged items, but does not stop Koha from using damaged items to >fill holds. This seems like incorrect behavior. > >Test Plan: >1) Set 'AllowHoldsOnDamagedItems' to "Don't Allow" >2) Pick an item, set it to damaged >3) Place a bib-level hold on this item's record >4) Scan the item though the returns system >5) Koha will ask to use this item to fill the hold, click "ignore" >6) Apply this patch >7) Repeat step 4 >8) Koha will not ask to use this item to fill the hold > >Signed-off-by: Srdjan <srdjan@catalyst.net.nz> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > C4/Reserves.pm | 26 ++++++++++++++-------- > .../en/modules/admin/preferences/circulation.pref | 2 +- > 2 files changed, 18 insertions(+), 10 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index f066404..a5f717b 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -452,13 +452,17 @@ sub CanItemBeReserved{ > my $dbh = C4::Context->dbh; > my $allowedreserves = 0; > >- my $controlbranch = C4::Context->preference('ReservesControlBranch'); >- my $itype = C4::Context->preference('item-level_itypes') ? "itype" : "itemtype"; >- > # we retrieve borrowers and items informations # >- my $item = GetItem($itemnumber); >+ my $item = GetItem($itemnumber); >+ >+ # If an item is damaged and we don't allow holds on damaged items, we can stop right here >+ return 0 if ( $item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems') ); >+ > my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber); > >+ my $controlbranch = C4::Context->preference('ReservesControlBranch'); >+ my $itype = C4::Context->preference('item-level_itypes') ? "itype" : "itemtype"; >+ > # we retrieve user rights on this itemtype and branchcode > my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed > FROM issuingrules >@@ -856,7 +860,8 @@ sub CheckReserves { > items.biblioitemnumber, > itemtypes.notforloan, > items.notforloan AS itemnotforloan, >- items.itemnumber >+ items.itemnumber, >+ items.damaged > FROM items > LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber > LEFT JOIN itemtypes ON items.itype = itemtypes.itemtype >@@ -868,7 +873,8 @@ sub CheckReserves { > items.biblioitemnumber, > itemtypes.notforloan, > items.notforloan AS itemnotforloan, >- items.itemnumber >+ items.itemnumber, >+ items.damaged > FROM items > LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber > LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype >@@ -884,13 +890,15 @@ 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, $damaged ) = $sth->fetchrow_array; >+ >+ return if ( $damaged && !C4::Context->preference('AllowHoldsOnDamagedItems') ); > >- return ( '' ) unless $itemnumber; # bail if we got nothing. >+ return unless $itemnumber; # bail if we got nothing. > > # if item is not for loan it cannot be reserved either..... > # execpt where items.notforloan < 0 : This indicates the item is holdable. >- return ( '' ) if ( $notforloan_per_item > 0 ) or $notforloan_per_itemtype; >+ return if ( $notforloan_per_item > 0 ) or $notforloan_per_itemtype; > > # Find this item in the reserves > my @reserves = _Findgroupreserve( $bibitem, $biblio, $itemnumber, $lookahead_days); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 2c5469b..828a522 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -363,7 +363,7 @@ Circulation: > choices: > yes: Allow > no: "Don't allow" >- - hold requests to be placed on damaged items. >+ - hold requests to be placed on and filled by damaged items. > - > - pref: AllowOnShelfHolds > choices: >-- >1.8.3.2
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 10452
:
18899
|
19784
|
24498
|
24499
| 24544 |
24545