Lines 420-430
my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit');
Link Here
|
420 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
420 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
421 |
@limits = grep { not $is_nolimit{$_} } @limits; |
421 |
@limits = grep { not $is_nolimit{$_} } @limits; |
422 |
|
422 |
|
|
|
423 |
my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse'); |
424 |
|
423 |
if($params->{'multibranchlimit'}) { |
425 |
if($params->{'multibranchlimit'}) { |
424 |
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); |
426 |
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); |
425 |
my @libraries = $search_group->all_libraries; |
427 |
my @libraries = $search_group->all_libraries; |
426 |
my $multibranch = '('.join( " OR ", map { '(homebranch: ' . $_->branchcode .')' } @libraries ) .')'; |
428 |
|
427 |
push @limits, $multibranch if ($multibranch ne '()'); |
429 |
if ( $branchfield eq "homebranch") { |
|
|
430 |
my $multihomebranch = '('.join( " OR ", map { 'homebranch: ' . $_->branchcode } @libraries ) .')'; |
431 |
push @limits, $multihomebranch if ( $multihomebranch ne '()'); |
432 |
} elsif ( $branchfield eq "holdingbranch") { |
433 |
my $multiholdingbranch = '('.join( " OR ", map { 'holdingbranch: ' . $_->branchcode } @libraries ) .')'; |
434 |
push @limits, $multiholdingbranch if ( $multiholdingbranch ne '()'); |
435 |
} else { |
436 |
my $multihomeandholdingbranch = '('.join( " OR ", map { 'homebranch: ' . $_->branchcode, 'holdingbranch: ' . $_->branchcode} @libraries ) .')'; |
437 |
push @limits, $multihomeandholdingbranch if ($multihomeandholdingbranch ne '()'); |
438 |
} |
428 |
} |
439 |
} |
429 |
|
440 |
|
430 |
my $available; |
441 |
my $available; |