[Rt-commit] r6743 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Sun Jan 14 23:32:53 EST 2007


Author: ruz
Date: Sun Jan 14 23:32:52 2007
New Revision: 6743

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Elements/CollectionAsTable/Header

Log:
 r4355 at cubic-pc:  cubic | 2007-01-14 10:38:18 +0300
 * don't call column map twice when sorting is enabled


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	Sun Jan 14 23:32:52 2007
@@ -56,13 +56,13 @@
 $maxitems     => undef
 </%ARGS>
 <tr class="collection-as-table">
-<%perl>
+<%PERL>
 
 my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString );
 
 my $item = 0;
-foreach my $col (@Format) {
-    my $title = $col->{title} || '';
+foreach my $col ( @Format ) {
+    my $title = $col->{'title'} || '';
     if ( $title eq 'NEWLINE' ) {
         while ( $item < $maxitems ) {
             $m->out(qq{<th class="collection-as-table">&nbsp;</th>\n});
@@ -75,7 +75,7 @@
     } elsif ( $title eq 'NBSP' ) {
         $item++;
         $m->out(qq{<th class="collection-as-table">&nbsp;</th>\n});
-	next;
+        next;
     }
 
     $item++;
@@ -107,35 +107,22 @@
         }
     }
 
-    if (
-           $AllowSorting
-        && $col->{'attribute'}
-        && $m->comp(
+    if ( $AllowSorting and $col->{'attribute'}
+        and my $attr = $m->comp(
             "/Elements/$Class/ColumnMap",
             Name => $col->{'attribute'},
             Attr => 'attribute'
         )
       )
     {
-
         $m->out(
             '<a href="' . $BaseURL
-              . $m->comp(
-                '/Elements/QueryString',
+            . $m->comp( '/Elements/QueryString',
                 %generic_query_args,
-                OrderBy => (
-                    $m->comp(
-                        "/Elements/$Class/ColumnMap",
-                        Name => $col->{'attribute'},
-                        Attr => 'attribute'
-                      )
-                      || $col->{'attribute'}
-                ),
-                Order => ( $ARGS{'Order'} eq 'ASC' ? 'DESC' : 'ASC' )
-              )
-              . '">'
-              . $title
-              . '</a>'
+                OrderBy => $attr || $col->{'attribute'},
+                Order   => ( $ARGS{'Order'} eq 'ASC' ? 'DESC' : 'ASC' )
+            )
+            . '">'. $title .'</a>'
         );
     }
     else {
@@ -143,5 +130,5 @@
     }
     $m->out('</th>');
 }
-</%perl>
+</%PERL>
 </tr>


More information about the Rt-commit mailing list