[Rt-commit] r4736 - in rtir/branches/1.9-EXPERIMENTAL: html/RTIR/Elements html/RTIR/Search html/RTIR/Search/Elements

ruz at bestpractical.com ruz at bestpractical.com
Mon Mar 13 14:57:37 EST 2006


Author: ruz
Date: Mon Mar 13 14:57:35 2006
New Revision: 4736

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/BuildQuery
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCFs
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCriteria
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/RefineTabs
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Refine.html
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Results.html

Log:
 r936 at cubic-pc:  cubic | 2006-03-13 23:02:01 +0300
  r928 at cubic-pc:  cubic | 2006-03-13 22:52:29 +0300
  "search refine" refactoring
  
  Main things we want to complete:
  * add links to refine page in different places,
    for example when you're on Merge page you can click link and
    refine query and return back to *the same* merge page you were on;
  * append tabs to queue or ticket level with refine subtab,
    for example you are on 'Link IR #XXX to Incident' page and you see
    'RTIR->IRs->IR #XXX->Link to Incident' as active chian of tabs, but
    there is also refine subtab and you can click it and stay on *the same*
    tabs and return back link page after refining
  * pages that have query argument and need refine functionality has also
    other arguments which define state of the page like id, Queue, All, Status,
    Child and other so we need easy way to pass this args through Refine.html
  
  RefineTabs
  * This is wrapper around QueueTabs, that you should use when you want to add
    refine subtab to the active tab.
  * Component allow to do three things:
    1) append tabs to ticket view or queue view with refine subtab
    2) add subtab to the tab defined in QueueTabs
    3) all other calls works as page uses default Queues's refine tab
  * $current_tab, $QueryString are required arguments
  * in order to add refine subtab provide $current_subtab argument
  ** $current_subtab should be path to refine page component,
     usually it should be RTIR/Search/Refine.html, but nobody stops
     you to use another refine page
  ** BaseQuery is also needed if you want show it to user on refine page
  
  PickCriteria and PickCFs
  * there is could be more then one queue in list,
    we should show all CFs
  
  QueueTabs:
  * Load Ticket when we have id
  * we appendtabs, but it could have subtabs which shouldn't drop
  * pass through BaseQuery and ResultPage to Refine.html
  
 


Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs	Mon Mar 13 14:57:35 2006
@@ -35,7 +35,12 @@
 
 <%INIT>
 if ( $QueryString =~ s/^&// ) {
-    $RT::Logger->warning("queue string has leading &");
+    $RT::Logger->warning("query string has leading &");
+}
+
+if ( !$Ticket && $id ) {
+    $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
+    $Ticket->Load( $id );
 }
 
 my ($Type) = $m->comp( '/RTIR/Elements/Type', Queue => $QueueName );
@@ -125,19 +130,18 @@
         };
 
         foreach my $key ( keys %$appendtabs ) {
-            $ticket_page_tabs->{$key}->{'title'}
-                = $appendtabs->{$key}->{'title'};
-            $ticket_page_tabs->{$key}->{'path'}
-                = $appendtabs->{$key}->{'path'};
+            foreach ( qw(title path subtabs current_subtab) ) {
+                $ticket_page_tabs->{ $key }->{ $_ } = $appendtabs->{ $key }->{ $_ };
+            }
         }
     }
-    $tabs->{'this'}->{'subtabs'} = $ticket_page_tabs;
     $current_subtab ||= "RTIR/Display.html?id=$id";
 
+    $tabs->{'this'}->{'subtabs'} = $ticket_page_tabs;
     foreach my $tab ( values %$ticket_page_tabs ) {
         next unless $tab->{'path'} eq $current_subtab;
-
-        $tab->{'subtabs'} = $subtabs;
+        
+        $tab->{'subtabs'} = { %{ $tab->{'subtabs'} || {} }, %$subtabs } if $subtabs;
         $tabs->{'this'}->{'current_subtab'} = $tab->{'path'};
     }
 
