X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FDashboards%2FElements%2FListOfDashboards;h=8f7b4ae74b4095b501ccb0e1f6f03dbb34364393;hb=7322f2afedcc2f427e997d1535a503613a83f088;hp=55d632e520877797398838c5ff35b812f0d4a60b;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941;p=freeside.git diff --git a/rt/share/html/Dashboards/Elements/ListOfDashboards b/rt/share/html/Dashboards/Elements/ListOfDashboards index 55d632e52..8f7b4ae74 100644 --- a/rt/share/html/Dashboards/Elements/ListOfDashboards +++ b/rt/share/html/Dashboards/Elements/ListOfDashboards @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -48,19 +48,36 @@ <%init> # put the list of dashboards into the navigation use RT::Dashboard; +my @objs = RT::Dashboard->new($User)->ObjectsForLoading( + IncludeSuperuserGroups => $IncludeSuperuserGroups + ); -my @objs = RT::Dashboard->new($session{CurrentUser})->_PrivacyObjects(ShowSystem => 1); -my $dashboard_map = $m->comp("/Dashboards/Elements/DashboardsForObjects", Objects => \@objs); +my %dashboard_map; + +for my $object (@objs) { + my $new_dashboards = $m->comp("/Dashboards/Elements/DashboardsForObject", + Object => $object, User => $User ); + + push @{ $dashboard_map{$_} }, @{ $new_dashboards->{$_} || [] } + for qw/personal system/; + + push @{ $dashboard_map{group}{$_} }, @{ $new_dashboards->{group}{$_} } + for keys %{ $new_dashboards->{group} || {} }; +} my @dashboards = ( - (sort { $a->Id <=> $b->Id } @{ $dashboard_map->{personal} || [] }), - (sort { $a->Id <=> $b->Id } @{ $dashboard_map->{system} || [] }), + (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} || {} }, + map { sort { $a->Id <=> $b->Id } @{ $dashboard_map{group}{$_} } } + keys %{ $dashboard_map{group} || {} }, ); $m->callback(%ARGS, dashboards => \@dashboards, CallbackName => 'ModifyDashboards'); return @dashboards; +<%args> +$User => $session{CurrentUser} +$IncludeSuperuserGroups => 1 +