koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/opac search [dev_week]


From: Ryan Higgins
Subject: [Koha-cvs] koha/opac search [dev_week]
Date: Wed, 11 Apr 2007 16:07:41 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Ryan Higgins <rych>     07/04/11 16:07:41

Modified files:
        opac           : search 

Log message:
        fix lost sort on Next button

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/search?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.9&r2=1.1.2.10

Patches:
Index: search
===================================================================
RCS file: /sources/koha/koha/opac/Attic/search,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -b -r1.1.2.9 -r1.1.2.10
--- search      12 Oct 2006 02:33:21 -0000      1.1.2.9
+++ search      11 Apr 2007 16:07:41 -0000      1.1.2.10
@@ -2,7 +2,7 @@
 # Script to perform searching
 # For documentation try 'perldoc /path/to/search'
 #
-# $Header: /sources/koha/koha/opac/Attic/search,v 1.1.2.9 2006/10/12 02:33:21 
kados Exp $
+# $Header: /sources/koha/koha/opac/Attic/search,v 1.1.2.10 2007/04/11 16:07:41 
rych Exp $
 #
 # Copyright 2006 LibLime
 #
@@ -387,6 +387,7 @@
        ($error, $results_hashref, $facets) = 
getRecords($koha_query,$federated_query,address@hidden,address@hidden,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
 
 };
+
 if ($@ || $error) {
        $template->param(query_error => $error.$@);
        warn "error: ".$error.$@;
@@ -406,7 +407,7 @@
                
                ## If there's just one result, redirect to the detail page
                if ($total == 1) {
-                       my address@hidden>{biblionumber};
+                       my $biblionumber=$newresults[0]->{biblionumber};  
                        print $cgi->redirect("/bib/$biblionumber");
                        exit;
                }
@@ -427,6 +428,7 @@
                        $current_page_number = ($offset / $results_per_page + 
1) if $offset;
                        my $previous_page_offset = $offset - $results_per_page 
unless ($offset - $results_per_page <0);
                        my $next_page_offset = $offset + $results_per_page;
+                       my $sort_by = join " ",@sort_by; 
 
                        # If we're within the first 10 pages, keep it simple
                        #warn "current page:".$current_page_number;
@@ -444,7 +446,7 @@
                                        # it should only be highlighted if it's 
the current page
                                        my $highlight = 1 if ($this_page_number 
== $current_page_number);
                                        # put it in the array
-                                       push @page_numbers, { offset => 
$this_offset, pg => $this_page_number, highlight => $highlight, sort_by => join 
" ",@sort_by };
+                                       push @page_numbers, { offset => 
$this_offset, pg => $this_page_number, highlight => $highlight, sort_by => 
$sort_by };
                                }
                        }
                        # now, show twenty pages, with the current one smack in 
the middle
@@ -453,13 +455,14 @@
                     my $this_offset = 
((($i-9)*$results_per_page)-$results_per_page);
                     my $this_page_number = $i-9;
                     my $highlight = 1 if ($this_page_number == 
$current_page_number);
-                    push @page_numbers, { offset => $this_offset, pg => 
$this_page_number, highlight => $highlight, sort_by => join " ",@sort_by };
+                    push @page_numbers, { offset => $this_offset, pg => 
$this_page_number, highlight => $highlight, sort_by => $sort_by };
                 }
        
                        }
 
                        $template->param(PAGE_NUMBERS => address@hidden,
                                                        previous_page_offset => 
$previous_page_offset,
+                                                       sort_by => $sort_by,
                                                        next_page_offset => 
$next_page_offset) unless $pages < 2;
                }
        } # end of the if local




reply via email to

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