Adding more sort options

This commit is contained in:
rangi 2006-03-21 22:49:18 +00:00
parent 6d5073bfe4
commit be22e680c8

View file

@ -258,7 +258,30 @@ sub catalogsearch {
}
# sort result set
# in theory this should sort by title
if ($rs->sort("yaz", "1=4 <i") < 0) {
my $sort;
if ($orderby eq 'biblio.title'){
$sort="1=4";
}
elsif ($orderby eq 'biblio.author'){
$sort="1=1003";
}
elsif ($orderby eq 'biblioitems.dewey'){
$sort="1=13";
}
elsif ($orderby eq 'biblioitems.publicationyear'){
$sort="1=30";
}
elsif ($orderby eq 'biblioitems.publishercode'){
$sort="1=1018";
}
if ($desc_or_asc eq 'ASC'){
$sort.=" <i";
}
else {
$sort.=" >i";
}
if ($rs->sort("yaz", $sort) < 0) {
warn "sort failed";
}
else {