[Rt-commit] r19251 - in rt/3.8/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Thu Apr 16 20:53:23 EDT 2009


Author: sartak
Date: Thu Apr 16 20:53:22 2009
New Revision: 19251

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/share/html/Dashboards/Queries.html

Log:
 r82253 at onn:  sartak | 2009-04-16 20:53:15 -0400
 Allow users to add dashboards to dashboards :)


Modified: rt/3.8/trunk/share/html/Dashboards/Queries.html
==============================================================================
--- rt/3.8/trunk/share/html/Dashboards/Queries.html	(original)
+++ rt/3.8/trunk/share/html/Dashboards/Queries.html	Thu Apr 16 20:53:22 2009
@@ -97,7 +97,7 @@
             my $name;
             my $type = $portlet->{portlet_type};
 
-            if ($type eq 'search') {
+            if ($type eq 'search' || $type eq 'dashboard') {
                 $name = join '-', $type, $portlet->{id}, $portlet->{privacy};
             }
             elsif ($type eq 'component') {
@@ -119,6 +119,15 @@
     $desc_of{$name} = $desc;
 }
 
+# add dashboards
+my $dashboards = $m->comp("/Dashboards/Elements/DashboardsForObjects", flatten => 1);
+for my $dashboard (@{ $dashboards || [] }) {
+    my $name = 'dashboard-' . $dashboard->Id . '-' . $dashboard->Privacy;
+    my $desc = $dashboard->Name;
+    push @items, [$name, $desc];
+    $desc_of{$name} = $desc;
+}
+
 # add saved searches
 my @objs = RT::System->new($session{'CurrentUser'});
 
@@ -162,7 +171,7 @@
                 my $desc = $desc_of{$item};
                 my $portlet_type = $1 if $item =~ s/^(\w+)-//;
 
-                if ($portlet_type eq 'search') {
+                if ($portlet_type eq 'search' || $portlet_type eq 'dashboard') {
                     my ($id, $privacy) = split '-', $item, 2;
                     push @portlets, {
                         portlet_type => $portlet_type,


More information about the Rt-commit mailing list