Lines 1135-1144
sub IsAvailableForItemLevelRequest {
Link Here
|
1135 |
# FIXME - a lot of places in the code do this |
1135 |
# FIXME - a lot of places in the code do this |
1136 |
# or something similar - need to be |
1136 |
# or something similar - need to be |
1137 |
# consolidated |
1137 |
# consolidated |
1138 |
my $itype = _get_itype($item); |
1138 |
my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); |
|
|
1139 |
my $item_object = Koha::Items->find( $item->{itemnumber } ); |
1140 |
my $itemtype = $item_object->effective_itemtype; |
1139 |
my $notforloan_per_itemtype |
1141 |
my $notforloan_per_itemtype |
1140 |
= $dbh->selectrow_array("SELECT notforloan FROM itemtypes WHERE itemtype = ?", |
1142 |
= $dbh->selectrow_array("SELECT notforloan FROM itemtypes WHERE itemtype = ?", |
1141 |
undef, $itype); |
1143 |
undef, $itemtype); |
1142 |
|
1144 |
|
1143 |
return 0 if |
1145 |
return 0 if |
1144 |
$notforloan_per_itemtype || |
1146 |
$notforloan_per_itemtype || |
Lines 1147-1153
sub IsAvailableForItemLevelRequest {
Link Here
|
1147 |
$item->{withdrawn} || |
1149 |
$item->{withdrawn} || |
1148 |
($item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems')); |
1150 |
($item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems')); |
1149 |
|
1151 |
|
1150 |
my $on_shelf_holds = _OnShelfHoldsAllowed($itype,$borrower->{categorycode},$item->{holdingbranch}); |
1152 |
my $on_shelf_holds = Koha::IssuingRules->get_onshelfholds_policy( { item => $item_object, patron => $patron } ); |
1151 |
|
1153 |
|
1152 |
if ( $on_shelf_holds == 1 ) { |
1154 |
if ( $on_shelf_holds == 1 ) { |
1153 |
return 1; |
1155 |
return 1; |