[Rt-commit] [svn] r1396 - in rtir/branches/1.1/html/RTIR: . Elements Search

leira at pallas.eruditorum.org leira at pallas.eruditorum.org
Wed Sep 1 17:32:26 EDT 2004


Author: leira
Date: Wed Sep  1 17:32:25 2004
New Revision: 1396

Modified:
   rtir/branches/1.1/html/RTIR/Elements/QueueTabs
   rtir/branches/1.1/html/RTIR/Merge.html
   rtir/branches/1.1/html/RTIR/Search/MergeRefine.html
   rtir/branches/1.1/html/RTIR/Search/Results.html
Log:
Fix MergeRefine.  Make Merge.html more like Results.html (they should ultimately become one file, if possible).


Modified: rtir/branches/1.1/html/RTIR/Elements/QueueTabs
==============================================================================
--- rtir/branches/1.1/html/RTIR/Elements/QueueTabs	(original)
+++ rtir/branches/1.1/html/RTIR/Elements/QueueTabs	Wed Sep  1 17:32:25 2004
@@ -109,13 +109,13 @@
             path  => "RTIR/Split.html?Ticket=" . $id, };
 
     $ticket_page_tabs->{'_G'} = { title => loc('Merge'),
-            path  => "RTIR/Merge.html?NewSearch=1&id=$id",
+            path  => "RTIR/Merge.html?id=$id$QueryString",
 	    separator => 1  };
 
 }
 
 foreach my $tab ( sort keys %{$ticket_page_tabs} ) {
-    if ( $ticket_page_tabs->{$tab}->{'path'} eq $current_subtab ) {
+    if ( $ticket_page_tabs->{$tab}->{'path'} eq $current_tab ) {
         $ticket_page_tabs->{$tab}->{"subtabs"}        = $subtabs;
         $tabs->{'this'}->{"current_subtab"}        = 
         $ticket_page_tabs->{$tab}->{"path"};

Modified: rtir/branches/1.1/html/RTIR/Merge.html
==============================================================================
--- rtir/branches/1.1/html/RTIR/Merge.html	(original)
+++ rtir/branches/1.1/html/RTIR/Merge.html	Wed Sep  1 17:32:25 2004
@@ -22,13 +22,19 @@
 %# 
 %# 
 %# END LICENSE BLOCK
-<& /RTIR/Elements/Header, Title => $Title &>
+<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &>
 <& '/RTIR/'.$Type.'/Elements/Tabs', 
     Ticket => $Ticket, 
-    current_tab => "RTIR/Merge.html?NewSearch=1&id=".$Ticket->Id, 
-    current_subtab => "RTIR/Merge.html?NewSearch=1&id=".$Ticket->Id, 
+    current_tab => "RTIR/Merge.html?id=".$Ticket->Id. "$QueryString", 
     subtabs => $mergetabs,
-    Title => $Title &>
+    Title => $title,
+    Format => $Format,
+    Query => $Query,
+    Rows => $Rows,
+    OrderBy => $OrderBy,
+    Order => $Order,
+    QueryString => $QueryString,
+ &>
 
 <& /RTIR/Elements/ListActions, actions => \@results &>
 
@@ -43,9 +49,9 @@
 
 <& /RTIR/Search/Elements/ShowResults, 
     Queue => $Queue,
+    Query => $Query,
     QueryString => $QueryString, 
     BaseURL => $RT::WebPath."/RTIR/Merge.html?id=$id&",
-    Format => $Format,
     %ARGS &>
 
 <HR>
@@ -55,27 +61,13 @@
 
 <%INIT>
 $Format = $RT::RTIRMergeSearchResultFormat;
+$ARGS{'Format'} = $Format;
 
 my $Ticket = LoadTicket($id);
 my $Queue = $Ticket->QueueObj->Name;
 
-my $mergetabs = { } ;
-
-$mergetabs->{'_a'} = {
-    class => "nav",
-    path => "RTIR/Search/MergeRefine.html?Queue=" . $Ticket->QueueObj->Name . "&id=$id",
-    title => loc('Refine') };
-	
 my ($Type, @states) = $m->comp('Elements/Type', Ticket => $Ticket->Id);
 
-if (! $session{'tickets'}) {
-    # Init a new search
-    $session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} );
-}
-
-# Iterate through the ARGS hash and remove anything with a null value.
-map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS);
-
 my $merge = $ARGS{'SelectedTicket'};
 my ($MergeTicket, @results);
 
@@ -89,7 +81,7 @@
   }
 }
 
