[Rt-commit] r2403 - in rt/branches/PLATANO-EXPERIMENTAL: . html/Elements/CollectionAsTable

jesse at bestpractical.com jesse at bestpractical.com
Mon Mar 14 02:36:30 EST 2005


Author: jesse
Date: Mon Mar 14 02:36:30 2005
New Revision: 2403

Modified:
   rt/branches/PLATANO-EXPERIMENTAL/   (props changed)
   rt/branches/PLATANO-EXPERIMENTAL/html/Elements/CollectionAsTable/Row
Log:
 r8507 at hualien:  jesse | 2005-03-14 02:28:57 -0500
  r6473 at hualien:  jesse | 2005-03-06 16:04:46 -0500
  Small cleanups to print out less hardcoded style information (introduced by the pull-up from 3.2)
 


Modified: rt/branches/PLATANO-EXPERIMENTAL/html/Elements/CollectionAsTable/Row
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL/html/Elements/CollectionAsTable/Row	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL/html/Elements/CollectionAsTable/Row	Mon Mar 14 02:36:30 2005
@@ -53,43 +53,53 @@
 </%ARGS>
 
 <%PERL>
-$m->out( '<TR class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
+$m->out('<TR class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
 my $item;
 foreach my $column (@Format) {
     if ( $column->{title} eq 'NEWLINE' ) {
-	while ($item < $maxitems) {
-	    $m->out(qq{<td class="collection-as-table">&nbsp;</td>\n});
-	    $item++;
-	}
-	$item = 0;
+        while ( $item < $maxitems ) {
+            $m->out(qq{<td class="collection-as-table">&nbsp;</td>\n});
+            $item++;
+        }
+        $item = 0;
         $m->out('</TR>');
-        $m->out( '<TR class="' . 
-               ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
+        $m->out('<TR class="'
+              . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' )
+              . '" >' );
         next;
     }
     $item++;
-	my $align = ($column->{align} || "left");
-    $m->out('<td class="collection-as-table" align="' . $align . '">');
+    $m->out('<td class="collection-as-table" ');
+    $m->out( 'align="' . $column->{align} . '"' ) if ( $column->{align} );
+    $m->out('>');
     foreach my $subcol ( @{ $column->{output} } ) {
         if ( $subcol =~ /^__(.*?)__$/o ) {
-            my $col = $1;
-            my $value = $m->comp('/Elements/RT__Ticket/ColumnMap', Name => $col, Attr => 'value');
+            my $col   = $1;
+            my $value = $m->comp(
+                '/Elements/RT__Ticket/ColumnMap',
+                Name => $col,
+                Attr => 'value'
+            );
+
+            if ( $value && ref($value) ) {
+
+                # All HTML snippets are returned by the callback function
+                # as scalar references.  Data fetched from the objects are
+                # plain scalars, and needs to be escaped properly.
+                $m->out(
+                    map {
+                        ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' )
+                      } &{$value}( $record, $i )
+                );
+            }
+            else {
 
-            if ( $value && ref($value)) {
-		# All HTML snippets are returned by the callback function
-		# as scalar references.  Data fetched from the objects are
-		# plain scalars, and needs to be escaped properly.
-		$m->out( 
-		    map { ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' ) }
-		    &{ $value } ( $record, $i )
-	        );
-            } else {
-		# Simple value; just escape it.
+                # Simple value; just escape it.
                 $m->out( $m->interp->apply_escapes( $value => 'h' ) );
             }
         }
         else {
-            $m->out( $subcol );
+            $m->out($subcol);
         }
     }
     $m->out('</td>');


More information about the Rt-commit mailing list