[Rt-commit] [svn] r1138 - rt/branches/rt-3.1/html/Ticket/Elements

alexmv at pallas.eruditorum.org alexmv at pallas.eruditorum.org
Tue Jun 22 19:37:55 EDT 2004


Author: alexmv
Date: Tue Jun 22 19:37:54 2004
New Revision: 1138

Modified:
   rt/branches/rt-3.1/html/Ticket/Elements/Tabs
Log:
 * Fix first/prev/next/last buttons (only show once, reparent to sensible place)
 * Add "show results" link whenever there is a search


Modified: rt/branches/rt-3.1/html/Ticket/Elements/Tabs
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Elements/Tabs	(original)
+++ rt/branches/rt-3.1/html/Ticket/Elements/Tabs	Tue Jun 22 19:37:54 2004
@@ -51,7 +51,7 @@
 		$session{'tickets'}->PrepForSerialization();
         }
 
-        # Don't $current_toptab = display prev links if we're on the first ticket
+        # Don't display prev links if we're on the first ticket
         if ($item_map->{$Ticket->Id}->{prev}) {
                 $searchtabs->{'_a'} = {
                             class => "nav",
@@ -159,28 +159,28 @@
 
 my $args = "?" . $m->comp(
     '/Elements/QueryString',
-    Query  => $ARGS{'Query'},
-    Format => $ARGS{'Format'},
-    Rows   => $ARGS{'Rows'}
-  ) if ($ARGS{'Query'});
+    Query  => $ARGS{'Query'}  || $session{'CurrentSearchHash'}->{'Query'},
+    Format => $ARGS{'Format'} || $session{'CurrentSearchHash'}->{'Format'},
+    Rows   => $ARGS{'Rows'},
+  ) if ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'});
 
 $tabs->{"f"} = { path      => "Search/Build.html?NewQuery=1",
-                 title     => loc('New Query'),
-                 subtabs   => $searchtabs };
+                 title     => loc('New Query')};
 $tabs->{"g"} = { path      => "Search/Build.html$args",
-                 title     => loc('Query Builder'),
-                 subtabs   => $searchtabs };
+                 title     => loc('Query Builder')};
 $tabs->{"h"} = { path      => "Search/Edit.html$args",
                  title     => loc('Advanced'),
                  separator => 1 };
-if ($current_tab =~  "Search/Results.html") {
-$tabs->{"i"} = { path      => "Search/Results.html$args",
-                 title     => loc('Show Results'),
-                 separator => 1 };
-
-$current_tab = "Search/Results.html$args";
-
+if (defined $session{'tickets'} and $session{'tickets'}->Count) {
+  $tabs->{"i"} = { path      => "Search/Results.html$args",
+                   title     => loc('Show Results'),
+                   separator => 1,
+                   subtabs   => $searchtabs };
+  if ($current_tab =~  "Search/Results.html") {
+    $current_tab = "Search/Results.html$args";
+  }
 }
+
 </%INIT>
 
   


More information about the Rt-commit mailing list