Lines 375-385
my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit');
Link Here
|
375 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
375 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
376 |
@limits = grep { not $is_nolimit{$_} } @limits; |
376 |
@limits = grep { not $is_nolimit{$_} } @limits; |
377 |
|
377 |
|
|
|
378 |
my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse'); |
379 |
|
378 |
if($params->{'multibranchlimit'}) { |
380 |
if($params->{'multibranchlimit'}) { |
379 |
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); |
381 |
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); |
380 |
my @libraries = $search_group->all_libraries; |
382 |
my @libraries = $search_group->all_libraries; |
381 |
my $multibranch = '('.join( " OR ", map { '(homebranch: ' . $_->branchcode .')' } @libraries ) .')'; |
383 |
|
382 |
push @limits, $multibranch if ($multibranch ne '()'); |
384 |
if ( $branchfield eq "homebranch") { |
|
|
385 |
my $multihomebranch = '('.join( " OR ", map { 'homebranch: ' . $_->branchcode } @libraries ) .')'; |
386 |
push @limits, $multihomebranch if ( $multihomebranch ne '()'); |
387 |
} elsif ( $branchfield eq "holdingbranch") { |
388 |
my $multiholdingbranch = '('.join( " OR ", map { 'holdingbranch: ' . $_->branchcode } @libraries ) .')'; |
389 |
push @limits, $multiholdingbranch if ( $multiholdingbranch ne '()'); |
390 |
} else { |
391 |
my $multihomeandholdingbranch = '('.join( " OR ", map { 'homebranch: ' . $_->branchcode, 'holdingbranch: ' . $_->branchcode} @libraries ) .')'; |
392 |
push @limits, $multihomeandholdingbranch if ($multihomeandholdingbranch ne '()'); |
393 |
} |
383 |
} |
394 |
} |
384 |
|
395 |
|
385 |
my $available; |
396 |
my $available; |