Lines 440-457
if ($params->{'limit-yr'}) {
Link Here
|
440 |
# $ %z3950p will be a hash ref if the indexes are present (advacned search), otherwise undef |
440 |
# $ %z3950p will be a hash ref if the indexes are present (advacned search), otherwise undef |
441 |
my $z3950par; |
441 |
my $z3950par; |
442 |
my $indexes2z3950 = { |
442 |
my $indexes2z3950 = { |
443 |
kw=>'title', au=>'author', 'au,phr'=>'author', nb=>'isbn', ns=>'issn', |
443 |
kw=>'title', au=>'author', 'au,phr'=>'author', nb=>'isbn', ns=>'issn', |
444 |
'lcn,phr'=>'dewey', su=>'subject', 'su,phr'=>'subject', |
444 |
'lcn,phr'=>'dewey', su=>'subject', 'su,phr'=>'subject', |
445 |
ti=>'title', 'ti,phr'=>'title', se=>'title' |
445 |
ti=>'title', 'ti,phr'=>'title', se=>'title' |
446 |
}; |
446 |
}; |
447 |
for (my $ii = 0; $ii < @operands; ++$ii) |
447 |
for (my $ii = 0; $ii < @operands; ++$ii) |
448 |
{ |
448 |
{ |
449 |
my $name = $indexes2z3950->{$indexes[$ii]}; |
449 |
my $name = $indexes2z3950->{$indexes[$ii]}; |
450 |
if (defined $name && defined $operands[$ii]) |
450 |
if (defined $name && defined $operands[$ii]) |
451 |
{ |
451 |
{ |
452 |
$z3950par ||= {}; |
452 |
$z3950par ||= {}; |
453 |
$z3950par->{$name} = $operands[$ii] if !exists $z3950par->{$name}; |
453 |
$z3950par->{$name} = $operands[$ii] if !exists $z3950par->{$name}; |
454 |
} |
454 |
} |
455 |
} |
455 |
} |
456 |
|
456 |
|
457 |
|
457 |
|
Lines 484-492
for my $this_cgi ( split('&',$query_cgi) ) {
Link Here
|
484 |
my $input_name = $1; |
484 |
my $input_name = $1; |
485 |
my $input_value = $2; |
485 |
my $input_value = $2; |
486 |
push @query_inputs, { input_name => $input_name, input_value => $input_value }; |
486 |
push @query_inputs, { input_name => $input_name, input_value => $input_value }; |
487 |
if ($input_name eq 'idx') { |
487 |
if ($input_name eq 'idx') { |
488 |
$scan_index_to_use = $input_value; # unless $scan_index_to_use; |
488 |
$scan_index_to_use = $input_value; # unless $scan_index_to_use; |
489 |
} |
489 |
} |
490 |
} |
490 |
} |
491 |
$template->param ( QUERY_INPUTS => \@query_inputs, |
491 |
$template->param ( QUERY_INPUTS => \@query_inputs, |
492 |
scan_index_to_use => $scan_index_to_use ); |
492 |
scan_index_to_use => $scan_index_to_use ); |
Lines 552-559
for (my $i=0;$i<@servers;$i++) {
Link Here
|
552 |
## If there's just one result, redirect to the detail page |
552 |
## If there's just one result, redirect to the detail page |
553 |
if ($total == 1) { |
553 |
if ($total == 1) { |
554 |
my $biblionumber = $newresults[0]->{biblionumber}; |
554 |
my $biblionumber = $newresults[0]->{biblionumber}; |
555 |
my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); |
555 |
my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); |
556 |
my $views = { C4::Search::enabled_staff_search_views }; |
556 |
my $views = { C4::Search::enabled_staff_search_views }; |
557 |
if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { |
557 |
if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { |
558 |
print $cgi->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber"); |
558 |
print $cgi->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber"); |
559 |
} elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) { |
559 |
} elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) { |
Lines 578-589
for (my $i=0;$i<@servers;$i++) {
Link Here
|
578 |
$template->param(limit_desc => $limit_desc); |
578 |
$template->param(limit_desc => $limit_desc); |
579 |
$template->param(offset => $offset); |
579 |
$template->param(offset => $offset); |
580 |
$template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold); |
580 |
$template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold); |
581 |
$template->param (z3950_search_params => C4::Search::z3950_search_args($query_desc)); |
581 |
$template->param (z3950_search_params => C4::Search::z3950_search_args($query_desc)); |
582 |
if ($query_desc || $limit_desc) { |
582 |
if ($query_desc || $limit_desc) { |
583 |
$template->param(searchdesc => 1); |
583 |
$template->param(searchdesc => 1); |
584 |
} |
584 |
} |
585 |
$template->param(stopwords_removed => "@$stopwords_removed") if $stopwords_removed; |
585 |
$template->param(stopwords_removed => "@$stopwords_removed") if $stopwords_removed; |
586 |
$template->param(results_per_page => $results_per_page); |
586 |
$template->param(results_per_page => $results_per_page); |
|
|
587 |
# must define a value for size if not present in DB |
588 |
# in order to avoid problems generated by the default size value in TT |
589 |
foreach my $line (@newresults) { |
590 |
if ( not exists $line->{'size'} ) { $line->{'size'} = "" } |
591 |
} |
587 |
$template->param(SEARCH_RESULTS => \@newresults); |
592 |
$template->param(SEARCH_RESULTS => \@newresults); |
588 |
|
593 |
|
589 |
## FIXME: add a global function for this, it's better than the current global one |
594 |
## FIXME: add a global function for this, it's better than the current global one |
Lines 649-655
for (my $i=0;$i<@servers;$i++) {
Link Here
|
649 |
# no hits |
654 |
# no hits |
650 |
else { |
655 |
else { |
651 |
$template->param(searchdesc => 1,query_desc => $query_desc,limit_desc => $limit_desc); |
656 |
$template->param(searchdesc => 1,query_desc => $query_desc,limit_desc => $limit_desc); |
652 |
$template->param (z3950_search_params => C4::Search::z3950_search_args($z3950par || $query_desc)); |
657 |
$template->param (z3950_search_params => C4::Search::z3950_search_args($z3950par || $query_desc)); |
653 |
} |
658 |
} |
654 |
|
659 |
|
655 |
} # end of the if local |
660 |
} # end of the if local |
Lines 679-685
$template->param(
Link Here
|
679 |
total => $total, |
684 |
total => $total, |
680 |
opacfacets => 1, |
685 |
opacfacets => 1, |
681 |
facets_loop => $facets, |
686 |
facets_loop => $facets, |
682 |
displayFacetCount=> C4::Context->preference('displayFacetCount')||0, |
687 |
displayFacetCount=> C4::Context->preference('displayFacetCount')||0, |
683 |
scan => $scan, |
688 |
scan => $scan, |
684 |
search_error => $error, |
689 |
search_error => $error, |
685 |
); |
690 |
); |
686 |
- |
|
|