X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FDashboards%2FElements%2FListOfDashboards;h=d6f5bccad61ba3f5d5fb269e506f36b5cdc2777d;hb=31f3763747b82764bb019cfab5b2a2945fc9a99d;hp=55d632e520877797398838c5ff35b812f0d4a60b;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/rt/share/html/Dashboards/Elements/ListOfDashboards b/rt/share/html/Dashboards/Elements/ListOfDashboards index 55d632e52..d6f5bccad 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-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -49,18 +49,34 @@ # 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 @objs = RT::Dashboard->new($session{CurrentUser})->ObjectsForLoading( + IncludeSuperuserGroups => $IncludeSuperuserGroups + ); + +my %dashboard_map; + +for my $object (@objs) { + my $new_dashboards = $m->comp("/Dashboards/Elements/DashboardsForObject", Object => $object); + + 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> +$IncludeSuperuserGroups => 1 +