[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.5-305-g0c6959a

sartak at bestpractical.com sartak at bestpractical.com
Thu Oct 15 13:16:51 EDT 2009


The branch, 3.8-trunk has been updated
       via  0c6959ab9ad12d4dcd2fc53960ab1c40d6bdc18d (commit)
      from  2e3048aa48803009e845a2b81d2132b425e37b7f (commit)

Summary of changes:
 share/html/Dashboards/index.html |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 0c6959ab9ad12d4dcd2fc53960ab1c40d6bdc18d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Oct 15 13:16:03 2009 -0400

    Add a MassageDashboards callback for the dashboard homepage

diff --git a/share/html/Dashboards/index.html b/share/html/Dashboards/index.html
index 10e77f7..8f71ab0 100644
--- a/share/html/Dashboards/index.html
+++ b/share/html/Dashboards/index.html
@@ -54,18 +54,21 @@
 
 <& /Dashboards/Elements/ShowDashboards,
     Title      => loc('Personal Dashboards'),
-    Dashboards => [sort { $a->Id <=> $b->Id } @{ $dashboards->{personal} || [] }],
+    Dashboards => \@personal_dashboards,
 &>
 
 <& /Dashboards/Elements/ShowDashboards,
     Title      => loc('System Dashboards'),
-    Dashboards => [sort { $a->Id <=> $b->Id } @{ $dashboards->{system} || [] }],
+    Dashboards => \@system_dashboards,
 &>
 
-% for my $group (sort keys %{ $dashboards->{group} || {} }) {
+% for (@grouped_dashboards) {
+%   my $group = $_->{name};
+%   my $dashboards = $_->{dashboards};
+
     <& /Dashboards/Elements/ShowDashboards,
         Title      => loc('[_1] DashBoards', $group),
-        Dashboards => [sort { $a->Id <=> $b->Id } @{ $dashboards->{group}{$group} || [] }],
+        Dashboards => $dashboards,
     &>
 % }
 
@@ -80,6 +83,23 @@ if (defined $Deleted) {
     push @actions, loc("Deleted dashboard [_1]", $Deleted);
 }
 
+my @personal_dashboards = sort { $a->Id <=> $b->Id } @{ $dashboards->{personal} || [] };
+my @system_dashboards = sort { $a->Id <=> $b->Id } @{ $dashboards->{system} || [] };
+
+my @groups = sort keys %{ $dashboards->{group} || {} };
+my @grouped_dashboards = map {
+    {
+        name => $_,
+        dashboards => [ sort { $a->Id <=> $b->Id } @{ $dashboards->{group}{$_} || [] } ],
+    }
+} @groups;
+
+$m->callback(
+    PersonalDashboards => \@personal_dashboards,
+    SystemDashboards   => \@system_dashboards,
+    GroupedDashboards  => \@grouped_dashboards,
+    CallbackName       => 'MassageDashboards',
+);
 </%INIT>
 <%ARGS>
 $Deleted => undef

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


More information about the Rt-commit mailing list