Bug 19301: Remove C4::Reserves::OnShelfHoldsAllowed
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 12 Sep 2017 17:04:08 +0000 (14:04 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 13 Feb 2018 16:36:00 +0000 (13:36 -0300)
At this point the subroutine is not used anymore

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Reserves.pm
t/db_dependent/Reserves.t

index 4f8d16e..73b86b6 100644 (file)
@@ -1148,22 +1148,6 @@ sub IsAvailableForItemLevelRequest {
     }
 }
 
-=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;
 
@@ -1191,13 +1175,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 );
index 992e878..57de1dd 100755 (executable)
@@ -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));