porting sort_by stuff from staff to opac

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Paul POULAIN 2007-11-16 18:49:13 -06:00 committed by Joshua Ferraro
parent 6a8899390c
commit ef2855e2cd
2 changed files with 16 additions and 3 deletions

View file

@ -122,7 +122,20 @@
<p style="float: right;">
Re-sort results
<select id="sort_by" name="sort_by" onChange="javascript:document.myform.submit();">
<!--TMPL_INCLUDE Name="resort_form.inc"-->
<option value="">Field-weighted, Relevance Ranked</option>
<option value="popularity_dsc" <!-- TMPL_IF NAME="popularity_dsc" -->selected="selected" <!-- /TMPL_IF -->>Popularity (Most to Least)</option>
<option value="popularity_asc" <!-- TMPL_IF NAME="popularity_asc" -->selected="selected" <!-- /TMPL_IF -->>Popularity (Least to Most)</option>
<option value="author_az" <!-- TMPL_IF NAME="author_az" -->selected="selected" <!-- /TMPL_IF -->>Author (A-Z)</option>
<option value="author_za" <!-- TMPL_IF NAME="author_za" -->selected="selected" <!-- /TMPL_IF -->>Author (Z-A)</option>
<option value="call_number_asc" <!-- TMPL_IF NAME="call_number_asc" -->selected="selected" <!-- /TMPL_IF -->>Call Number (Non-fiction 0-9 to Fiction A-Z)</option>
<option value="call_number_dsc" <!-- TMPL_IF NAME="call_number_dsc" -->selected="selected" <!-- /TMPL_IF -->>Call Number (Fiction Z-A to Non-fiction 9-0)</option>
<option value="pubdate_asc" <!-- TMPL_IF NAME="pubdate_asc" -->selected="selected" <!-- /TMPL_IF -->>Dates</option>
<option value="pubdate_dsc" <!-- TMPL_IF NAME="pubdate_asc" -->selected="selected" <!-- /TMPL_IF -->>&nbsp;&nbsp;&nbsp;Publication/Copyright Date: Newest to Oldest</option>
<option value="pubdate_asc" <!-- TMPL_IF NAME="pubdate_dsc" -->selected="selected" <!-- /TMPL_IF -->>&nbsp;&nbsp;&nbsp;Publication/Copyright Date: Oldest to Newest</option>
<option value="acqdate_dsc" <!-- TMPL_IF NAME="acqdate_asc" -->selected="selected" <!-- /TMPL_IF -->>&nbsp;&nbsp;&nbsp;Acquisition Date: Newest to Oldest</option>
<option value="acqdate_asc" <!-- TMPL_IF NAME="acqdate_dsc" -->selected="selected" <!-- /TMPL_IF -->>&nbsp;&nbsp;&nbsp;Acquisition Date: Oldest to Newest</option>
<option value="title_az" <!-- TMPL_IF NAME="title_az" -->selected="selected" <!-- /TMPL_IF -->>Title (A-Z)</option>
<option value="title_za" <!-- TMPL_IF NAME="title_za" -->selected="selected" <!-- /TMPL_IF -->>Title (Z-A)</option>
</select>
</p>
<!-- RESORT END -->

View file

@ -325,8 +325,8 @@ if ( $template_name eq "opac-advsearch.tmpl" ) {
# load the sort_by options for the template
my $sort_by = $cgi->param('sort_by');
$template->param( $sort_by => 1);
$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;
@ -348,7 +348,7 @@ my @sort_by;
# load the sort_by options for the template
my $sort_by = $params->{'sort_by'};
$sort_by=~$1.($2 eq "lt"?'d':'a') if ($sort_by=~/1=(\d+) \&([a-z]+)\;/);
$template->param( sort_by => $sort_by);
$template->param( $sort_by => 1);
#
# Use the servers defined, or just search our local catalog(default)