Lines 919-928
sub CheckReserves {
Link Here
|
919 |
if ( ( $res->{'priority'} && $res->{'priority'} < $priority ) || $local_hold_match ) { |
919 |
if ( ( $res->{'priority'} && $res->{'priority'} < $priority ) || $local_hold_match ) { |
920 |
$item ||= Koha::Items->find($itemnumber); |
920 |
$item ||= Koha::Items->find($itemnumber); |
921 |
next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype; |
921 |
next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype; |
922 |
$patron ||= Koha::Patrons->find( $res->{borrowernumber} ); |
922 |
my $branch = $item->holds_control_library({ patron => \$patron, patron_id => $res->{borrowernumber} }); |
923 |
my $branch = $item->holds_control_library( $patron ); |
|
|
924 |
my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype); |
923 |
my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype); |
925 |
next if ($branchitemrule->{'holdallowed'} eq 'not_allowed'); |
924 |
next if ($branchitemrule->{'holdallowed'} eq 'not_allowed'); |
|
|
925 |
$patron ||= Koha::Patrons->find( $res->{borrowernumber} ); |
926 |
next if (($branchitemrule->{'holdallowed'} eq 'from_home_library') && ($item->homebranch ne $patron->branchcode)); |
926 |
next if (($branchitemrule->{'holdallowed'} eq 'from_home_library') && ($item->homebranch ne $patron->branchcode)); |
927 |
my $library = Koha::Libraries->find({branchcode=>$item->homebranch}); |
927 |
my $library = Koha::Libraries->find({branchcode=>$item->homebranch}); |
928 |
next if (($branchitemrule->{'holdallowed'} eq 'from_local_hold_group') && (!$library->validate_hold_sibling({branchcode => $patron->branchcode}) )); |
928 |
next if (($branchitemrule->{'holdallowed'} eq 'from_local_hold_group') && (!$library->validate_hold_sibling({branchcode => $patron->branchcode}) )); |
Lines 1341-1347
sub IsAvailableForItemLevelRequest {
Link Here
|
1341 |
return 0 unless $destination; |
1341 |
return 0 unless $destination; |
1342 |
return 0 unless $destination->pickup_location; |
1342 |
return 0 unless $destination->pickup_location; |
1343 |
return 0 unless $item->can_be_transferred( { to => $destination } ); |
1343 |
return 0 unless $item->can_be_transferred( { to => $destination } ); |
1344 |
my $reserves_control_branch = $item->holds_control_library( $patron ); |
1344 |
my $reserves_control_branch = $item->holds_control_library({ patron => \$patron }); |
1345 |
my $branchitemrule = |
1345 |
my $branchitemrule = |
1346 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $item->itype ); |
1346 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $item->itype ); |
1347 |
my $home_library = Koha::Libraries->find( {branchcode => $item->homebranch} ); |
1347 |
my $home_library = Koha::Libraries->find( {branchcode => $item->homebranch} ); |
Lines 1383-1389
sub ItemsAnyAvailableAndNotRestricted {
Link Here
|
1383 |
my @items = Koha::Items->search( { biblionumber => $param->{biblionumber} } )->as_list; |
1383 |
my @items = Koha::Items->search( { biblionumber => $param->{biblionumber} } )->as_list; |
1384 |
|
1384 |
|
1385 |
foreach my $i (@items) { |
1385 |
foreach my $i (@items) { |
1386 |
my $reserves_control_branch = $i->holds_control_library( $param->{patron} ); |
1386 |
my $reserves_control_branch = $i->holds_control_library({ patron => \$param->{patron} }); |
1387 |
my $branchitemrule = |
1387 |
my $branchitemrule = |
1388 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1388 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1389 |
my $item_library = Koha::Libraries->find( { branchcode => $i->homebranch } ); |
1389 |
my $item_library = Koha::Libraries->find( { branchcode => $i->homebranch } ); |