koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/C4 SearchMarc.pm


From: Chris Cormack
Subject: [Koha-cvs] koha/C4 SearchMarc.pm
Date: Tue, 21 Mar 2006 22:49:18 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         
Changes by:     Chris Cormack <address@hidden>  06/03/21 22:49:18

Modified files:
        C4             : SearchMarc.pm 

Log message:
        Adding more sort options

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/SearchMarc.pm.diff?tr1=1.62&tr2=1.63&r1=text&r2=text

Patches:
Index: koha/C4/SearchMarc.pm
diff -u koha/C4/SearchMarc.pm:1.62 koha/C4/SearchMarc.pm:1.63
--- koha/C4/SearchMarc.pm:1.62  Mon Mar 13 23:17:26 2006
+++ koha/C4/SearchMarc.pm       Tue Mar 21 22:49:18 2006
@@ -225,7 +225,7 @@
                        if ($field eq 'biblio.author') {
                                $query .= "Author all \""address@hidden"\"";
                        } elsif ($field eq 'biblio.title') {
-                               $query .= "Title all \""address@hidden"\"";
+                           $query .= "Title all \""address@hidden"\"";
                        } elsif ($field eq 'biblioitems.isbn') {
                                $query .= "Isbn= "address@hidden;
                        } elsif ($field eq 'bibliosubject.subject'){
@@ -258,7 +258,30 @@
        }
         # 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 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]