Lines 1099-1108
sub IsAvailableForItemLevelRequest {
Link Here
|
1099 |
# FIXME - a lot of places in the code do this |
1099 |
# FIXME - a lot of places in the code do this |
1100 |
# or something similar - need to be |
1100 |
# or something similar - need to be |
1101 |
# consolidated |
1101 |
# consolidated |
1102 |
my $itype = _get_itype($item); |
1102 |
my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); |
|
|
1103 |
my $item_object = Koha::Items->find( $item->{itemnumber } ); |
1104 |
my $itemtype = $item_object->effective_itemtype; |
1103 |
my $notforloan_per_itemtype |
1105 |
my $notforloan_per_itemtype |
1104 |
= $dbh->selectrow_array("SELECT notforloan FROM itemtypes WHERE itemtype = ?", |
1106 |
= $dbh->selectrow_array("SELECT notforloan FROM itemtypes WHERE itemtype = ?", |
1105 |
undef, $itype); |
1107 |
undef, $itemtype); |
1106 |
|
1108 |
|
1107 |
return 0 if |
1109 |
return 0 if |
1108 |
$notforloan_per_itemtype || |
1110 |
$notforloan_per_itemtype || |
Lines 1111-1117
sub IsAvailableForItemLevelRequest {
Link Here
|
1111 |
$item->{withdrawn} || |
1113 |
$item->{withdrawn} || |
1112 |
($item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems')); |
1114 |
($item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems')); |
1113 |
|
1115 |
|
1114 |
my $on_shelf_holds = _OnShelfHoldsAllowed($itype,$borrower->{categorycode},$item->{holdingbranch}); |
1116 |
my $on_shelf_holds = Koha::IssuingRules->get_onshelfholds_policy( { item => $item_object, patron => $patron } ); |
1115 |
|
1117 |
|
1116 |
if ( $on_shelf_holds == 1 ) { |
1118 |
if ( $on_shelf_holds == 1 ) { |
1117 |
return 1; |
1119 |
return 1; |