@@ -247,7 +251,7 @@
 # If we're looking at a specific item, dont' show the refine tab
 $tabs->{"A"} = {
     path  => "RTIR/Create.html?$EscapedQueueName",
-    title => loc("New $Type")
+    title => loc("New $Type"),
 };
 
 $tabs->{"g"} = {
@@ -258,9 +262,9 @@
     $tabs->{'ga'} = {
         class => "nav",
         path  => "RTIR/Search/Refine.html?$EscapedQueueName&$QueryString&"
-            . $m->comp(
-            '/Elements/QueryString',
-            ResultPage => "/RTIR/Search/Results.html?$EscapedQueueName",
+            . $m->comp('/Elements/QueryString',
+                BaseQuery  => $BaseQuery,
+                ResultPage => "/RTIR/Search/Results.html?$EscapedQueueName",
             ),
         title => loc('Refine'),
     };
@@ -291,20 +295,27 @@
     };
 }
 
-foreach my $tab ( values %{$tabs} ) {
-    if ( $tab->{'path'} eq $current_tab ) {
+if ( $subtabs ) {
+    foreach my $tab ( values %{$tabs} ) {
+        next unless $tab->{'path'} eq $current_tab;
+
         $tab->{'subtabs'} = { %{ $tab->{'subtabs'} || {} }, %$subtabs };
     }
 }
 
 </%INIT>
 <%ARGS>
-$Ticket => undef
-$subtabs => {}
-$appendtabs => undef
-$current_tab => undef
+$Title          => ''
+$id             => undef
+$Ticket         => undef
+$QueueName      => 'Incident Reports'
+
+$BaseQuery      => ''
+$QueryString    => ''
+
+$appendtabs     => undef
+$current_tab    => undef
+
+$subtabs        => {}
 $current_subtab => undef
-$Title => ''
-$QueryString => ''
-$QueueName => 'Incident Reports'
 </%ARGS>

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/BuildQuery
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/BuildQuery	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/BuildQuery	Mon Mar 13 14:57:35 2006
@@ -44,18 +44,16 @@
 %# 
 %# }}} END BPS TAGGED BLOCK
 
-<form method="post" action="Refine.html" name="BuildQuery">
-<input type="hidden" name="SearchId" value="<%$SearchId%>" />
-<input type="hidden" name="Query" value="<%$Query%>" />
-<input type="hidden" name="Format" value="<%$Format%>" />
-<input type="hidden" name="BaseQuery" value="<%$BaseQuery%>" />
-<input type="hidden" name="Queue" value="<%$Queue%>" />
-<input type="hidden" name="id" value="<%$id%>" />
-<input type="hidden" name="ResultPage" value="<%$ResultPage%>" />
+<form method="post" action="<% RT->Config->Get('WebPath')%><% $m->request_comp->path %>" name="BuildQuery">
+<input type="hidden" name="SearchId" value="<% $SearchId %>" />
+<input type="hidden" name="BaseQuery" value="<% $BaseQuery %>" />
+<input type="hidden" name="Query" value="<% $Query %>" />
+<input type="hidden" name="Format" value="<% $Format %>" />
+<input type="hidden" name="ResultPage" value="<% $ResultPage %>" />
 <table width="100%">
 <tr>
 <td valign="top" class="boxcontainer">
-<& PickCriteria, query => $Query, Queue => $Queue &>
+<& PickCriteria, Queues => $queues &>
 <& /Elements/Submit, Caption => loc('Add additional criteria'), Label => loc('Add'), Name => 'AddClause'&>
 
 </td>
@@ -94,7 +92,6 @@
     &>
 </form>
 <%ARGS>
-$id => undef
 $SearchId => undef
 $BaseQuery => undef
 $Query => undef
@@ -103,7 +100,6 @@
 $Order => undef
 $OrderBy => undef
 $RowsPerPage => undef
-$HideResults => 0
 $queues => undef
 @actions => ()
 $optionlist => undef

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCFs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCFs	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCFs	Mon Mar 13 14:57:35 2006
@@ -48,17 +48,32 @@
 % }
 <%INIT>
 my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
-my $QueueObj = RT::Queue->new($session{'CurrentUser'});
-$QueueObj->Load($Queue);
-
-$CustomFields->LimitToQueue( $QueueObj->Id );
 $CustomFields->LimitToGlobal;
 $CustomFields->Limit( FIELD => 'Name', OPERATOR => 'STARTSWITH', VALUE => '_RTIR_' );
 
+if ( $Queues ) {
+    my @list;
+    if ( ref $Queues eq 'HASH' ) {
+        @list = grep $_ && $Queues->{$_}, keys %$Queues;
+    }
+    elsif ( ref $Queues eq 'ARRAY' ) {
+        @list = grep $_, @$Queues;
+    } else {
+        @list = ($Queues);
+    }
+    foreach my $queue( @list ) {
+        my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
+        $QueueObj->Load( $queue );
+        next unless $QueueObj->Id;
+
+        $CustomFields->LimitToQueue( $QueueObj->Id );
+    }
+}
+
 my @lines;
 while ( my $CustomField = $CustomFields->Next ) {
     my $label = $CustomField->Name;
-    $label =~ s/^_RTIR_//;
+    $label =~ s/^_RTIR_//; # XXX: add queue name to label
 
     my %line;
     $line{'Name'} = "'CF.{" . $CustomField->Name . "}'";
@@ -83,5 +98,5 @@
 </%INIT>
 
 <%ARGS>
-$Queue => undef
+$Queues => undef
 </%ARGS>

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCriteria
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCriteria	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCriteria	Mon Mar 13 14:57:35 2006
@@ -58,22 +58,12 @@
 <tr class="separator"><td colspan="3"><hr /></td></tr>
 
 <& /Search/Elements/PickBasics &>
-<& PickCFs, Queue => $Queue &>
-<& /Search/Elements/PickCFs, cfqueues => $cfqueues &>
+<& PickCFs, Queues => $Queues &>
+<& /Search/Elements/PickCFs, cfqueues => $Queues &>
 
 </table>
 
 </&>
-
-<%INIT>
-my $cfqueues = ();
-my $QueueObj = new RT::Queue($session{'CurrentUser'});
-$QueueObj->Load($Queue);
-$cfqueues->{$QueueObj->Id} = 1;
-</%INIT>
-
 <%ARGS>
-$addquery => 0
-$query => undef
-$Queue => undef
+$Queues => {}
 </%ARGS>

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/RefineTabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/RefineTabs	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/RefineTabs	Mon Mar 13 14:57:35 2006
@@ -1,12 +1,142 @@
-<& '/RTIR/'.$Type.'/Elements/Tabs', 
-    current_tab => 'RTIR/Search/Refine.html',
-    %ARGS
+<& '/RTIR/' . $Type . '/Elements/Tabs',
+    %ARGS,
+    current_tab    => $current_tab,
+    appendtabs     => $appendtabs,
+    subtabs        => $subtabs,
+    current_subtab => $current_subtab,
+    
 &>
 
 <%INIT>
-my ($Type) = $m->comp("/RTIR/Elements/Type", Queue => $Queue);
+my $split_uri = sub {
+    my $path = shift;
+    my @args;
+    ($path, @args) = split /[?&=]/, $path;
+    my %args;
+    while( my $k = shift @args ) {
+        my $v = shift @args;
+        s/%([0-9A-Z][0-9A-Z])/chr(hex($1))/gei for ($k, $v);
+        if ( exists $args{ $k } ) {
+            $args{ $k } = [ $args{ $k } ] unless ref $args{ $k };
+            push @{$args{ $k }}, $v;
+        }
+        else {
+            $args{ $k } = $v;
+        }
+    }
+    return $path, %args;
+};
+
+# if there is no args passed then parse them from URL
+unless( $id || $Ticket || $Queue ) {
+    my ($path, %args) = $split_uri->($current_tab);
+    ($id, $Queue) = @ARGS{'id', 'Queue'} = @args{'id', 'Queue'};
+}
+
+my ($QueueType) = $m->comp('/RTIR/Elements/Type', Queue => $Queue );
+my ($TicketType) = $m->comp('/RTIR/Elements/Type', Ticket => $id, TicketObj => $Ticket );
+my $Type = $TicketType || $QueueType;
+
+my %appendable_tab = (
+    'RTIR/Incident/ShowChildren.html' => {
+        title => loc('Children: [_1]', $Queue),
+    },
+    'RTIR/Incident/LinkChildren.html' => {
+        title => loc('Link [_1]', $QueueType),
+    },
+    'RTIR/Incident/LinkToIncident.html' => {
+        title => loc('Link to Incident'),
+    },
+    'RTIR/Incident/Reply.html' => {
+        title => loc('Bulk reply'),
+    },
+    'RTIR/Incident/LinkArticles.html' => {
+        title => loc('Link article'),
+    },
+    'RTIR/Create.html' => {
+        title => loc('Create linked [_1]', $QueueType),
+    },
+);
+
+my %with_subtab = (
+    'RTIR/Merge.html' => 1,
+);
+
+my $refine_path = '';
+if ( $current_subtab ) {
+    $refine_path = "$current_subtab?$QueryString&";
+    $refine_path .= $m->comp('/Elements/QueryString',
+        BaseQuery  => $BaseQuery,
+        ResultPage => $current_tab,
+    );
+}
+
+my ($current_tab_base, $current_tab_args) = split /\?/, $current_tab, 2;
+
+my ($appendtabs, $subtabs);
+if ( $appendable_tab{ $current_tab_base } ) {
+    # append tab and add refine subtab if needed
+    my $path = $current_tab;
+    if ( $QueryString ) {
+        $path .= ($path =~ /\?/)? '&': '?';
+        $path .= $QueryString;
+    }
+
+    $appendtabs->{'_I'} = {
+        path           => $path,
+        title          => $appendable_tab{ $current_tab_base }->{'title'},
+    };
+
+    if ( $current_subtab ) {
+        $appendtabs->{'_I'}->{'current_subtab'} = $refine_path if $current_subtab_active;
+        $appendtabs->{'_I'}->{'subtabs'} = {
+            _a => {
+                path => $refine_path,
+                title => loc('Refine'),
+            }
+        };
+    }
+    $current_subtab = $path;
+}
+elsif( $with_subtab{ $current_tab_base } ) {
+    # add refine subtab only
+    my $path = $current_tab;
+    if ( $QueryString ) {
+        $path .= ($path =~ /\?/)? '&': '?';
+        $path .= $QueryString;
+    }
+    if ( $current_subtab ) {
+# XXX: there is no way to mark refine subtab active
+#        $subtabs->{'current_subtab'} = $refine_path if $current_subtab_active;
+        $subtabs->{'_a'} = {
+            path => $refine_path,
+            title => loc('Refine'),
+        };
+    }
+    $current_subtab = $path;
+} else {
+    # don't add tabs or subtabs, but mark correct thing
+    if ( $current_subtab_active ) {
+        $current_tab_args ||= '';
+        my $refine_path = "$current_subtab?$current_tab_args&$QueryString";
+        $refine_path .= "&". $m->comp('/Elements/QueryString',
+            BaseQuery  => $BaseQuery,
+            ResultPage => $current_tab,
+        );
+        $current_tab = $refine_path;
+    }
+}
 
 </%INIT>
 <%ARGS>
-$Queue => ''
+$Ticket                => undef
+$id                    => $Ticket? $Ticket->Id: undef
+$Queue                 => undef
+
+$BaseQuery             => undef
+$QueryString           => undef
+
+$current_tab           => undef
+$current_subtab        => undef
+$current_subtab_active => 0
 </%ARGS>

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Refine.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Refine.html	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Refine.html	Mon Mar 13 14:57:35 2006
@@ -1,38 +1,38 @@
 %# {{{ BEGIN BPS TAGGED BLOCK
-%# 
+%#
 %# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
 %#                                          <jesse at bestpractical.com>
-%# 
+%#
 %# (Except where explicitly superseded by other copyright notices)
-%# 
-%# 
+%#
+%#
 %# LICENSE:
-%# 
+%#
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# been provided with this software, but in any event can be snarfed
 %# from www.gnu.org.
-%# 
+%#
 %# This work is distributed in the hope that it will be useful, but
 %# WITHOUT ANY WARRANTY; without even the implied warranty of
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
-%# 
+%#
 %# You should have received a copy of the GNU General Public License
 %# along with this program; if not, write to the Free Software
 %# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-%# 
-%# 
+%#
+%#
 %# CONTRIBUTION SUBMISSION POLICY:
-%# 
+%#
 %# (The following paragraph is not intended to limit the rights granted
 %# to you to modify and distribute this software under the terms of
 %# the GNU General Public License and is only of importance to you if
 %# you choose to contribute your changes and enhancements to the
 %# community by submitting them to Best Practical Solutions, LLC.)
-%# 
+%#
 %# By intentionally submitting any modifications, corrections or
 %# derivatives to this work, or any other work intended for use with
 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
@@ -41,56 +41,44 @@
 %# royalty-free, perpetual, license to use, copy, create derivative
 %# works based on those contributions, and sublicense and distribute
 %# those contributions and any derivatives thereof.
-%# 
+%#
 %# }}} END BPS TAGGED BLOCK
 <& /Elements/Header, Title => $title &>
 
-<& '/RTIR/Search/Elements/RefineTabs',
-   path => $path,
-   current_tab => $current_tab,
-   current_subtab => $current_subtab,
-   Ticket => $Ticket, 
-   Queue => $Queue,
+<& Elements/RefineTabs, 
    Title => $title,
-   Format => $Format,
-   Query => $Query,
-   Rows => $Rows,
-   OrderBy => $OrderBy,
-   Order => $Order,
+
+   BaseQuery   => $BaseQuery,
    QueryString => $QueryString,
-   id => $id,
+
+   current_tab           => $ResultPage,
+   current_subtab        => 'RTIR/Search/Refine.html',
+   current_subtab_active => 1,
 &>
 
-<& /RTIR/Search/Elements/BuildQuery, 
-    id => $id,
+<& Elements/BuildQuery,
     queues => \%queues, 
     actions => $results, 
     optionlist => $optionlist,
     search_hash => $search_hash,
     AvailableColumns => $AvailableColumns,
     CurrentFormat => $CurrentFormat,
-    BaseQuery => $BaseQuery,
     ResultPage => $ResultPage,
     SearchId => $SearchId,
     NewQuery => $NewQuery,
+
+    BaseQuery => $BaseQuery,
     Query => $Query,
-    BaseURL => $BaseURL,
-    Rows => $Rows,
     Format => $Format,
-    Queue => $Queue,
+    Rows => $Rows,
     Page => $Page,
-    Order => $Order,
     OrderBy => $OrderBy,
+    Order => $Order,
 &>
 
 <%INIT>
 my $SearchId;
 
-if ( !$Ticket && $id ) {
-    $Ticket = new RT::Ticket($session{'CurrentUser'});
-    $Ticket->Load( $id );
-}
-
 my %queues = ();
 my $results;
 my $optionlist;
@@ -99,37 +87,14 @@
 my $AvailableColumns;
 my $CurrentFormat;
 
-# Set up a queues so we can use it to find custom fields to sort on or display
-$queues{$Queue} = 1;
-
-$BaseQuery ||= $m->comp('/RTIR/Elements/BaseQuery', Queue => $Queue);
-
-if ($NewQuery) {
-    # If it's a new query, wipe it ourselves...
-
-    # Wipe all data-carrying variables clear if we want a new
-    # search, or we're deleting an old one..
-
-    $Query = '';
-    $Format = '';
-    $Order = '';
-    $OrderBy = '';
-    $Rows = '';
-    # ($search hasn't been set yet; no need to clear)
-
-    $m->comp('Elements/ClearQuery', %ARGS);
-
-    # and replace it with our standard new query...
-
-    $Query = $m->comp('/RTIR/Elements/NewQuery', Queue => $Queue);
-
-    # and claim it isn't a new query any more
-
+if ( $NewQuery ) {
+    $Query = ''; $Format = ''; $Order = ''; $OrderBy = ''; $Rows = '';
+    $m->comp('/RTIR/Search/Elements/ClearQuery', %ARGS);
     $NewQuery = 0;
 }
 
 ( $Query, $Format, $Order, $OrderBy, $Rows, $SearchId ) = 
-    $m->comp('/RTIR/Search/Elements/ProcessQuery', 
+    $m->comp('Elements/ProcessQuery',
              queues => \%queues, 
              results => \$results, 
              optionlist => \$optionlist,
@@ -139,52 +104,29 @@
              CurrentFormat => \$CurrentFormat,
              BaseQuery => $BaseQuery,
              ResultPage => $ResultPage,
-             id => $id,
-             %ARGS);
+             %ARGS,
+    );
 
-# {{{ Build a querystring for the tabs
-my $QueryString = $m->comp('/Elements/QueryString', 
-        Query => $Query,
-        Format => $Format,
-        Order => $Order,
-        OrderBy => $OrderBy,
-        Rows => $Rows) if ($Query);
-# }}}
-
-my $path = $BaseURL;
-if( $path !~ /[?&]$/ ) {
-    $path .= ($path =~ /\?/)? '&': '?';
-}
-$path .= $m->comp( '/Elements/QueryString',
-                   Queue => $Queue,
-                   id    => $id,
-                 );
-$path .= "&$QueryString";
-
-$current_tab ||= 'RTIR/Search/Refine.html?'
-                 . $m->comp( '/Elements/QueryString', Queue => $Queue )
-                 .'&'. $QueryString
-                 .'&'. $m->comp( '/Elements/QueryString', ResultPage => $ResultPage );
+my $QueryString = $m->comp('/Elements/QueryString',
+    Query   => $Query,
+    Format  => $Format,
+    Order   => $Order,
+    OrderBy => $OrderBy,
+    Rows    => $Rows,
+);
 
 </%INIT>
 
 <%ARGS>
-$id => undef
-$Ticket => undef
-
-$title => loc("Refine Search")
-$ResultPage => undef
-$BaseURL => 'RTIR/Search/Refine.html'
-$NewQuery => 0
-
-$Queue => ''
-$BaseQuery => ''
-$Query => ''
-$Format => undef
-$Rows => 50
-$Page => 1
-$OrderBy => 'id'
-$Order => 'ASC'
-$current_tab => undef
-$current_subtab => undef
+$title      => loc("Refine Search")
+$ResultPage => 'RTIR/Search/Results.html'
+$NewQuery   => 0
+
+$BaseQuery  => ''
+$Query      => ''
+$Format     => undef
+$Rows       => 50
+$Page       => 1
+$OrderBy    => 'id'
+$Order      => 'ASC'
 </%ARGS>

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Results.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Results.html	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Results.html	Mon Mar 13 14:57:35 2006
@@ -45,28 +45,26 @@
 %# }}} END BPS TAGGED BLOCK
 <& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} || 0 &>
 <& '/RTIR/'.$Type.'/Elements/Tabs',
-    current_tab => "RTIR/Search/Results.html?$EscapedQueue&$QueryString",
     Title       => $title,
-    Format      => $Format,
-    Query       => $Query,
-    Rows        => $Rows,
-    OrderBy     => $OrderBy,
-    Order       => $Order,
+    BaseQuery   => $BaseQuery,
     QueryString => $QueryString,
+
+    current_tab => $current_tab,
 &>
 
 <& /Elements/ListActions, actions => \@results &>
 
 <& Elements/ShowResults,
     %ARGS,
-    Queue       => $Queue,
-    BaseQuery   => $BaseQuery,
-    Query       => $Query,
-    Format      => $Format,
-    Rows        => $Rows,
-    Page        => $Page,
-    OrderBy     => $OrderBy,
-    Order       => $Order,
+    Queue          => $Queue,
+    BaseURL        => $BaseURL,
+    BaseQuery      => $BaseQuery,
+    Query          => $Query,
+    Format         => $Format,
+    Rows           => $Rows,
+    Page           => $Page,
+    OrderBy        => $OrderBy,
+    Order          => $Order,
     ShowNavigation => 1
 &>
 <div align="right">
@@ -78,20 +76,20 @@
 $Format    ||= RT->Config->Get('RTIRSearchResultFormats')->{ $Type . 'Default' };
 
 my $QueryString = $m->comp( '/Elements/QueryString',
-                            BaseQuery => $BaseQuery,
                             Query     => $Query,
                             Format    => $Format,
                             Rows      => $Rows,
+                            Page      => $Page,
                             OrderBy   => $OrderBy,
                             Order     => $Order,
-                            Page      => $Page,
                           );
-my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query);
-my $EscapedQueue = $m->comp( '/Elements/QueryString', Queue => $Queue );
+my $BaseURL = "RTIR/Search/Results.html?". $m->comp( '/Elements/QueryString', Queue => $Queue );
+my $current_tab = "$BaseURL&$QueryString";
 
 </%INIT>
 <%ARGS>
 $Queue     => ''
+
 $BaseQuery => $m->comp( '/RTIR/Elements/BaseQuery', Queue => $Queue )
 $Query     => $m->comp( '/RTIR/Elements/NewQuery', Queue => $Queue )
 $Format    => undef
@@ -99,5 +97,6 @@
 $Page      => 1
 $OrderBy   => 'id'
 $Order     => 'ASC'
+
 @results   => ()
 </%ARGS>


More information about the Rt-commit mailing list