fixing page numbers to use query_cgi
authorJoshua Ferraro <jmf@liblime.com>
Wed, 21 Nov 2007 19:40:15 +0000 (13:40 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 21 Nov 2007 20:13:02 +0000 (14:13 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Search.pm
catalogue/search.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl

index fde3f36..54537d9 100644 (file)
@@ -786,7 +786,9 @@ sub buildQuery {
                         $query .= " $operators[$i-1] ";
                         $query .= " $index_plus " unless $indexes_set;
                         $query .= " $operand";
-                                               $query_cgi .="";
+                                               $query_cgi .="&op=$operators[$i-1]";
+                                               $query_cgi .="&idx=$index" if $index;
+                                               $query_cgi .="&q=$operands[$i]" if $operand;
                                                $query_search_desc .=" $operators[$i-1] $index_plus $operands[$i]";
                     }
 
@@ -795,7 +797,8 @@ sub buildQuery {
                         $query .= " and ";
                         $query .= "$index_plus " unless $indexes_set;
                         $query .= "$operand";
-                                               $query_cgi .="";
+                                               $query_cgi .="&op=and&idx=$index" if $index;
+                                               $query_cgi .="&q=$operands[$i]" if $operand;
                         $query_search_desc .= " and $index_plus $operands[$i]";
                     }
                 }
@@ -805,7 +808,8 @@ sub buildQuery {
                                        $query .=" $index_plus " unless $indexes_set;
                                        $query .= $operand;
                                        $query_search_desc .= " $index_plus $operands[$i]";
-                                       $query_cgi.="";
+                                       $query_cgi.="&idx=$index" if $index;
+                                       $query_cgi.="&q=$operands[$i]" if $operand;
 
                     $previous_operand = 1;
                 }
index 2ad81c8..6fa3d8a 100755 (executable)
@@ -461,6 +461,7 @@ for (my $i=0;$i<=@servers;$i++) {
         if ($hits) {
             $template->param(total => $hits);
                        $template->param(limit_cgi => $limit_cgi);
+                       $template->param(query_cgi => $query_cgi);
             $template->param(searchdesc => ($query_type?"$query_type=":"")."$query_search_desc" );
             $template->param(results_per_page =>  $results_per_page);
             $template->param(SEARCH_RESULTS => \@newresults);
index 17b5fc3..49f40a7 100644 (file)
     
 <!-- TMPL_IF NAME="PAGE_NUMBERS" --><div class="pages">
     <!-- Row of numbers corresponding to search result pages -->
-        <!-- TMPL_IF NAME="previous_page_offset" --><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?q=<!-- TMPL_VAR NAME="searchdesc" -->&amp;offset=<!-- TMPL_VAR NAME="previous_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">&lt;&lt; Previous</a><!-- /TMPL_IF -->
-    <!-- TMPL_LOOP NAME="PAGE_NUMBERS" --><!-- TMPL_IF NAME="highlight" --><span class="current"><!-- TMPL_VAR NAME="pg" --></span><!-- TMPL_ELSE -->        <a class="nav" href="/cgi-bin/koha/catalogue/search.pl?q=<!-- TMPL_VAR NAME="searchdesc" -->&amp;offset=<!-- TMPL_VAR NAME="offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->"><!-- TMPL_VAR NAME="pg" --></a><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="previous_page_offset" --><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="previous_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">&lt;&lt; Previous</a><!-- /TMPL_IF -->
+
+    <!-- TMPL_LOOP NAME="PAGE_NUMBERS" --><!-- TMPL_IF NAME="highlight" --><span class="current"><!-- TMPL_VAR NAME="pg" --></span><!-- TMPL_ELSE -->        <a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->"><!-- TMPL_VAR NAME="pg" --></a><!-- /TMPL_IF -->
     <!-- /TMPL_LOOP -->
 
-        <!-- TMPL_IF NAME="next_page_offset" --><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?q=<!-- TMPL_VAR NAME="searchdesc" -->&amp;offset=<!-- TMPL_VAR NAME="next_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Next &gt;&gt;</a><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="next_page_offset" --><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="next_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Next &gt;&gt;</a><!-- /TMPL_IF -->
 </div><!-- /TMPL_IF -->
     
         <!-- TMPL_IF NAME="outer_sup_results_loop" -->