Lines 997-1024
sub pickup_locations {
Link Here
|
997 |
my $patron = $params->{patron}; |
997 |
my $patron = $params->{patron}; |
998 |
|
998 |
|
999 |
my $circ_control_branch = Koha::Policy::Holds->holds_control_library( $self, $patron ); |
999 |
my $circ_control_branch = Koha::Policy::Holds->holds_control_library( $self, $patron ); |
1000 |
my $branchitemrule = |
1000 |
my $branchitemrule = C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); |
1001 |
C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); |
1001 |
|
1002 |
|
1002 |
if ( $branchitemrule->{holdallowed} eq 'from_local_hold_group' |
1003 |
if ( |
1003 |
&& !$self->home_branch->validate_hold_sibling( { branchcode => $patron->branchcode } ) |
1004 |
$branchitemrule->{holdallowed} eq 'from_local_hold_group' && |
1004 |
|| $branchitemrule->{holdallowed} eq 'from_home_library' |
1005 |
!$self->home_branch->validate_hold_sibling( {branchcode => $patron->branchcode} ) || |
1005 |
&& $self->home_branch->branchcode ne $patron->branchcode ) |
1006 |
$branchitemrule->{holdallowed} eq 'from_home_library' && |
1006 |
{ |
1007 |
$self->home_branch->branchcode ne $patron->branchcode |
|
|
1008 |
) { |
1009 |
return Koha::Libraries->new()->empty; |
1007 |
return Koha::Libraries->new()->empty; |
1010 |
} |
1008 |
} |
1011 |
|
1009 |
|
1012 |
my $pickup_libraries; |
1010 |
my $pickup_libraries; |
1013 |
if ($branchitemrule->{hold_fulfillment_policy} eq 'holdgroup') { |
1011 |
if ( $branchitemrule->{hold_fulfillment_policy} eq 'holdgroup' ) { |
1014 |
$pickup_libraries = $self->home_branch->get_hold_libraries; |
1012 |
$pickup_libraries = $self->home_branch->get_hold_libraries; |
1015 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'patrongroup') { |
1013 |
} elsif ( $branchitemrule->{hold_fulfillment_policy} eq 'patrongroup' ) { |
1016 |
my $plib = Koha::Libraries->find({ branchcode => $patron->branchcode}); |
1014 |
my $plib = Koha::Libraries->find( { branchcode => $patron->branchcode } ); |
1017 |
$pickup_libraries = $plib->get_hold_libraries; |
1015 |
$pickup_libraries = $plib->get_hold_libraries; |
1018 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'homebranch') { |
1016 |
} elsif ( $branchitemrule->{hold_fulfillment_policy} eq 'homebranch' ) { |
1019 |
$pickup_libraries = Koha::Libraries->search({ branchcode => $self->homebranch }); |
1017 |
$pickup_libraries = Koha::Libraries->search( { branchcode => $self->homebranch } ); |
1020 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch') { |
1018 |
} elsif ( $branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch' ) { |
1021 |
$pickup_libraries = Koha::Libraries->search({ branchcode => $self->holdingbranch }); |
1019 |
$pickup_libraries = Koha::Libraries->search( { branchcode => $self->holdingbranch } ); |
1022 |
} else { |
1020 |
} else { |
1023 |
$pickup_libraries = Koha::Libraries->search(); |
1021 |
$pickup_libraries = Koha::Libraries->search(); |
1024 |
} |
1022 |
} |
1025 |
- |
|
|