koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/opac opac-search.pl [rel_2_2]


From: Ryan Higgins
Subject: [Koha-cvs] koha/opac opac-search.pl [rel_2_2]
Date: Sun, 08 Apr 2007 14:52:27 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Ryan Higgins <rych>     07/04/08 14:52:27

Modified files:
        opac           : opac-search.pl 

Log message:
        adding numresults & sort preferences

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-search.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.21.2.19&r2=1.21.2.20

Patches:
Index: opac-search.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-search.pl,v
retrieving revision 1.21.2.19
retrieving revision 1.21.2.20
diff -u -b -r1.21.2.19 -r1.21.2.20
--- opac-search.pl      14 Nov 2006 10:43:57 -0000      1.21.2.19
+++ opac-search.pl      8 Apr 2007 14:52:27 -0000       1.21.2.20
@@ -43,6 +43,9 @@
        my $orderby = $query->param('orderby');
        my $desc_or_asc = $query->param('desc_or_asc');
        my $exactsearch = $query->param('exact');
+    if (C4::Context->preference('numericCallNumber') && $orderby eq 
'biblioitems.classification') {
+        $desc_or_asc .= '+0';
+    } # interpret classification as number, not string.
        my @tags;
        for (my $i=0;$i<=$#marclist;$i++) {
       if ($marclist[$i] eq "biblioitems.isbn") {
@@ -71,9 +74,13 @@
         push @tags, "";
       }
     }
-       
+    if ( $query->param('resultsperpage') ) {
        $resultsperpage= $query->param('resultsperpage');
-       $resultsperpage = 19 if(!defined $resultsperpage);
+    } elsif ( C4::Context->preference('opacDefaultNumResults') ) {
+        $resultsperpage=  C4::Context->preference('opacDefaultNumResults');
+    } else {
+        $resultsperpage = 19 ;
+    }; 
        
        if ($exactsearch) {
                foreach (@operator) {
@@ -99,7 +106,7 @@
                                                                                
$startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc);
        if ($total ==1) {
        if (C4::Context->preference("BiblioDefaultView") eq "normal") {
-            print 
$query->redirect("/cgi-bin/koha/opac-detail.pl?bib="address@hidden>{biblionumber});
+            print 
$query->redirect("/cgi-bin/koha/opac-detail.pl?bib="address@hidden>{biblionumber}
 . "&single=1" );
        } elsif (C4::Context->preference("BiblioDefaultView") eq "marc") {
             print 
$query->redirect("/cgi-bin/koha/opac-MARCdetail.pl?bib="address@hidden>{biblionumber});
        } else {
@@ -195,6 +202,7 @@
                        numbers=>address@hidden,
                        searchdesc=> $searchdesc,
                        $defaultview => 1,
+            urlLinkText => C4::Context->preference("urlLinkText"),
                );
 
 } else {
@@ -254,16 +262,8 @@
        $template->param(classlist => $classlist,
                                        branchloop=>address@hidden,
                                        itemtypeloop => address@hidden,
-#                                      CGIbranch => $CGIbranch,
-                                       suggestion => 
C4::Context->preference("suggestion"),
-                                       virtualshelves => 
C4::Context->preference("virtualshelves"),
-                                       LibraryName => 
C4::Context->preference("LibraryName"),
-                                       OpacNav => 
C4::Context->preference("OpacNav"),
-                                       opaccredits => 
C4::Context->preference("opaccredits"),
-                                       AmazonContent => 
C4::Context->preference("AmazonContent"),
-                               opacsmallimage => 
C4::Context->preference("opacsmallimage"),
-                               opaclayoutstylesheet => 
C4::Context->preference("opaclayoutstylesheet"),
-                               opaccolorstylesheet => 
C4::Context->preference("opaccolorstylesheet"),
+                                       CGIbranch => $CGIbranch,
+                                       opacDefaultNumResults => 
C4::Context->preference("opacDefaultNumResults"),
        );
 }
 




reply via email to

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