summaryrefslogtreecommitdiff
path: root/rt/share/html/Dashboards/Elements
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-09 22:32:26 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-09 22:32:26 -0700
commit026dc7ad72ba972f230b6709e31fa64397d75ad4 (patch)
treec5af1a7ac9154744afc3660e9a9405892f2bb50b /rt/share/html/Dashboards/Elements
parent07b4bc84d1078f7390221d766cdb3142513db4b0 (diff)
parent1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (diff)
merge RT 4.2.11 and Header changes to disable RT javascript, RT#34237
Diffstat (limited to 'rt/share/html/Dashboards/Elements')
-rw-r--r--rt/share/html/Dashboards/Elements/DashboardsForObject6
-rw-r--r--rt/share/html/Dashboards/Elements/ListOfDashboards7
-rw-r--r--rt/share/html/Dashboards/Elements/SelectPrivacy6
-rw-r--r--rt/share/html/Dashboards/Elements/ShowDashboards1
-rw-r--r--rt/share/html/Dashboards/Elements/ShowPortlet/component12
-rw-r--r--rt/share/html/Dashboards/Elements/ShowPortlet/dashboard1
6 files changed, 24 insertions, 9 deletions
diff --git a/rt/share/html/Dashboards/Elements/DashboardsForObject b/rt/share/html/Dashboards/Elements/DashboardsForObject
index 4c9df63..3de0216 100644
--- a/rt/share/html/Dashboards/Elements/DashboardsForObject
+++ b/rt/share/html/Dashboards/Elements/DashboardsForObject
@@ -57,7 +57,7 @@ my $privacy = RT::Dashboard->_build_privacy($Object);
while (my $attr = $Object->Attributes->Next) {
if ($attr->Name =~ /^Dashboard\b/) {
- my $dashboard = RT::Dashboard->new($session{'CurrentUser'});
+ my $dashboard = RT::Dashboard->new($User);
my ($ok, $msg) = $dashboard->Load($privacy, $attr->id);
if (!$ok) {
@@ -79,3 +79,7 @@ while (my $attr = $Object->Attributes->Next) {
return \%dashboards;
</%init>
+<%args>
+$User => $session{'CurrentUser'}
+</%args>
+
diff --git a/rt/share/html/Dashboards/Elements/ListOfDashboards b/rt/share/html/Dashboards/Elements/ListOfDashboards
index d6f5bcc..cc47c48 100644
--- a/rt/share/html/Dashboards/Elements/ListOfDashboards
+++ b/rt/share/html/Dashboards/Elements/ListOfDashboards
@@ -48,15 +48,15 @@
<%init>
# put the list of dashboards into the navigation
use RT::Dashboard;
-
-my @objs = RT::Dashboard->new($session{CurrentUser})->ObjectsForLoading(
+my @objs = RT::Dashboard->new($User)->ObjectsForLoading(
IncludeSuperuserGroups => $IncludeSuperuserGroups
);
my %dashboard_map;
for my $object (@objs) {
- my $new_dashboards = $m->comp("/Dashboards/Elements/DashboardsForObject", Object => $object);
+ my $new_dashboards = $m->comp("/Dashboards/Elements/DashboardsForObject",
+ Object => $object, User => $User );
push @{ $dashboard_map{$_} }, @{ $new_dashboards->{$_} || [] }
for qw/personal system/;
@@ -78,5 +78,6 @@ $m->callback(%ARGS, dashboards => \@dashboards, CallbackName => 'ModifyDashboard
return @dashboards;
</%init>
<%args>
+$User => $session{CurrentUser}
$IncludeSuperuserGroups => 1
</%args>
diff --git a/rt/share/html/Dashboards/Elements/SelectPrivacy b/rt/share/html/Dashboards/Elements/SelectPrivacy
index 5628d75..9eb276a 100644
--- a/rt/share/html/Dashboards/Elements/SelectPrivacy
+++ b/rt/share/html/Dashboards/Elements/SelectPrivacy
@@ -60,11 +60,11 @@ foreach my $object (@Objects) {
if (ref($object) eq 'RT::User') {
$label = $object->id == $session{'CurrentUser'}->Id
? loc("My dashboards")
- : loc("[_1]'s dashboards", $m->scomp('/Elements/ShowUser', User => $object));
+ : loc("[_1]'s dashboards", $object->Format);
} else {
- $label = loc("[_1]'s dashboards", $m->interp->apply_escapes($object->Name, 'h'));
+ $label = loc("[_1]'s dashboards", $object->Name);
}
</%perl>
-<option <%$selected|n%> value="<%$privacy%>"><% $label |n %></option>
+<option <%$selected|n%> value="<%$privacy%>"><% $label %></option>
% }
</select>
diff --git a/rt/share/html/Dashboards/Elements/ShowDashboards b/rt/share/html/Dashboards/Elements/ShowDashboards
index 5cf73a7..b57867b 100644
--- a/rt/share/html/Dashboards/Elements/ShowDashboards
+++ b/rt/share/html/Dashboards/Elements/ShowDashboards
@@ -54,6 +54,7 @@
% } else {
% $title = loc("[_1]'s dashboards",$Object->Name);
% }
+% $title =~ s/([\\'])/\\$1/g;
% $title = $m->interp->apply_escapes($title, 'h');
<& /Elements/CollectionList,
%ARGS,
diff --git a/rt/share/html/Dashboards/Elements/ShowPortlet/component b/rt/share/html/Dashboards/Elements/ShowPortlet/component
index 5218843..3b54da2 100644
--- a/rt/share/html/Dashboards/Elements/ShowPortlet/component
+++ b/rt/share/html/Dashboards/Elements/ShowPortlet/component
@@ -51,4 +51,14 @@ $Portlet
$Rows => 20
$Preview => 0
</%args>
-% $m->comp($Portlet->{path});
+<%init>
+my $full_path = $Portlet->{path};
+(my $path = $full_path) =~ s{^/Elements/}{};
+
+my $allowed = grep { $_ eq $path } @{RT->Config->Get('HomepageComponents')};
+</%init>
+% if (!$allowed) {
+% $m->out( $m->interp->apply_escapes( loc("Invalid portlet [_1]", $path), "h" ) );
+% } else {
+% $m->comp($full_path);
+% }
diff --git a/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard b/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard
index d2ae85d..3c35ea8 100644
--- a/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard
+++ b/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard
@@ -56,7 +56,6 @@ $Depth => 0
<%init>
my $current_dashboard;
-use Scalar::Util 'blessed';
if (blessed($Portlet) && $Portlet->isa('RT::Dashboard')) {
$current_dashboard = $Portlet;
}