diff options
Diffstat (limited to 'rt/share/html/Dashboards/Elements/ListOfDashboards')
-rw-r--r-- | rt/share/html/Dashboards/Elements/ListOfDashboards | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rt/share/html/Dashboards/Elements/ListOfDashboards b/rt/share/html/Dashboards/Elements/ListOfDashboards new file mode 100644 index 0000000..b2cbd3e --- /dev/null +++ b/rt/share/html/Dashboards/Elements/ListOfDashboards @@ -0,0 +1,19 @@ +<%init> +# 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} || {} }, +); + +$m->callback(%ARGS, dashboards => \@dashboards, CallbackName => 'ModifyDashboards'); + +return @dashboards; +</%init> |