From 57cdaee5de4cfc9878d75d74be6cf395749608e7 Mon Sep 17 00:00:00 2001 From: hdl Date: Fri, 20 Jul 2007 07:49:06 +0000 Subject: [PATCH] Putting order list into Template rather than setting this in a script. For translations. --- koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl | 70 +++++++++++++++++-- opac/opac-search.pl | 10 ++- 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl index f1ebd5026c..1e9f93e8c9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl @@ -114,14 +114,76 @@ Error :
- +

Re-sort results

diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 2146854c6c..aa0287c5dd 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -342,10 +342,8 @@ if ( $template_name eq "opac-advsearch.tmpl" ) { # load the sort_by options for the template my $sort_by = $cgi->param('sort_by'); - my $sort_by_loop = displaySortby($sort_by); - $template->param( - sort_by_loop => $sort_by_loop, - ); + $sort_by=$1.($2 eq "lt"?'d':'a') if ($sort_by=~/1=(\d+) \&([a-z]+)\;/); + $template->param( sort_by => $sort_by); output_html_with_http_headers $cgi, $cookie, $template->output; exit; @@ -366,8 +364,8 @@ my @sort_by; # load the sort_by options for the template my $sort_by = $params->{'sort_by'}; -my $sort_by_loop = displaySortby($sort_by); -$template->param( sort_by_loop => $sort_by_loop ); +$sort_by=~$1.($2 eq "lt"?'d':'a') if ($sort_by=~/1=(\d+) \&([a-z]+)\;/); +$template->param( sort_by => $sort_by); # # Use the servers defined, or just search our local catalog(default) -- 2.39.5