From 9f3e6b4a407ff79a5fa9ff627077dee884bccc24 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Mon, 14 Jul 2008 11:33:13 -0500 Subject: [PATCH] Fix for 1863: Result list for 'scan' index searches incorrect after first page --- catalogue/search.pl | 13 +++++++--- .../prog/en/modules/catalogue/results.tmpl | 26 +++++++++---------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index ad3d6a40c3..f033f5e12d 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -357,6 +357,11 @@ my @operators; my @indexes; @indexes = split("\0",$params->{'idx'}); +# if a simple index (only one) display the index used in the top search box +if ($indexes[0] && !$indexes[1]) { + $template->param("ms_".$indexes[0] => 1);} + + # an operand can be a single term, a phrase, or a complete ccl query my @operands; @operands = split("\0",$params->{'q'}) if $params->{'q'}; @@ -414,7 +419,7 @@ my @results; ## parse the query_cgi string and put it into a form suitable for s my @query_inputs; -my $scan_index; +my $scan_index_to_use; for my $this_cgi ( split('&',$query_cgi) ) { next unless $this_cgi; @@ -423,10 +428,12 @@ for my $this_cgi ( split('&',$query_cgi) ) { my $input_value = $2; $input_name =~ s/=$//; push @query_inputs, { input_name => $input_name, input_value => $input_value }; - $scan_index = $input_value unless $scan_index; + if ($input_name eq 'idx') { + $scan_index_to_use = $input_value; # unless $scan_index_to_use; + } } $template->param ( QUERY_INPUTS => \@query_inputs, - scan_index => $scan_index ); + scan_index_to_use => $scan_index_to_use ); ## parse the limit_cgi string and put it into a form suitable for s my @limit_inputs; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl index 9fb49bd288..034ce0f94f 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -119,18 +119,18 @@ $(window).load(function() { @@ -147,7 +147,7 @@ $(window).load(function() { - &q="""> + &q="""> -- 2.39.5