Lines 47-52
use Koha::Libraries;
Link Here
|
47 |
use Koha::Old::Holds; |
47 |
use Koha::Old::Holds; |
48 |
use Koha::Patrons; |
48 |
use Koha::Patrons; |
49 |
use Koha::Plugins; |
49 |
use Koha::Plugins; |
|
|
50 |
use Koha::Policy::Holds; |
50 |
|
51 |
|
51 |
use List::MoreUtils qw( any ); |
52 |
use List::MoreUtils qw( any ); |
52 |
|
53 |
|
Lines 937-943
sub CheckReserves {
Link Here
|
937 |
next if $res->{item_group_id} && ( !$item->item_group || $item->item_group->id != $res->{item_group_id} ); |
938 |
next if $res->{item_group_id} && ( !$item->item_group || $item->item_group->id != $res->{item_group_id} ); |
938 |
next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype; |
939 |
next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype; |
939 |
$patron //= Koha::Patrons->find( $res->{borrowernumber} ); |
940 |
$patron //= Koha::Patrons->find( $res->{borrowernumber} ); |
940 |
my $branch = $item->holds_control_library( $patron ); |
941 |
my $branch = Koha::Policy::Holds->holds_control_library( $item, $patron ); |
941 |
my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype); |
942 |
my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype); |
942 |
next if ($branchitemrule->{'holdallowed'} eq 'not_allowed'); |
943 |
next if ($branchitemrule->{'holdallowed'} eq 'not_allowed'); |
943 |
next if (($branchitemrule->{'holdallowed'} eq 'from_home_library') && ($item->homebranch ne $patron->branchcode)); |
944 |
next if (($branchitemrule->{'holdallowed'} eq 'from_home_library') && ($item->homebranch ne $patron->branchcode)); |
Lines 1357-1363
sub IsAvailableForItemLevelRequest {
Link Here
|
1357 |
return 0 unless $destination; |
1358 |
return 0 unless $destination; |
1358 |
return 0 unless $destination->pickup_location; |
1359 |
return 0 unless $destination->pickup_location; |
1359 |
return 0 unless $item->can_be_transferred( { to => $destination } ); |
1360 |
return 0 unless $item->can_be_transferred( { to => $destination } ); |
1360 |
my $reserves_control_branch = $item->holds_control_library( $patron ); |
1361 |
my $reserves_control_branch = Koha::Policy::Holds->holds_control_library( $item, $patron ); |
1361 |
my $branchitemrule = |
1362 |
my $branchitemrule = |
1362 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $item->itype ); |
1363 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $item->itype ); |
1363 |
my $home_library = Koha::Libraries->find( {branchcode => $item->homebranch} ); |
1364 |
my $home_library = Koha::Libraries->find( {branchcode => $item->homebranch} ); |
Lines 1406-1412
sub ItemsAnyAvailableAndNotRestricted {
Link Here
|
1406 |
my @items = Koha::Items->search( { biblionumber => $param->{biblionumber} } )->as_list; |
1407 |
my @items = Koha::Items->search( { biblionumber => $param->{biblionumber} } )->as_list; |
1407 |
|
1408 |
|
1408 |
foreach my $i (@items) { |
1409 |
foreach my $i (@items) { |
1409 |
my $reserves_control_branch = $i->holds_control_library( $param->{patron} ); |
1410 |
my $reserves_control_branch = Koha::Policy::Holds->holds_control_library( $i, $param->{patron} ); |
1410 |
my $branchitemrule = |
1411 |
my $branchitemrule = |
1411 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1412 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1412 |
my $item_library = Koha::Libraries->find( { branchcode => $i->homebranch } ); |
1413 |
my $item_library = Koha::Libraries->find( { branchcode => $i->homebranch } ); |