[Rt-commit] r13583 - in rt/3.8/trunk: . share/html/Dashboards/Elements share/html/Elements

sartak at bestpractical.com sartak at bestpractical.com
Tue Jun 24 20:57:30 EDT 2008


Author: sartak
Date: Tue Jun 24 20:57:29 2008
New Revision: 13583

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/share/html/Dashboards/Elements/ShowDashboards
   rt/3.8/trunk/share/html/Dashboards/index.html
   rt/3.8/trunk/share/html/Elements/Dashboards

Log:
 r63214 at onn:  sartak | 2008-06-24 20:56:36 -0400
 Better sorting of dashboards (first by type, then by ID ascending)


Modified: rt/3.8/trunk/share/html/Dashboards/Elements/ShowDashboards
==============================================================================
--- rt/3.8/trunk/share/html/Dashboards/Elements/ShowDashboards	(original)
+++ rt/3.8/trunk/share/html/Dashboards/Elements/ShowDashboards	Tue Jun 24 20:57:29 2008
@@ -79,7 +79,7 @@
         </tr>
 
 %   my $i = 0;
-%   for my $dashboard (sort {$b->Id <=> $a->Id} @$Dashboards) {
+%   for my $dashboard (@$Dashboards) {
 %       my $url = sprintf '%s/Dashboards/Modify.html?id=%d',
 %                 RT->Config->Get('WebPath'),
 %                 $dashboard->Id;

Modified: rt/3.8/trunk/share/html/Dashboards/index.html
==============================================================================
--- rt/3.8/trunk/share/html/Dashboards/index.html	(original)
+++ rt/3.8/trunk/share/html/Dashboards/index.html	Tue Jun 24 20:57:29 2008
@@ -54,18 +54,18 @@
 
 <& /Dashboards/Elements/ShowDashboards,
     Type       => "Personal",
-    Dashboards => $dashboards->{personal},
+    Dashboards => [sort { $a->Id <=> $b->Id } @{ $dashboards->{personal} }],
 &>
 
 <& /Dashboards/Elements/ShowDashboards,
     Type => "System",
-    Dashboards => $dashboards->{system},
+    Dashboards => [sort { $a->Id <=> $b->Id } @{ $dashboards->{system} }],
 &>
 
 % for my $group (sort keys %{ $dashboards->{group} || {} }) {
     <& /Dashboards/Elements/ShowDashboards,
         Type       => $group,
-        Dashboards => $dashboards->{group}{$group},
+        Dashboards => [sort { $a->Id <=> $b->Id } @{$dashboards->{group}{$group}}],
     &>
 % }
 

Modified: rt/3.8/trunk/share/html/Elements/Dashboards
==============================================================================
--- rt/3.8/trunk/share/html/Elements/Dashboards	(original)
+++ rt/3.8/trunk/share/html/Elements/Dashboards	Tue Jun 24 20:57:29 2008
@@ -62,10 +62,10 @@
 my $dashboard_map = $m->comp("/Dashboards/Elements/DashboardsForObjects", Objects => \@objs);
 
 my @dashboards = (
-    @{ $dashboard_map->{personal} || [] },
-    @{ $dashboard_map->{system}   || [] },
+    (sort { $a->Id <=> $b->Id } @{ $dashboard_map->{personal} || [] }),
+    (sort { $a->Id <=> $b->Id } @{ $dashboard_map->{system}   || [] }),
 
-    map { @{ $dashboard_map->{group}{$_} } }
+    map { sort { $a->Id <=> $b->Id } @{ $dashboard_map->{group}{$_} } }
         keys %{ $dashboard_map->{group} || {} },
 );
 


More information about the Rt-commit mailing list