X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FDashboards%2FElements%2FShowDashboards;h=600f356704ed8dd2bd108326c3795e9e9bf92169;hp=8dcc733eb94d7430cc23929fea39019313573f01;hb=de9d037528895f7151a9aead6724ce2df95f9586;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/rt/share/html/Dashboards/Elements/ShowDashboards b/rt/share/html/Dashboards/Elements/ShowDashboards index 8dcc733eb..600f35670 100644 --- a/rt/share/html/Dashboards/Elements/ShowDashboards +++ b/rt/share/html/Dashboards/Elements/ShowDashboards @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,68 +45,28 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<&| /Widgets/TitleBox, title => $Title &> -<& SELF:table, %ARGS &> - -<%ARGS> -$Title => undef - - -<%METHOD table> -<%ARGS> -$Dashboards => undef -$Verbose => 1 - -<%INIT> -# map each subscription to a dashboard ID -my %subscription_for; - -for my $attr ($session{'CurrentUser'}->UserObj->Attributes->Named('Subscription')) { - $subscription_for{$attr->SubValue('DashboardId')} = $attr; -} - - -% if (@$Dashboards == 0) { -% if ($Verbose) { -

<% loc("No dashboards.") %>

+% foreach my $Object (@Objects) { +% my $Dashboards = RT::Dashboards->new($session{CurrentUser}); +% $Dashboards->LimitToPrivacy(join('-',ref($Object),$Object->Id)); +% my $title; +% if (ref $Object eq 'RT::User' && $Object->Id == $session{CurrentUser}->Id) { +% $title = loc("My dashboards"); +% } else { +% $title = loc("[_1]'s dashboards",$Object->Name); % } -% } else { - - -% if ($Verbose) { - -% } - - - - -% my $i = 0; -% for my $dashboard (@$Dashboards) { -% my $url = sprintf '%s/Dashboards/%d/%s', -% RT->Config->Get('WebPath'), -% $dashboard->Id, -% $dashboard->Name; - - -% if ($Verbose) { - -% } - - - -% } - -
<% loc("#") %><% loc("Name") %><% loc("Subscription") %>
- - <% $dashboard->Id %> - - - - <% $dashboard->Name %> - - - <& /Dashboards/Elements/ShowSubscription, Dashboard => $dashboard, Subscription => $subscription_for{$dashboard->Id} &> -
+% $title =~ s/([\\'])/\\$1/g; +% $title = $m->interp->apply_escapes($title, 'h'); +<& /Elements/CollectionList, + %ARGS, + Format => qq{'__Name__/TITLE:$title', __Subscription__}, + Collection => $Dashboards, +&> % } - +<%init> +use RT::Dashboards; +my @Objects = RT::Dashboard->new($session{CurrentUser})->ObjectsForLoading(IncludeSuperuserGroups => $IncludeSuperuserGroups); + +<%args> +$IncludeSuperuserGroups => 1 +