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

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


Author: ruz
Date: Mon Mar 13 14:57:01 2006
New Revision: 4735

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/ShowResults

Log:
 r935 at cubic-pc:  cubic | 2006-03-13 23:02:01 +0300
  r927 at cubic-pc:  cubic | 2006-03-13 18:32:50 +0300
  * add leading WebPath to BaseURL if it has no leading slash
  * add trailing URL args separator if there is no one
  ** both changes allow to pass $current_tab without changes,
     dancing around this facts in components makes code more complicated
 


Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/ShowResults
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/ShowResults	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/ShowResults	Mon Mar 13 14:57:01 2006
@@ -27,22 +27,21 @@
                             Queue     => $Queue,
                             Query     => $Query,
                             Rows      => $Rows,
+                            Page      => $Page,
                             OrderBy   => $OrderBy,
                             Order     => $Order,
-                            Page      => $Page,
                           );
 </%PERL>
 % if ( $Queue eq 'Incident Reports') {
+<a href="<%RT->Config->Get('WebPath')%>/RTIR/Report/BulkReject.html?<% $QueryString %>"><&|/l&>Bulk Reject</&></a> |
+% }
 
+<a href="<% RT->Config->Get('WebPath') %>/Search/Results.tsv?<% $ShortQueryString %>"><&|/l&>spreadsheet</&></a> |
+<a href="<% RT->Config->Get('WebPath') %>/Search/Results.rdf?<% $ShortQueryString %>"><&|/l&>RSS</&></a> |
 
-<a href="<%RT->Config->Get('WebPath')%>/RTIR/Report/BulkReject.html?<% $QueryString %>"><&|/l&>Bulk Reject</&></a>
-
-% }
-<a href="<%RT->Config->Get('WebPath')%>/Search/Results.tsv?<%$ShortQueryString%>"><&|/l&>spreadsheet</&></a> |
-<a href="<% RT->Config->Get('WebPath')."/Search/Results.rdf?$ShortQueryString"%>"><&|/l&>RSS</&></a> |
-<form method="get" action="<%RT->Config->Get('WebPath')%>/Search/Chart.html"><&|/l&>chart</&>
+<form method="get" action="<% RT->Config->Get('WebPath') %>/Search/Chart.html"><&|/l&>chart</&>
 % my %hiddens = (Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order);
-% foreach my $key (keys(%hiddens)) {
+% foreach my $key ( keys %hiddens ) {
 <input type="hidden" class="hidden" name="<%$key%>" value="<%defined($hiddens{$key})?$hiddens{$key}:''%>" />
 % }
 <&|/l, $m->scomp('/Search/Elements/SelectGroupBy', Name => 'PrimaryGroupBy') &>grouped by [_1]</&>
@@ -56,13 +55,12 @@
 
 $Query = join ' AND ', map "( $_ )", grep $_, $BaseQuery, $Query;
 
-$OrderBy = join "|", @{$OrderBy} if ref $OrderBy;
-$Order   = join "|", @{$Order}   if ref $Order;
-
 my $collection = $session{'tickets'} || RT::Tickets->new( $session{'CurrentUser'} );
 $collection->FromSQL( $Query ) if $Query;
 $session{'tickets'} = $collection;
 
+$OrderBy = join "|", @{$OrderBy} if ref $OrderBy;
+$Order   = join "|", @{$Order}   if ref $Order;
 if ( $OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'}
      || $Order ne $session{'CurrentSearchHash'}->{'Order'} )
 {
@@ -72,17 +70,23 @@
 
 return '' if !$ShowEmpty && !$collection->CountAll;
 
+$BaseURL = RT->Config->Get('WebPath')."/$BaseURL" unless $BaseURL =~ m{^/};
+$BaseURL .= ( $BaseURL =~ /\?/ )? '&': '?' unless $BaseURL =~ m{[&?]$};
+
 </%INIT>
 <%ARGS>
 $Queue          => ''
+
 $BaseQuery      => ''
-$Format         => ''
 $Query          => ''
+$Format         => ''
 $Rows           => undef
 $Page           => 1
 $OrderBy        => $session{'CurrentSearchHash'}->{'OrderBy'} || 'id'
 $Order          => $session{'CurrentSearchHash'}->{'Order'} || 'ASC'
-$BaseURL        => RT->Config->Get('WebPath')."/Search/Results.html?"
+
+$BaseURL        => "RTIR/Search/Results.html?"
+
 $ShowNavigation => 0
 $AllowSorting   => 1
 $ShowEmpty      => 0


More information about the Rt-commit mailing list