Lines 314-332
sub pickup_locations {
Link Here
|
314 |
my $branchitemrule = |
314 |
my $branchitemrule = |
315 |
C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); |
315 |
C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); |
316 |
|
316 |
|
317 |
my $branch_control = C4::Context->preference('HomeOrHoldingBranch'); |
|
|
318 |
my $library = $branch_control eq 'holdingbranch' ? $self->holding_branch : $self->home_branch; |
319 |
|
320 |
my @libs; |
317 |
my @libs; |
321 |
if(defined $patron) { |
318 |
if(defined $patron) { |
322 |
return @libs if $branchitemrule->{holdallowed} == 3 && !$library->validate_hold_sibling( {branchcode => $patron->branchcode} ); |
319 |
return @libs if $branchitemrule->{holdallowed} == 3 && !$self->home_branch->validate_hold_sibling( {branchcode => $patron->branchcode} ); |
323 |
return @libs if $branchitemrule->{holdallowed} == 1 && $library->branchcode ne $patron->branchcode; |
320 |
return @libs if $branchitemrule->{holdallowed} == 1 && $self->home_branch->branchcode ne $patron->branchcode; |
324 |
} |
321 |
} |
325 |
|
322 |
|
326 |
if ($branchitemrule->{hold_fulfillment_policy} eq 'holdgroup') { |
323 |
if ($branchitemrule->{hold_fulfillment_policy} eq 'holdgroup') { |
327 |
@libs = $library->get_hold_libraries; |
324 |
@libs = $self->home_branch->get_hold_libraries; |
328 |
my $circ_control_library = Koha::Libraries->find($circ_control_branch); |
325 |
push @libs, $self->home_branch unless scalar(@libs) > 0; |
329 |
push @libs, $circ_control_library unless scalar(@libs) > 0; |
326 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'patrongroup') { |
|
|
327 |
my $plib = Koha::Libraries->find({ branchcode => $patron->branchcode}); |
328 |
@libs = $plib->get_hold_libraries; |
329 |
push @libs, $self->home_branch unless scalar(@libs) > 0; |
330 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'homebranch') { |
330 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'homebranch') { |
331 |
push @libs, $self->home_branch; |
331 |
push @libs, $self->home_branch; |
332 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch') { |
332 |
} elsif ($branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch') { |