[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-395-g03f951c
Alex Vandiver
alexmv at bestpractical.com
Fri Nov 5 13:45:44 EDT 2010
The branch, 3.9-trunk has been updated
via 03f951c64f1d9c7b491595c4e75bff16eee6935f (commit)
from 97910aed7b5c70bef5f39bdfe8d3c8e35a1f221e (commit)
Summary of changes:
share/html/Elements/CollectionAsTable/Header | 1 +
share/html/Elements/CollectionList | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit 03f951c64f1d9c7b491595c4e75bff16eee6935f
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Nov 5 13:20:17 2010 -0400
Make ordering "by Created" effectively be an alias for "by id"
Since the creation date and the id are essentially guaranteed to be
identical orderings, this eliminates a no-op click when sorting by
creation date, when it is currently sorted by id.
diff --git a/share/html/Elements/CollectionAsTable/Header b/share/html/Elements/CollectionAsTable/Header
index b580e29..5d3376f 100644
--- a/share/html/Elements/CollectionAsTable/Header
+++ b/share/html/Elements/CollectionAsTable/Header
@@ -123,6 +123,7 @@ 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'
diff --git a/share/html/Elements/CollectionList b/share/html/Elements/CollectionList
index 8e57d4d..0b15a96 100644
--- a/share/html/Elements/CollectionList
+++ b/share/html/Elements/CollectionList
@@ -71,6 +71,7 @@ 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