Lines 412-422
my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit');
Link Here
|
412 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
412 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
413 |
@limits = grep { not $is_nolimit{$_} } @limits; |
413 |
@limits = grep { not $is_nolimit{$_} } @limits; |
414 |
|
414 |
|
|
|
415 |
my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse'); |
416 |
|
415 |
if($params->{'multibranchlimit'}) { |
417 |
if($params->{'multibranchlimit'}) { |
416 |
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); |
418 |
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); |
417 |
my @libraries = $search_group->all_libraries; |
419 |
my @libraries = $search_group->all_libraries; |
418 |
my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; |
420 |
my $multihomebranch = '('.join( " or ", map { 'homebranch: ' . $_->id } @libraries ) .')'; |
419 |
push @limits, $multibranch if ($multibranch ne '()'); |
421 |
my $multiholdingbranch = '('.join( " or ", map { 'holdingbranch: ' . $_->id } @libraries ) .')'; |
|
|
422 |
|
423 |
if ( $branchfield eq "homebranch") { |
424 |
push @limits, $multihomebranch if ( $multihomebranch ne '()'); |
425 |
} elsif ( $branchfield eq "holdingbranch") { |
426 |
push @limits, $multiholdingbranch if ( $multiholdingbranch ne '()'); |
427 |
} else { |
428 |
my $multihomeandholdingbranch = '('.join( " or ", map { 'homebranch: ' . $_->id, 'holdingbranch: ' . $_->id} @libraries ) .')'; |
429 |
push @limits, $multihomeandholdingbranch if ($multihomeandholdingbranch ne '()'); |
430 |
} |
420 |
} |
431 |
} |
421 |
|
432 |
|
422 |
my $available; |
433 |
my $available; |