|
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 1174-1182
sub IsAvailableForItemLevelRequest {
Link Here
|
| 1174 |
my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); |
1174 |
my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); |
| 1175 |
my $item_object = Koha::Items->find( $item->{itemnumber } ); |
1175 |
my $item_object = Koha::Items->find( $item->{itemnumber } ); |
| 1176 |
my $itemtype = $item_object->effective_itemtype; |
1176 |
my $itemtype = $item_object->effective_itemtype; |
| 1177 |
my $notforloan_per_itemtype |
1177 |
my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; |
| 1178 |
= $dbh->selectrow_array("SELECT notforloan FROM itemtypes WHERE itemtype = ?", |
|
|
| 1179 |
undef, $itemtype); |
| 1180 |
|
1178 |
|
| 1181 |
return 0 if |
1179 |
return 0 if |
| 1182 |
$notforloan_per_itemtype || |
1180 |
$notforloan_per_itemtype || |
|
Lines 1203-1211
sub IsAvailableForItemLevelRequest {
Link Here
|
| 1203 |
my $any_available = 0; |
1201 |
my $any_available = 0; |
| 1204 |
|
1202 |
|
| 1205 |
foreach my $i (@items) { |
1203 |
foreach my $i (@items) { |
| 1206 |
|
1204 |
my $reserves_control_branch = GetReservesControlBranch( $i->unblessed(), $borrower ); |
| 1207 |
my $circ_control_branch = C4::Circulation::_GetCircControlBranch( $i->unblessed(), $borrower ); |
1205 |
my $branchitemrule = C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
| 1208 |
my $branchitemrule = C4::Circulation::GetBranchItemRule( $circ_control_branch, $i->itype ); |
|
|
| 1209 |
|
1206 |
|
| 1210 |
$any_available = 1 |
1207 |
$any_available = 1 |
| 1211 |
unless $i->itemlost |
1208 |
unless $i->itemlost |