summaryrefslogtreecommitdiff
path: root/rt/share/html/Dashboards/Elements/ListOfDashboards
blob: b2cbd3ebefdb322d4f302d4873122e4ee0819e55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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>