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