-my $Title = loc("Merge [_1] #[_2]: [_3]", $Type, $id, $Ticket->Subject);
+my $title = loc("Merge [_1] #[_2]: [_3]", $Type, $id, $Ticket->Subject);
 
 if (!$Query) {
     $Query = $m->comp('/RTIR/Elements/NewQuery', Queue => $Queue);
@@ -111,12 +103,19 @@
 $Query = "$BaseQuery AND ( $Query )";
 $ARGS{'Query'} = $Query;
 
+my $mergetabs = { };
+
+$mergetabs->{'_a'} = {
+    class => "nav",
+    path => "RTIR/Search/MergeRefine.html?Queue=" . $Ticket->QueueObj->Name . "&id=$id$QueryString",
+    title => loc('Refine') };
+	
 </%INIT>
       
 <%ARGS>
 $BaseQuery => undef
 $Query => undef
-$Format => undef 
+$Format => $RT::RTIRMergeSearchResultFormat
 $HideResults => 0
 $Rows => 50
 $Page => 1

Modified: rtir/branches/1.1/html/RTIR/Search/MergeRefine.html
==============================================================================
--- rtir/branches/1.1/html/RTIR/Search/MergeRefine.html	(original)
+++ rtir/branches/1.1/html/RTIR/Search/MergeRefine.html	Wed Sep  1 17:32:25 2004
@@ -46,8 +46,8 @@
 <& /Elements/Header, Title => $title &>
 <& '/RTIR/'.$Type.'/Elements/Tabs', 
     Ticket => $Ticket, 
-    current_tab => "RTIR/Merge.html?NewSearch=1&id=".$Ticket->Id, 
-    current_subtab => "RTIR/MergeRefine.html?Queue=$Queue&id=".$Ticket->Id, 
+    current_tab => $current_tab, 
+    current_subtab => $current_subtab, 
     subtabs => $mergetabs,
     Title => $title &>
 
@@ -60,7 +60,7 @@
     AvailableColumns => $AvailableColumns,
     CurrentFormat => $CurrentFormat,
     BaseQuery => $BaseQuery,
-    FormAction => 'MergeRefine.html',
+    FormAction => $FormAction,
     %ARGS &>
 
 <%INIT>
@@ -73,7 +73,7 @@
 
 $mergetabs->{'_a'} = {
     class => "nav",
-    path => "RTIR/MergeRefine.html?Queue=" . $Ticket->QueueObj->Name . "&id=$id",
+    path => $current_subtab,
     title => loc('Refine') };
 	
 my %queues = ();
@@ -123,8 +123,7 @@
 	     AvailableColumns => \$AvailableColumns,
 	     CurrentFormat => \$CurrentFormat,
 	     BaseQuery => $BaseQuery,
-	     Query => "foo bar",
-	     ResultPage => '/RTIR/Merge.html',
+	     ResultPage => $ResultPage,
 	     id => $id,
 	     %ARGS);
 
@@ -149,4 +148,8 @@
 $Queue => undef
 $Query => undef
 $id => undef
+$current_tab => "RTIR/Merge.html?NewSearch=1&id=".$id
+$current_subtab => "RTIR/MergeRefine.html?Queue=$Queue&id=".$id
+$FormAction => 'MergeRefine.html'
+$ResultPage => '/RTIR/Merge.html'
 </%ARGS>

Modified: rtir/branches/1.1/html/RTIR/Search/Results.html
==============================================================================
--- rtir/branches/1.1/html/RTIR/Search/Results.html	(original)
+++ rtir/branches/1.1/html/RTIR/Search/Results.html	Wed Sep  1 17:32:25 2004
@@ -56,42 +56,24 @@
 &>
 <hr>
 
-<& Elements/ShowResults, QueryString => $QueryString, %ARGS &>
+<& Elements/ShowResults, 
+   Query => $Query, 
+   QueryString => $QueryString, 
+   %ARGS 
+&>
 
 <%INIT>
 my ($Type, @states) = $m->comp("/RTIR/Elements/Type", Queue => $Queue);
 
-my ($title, $ticketcount);
-$session{'i'}++;
-$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'})  unless ($session{'tickets'});
-$session{'tickets'}->FromSQL($Query) if ($Query);
-$session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order); 
-
-if ($OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'}
-    or $Order ne $session{'CurrentSearchHash'}->{'Order'}) {
-    $session{'CurrentSearchHash'}->{'OrderBy'} = $OrderBy;
-    $session{'CurrentSearchHash'}->{'Order'}   = $Order;
-    # Invalidate the ordering cache
-    undef $session{'tickets'}->{'items_array'};
-}
-
-
-if ( $session{'tickets'}->Query()) {
-    $ticketcount = $session{tickets}->CountAll();
-    $title = loc('Found [quant,_1,ticket]', $ticketcount);
-} else {
-    $title = loc("Find tickets");
-}
+my $title = loc("Results");
 
 if (!$Query) {
     $Query = $m->comp('/RTIR/Elements/NewQuery', Queue => $Queue);
 }
 
-$ARGS{'Query'} = $Query;
-
 my $QueryString = "&".$m->comp('/Elements/QueryString',
                                Query => $Query,
-                               Format => $Format . ',__Check__',
+                               Format => $Format,
                                Rows => $Rows,
                                OrderBy => $OrderBy,
                                Order => $Order,
@@ -102,6 +84,7 @@
 }
 
 $Query = "$BaseQuery AND ( $Query )";
+$ARGS{'Query'} = $Query;
 
 </%INIT>
 


More information about the Rt-commit mailing list