Lines 442-451
sub CanItemBeReserved {
Link Here
|
442 |
return { status => 'tooManyReserves', limit => $rule->rule_value} if $total_holds_count >= $rule->rule_value; |
442 |
return { status => 'tooManyReserves', limit => $rule->rule_value} if $total_holds_count >= $rule->rule_value; |
443 |
} |
443 |
} |
444 |
|
444 |
|
445 |
my $circ_control_branch = |
445 |
my $reserves_control_branch = |
446 |
C4::Circulation::_GetCircControlBranch( $item->unblessed(), $borrower ); |
446 |
GetReservesControlBranch( $item->unblessed(), $borrower ); |
447 |
my $branchitemrule = |
447 |
my $branchitemrule = |
448 |
C4::Circulation::GetBranchItemRule( $circ_control_branch, $item->itype ); # FIXME Should not be item->effective_itemtype? |
448 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $item->itype ); # FIXME Should not be item->effective_itemtype? |
449 |
|
449 |
|
450 |
if ( $branchitemrule->{holdallowed} == 0 ) { |
450 |
if ( $branchitemrule->{holdallowed} == 0 ) { |
451 |
return { status => 'notReservable' }; |
451 |
return { status => 'notReservable' }; |
Lines 1173-1181
sub IsAvailableForItemLevelRequest {
Link Here
|
1173 |
my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); |
1173 |
my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); |
1174 |
my $item_object = Koha::Items->find( $item->{itemnumber } ); |
1174 |
my $item_object = Koha::Items->find( $item->{itemnumber } ); |
1175 |
my $itemtype = $item_object->effective_itemtype; |
1175 |
my $itemtype = $item_object->effective_itemtype; |
1176 |
my $notforloan_per_itemtype |
1176 |
my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; |
1177 |
= $dbh->selectrow_array("SELECT notforloan FROM itemtypes WHERE itemtype = ?", |
|
|
1178 |
undef, $itemtype); |
1179 |
|
1177 |
|
1180 |
return 0 if |
1178 |
return 0 if |
1181 |
$notforloan_per_itemtype || |
1179 |
$notforloan_per_itemtype || |
Lines 1202-1210
sub IsAvailableForItemLevelRequest {
Link Here
|
1202 |
my $any_available = 0; |
1200 |
my $any_available = 0; |
1203 |
|
1201 |
|
1204 |
foreach my $i (@items) { |
1202 |
foreach my $i (@items) { |
1205 |
|
1203 |
my $reserves_control_branch = GetReservesControlBranch( $i->unblessed(), $borrower ); |
1206 |
my $circ_control_branch = C4::Circulation::_GetCircControlBranch( $i->unblessed(), $borrower ); |
1204 |
my $branchitemrule = C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1207 |
my $branchitemrule = C4::Circulation::GetBranchItemRule( $circ_control_branch, $i->itype ); |
|
|
1208 |
|
1205 |
|
1209 |
$any_available = 1 |
1206 |
$any_available = 1 |
1210 |
unless $i->itemlost |
1207 |
unless $i->itemlost |