Bugzilla – Attachment 67421 Details for
Bug 19301
Move C4::Reserves::OnShelfHoldsAllowed to the Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19301: Remove C4::Reserves::OnShelfHoldsAllowed
Bug-19301-Remove-C4ReservesOnShelfHoldsAllowed.patch (text/plain), 3.27 KB, created by
Alex Buckley
on 2017-09-27 23:47:18 UTC
(
hide
)
Description:
Bug 19301: Remove C4::Reserves::OnShelfHoldsAllowed
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-09-27 23:47:18 UTC
Size:
3.27 KB
patch
obsolete
>From 3b568340acf12c59b02832a2455c01cb3ec01ea3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 12 Sep 2017 14:04:08 -0300 >Subject: [PATCH] Bug 19301: Remove C4::Reserves::OnShelfHoldsAllowed > >At this point the subroutine is not used anymore > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >--- > C4/Reserves.pm | 23 ----------------------- > t/db_dependent/Reserves.t | 26 +------------------------- > 2 files changed, 1 insertion(+), 48 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index a0be087..4f5efd9 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1177,22 +1177,6 @@ sub IsAvailableForItemLevelRequest { > return $item->{onloan} || GetReserveStatus($item->{itemnumber}) eq "Waiting"; > } > >-=head2 OnShelfHoldsAllowed >- >- OnShelfHoldsAllowed($itemtype,$borrowercategory,$branchcode); >- >-Checks issuingrules, using the borrowers categorycode, the itemtype, and branchcode to see if onshelf >-holds are allowed, returns true if so. >- >-=cut >- >-sub OnShelfHoldsAllowed { >- my ($item, $borrower) = @_; >- >- my $itype = _get_itype($item); >- return _OnShelfHoldsAllowed($itype,$borrower->{categorycode},$item->{holdingbranch}); >-} >- > sub _get_itype { > my $item = shift; > >@@ -1220,13 +1204,6 @@ sub _get_itype { > return $itype; > } > >-sub _OnShelfHoldsAllowed { >- my ($itype,$borrowercategory,$branchcode) = @_; >- >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrowercategory, itemtype => $itype, branchcode => $branchcode }); >- return $issuing_rule ? $issuing_rule->onshelfholds : undef; >-} >- > =head2 AlterPriority > > AlterPriority( $where, $reserve_id ); >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index fd79427..4db6b8a 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 58; >+use Test::More tests => 56; > use Test::MockModule; > use Test::Warn; > >@@ -540,30 +540,6 @@ $item = GetItem($itemnumber); > > ok( C4::Reserves::IsAvailableForItemLevelRequest($item, $borrower), "Reserving a book on item level" ); > >-my $itype = C4::Reserves::_get_itype($item); >-my $categorycode = $borrower->{categorycode}; >-my $holdingbranch = $item->{holdingbranch}; >-my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >- { >- categorycode => $categorycode, >- itemtype => $itype, >- branchcode => $holdingbranch >- } >-); >- >-$dbh->do( >- "UPDATE issuingrules SET onshelfholds = 1 WHERE categorycode = ? AND itemtype= ? and branchcode = ?", >- undef, >- $issuing_rule->categorycode, $issuing_rule->itemtype, $issuing_rule->branchcode >-); >-ok( C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed() allowed" ); >-$dbh->do( >- "UPDATE issuingrules SET onshelfholds = 0 WHERE categorycode = ? AND itemtype= ? and branchcode = ?", >- undef, >- $issuing_rule->categorycode, $issuing_rule->itemtype, $issuing_rule->branchcode >-); >-ok( !C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed() disallowed" ); >- > # tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526) > # hold from A pos 1, today, no fut holds: MoveReserve should fill it > $dbh->do('DELETE FROM reserves', undef, ($bibnum)); >-- >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 19301
:
67122
|
67123
|
67420
|
67421
|
69846
|
69847
|
70106
|
70107
|
70108
|
70109