From df7f0df7400c02a57fb5bf5887eb9cade2ba0510 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sun, 7 Aug 2016 16:03:13 +0200 Subject: [PATCH] Bug 17074: Fix links in result list of 'scan indexes' and keep search term visible MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The 'scan indexes' search that can be reached from the advanced search has 2 problems to begin with: - The search term you searched for is not displayed in the input field. - The links in the result list are missing the index and because of that, are not giving the correct results. To test: - Go to the advanced search, select an index to search in - Enter a search term and check 'scan indexes' - Submit search - Check if the search term is visible in the input box - Check if the result links contain your selected index and give you correct results (count and the number of results should match) Tested both patches together, works as expected. Signed-off-by: Marc Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 8d7e62b808522b1871d6b704e0ae5def3be886ee) Signed-off-by: Frédéric Demians (cherry picked from commit 2b62fbde3357b396d72cbce7d625b096c0467307) Signed-off-by: Julian Maurice --- catalogue/search.pl | 7 ++++++- .../intranet-tmpl/prog/en/modules/catalogue/results.tt | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index e50443c4d2..06e11693c3 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -489,6 +489,7 @@ my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit ## parse the query_cgi string and put it into a form suitable for s my @query_inputs; my $scan_index_to_use; +my $scan_search_term_to_use; for my $this_cgi ( split('&',$query_cgi) ) { next unless $this_cgi; @@ -499,9 +500,13 @@ for my $this_cgi ( split('&',$query_cgi) ) { if ($input_name eq 'idx') { $scan_index_to_use = $input_value; # unless $scan_index_to_use; } + if ($input_name eq 'q') { + $scan_search_term_to_use = $input_value; + } } $template->param ( QUERY_INPUTS => \@query_inputs, - scan_index_to_use => $scan_index_to_use ); + scan_index_to_use => $scan_index_to_use, + scan_search_term_to_use => $scan_search_term_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.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index c68307bb9c..68038cbfbc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -397,7 +397,11 @@ var holdForPatron = function () { @@ -443,7 +447,7 @@ var holdForPatron = function () { [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
- Scan Index for: + [% IF ( scan_search_term_to_use ) %] + Scan Index for: + [% ELSE %] + Scan Index for: + [% END %]
- [% SEARCH_RESULT.title |html %] + [% SEARCH_RESULT.title |html %] [% SEARCH_RESULT.author %] -- 2.39.5