Lines 46-51
use Koha::Libraries;
Link Here
|
46 |
use Koha::Old::Holds; |
46 |
use Koha::Old::Holds; |
47 |
use Koha::Patrons; |
47 |
use Koha::Patrons; |
48 |
use Koha::Plugins; |
48 |
use Koha::Plugins; |
|
|
49 |
use Koha::Policy::Holds; |
49 |
|
50 |
|
50 |
use List::MoreUtils qw( any ); |
51 |
use List::MoreUtils qw( any ); |
51 |
|
52 |
|
Lines 921-927
sub CheckReserves {
Link Here
|
921 |
next if $res->{item_group_id} && ( !$item->item_group || $item->item_group->id != $res->{item_group_id} ); |
922 |
next if $res->{item_group_id} && ( !$item->item_group || $item->item_group->id != $res->{item_group_id} ); |
922 |
next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype; |
923 |
next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype; |
923 |
$patron //= Koha::Patrons->find( $res->{borrowernumber} ); |
924 |
$patron //= Koha::Patrons->find( $res->{borrowernumber} ); |
924 |
my $branch = $item->holds_control_library( $patron ); |
925 |
my $branch = Koha::Policy::Holds->holds_control_library( $item, $patron ); |
925 |
my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype); |
926 |
my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype); |
926 |
next if ($branchitemrule->{'holdallowed'} eq 'not_allowed'); |
927 |
next if ($branchitemrule->{'holdallowed'} eq 'not_allowed'); |
927 |
next if (($branchitemrule->{'holdallowed'} eq 'from_home_library') && ($item->homebranch ne $patron->branchcode)); |
928 |
next if (($branchitemrule->{'holdallowed'} eq 'from_home_library') && ($item->homebranch ne $patron->branchcode)); |
Lines 1344-1350
sub IsAvailableForItemLevelRequest {
Link Here
|
1344 |
return 0 unless $destination; |
1345 |
return 0 unless $destination; |
1345 |
return 0 unless $destination->pickup_location; |
1346 |
return 0 unless $destination->pickup_location; |
1346 |
return 0 unless $item->can_be_transferred( { to => $destination } ); |
1347 |
return 0 unless $item->can_be_transferred( { to => $destination } ); |
1347 |
my $reserves_control_branch = $item->holds_control_library( $patron ); |
1348 |
my $reserves_control_branch = Koha::Policy::Holds->holds_control_library( $item, $patron ); |
1348 |
my $branchitemrule = |
1349 |
my $branchitemrule = |
1349 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $item->itype ); |
1350 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $item->itype ); |
1350 |
my $home_library = Koha::Libraries->find( {branchcode => $item->homebranch} ); |
1351 |
my $home_library = Koha::Libraries->find( {branchcode => $item->homebranch} ); |
Lines 1386-1392
sub ItemsAnyAvailableAndNotRestricted {
Link Here
|
1386 |
my @items = Koha::Items->search( { biblionumber => $param->{biblionumber} } )->as_list; |
1387 |
my @items = Koha::Items->search( { biblionumber => $param->{biblionumber} } )->as_list; |
1387 |
|
1388 |
|
1388 |
foreach my $i (@items) { |
1389 |
foreach my $i (@items) { |
1389 |
my $reserves_control_branch = $i->holds_control_library( $param->{patron} ); |
1390 |
my $reserves_control_branch = Koha::Policy::Holds->holds_control_library( $i, $param->{patron} ); |
1390 |
my $branchitemrule = |
1391 |
my $branchitemrule = |
1391 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1392 |
C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1392 |
my $item_library = Koha::Libraries->find( { branchcode => $i->homebranch } ); |
1393 |
my $item_library = Koha::Libraries->find( { branchcode => $i->homebranch } ); |