From daf43e4a63b29aab365407fefb4c9c5e2b06cbdd Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Wed, 21 Nov 2007 18:34:08 -0600 Subject: [PATCH] switching from searchdesc to query_desc and limit_desc, searchdesc is now just a flag Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Search.pm | 3 ++- catalogue/search.pl | 20 +++++++++++++------ .../prog/en/modules/catalogue/results.tmpl | 8 ++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 5f15f964de..0e54feed1a 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -833,9 +833,10 @@ sub buildQuery { # these are treated as OR elsif ( $this_limit =~ /mc/ ) { $group_OR_limits .= " or " if $group_OR_limits; + $limit_desc .=" or " if $group_OR_limits; $group_OR_limits .= "$this_limit"; $limit_cgi .="&limit=$this_limit"; - $limit_desc .= " or $this_limit"; + $limit_desc .= "$this_limit"; } # regular old limits diff --git a/catalogue/search.pl b/catalogue/search.pl index 9acd2eaada..4be9a40aa9 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -395,12 +395,12 @@ my $hits; my $expanded_facet = $params->{'expand'}; # Define some global variables -my ( $error,$query,$simple_query,$query_cgi,$query_search_desc,$limit,$limit_cgi,$limit_desc,$query_type); +my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$query_type); my @results; ## I. BUILD THE QUERY -( $error,$query,$simple_query,$query_cgi,$query_search_desc,$limit,$limit_cgi,$limit_desc,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by); +( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by); ## parse the query_cgi string and put it into a form suitable for s my @query_inputs; @@ -480,13 +480,17 @@ for (my $i=0;$i<=@servers;$i++) { if ($server =~/biblioserver/) { # this is the local bibliographic server $hits = $results_hashref->{$server}->{"hits"}; my $page = $cgi->param('page') || 0; - my @newresults = searchResults( $query_search_desc,$hits,$results_per_page,$offset,@{$results_hashref->{$server}->{"RECORDS"}}); + my @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,@{$results_hashref->{$server}->{"RECORDS"}}); $total = $total + $results_hashref->{$server}->{"hits"}; if ($hits) { $template->param(total => $hits); $template->param(limit_cgi => $limit_cgi); $template->param(query_cgi => $query_cgi); - $template->param(searchdesc => ($query_type?"$query_type=":"")."$query_search_desc" ); + $template->param(query_desc => $query_desc); + $template->param(limit_desc => $limit_desc); + if ($query_desc || $limit_desc) { + $template->param(searchdesc => 1); + } $template->param(results_per_page => $results_per_page); $template->param(SEARCH_RESULTS => \@newresults); ## Build the page numbers on the bottom of the page @@ -564,17 +568,21 @@ for (my $i=0;$i<=@servers;$i++) { $template->param( #classlist => $classlist, total => $total, - searchdesc => ($query_type?"$query_type=":"")."$query_search_desc", opacfacets => 1, facets_loop => $facets, scan => $scan, search_error => $error, ); + +if ($query_desc || $limit_desc) { + $template->param(searchdesc => 1); +} + ## Now let's find out if we have any supplemental data to show the user # and in the meantime, save the current query for statistical purposes, etc. my $koha_spsuggest; # a flag to tell if we've got suggestions coming from Koha my @koha_spsuggest; # place we store the suggestions to be returned to the template as LOOP -my $phrases = $query_search_desc; +my $phrases = $query_desc; my $ipaddress; if ( C4::Context->preference("kohaspsuggest") ) { 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 4060533098..6d488270ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -1,12 +1,12 @@ -Koha › Catalog › <!-- TMPL_IF NAME="searchdesc" -->Results of Search for '<!-- TMPL_VAR NAME="searchdesc" -->'<!-- TMPL_ELSE -->You did not specify any search criteria<!-- /TMPL_IF --> +Koha › Catalog › <!-- TMPL_IF NAME="searchdesc" -->Results of Search for '<!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->'<!-- TMPL_ELSE -->You did not specify any search criteria<!-- /TMPL_IF --> - +
@@ -27,13 +27,13 @@

- results found for '' + results found for ''

No results found

- No results match your search for in Catalog. + No results match your search for in Catalog.

No results found