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