|
Lines 312-318
$tag = $params->{tag} if $params->{tag};
Link Here
|
| 312 |
my $pasarParams = ''; |
312 |
my $pasarParams = ''; |
| 313 |
my $j = 0; |
313 |
my $j = 0; |
| 314 |
for (keys %$params) { |
314 |
for (keys %$params) { |
| 315 |
my @pasarParam = split("\0", $params->{$_}); |
315 |
my @pasarParam = $cgi->param($_); |
| 316 |
for my $paramValue(@pasarParam) { |
316 |
for my $paramValue(@pasarParam) { |
| 317 |
$pasarParams .= '&' if ($j > 0); |
317 |
$pasarParams .= '&' if ($j > 0); |
| 318 |
$pasarParams .= $_ . '=' . $paramValue; |
318 |
$pasarParams .= $_ . '=' . $paramValue; |
|
Lines 333-339
if ( C4::Context->preference('OPACdefaultSortField')
Link Here
|
| 333 |
} |
333 |
} |
| 334 |
|
334 |
|
| 335 |
my @allowed_sortby = qw /acqdate_asc acqdate_dsc author_az author_za call_number_asc call_number_dsc popularity_asc popularity_dsc pubdate_asc pubdate_dsc relevance title_az title_za/; |
335 |
my @allowed_sortby = qw /acqdate_asc acqdate_dsc author_az author_za call_number_asc call_number_dsc popularity_asc popularity_dsc pubdate_asc pubdate_dsc relevance title_az title_za/; |
| 336 |
@sort_by = split("\0",$params->{'sort_by'}) if $params->{'sort_by'}; |
336 |
@sort_by = $cgi->param('sort_by'); |
| 337 |
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by); |
337 |
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by); |
| 338 |
foreach my $sort (@sort_by) { |
338 |
foreach my $sort (@sort_by) { |
| 339 |
if ( $sort ~~ @allowed_sortby ) { |
339 |
if ( $sort ~~ @allowed_sortby ) { |
|
Lines 343-350
foreach my $sort (@sort_by) {
Link Here
|
| 343 |
$template->param('sort_by' => $sort_by[0]); |
343 |
$template->param('sort_by' => $sort_by[0]); |
| 344 |
|
344 |
|
| 345 |
# Use the servers defined, or just search our local catalog(default) |
345 |
# Use the servers defined, or just search our local catalog(default) |
| 346 |
my @servers; |
346 |
my @servers = $cgi->param('server'); |
| 347 |
@servers = split("\0",$params->{'server'}) if $params->{'server'}; |
|
|
| 348 |
unless (@servers) { |
347 |
unless (@servers) { |
| 349 |
#FIXME: this should be handled using Context.pm |
348 |
#FIXME: this should be handled using Context.pm |
| 350 |
@servers = ("biblioserver"); |
349 |
@servers = ("biblioserver"); |
|
Lines 353-373
unless (@servers) {
Link Here
|
| 353 |
|
352 |
|
| 354 |
# operators include boolean and proximity operators and are used |
353 |
# operators include boolean and proximity operators and are used |
| 355 |
# to evaluate multiple operands |
354 |
# to evaluate multiple operands |
| 356 |
my @operators; |
355 |
my @operators = $cgi->param('op'); |
| 357 |
@operators = split("\0",$params->{'op'}) if $params->{'op'}; |
|
|
| 358 |
|
356 |
|
| 359 |
# indexes are query qualifiers, like 'title', 'author', etc. They |
357 |
# indexes are query qualifiers, like 'title', 'author', etc. They |
| 360 |
# can be single or multiple parameters separated by comma: kw,right-Truncation |
358 |
# can be single or multiple parameters separated by comma: kw,right-Truncation |
| 361 |
my @indexes; |
359 |
my @indexes = $cgi->param('idx'); |
| 362 |
@indexes = split("\0",$params->{'idx'}) if $params->{'idx'}; |
|
|
| 363 |
|
360 |
|
| 364 |
# if a simple index (only one) display the index used in the top search box |
361 |
# if a simple index (only one) display the index used in the top search box |
| 365 |
if ($indexes[0] && !$indexes[1]) { |
362 |
if ($indexes[0] && !$indexes[1]) { |
| 366 |
$template->param("ms_".$indexes[0] => 1); |
363 |
$template->param("ms_".$indexes[0] => 1); |
| 367 |
} |
364 |
} |
| 368 |
# an operand can be a single term, a phrase, or a complete ccl query |
365 |
# an operand can be a single term, a phrase, or a complete ccl query |
| 369 |
my @operands; |
366 |
my @operands = $cgi->param('q'); |
| 370 |
@operands = split("\0",$params->{'q'}) if $params->{'q'}; |
|
|
| 371 |
|
367 |
|
| 372 |
# if a simple search, display the value in the search box |
368 |
# if a simple search, display the value in the search box |
| 373 |
if ($operands[0] && !$operands[1]) { |
369 |
if ($operands[0] && !$operands[1]) { |
|
Lines 375-382
if ($operands[0] && !$operands[1]) {
Link Here
|
| 375 |
} |
371 |
} |
| 376 |
|
372 |
|
| 377 |
# limits are use to limit to results to a pre-defined category such as branch or language |
373 |
# limits are use to limit to results to a pre-defined category such as branch or language |
| 378 |
my @limits; |
374 |
my @limits = $cgi->param('limit'); |
| 379 |
@limits = split("\0",$params->{'limit'}) if $params->{'limit'}; |
|
|
| 380 |
|
375 |
|
| 381 |
if($params->{'multibranchlimit'}) { |
376 |
if($params->{'multibranchlimit'}) { |
| 382 |
push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; |
377 |
push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; |
| 383 |
- |
|
|