[Rt-commit] r12006 - in rt/branches/3.8-TESTING: . html/Prefs/Dashboards html/Prefs/Dashboards/Elements

sartak at bestpractical.com sartak at bestpractical.com
Fri May 2 18:06:36 EDT 2008


Author: sartak
Date: Fri May  2 18:06:35 2008
New Revision: 12006

Added:
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/DashboardTabs   (contents, props changed)
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/DashboardsForObject
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/SelectPrivacy
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/ShowDashboards
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/ShowSubscription
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Modify.html   (contents, props changed)
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Queries.html
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Render.html
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/Subscription.html
   rt/branches/3.8-TESTING/html/Prefs/Dashboards/index.html
Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/html/User/Elements/Tabs

Log:
 r54765 at Macintosh:  sartak | 2008-05-01 17:32:06 -0400
 Templates for Dashboards


Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/DashboardTabs
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/DashboardTabs	Fri May  2 18:06:35 2008
@@ -0,0 +1,104 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<& /User/Elements/Tabs,
+    subtabs => $tabs,
+    current_tab => 'Prefs/Dashboards',
+    current_subtab => $current_subtab,
+    Title => $Title &>
+
+<%INIT>
+my $tabs;
+my $real_subtab = $current_subtab;
+if ( $DashboardObj and $DashboardObj->Id ) {
+    my $idpriv = sprintf 'id=%d&Privacy=%s',
+                 $DashboardObj->Id,
+                 $DashboardObj->Privacy;
+    my $modify  = "Prefs/Dashboards/Modify.html?$idpriv";
+    my $queries = "Prefs/Dashboards/Queries.html?$idpriv";
+    my $render  = "Prefs/Dashboards/Render.html?$idpriv";
+
+    $tabs->{"this"} = {
+        title   => $DashboardObj->Name,
+        path    => $modify,
+        current_subtab  => $current_subtab,
+        subtabs => {
+            a_Basics => { title => loc('Basics'),
+                          path  => $modify,
+            },
+
+            b_Queries => { title => loc('Queries'),
+                           path  => $queries,
+            },
+
+            c_Subscription => { title => loc('Subscription'),
+                                path  => "Prefs/Dashboards/Subscription.html?DashboardId=" . $DashboardObj->Id . "&Privacy=" . $DashboardObj->Privacy
+            },
+
+
+            z_Preview => { title => loc('Preview'),
+                           path  => $render,
+            },
+        }
+    };
+
+    $current_subtab = $modify;
+}
+
+$tabs->{"A"} = { title => loc('Select dashboard'),
+                 path  => "Prefs/Dashboards/index.html" };
+$tabs->{"B"} = { title     => loc('New dashboard'),
+                 path      => "Prefs/Dashboards/Modify.html?Create=1",
+                 separator => 1 };
+
+
+</%INIT>
+<%ARGS>
+$DashboardObj => undef
+$current_subtab => undef
+$Title => undef
+</%ARGS>

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/DashboardsForObject
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/DashboardsForObject	Fri May  2 18:06:35 2008
@@ -0,0 +1,72 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<%args>
+$Object => undef
+</%args>
+<%init>
+# Returns an array of dashboards associated on $Object
+
+use RT::Dashboard;
+my @dashboards;
+my $privacy = $Object->isa('RT::User')   ? 'RT::User-'  . $Object->Id
+            : $Object->isa('RT::Group')  ? 'RT::Group-' . $Object->Id
+            : $Object->isa('RT::System') ? 'RT::System'
+            : '';
+
+while (my $attr = $Object->Attributes->Next) {
+    if ($attr->Name =~ /^Dashboard\b/) {
+        my $dashboard = RT::Dashboard->new($session{'CurrentUser'});
+        my ($ok) = $dashboard->Load($privacy, $attr->id);
+        next if !$ok;
+
+        push @dashboards, $dashboard;
+    }
+}
+return @dashboards;
+</%init>
+

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/SelectPrivacy
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/SelectPrivacy	Fri May  2 18:06:35 2008
@@ -0,0 +1,60 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<%args>
+ at Objects => undef
+$Name => undef
+</%args>
+<select name="<%$Name%>">
+% foreach my $object (@Objects) {
+% if (ref($object) eq 'RT::User' && $object->id == $session{'CurrentUser'}->Id) {
+<option value="<%ref($object)%>-<%$object->id%>"><&|/l&>My dashboards</&></option>
+% } else {
+<option value="<%ref($object)%>-<%$object->id%>"><&|/l, $object->Name&>[_1]'s dashboards</&></option>
+% }
+% }
+</select>

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/ShowDashboards
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/ShowDashboards	Fri May  2 18:06:35 2008
@@ -0,0 +1,101 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<&| /Widgets/TitleBox, title => loc("[_1] Dashboards", $Type) &>
+
+% if (@$Dashboards == 0) {
+    <p><% loc("No dashboards.") %></p>
+% } else {
+    <table class="collection-as-table">
+        <tr class="collection-as-table">
+            <th class="collection-as-table"><% loc("#") %></th>
+            <th class="collection-as-table"><% loc("Name") %></th>
+            <th class="collection-as-table"><% loc("Subscription") %></th>
+        </tr>
+
+%   my $i = 0;
+%   for my $dashboard (sort {$b->Id <=> $a->Id} @$Dashboards) {
+%       my $url = sprintf '%s/Prefs/Dashboards/Modify.html?id=%d&Privacy=%s',
+%                 $RT::WebPath,
+%                 $dashboard->Id,
+%                 $dashboard->Privacy; 
+
+        <tr class="collection-as-table <% ++$i % 2 ? 'oddline' : 'evenline' %>">
+            <td class="collection-as-table">
+                <a href="<% $url %>">
+                    <% $dashboard->Id %>
+                </a>
+            </td>
+            <td class="collection-as-table">
+                <a href="<% $url %>">
+                    <% $dashboard->Name %>
+                </a>
+            </td>
+            <td class="collection-as-table">
+                <& /Prefs/Dashboards/Elements/ShowSubscription, Dashboard => $dashboard, Subscription => $subscription_for{$dashboard->Id} &>
+            </td>
+        </tr>
+%   }
+
+    </table>
+% }
+
+</&>
+
+<%ARGS>
+$Type    => "Personal"
+$Dashboards => undef
+</%ARGS>
+<%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;
+}
+</%INIT>
+

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/ShowSubscription
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Elements/ShowSubscription	Fri May  2 18:06:35 2008
@@ -0,0 +1,76 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<a href="<% $url %>"><% $frequency %></a>
+<%ARGS>
+$Dashboard => undef
+$Subscription => undef
+</%ARGS>
+<%INIT>
+my $url = sprintf '%s/Prefs/Dashboards/Subscription.html?DashboardId=%d&Privacy=%s',
+          $RT::WebPath,
+          $Dashboard->Id,
+          $Dashboard->Privacy;
+
+my $frequency = loc("None");
+
+if (defined $Subscription) {
+    my $freq = $Subscription->SubValue('Frequency');
+    my $hour = $Subscription->SubValue('Hour');
+
+    if ($freq eq 'weekly') {
+        my $day = (qw/Monday Tuesday Wednesday Thursday Friday Saturday Sunday/)[$Subscription->SubValue('Dow')];
+        $frequency = loc("[_1] (on [_2]) at [_3]", $freq, $day, $hour);
+    }
+    elsif ($freq eq 'monthly') {
+        $frequency = loc("[_1] (day [_2]) at [_3]", $freq, $Subscription->SubValue('Dom'), $hour);
+    } 
+    elsif ($freq eq 'daily') {
+        $frequency = loc("[_1] at [_2]", $freq, $hour);
+    }
+}
+</%INIT>

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Modify.html
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Modify.html	Fri May  2 18:06:35 2008
@@ -0,0 +1,158 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<& /Elements/Header, title => $title &>
+<& /Prefs/Dashboards/Elements/DashboardTabs,
+    current_subtab => $current_subtab,
+    Title => $title,
+    $Create ? () : (DashboardObj => $Dashboard),
+&>
+<& /Elements/ListActions, actions => \@results &>
+
+<form action="<%$RT::WebPath%>/Prefs/Dashboards/Modify.html" method="post" enctype="multipart/form-data">
+
+%unless ($Dashboard->Id) {
+<input type="hidden" class="hidden" name="id" value="new" />
+% } else {
+<input type="hidden" class="hidden" name="id" value="<%$Dashboard->Id%>" />
+% }
+<table>
+<tr><td align="right">
+<&|/l&>Name</&>:
+</td>
+<td><input name="Name" value="<%$Dashboard->Name%>" /></td>
+</tr>
+<tr><td align="right">
+<&|/l&>Privacy</&>:
+</td><td>
+<& /Prefs/Dashboards/Elements/SelectPrivacy, Name => "Privacy", Objects => \@privacies &>
+</td></tr>
+</table>
+<& /Elements/Submit, Label => loc('Save Changes') &>
+</form>
+<%INIT>
+
+my $current_subtab;
+my ($title, @results);
+my $tried_create = 0;
+
+use RT::Dashboard;
+
+my @privacies = RT::Dashboard->new($session{'CurrentUser'})->_PrivacyObjects;
+
+my $Dashboard = RT::Dashboard->new($session{'CurrentUser'});
+
+if ($Create) {
+    $current_subtab = 'Prefs/Dashboards/Modify.html?Create=1';
+    $title = loc("Create a new dashboard");
+} 
+else {
+    if ($id eq 'new') {
+        my ($val, $msg);
+        $tried_create = 1;
+
+        if ($session{'CurrentUser'}->HasRight(Right => 'ModifyDashboard', Object => $RT::System)) {
+            ($val, $msg) = $Dashboard->Save(
+                Name                  => $ARGS{'Name'},
+                Privacy               => $ARGS{'Privacy'},
+            );
+        }
+        else {
+            $msg = "No permission to create dashboards";
+        }
+
+        if (!$val) {
+            Abort(loc("Dashboard could not be created: [_1]", $msg));
+        }
+        $id = $Dashboard->Id;
+    }
+    else {
+        $Dashboard->Load($ARGS{'Privacy'}, $id)
+            or Abort('Could not load dashboard');
+    }
+
+    if ($id) {
+        $title = loc("Modify the dashboard [_1]", $Dashboard->Name);
+        $current_subtab = 'Prefs/Dashboards/Modify.html?id='
+                        . $id
+                        . '&Privacy=' . $Privacy;
+    }	
+    # If the create failed
+    else {
+        $Create = 1;
+        $current_subtab = 'Prefs/Dashboards/Modify.html?Create=1';
+        $title = loc("Create a new dashboard");
+    }
+}
+
+if (!$Create && !$tried_create && $id && defined($ARGS{'Name'})) {
+    my ($ok, $msg);
+    if ($session{'CurrentUser'}->HasRight(Right => 'ModifyDashboard', Object => $RT::System)) {
+        ($ok, $msg) = $Dashboard->Update(Privacy  => $ARGS{'Privacy'},
+                                      Name     => $ARGS{'Name'});
+    }
+    else {
+        $msg = "No permission to update dashboards";
+    }
+
+    if ($ok) {
+        push @results, loc("Dashboard updated");
+    }
+    else {
+        push @results, loc("Dashboard could not be updated: [_1]", $msg);
+    }
+
+}
+</%INIT>
+
+<%ARGS>
+$Create => undef
+$Name => undef
+$Privacy => undef
+$id => '' unless defined $id
+</%ARGS>
+

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Queries.html
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Queries.html	Fri May  2 18:06:35 2008
@@ -0,0 +1,167 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<& /Elements/Header, title => $title &>
+<& /Prefs/Dashboards/Elements/DashboardTabs,
+    current_subtab => $current_subtab,
+    Title => $title,
+    DashboardObj => $Dashboard &>
+
+<& /Widgets/SelectionBox:header, nojs => 1 &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<form action="<%$RT::WebPath%>/Prefs/Dashboards/Queries.html" method="post" enctype="multipart/form-data">
+<input type="hidden" class="hidden" name="id" value="<%$Dashboard->Id%>" />
+<input type="hidden" class="hidden" name="Privacy" value="<%$Dashboard->Privacy%>" />
+<table width="100%" border="0">
+<tr>
+
+<td valign="top" class="boxcontainer">
+<&| /Widgets/TitleBox, title => loc('Queries') &>
+<table>
+</td><td>
+<& /Widgets/SelectionBox:show, self => $sel, nojs => 1 &>
+</td></tr>
+</table>
+</&>
+
+</td>
+</tr>
+</table>
+
+</form>
+
+<%INIT>
+
+my $current_subtab = 'Prefs/Dashboards/Queries.html?id='
+                   . $id
+                   . '&Privacy=' . $Privacy;
+my @results;
+
+use RT::Dashboard;
+my $Dashboard = new RT::Dashboard($session{'CurrentUser'});
+$Dashboard->Load($ARGS{'Privacy'}, $id)
+    or Abort("Couldn't load dashboard.");
+my $title = loc("Modify the queries of dashboard [_1]", $Dashboard->Name);
+
+my %desc_of;
+my @items;
+my @selected;
+
+# Get the list of queries already in use
+for ($Dashboard->SearchIDs) {
+    my ($privacy, $id, $desc) = @$_;
+    my $name = "$id-$privacy";
+    push @selected, $name;
+    $desc_of{$name} = $desc;
+}
+
+my $sys = RT::System->new($session{'CurrentUser'});
+my @objs = ($sys);
+
+push @objs, RT::SavedSearches->new( $session{CurrentUser} )->_PrivacyObjects
+    if $session{'CurrentUser'}->HasRight( Right  => 'LoadSavedSearch',
+                                          Object => $RT::System );
+
+for my $object (@objs) {
+    for ($m->comp("/Search/Elements/SearchesForObject", Object => $object)) {
+        my ($desc, $search) = @$_;
+        my $SearchType = $search->Content->{'SearchType'} || 'Ticket';
+
+        my $privacy = $object->isa('RT::User')   ? 'RT::User-'  . $object->Id
+                    : $object->isa('RT::Group')  ? 'RT::Group-' . $object->Id
+                    : $object->isa('RT::System') ? 'RT::System'
+                    : '';
+
+        my $name = $search->Id . '-' . $privacy;
+        push @items, [$name, $desc];
+        $desc_of{$name} = $desc;
+    }
+}
+
+# Create a selectionbox widget for those queries
+my $sel = $m->comp(
+    '/Widgets/SelectionBox:new',
+    Action    => 'Prefs/Dashboards/Queries.html',
+    Name      => "Searches",
+    Available => \@items,
+    Selected  => \@selected,
+    AutoSave  => 1,
+    OnSubmit  => sub {
+        my $self = shift;
+
+        # transform list of "SearchID-PrivacyObjType-PrivacyObjID"s to
+        # list of [Privacy, SearchID, Description]s
+        my $searches = [ map {
+            [ reverse(split /-/, $_, 2), $desc_of{$_} ]
+        } @{ $self->{Current} } ];
+
+        my ($ok, $msg);
+        if ($session{'CurrentUser'}->HasRight(Right => 'ModifyDashboard', Object => $RT::System)) {
+            ($ok, $msg) = $Dashboard->Update(Searches => $searches);
+        }
+        else {
+            $msg = "No permission to update dashboards";
+        }
+
+        if ($ok) {
+            push @results, loc("Dashboard updated");
+        }
+        else {
+            push @results, loc("Dashboard could not be updated: [_1]", $msg);
+        }
+    },
+);
+$m->comp('/Widgets/SelectionBox:process', %ARGS, self => $sel, nojs => 1);
+
+</%INIT>
+<%ARGS>
+$Privacy => undef
+$id => '' unless defined $id
+</%ARGS>
+

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Render.html
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Render.html	Fri May  2 18:06:35 2008
@@ -0,0 +1,98 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<& /Elements/Header, title => $title &>
+<& /Prefs/Dashboards/Elements/DashboardTabs,
+    current_subtab => $current_subtab,
+    Title => $title,
+    DashboardObj => $DashboardObj &>
+
+<table border="0" width="100%">
+<tr valign="top">
+
+<td class="boxcontainer" width="70%">
+% foreach ($DashboardObj->SearchIDs) {
+%   my ($type, $id, $desc) = @$_;
+%   my @for_showsearch = $DashboardObj->SearchPrivacy(@$_);
+    <& /Elements/ShowSearch, @for_showsearch, Override => { Rows => $rows } &>
+% }
+</td>
+
+</tr>
+</table>
+
+<%INIT>
+
+my $current_subtab = 'Prefs/Dashboards/Render.html?id='
+                   . $id
+                   . '&Privacy=' . $Privacy;
+
+use RT::Dashboard;
+my $DashboardObj = RT::Dashboard->new($session{'CurrentUser'});
+$DashboardObj->Load($Privacy, $id)
+    or Abort('Could not load dashboard');
+
+my $SubscriptionObj = RT::Attribute->new($session{'CurrentUser'});
+my $Loaded = 0;
+
+# try to load the subscription to this id
+for my $sub ($session{'CurrentUser'}->UserObj->Attributes->Named('Subscription')) {
+    next unless $sub->SubValue('DashboardId') == $id;
+    $SubscriptionObj = $sub;
+    $Loaded = 1;
+    last;
+}
+
+my $rows = $Loaded ? $SubscriptionObj->SubValue('Rows') : 20;
+my $title = "Preview dashboard " . $DashboardObj->Name;
+
+</%INIT>
+<%ARGS>
+$id    => undef
+$Privacy     => undef
+</%ARGS>
+

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/Subscription.html
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/Subscription.html	Fri May  2 18:06:35 2008
@@ -0,0 +1,263 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<& /Elements/Header, title => $title &>
+<& /Prefs/Dashboards/Elements/DashboardTabs,
+    current_subtab => $current_subtab,
+    Title => $title,
+    DashboardObj => $DashboardObj &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<form action="<%$RT::WebPath%>/Prefs/Dashboards/Subscription.html" method="post" enctype="multipart/form-data">
+<input type="hidden" class="hidden" name="DashboardId" value="<% $SubscriptionObj->SubValue('DashboardId') %>" />
+<input type="hidden" class="hidden" name="Privacy" value="<% $SubscriptionObj->SubValue('Privacy') %>" />
+<table width="100%" border="0">
+<tr>
+
+<td valign="top" class="boxcontainer">
+<&| /Widgets/TitleBox, title => loc('Dashboard') &>
+
+<table>
+<tr><td align="right">
+<&|/l&>Dashboard</&>:
+</td><td>
+<% $DashboardObj->Name %>
+</td></tr>
+
+<tr><td align="right">
+<&|/l&>Queries</&>:
+</td><td>
+% my @searches = $DashboardObj->Searches;
+% if (!@searches) {
+(none)
+% } else {
+<ol>
+%    for my $query (@searches) {
+%       my $priv = $query->Privacy;
+%       my $name;
+%       if ($query->{Attribute}->Name =~ /^Search - (.*)$/) {
+%           $name = $1;
+%       } else {
+%           $name = $query->Name;
+%       }
+        <li>
+            <% loc($name, $SubscriptionObj->SubValue('Rows')) %>
+        </li>
+%    }
+</ol>
+% }
+</td></tr>
+
+</table>
+</&>
+
+<&| /Widgets/TitleBox, title => loc('Subscription') &>
+
+<table>
+<tr><td align="right">
+<&|/l&>Hour</&>:
+</td><td>
+<select name="Hour">
+% for my $hour (0..23) {
+%     my $formatted = sprintf '%02d:00', $hour;
+%     my $selected = $formatted eq $SubscriptionObj->SubValue('Hour')
+%                  ? 'selected="selected"'
+%                  : '';
+
+    <option value="<% $formatted %>" <%$selected%>><% $formatted %></option>
+% }
+</select>
+(in <%$timezone%>)
+</td></tr>
+<tr><td align="right">
+<&|/l&>Frequency</&>:
+</td><td>
+<input type="radio" name="Frequency" value="daily" <% $SubscriptionObj->SubValue('Frequency') eq 'daily' ? "checked" : "" %>>
+    daily
+</input><br />
+
+<input type="radio" name="Frequency" value="weekly"<% $SubscriptionObj->SubValue('Frequency') eq 'weekly' ? "checked" : "" %>>
+weekly</input>, on
+<select name="Dow">
+%   for my $dow (qw/Monday Tuesday Wednesday Thursday Friday Saturday Sunday/) {
+    <option value="<% $dow %>" <% $SubscriptionObj->SubValue('Dow') eq $dow ? 'selected="selected"' : '' %>><% loc($dow) %></option>
+%   }
+</select>
+<br />
+
+<input type="radio" name="Frequency" value="monthly"<% $SubscriptionObj->SubValue('Frequency') eq 'monthly' ? "checked" : "" %>>
+monthly</input> , on day
+<select name="Dom">
+%   for my $dom (1..31) {
+    <option value="<% $dom %>" <% $SubscriptionObj->SubValue('Dom') == $dom ? 'selected="selected"' : '' %>><% loc($dom) %></option>
+%   }
+</select>
+
+</td></tr>
+<tr><td align="right">
+<&|/l&>Rows</&>:
+</td><td>
+<select name="Rows">
+%   for my $rows (1, 2, 5, 10, 15, 20, 25, 50, 75, 100, 0) {
+        <option value="<% $rows %>" <% $SubscriptionObj->SubValue('Rows') eq $rows ? 'selected="selected"' : '' %>><% loc($rows || 'Unlimited') %></option>
+%   }
+</select>
+</td></tr>
+</table>
+</&>
+</td>
+</tr>
+</table>
+
+<& /Elements/Submit, Label => loc('Save Changes') &>
+<br />
+<& /Elements/Submit, Name => "Unsubscribe", Label => loc('Unsubscribe') &>
+
+</form>
+
+<%INIT>
+
+my $current_subtab = 'Prefs/Dashboards/Subscription.html?DashboardId='
+                   . $DashboardId
+                   . '&Privacy=' . $Privacy;
+
+my ($title, @results);
+my ($val, $msg);
+my $Loaded = 0;
+my $timezone = eval{$session{'CurrentUser'}->UserObj->Timezone} || 'UTC';
+
+use RT::Dashboard;
+my $DashboardObj = RT::Dashboard->new($session{'CurrentUser'});
+
+my $SubscriptionObj = RT::Attribute->new($session{'CurrentUser'});
+
+# first let's see if we already have a subscription to this DashboardId
+for my $sub ($session{'CurrentUser'}->UserObj->Attributes->Named('Subscription')) {
+    next unless $sub->SubValue('DashboardId') == $DashboardId;
+    $Loaded = 1;
+    $SubscriptionObj = $sub;
+    $DashboardObj->Load($SubscriptionObj->SubValue('Privacy'), 
+                     $SubscriptionObj->SubValue('DashboardId'));
+
+}
+
+if (!$Loaded) {
+    my ($ok, $msg) = $DashboardObj->Load($ARGS{'Privacy'}, 
+                                      $ARGS{'DashboardId'});
+    $ok || Abort("Couldn't subscribe to dashboard $DashboardId: $msg.");
+
+    if ($session{'CurrentUser'}->HasRight(Right => 'SubscribeDashboard', Object => $RT::System)) {
+        ($val, $msg) = $SubscriptionObj->Create(
+            Name => 'Subscription',
+            Description => 'Subscription to dashboard ' . $DashboardId,
+            Content => {
+                DashboardId  => $DashboardId,
+                Privacy   => $Privacy,
+                Frequency => 'daily',
+                Hour      => '06:00',
+                Dow       => 'Monday',
+                Dom       => 1,
+                Rows      => 20,
+            },
+            ContentType => 'storable',
+            Object      => $session{'CurrentUser'}->UserObj,
+        );
+    }
+    else {
+        $msg = "No permission to subscribe to dashboards";
+    }
+
+    if ($val) {
+        push @results, loc("Subscribed to dashboard [_1]", $DashboardObj->Name);
+        push @results, loc("Warning: you have no email address set, so you will not receive this dashboard until you have it set")
+            unless $session{'CurrentUser'}->EmailAddress;
+    }
+    else {
+        push @results, loc('Subscription could not be created: [_1]', $msg);
+    }
+}
+
+if ($Unsubscribe) {
+    my ($ok, $msg) = $SubscriptionObj->Delete();
+    $ok || Abort("Couldn't unsubscribe to dashboard $DashboardId.");
+    RT::Interface::Web::Redirect($RT::WebURL."Prefs/Dashboards/index.html?Unsubscribe=$DashboardId");
+}
+
+# if hour is undefined, then they're looking at this for the first time
+# so we don't modify anything yet
+if (defined $Hour) {
+    ($val, $msg) = $SubscriptionObj->SetSubValues(
+        Frequency => $Frequency,
+        Hour      => $Hour,
+        Dow       => $Dow,
+        Dom       => $Dom,
+        Rows      => $Rows,
+    );
+
+    # not so good to spew base64-encoded data at the user :)
+    if ($msg =~ /^Content changed from/) {
+        $msg = "Subscription updated.";
+    }
+
+    push @results, $msg;
+}
+
+$title = loc("Modify the subscription to dashboard [_1]", $DashboardObj->Name);
+
+</%INIT>
+<%ARGS>
+$DashboardId    => undef
+$Privacy     => undef
+$Frequency   => undef
+$Hour        => undef
+$Dow         => undef
+$Dom         => undef
+$Rows        => undef
+$Unsubscribe => undef
+</%ARGS>
+

