From 19e5eeb8e5580dbcf7c344adf5798b63ea720a88 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 11 Sep 2017 14:16:07 -0300 Subject: [PATCH] Bug 19300: Replace C4::Reserves::OPACItemHoldsAllowed - Remove the subroutine At this point the subroutine is not longer in use, we can remove it Signed-off-by: Alex Buckley Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- C4/Reserves.pm | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 06cde18228..11af849395 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -126,8 +126,6 @@ BEGIN { &IsAvailableForItemLevelRequest - &OPACItemHoldsAllowed - &AlterPriority &ToggleLowestPriority @@ -1722,54 +1720,6 @@ sub _ShiftPriorityByDateAndPriority { return $new_priority; # so the caller knows what priority they wind up receiving } -=head2 OPACItemHoldsAllowed - - OPACItemHoldsAllowed($item_record,$borrower_record); - -Checks issuingrules, using the borrowers categorycode, the itemtype, and branchcode to see -if specific item holds are allowed, returns true if so. - -=cut - -sub OPACItemHoldsAllowed { - my ($item,$borrower) = @_; - - my $branchcode = $item->{homebranch} or die "No homebranch"; - my $itype; - my $dbh = C4::Context->dbh; - if (C4::Context->preference('item-level_itypes')) { - # We can't trust GetItem to honour the syspref, so safest to do it ourselves - # When GetItem is fixed, we can remove this - $itype = $item->{itype}; - } - else { - my $query = "SELECT itemtype FROM biblioitems WHERE biblioitemnumber = ? "; - my $sth = $dbh->prepare($query); - $sth->execute($item->{biblioitemnumber}); - if (my $data = $sth->fetchrow_hashref()){ - $itype = $data->{itemtype}; - } - } - - my $query = "SELECT opacitemholds,categorycode,itemtype,branchcode FROM issuingrules WHERE - (issuingrules.categorycode = ? OR issuingrules.categorycode = '*') - AND - (issuingrules.itemtype = ? OR issuingrules.itemtype = '*') - AND - (issuingrules.branchcode = ? OR issuingrules.branchcode = '*') - ORDER BY - issuingrules.categorycode desc, - issuingrules.itemtype desc, - issuingrules.branchcode desc - LIMIT 1"; - my $sth = $dbh->prepare($query); - $sth->execute($borrower->{categorycode},$itype,$branchcode); - my $data = $sth->fetchrow_hashref; - my $opacitemholds = uc substr ($data->{opacitemholds}, 0, 1); - return '' if $opacitemholds eq 'N'; - return $opacitemholds; -} - =head2 MoveReserve MoveReserve( $itemnumber, $borrowernumber, $cancelreserve ) -- 2.39.5