Lines 299-317
sub pickup_locations {
Link Here
|
299 |
my $branchitemrule = |
299 |
my $branchitemrule = |
300 |
C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); |
300 |
C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); |
301 |
|
301 |
|
302 |
my $branch_control = C4::Context->preference('HomeOrHoldingBranch'); |
|
|
303 |
my $library = $branch_control eq 'holdingbranch' ? $self->holding_branch : $self->home_branch; |
304 |
|
305 |
my @libs; |
302 |
my @libs; |
306 |
if(defined $patron) { |
303 |
if(defined $patron) { |
307 |
return @libs if $branchitemrule->{holdallowed} == 3 && !$library->validate_hold_sibling( {branchcode => $patron->branchcode} ); |
304 |
return @libs if $branchitemrule->{holdallowed} == 3 && !$self->home_branch->validate_hold_sibling( {branchcode => $patron->branchcode} ); |
308 |
return @libs if $branchitemrule->{holdallowed} == 1 && $library->branchcode ne $patron->branchcode; |
305 |
return @libs if $branchitemrule->{holdallowed} == 1 && $self->home_branch->branchcode ne $patron->branchcode; |
309 |
} |
306 |
} |
310 |
|
307 |
|
311 |
if ($branchitemrule->{hold_fulfillment_policy} eq 'holdgroup') { |
308 |
if ($branchitemrule->{hold_fulfillment_policy} eq 'holdgroup') { |
312 |
@libs = $library->get_hold_libraries; |
309 |
@libs = $self->home_branch->get_hold_libraries; |
313 |
my $circ_control_library = Koha::Libraries->find($circ_control_branch); |
310 |
push @libs, $self->home_branch unless scalar(@libs) > 0; |
314 |
push @libs, $circ_control_library unless scalar(@libs) > 0; |
311 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'patrongroup') { |
|
|
312 |
my $plib = Koha::Libraries->find({ branchcode => $patron->branchcode}); |
313 |
@libs = $plib->get_hold_libraries; |
314 |
push @libs, $self->home_branch unless scalar(@libs) > 0; |
315 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'homebranch') { |
315 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'homebranch') { |
316 |
push @libs, $self->home_branch; |
316 |
push @libs, $self->home_branch; |
317 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch') { |
317 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch') { |