Added: rt/branches/3.8-TESTING/html/Prefs/Dashboards/index.html
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Prefs/Dashboards/index.html	Fri May  2 18:06:35 2008
@@ -0,0 +1,102 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<& /Elements/Header, title => $title &>
+<& /Prefs/Dashboards/Elements/DashboardTabs,
+    current_subtab => 'Prefs/Dashboards/index.html',
+    Title => $title &>
+
+<& /Elements/ListActions,
+    actions => $Unsubscribe
+             ? [loc("Unsubscribed to dashboard [_1]", $Unsubscribe)]
+             : [] &>
+
+<& /Prefs/Dashboards/Elements/ShowDashboards,
+    Type       => "Personal",
+    Dashboards => \@personal_dashboards,
+&>
+
+<& /Prefs/Dashboards/Elements/ShowDashboards,
+    Type => "System",
+    Dashboards => \@system_dashboards,
+&>
+
+% for my $group (sort keys %group_dashboards) {
+    <& /Prefs/Dashboards/Elements/ShowDashboards,
+        Type       => $group,
+        Dashboards => $group_dashboards{$group},
+    &>
+% }
+
+<%INIT>
+my $title = loc("Dashboards");
+my @personal_dashboards;
+my @system_dashboards;
+my %group_dashboards;
+
+use RT::Dashboard;
+
+my @objs = RT::Dashboard->new($session{CurrentUser})->_PrivacyObjects(ShowSystem => 1);
+
+for my $object (@objs) {
+    for my $dashboard ($m->comp("/Prefs/Dashboards/Elements/DashboardsForObject", Object => $object)) {
+        if ($object->isa('RT::System')) {
+            push @system_dashboards, $dashboard;
+        }
+        elsif ($object->isa('RT::User')) {
+            push @personal_dashboards, $dashboard;
+        }
+        else {
+            push @{ $group_dashboards{$object->Name} }, $dashboard;
+        }
+    }
+}
+</%INIT>
+<%ARGS>
+$Unsubscribe => undef
+</%ARGS>
+

Modified: rt/branches/3.8-TESTING/html/User/Elements/Tabs
==============================================================================
--- rt/branches/3.8-TESTING/html/User/Elements/Tabs	(original)
+++ rt/branches/3.8-TESTING/html/User/Elements/Tabs	Fri May  2 18:06:35 2008
@@ -67,6 +67,9 @@
 	       r => { title => loc('RT at a glance'),
 			   path => 'Prefs/MyRT.html',
 			 },
+	       s => { title => loc('Dashboards'),
+			   path => 'Prefs/Dashboards/index.html',
+			 },
 	       t => { title => loc('Other'),
 			   path => 'Prefs/Other.html',
 			 },


More information about the Rt-commit mailing list