[Rt-commit] r4482 - in rt/branches/3.7-EXPERIMENTAL: . html/Elements/CollectionAsTable lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Fri Feb 3 18:41:01 EST 2006


Author: ruz
Date: Fri Feb  3 18:40:52 2006
New Revision: 4482

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Header
   rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/ParseFormat
   rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Row
   rt/branches/3.7-EXPERIMENTAL/html/Elements/Menu
   rt/branches/3.7-EXPERIMENTAL/html/Elements/TicketList
   rt/branches/3.7-EXPERIMENTAL/lib/RT/CurrentUser.pm

Log:
 r1659 at cubic-pc:  cubic | 2006-01-27 22:13:02 +0300
 * drop some useless uninit warnings


Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Header
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Header	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Header	Fri Feb  3 18:40:52 2006
@@ -61,7 +61,8 @@
 
 my $item = 0;
 foreach my $col (@Format) {
-    if ( $col->{title} eq 'NEWLINE' ) {
+    my $title = $col->{title} || '';
+    if ( $title eq 'NEWLINE' ) {
         while ( $item < $maxitems ) {
             $m->out(qq{<th class="collection-as-table">&nbsp;</th>\n});
             $item++;
@@ -75,9 +76,8 @@
     $item++;
 
     $m->out('<th class="collection-as-table">');
-    my $title = $col->{title};
-    $title =~ s/^__(.*)__$/$1/o;
 
+    $title =~ s/^__(.*)__$/$1/o;
     my $tmp = $m->comp(
         '/Elements/RT__Ticket/ColumnMap',
         Name => $title,

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/ParseFormat
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/ParseFormat	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/ParseFormat	Fri Feb  3 18:40:52 2006
@@ -73,10 +73,10 @@
     if ( $col =~ s!/ALIGN:([^\/]+)!!io ) {
         $colref->{'align'} = $1;
     }
-    if ( $col =~ /__(.*?)__/gio ) {
+    if ( $col =~ /__(.*?)__/io ) {
         my @subcols;
         while ( $col =~ s/^(.*?)__(.*?)__//o ) {
-            push ( @subcols, $1 ) if ($1);
+            push ( @subcols, $1 ) if $1;
             push ( @subcols, "__$2__" );
             $colref->{'attribute'} = $2;
         }
@@ -95,7 +95,6 @@
         $colref->{'attribute'} = $1;
     }
 
-
     push @Columns, $colref;
 }
     return(@Columns);

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Row
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Row	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Row	Fri Feb  3 18:40:52 2006
@@ -56,7 +56,7 @@
 $m->out('<tr class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
 my $item;
 foreach my $column (@Format) {
-    if ( $column->{title} eq 'NEWLINE' ) {
+    if ( $column->{title} && $column->{title} eq 'NEWLINE' ) {
         while ( $item < $maxitems ) {
             $m->out(qq{<td class="collection-as-table">&nbsp;</td>\n});
             $item++;
@@ -93,8 +93,7 @@
                 @out =
                     map {
                         ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' )
-                      } &{$value}( $record, $i )
-                ;
+                      } &{$value}( $record, $i );
             }
             else {
 

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/Menu
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/Menu	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/Menu	Fri Feb  3 18:40:52 2006
@@ -55,7 +55,7 @@
 % foreach $tab (sort keys %{$toptabs}) {
 %     $count++;
 %
-%     my $current = $current_toptab;
+%     my $current = $current_toptab || '';
 %     my $path    = $toptabs->{$tab}->{'path'} || "";
 %     
 %     $path    =~ s#/index.html$##gi;

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/TicketList
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/TicketList	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/TicketList	Fri Feb  3 18:40:52 2006
@@ -103,8 +103,8 @@
 % }
 <%INIT>
 unless ($Collection) {
-        $Collection = RT::Tickets->new($session{'CurrentUser'});
-        $Collection->FromSQL($Query);
+        $Collection = RT::Tickets->new( $session{'CurrentUser'} );
+        $Collection->FromSQL( $Query );
 }
 
 my $TotalFound =  $Collection->CountAll();
@@ -122,10 +122,8 @@
     $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); 
 }
 
-$Collection->RowsPerPage($Rows) if ($Rows);
-$Collection->GotoPage($Page-1); # SB uses page 0 as the first page
-
-$Format ||= RT->Config->Get('DefaultSearchResultFormat');
+$Collection->RowsPerPage( $Rows ) if $Rows;
+$Collection->GotoPage( $Page - 1 ); # SB uses page 0 as the first page
 
 # DisplayFormat lets us use a "temporary" format for display, while 
 # still using our original format for next/prev page links.
@@ -137,7 +135,7 @@
 $Format = $m->comp('/Elements/ScrubHTML', Content => $Format);
 $DisplayFormat = $m->comp('/Elements/ScrubHTML', Content => $DisplayFormat);
 
-my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $DisplayFormat);
+my @Format = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $DisplayFormat);
 
 # Find the maximum number of items in any row, so we can pad the table.
 my ($maxitems, $item) = (0, 0);
@@ -153,17 +151,19 @@
 
 </%INIT>
 <%ARGS>
+$Collection => undef
+
 $Query => undef
+$Format => RT->Config->Get('DefaultSearchResultFormat')
+$DisplayFormat => undef
+$Order => undef
+$OrderBy => undef
 $Rows => 50
+
 $Page => 1
 $Title => 'Ticket Search'
-$Collection => undef
-$AllowSorting => undef
-$Order => undef
-$OrderBy => undef
 $BaseURL => undef
-$Format => RT->Config->Get('DefaultSearchResultFormat')
-$DisplayFormat => undef
+$AllowSorting => undef
 $ShowNavigation => 1
 $ShowHeader => 1
 $ShowEmpty => 0

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/CurrentUser.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/CurrentUser.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/CurrentUser.pm	Fri Feb  3 18:40:52 2006
@@ -387,14 +387,14 @@
 
 sub loc {
     my $self = shift;
-    return '' if $_[0] eq '';
+    return '' if !defined $_[0] || $_[0] eq '';
 
     my $handle = $self->LanguageHandle;
 
     if (@_ == 1) {
 	# pre-scan the lexicon hashes to return _AUTO keys verbatim,
 	# to keep locstrings containing '[' and '~' from tripping over Maketext
-	return $_[0] unless grep { exists $_->{$_[0]} } @{ $handle->_lex_refs };
+	return $_[0] unless grep exists $_->{$_[0]}, @{ $handle->_lex_refs };
     }
 
     return $handle->maketext(@_);


More information about the Rt-commit mailing list