[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-396-g48a1ac1

Alex Vandiver alexmv at bestpractical.com
Fri Nov 5 14:08:17 EDT 2010


The branch, 3.9-trunk has been updated
       via  48a1ac1a22021813da87a1f967f5918081e19d9b (commit)
      from  03f951c64f1d9c7b491595c4e75bff16eee6935f (commit)

Summary of changes:
 share/html/Elements/CollectionAsTable/Header |    3 +--
 share/html/Elements/CollectionList           |    1 -
 2 files changed, 1 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 48a1ac1a22021813da87a1f967f5918081e19d9b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Nov 5 13:56:48 2010 -0400

    Make Created less of a tight alias to id
    
    It is possible to import databases which do not maintain the id to
    Created mapping which normal data posesses.  As such, move to not
    disallowing Created, but rather treating them as equivilent simply for
    sorting purposes.

diff --git a/share/html/Elements/CollectionAsTable/Header b/share/html/Elements/CollectionAsTable/Header
index 5d3376f..837de1c 100644
--- a/share/html/Elements/CollectionAsTable/Header
+++ b/share/html/Elements/CollectionAsTable/Header
@@ -123,11 +123,10 @@ foreach my $col ( @Format ) {
       )
     {
         $attr = ProcessColumnMapValue( $attr, Arguments => [ $col->{'attribute'} ], Escape => 0 );
-        $attr = "id" if $attr eq "Created";
 
         my $new_order = 'ASC';
         $new_order = $Order[0] eq 'ASC'? 'DESC': 'ASC'
-            if $OrderBy[0] && $OrderBy[0] eq $attr;
+            if $OrderBy[0] && ($OrderBy[0] eq $attr or "$attr|$OrderBy[0]" =~ /^(Created|id)\|(Created|id)$/);
 
         $m->out(
             '<a href="' . $BaseURL
diff --git a/share/html/Elements/CollectionList b/share/html/Elements/CollectionList
index 0b15a96..8e57d4d 100644
--- a/share/html/Elements/CollectionList
+++ b/share/html/Elements/CollectionList
@@ -71,7 +71,6 @@ if ( @OrderBy && ($AllowSorting || !$Collection->{'order_by'}) ) {
         @OrderBy = split /\|/, $OrderBy[0];
         @Order = split /\|/,$Order[0];
     }
-    @OrderBy = map {$_ eq "Created" ? "id" : $_} @OrderBy;
     $Collection->OrderByCols(
         map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } }
         ( 0 .. $#OrderBy )

-----------------------------------------------------------------------


More information about the Rt-commit mailing list