[Rt-commit] r18964 - in rt/3.8/trunk: share/html

sartak at bestpractical.com sartak at bestpractical.com
Fri Mar 27 16:21:45 EDT 2009


Author: sartak
Date: Fri Mar 27 16:21:44 2009
New Revision: 18964

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

Log:
 r81614 at onn:  sartak | 2009-03-27 16:21:21 -0400
 Include dashboards in the top navigation


Modified: rt/3.8/trunk/share/html/index.html
==============================================================================
--- rt/3.8/trunk/share/html/index.html	(original)
+++ rt/3.8/trunk/share/html/index.html	Fri Mar 27 16:21:44 2009
@@ -76,9 +76,11 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <& /Elements/Tabs, 
-    current_toptab => '', 
-    Title=>loc("RT at a glance"),
-    actions => $actions,
+    Title          => loc("RT at a glance"),
+    current_tab    => 'index.html',
+    current_toptab => 'index.html',
+    tabs           => $tabs,
+    actions        => $actions,
     &>
 <& /Elements/ListActions, actions => \@results &>    
 <& /Elements/MyRT &>
@@ -137,6 +139,33 @@
     };
 }
 
+# put the list of dashboards into the navigation
+use RT::Dashboard;
+
+my @objs = RT::Dashboard->new($session{CurrentUser})->_PrivacyObjects(ShowSystem => 1);
+my $dashboard_map = $m->comp("/Dashboards/Elements/DashboardsForObjects", Objects => \@objs);
+
+my @dashboards = (
+    (sort { $a->Id <=> $b->Id } @{ $dashboard_map->{personal} || [] }),
+    (sort { $a->Id <=> $b->Id } @{ $dashboard_map->{system}   || [] }),
+
+    map { sort { $a->Id <=> $b->Id } @{ $dashboard_map->{group}{$_} } }
+        keys %{ $dashboard_map->{group} || {} },
+);
+
+my $position = 0;
+my $tabs = {
+    map {
+        ++$position;
+        my $key = sprintf 'D-%03d', $position;
+        $key => {
+            title => $_->Name,
+            path  => 'Dashboards/' . $_->Id . '/' . $_->Name,
+        }
+    }
+    @dashboards
+};
+
 </%init>
 
 %# --></body></html>


More information about the Rt-commit mailing list