Lines 397-408
my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit');
Link Here
|
397 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
397 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
398 |
@limits = grep { not $is_nolimit{$_} } @limits; |
398 |
@limits = grep { not $is_nolimit{$_} } @limits; |
399 |
|
399 |
|
|
|
400 |
my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse'); |
401 |
|
400 |
if($params->{'multibranchlimit'}) { |
402 |
if($params->{'multibranchlimit'}) { |
401 |
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); |
403 |
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); |
402 |
my @libraries = $search_group->all_libraries; |
404 |
my @libraries = $search_group->all_libraries; |
403 |
my $multihomebranch = '('.join( " or ", map { 'homebranch: ' . $_->id } @libraries ) .')'; |
405 |
my $multihomebranch = '('.join( " or ", map { 'homebranch: ' . $_->id } @libraries ) .')'; |
404 |
my $multiholdingbranch = '('.join( " or ", map { 'holdingbranch: ' . $_->id } @libraries ) .')'; |
406 |
my $multiholdingbranch = '('.join( " or ", map { 'holdingbranch: ' . $_->id } @libraries ) .')'; |
405 |
push @limits, $multihomebranch . " or " . $multiholdingbranch if ($multihomebranch && $multiholdingbranch ne '()'); |
407 |
|
|
|
408 |
if ( $branchfield eq "homebranch") { |
409 |
push @limits, $multihomebranch if ( $multihomebranch ne '()'); |
410 |
} elsif ( $branchfield eq "holdingbranch") { |
411 |
push @limits, $multiholdingbranch if ( $multiholdingbranch ne '()'); |
412 |
} else { |
413 |
my $multihomeandholdingbranch = '('.join( " or ", map { 'homebranch: ' . $_->id, 'holdingbranch: ' . $_->id} @libraries ) .')'; |
414 |
push @limits, $multihomeandholdingbranch if ($multihomeandholdingbranch ne '()'); |
415 |
} |
406 |
} |
416 |
} |
407 |
|
417 |
|
408 |
my $available; |
418 |
my $available; |