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