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