[Rt-commit] rt branch, 4.2/per-user-dashboards-in-menu, updated. rt-3.9.7-1234-g3c9794e
Shawn Moore
sartak at bestpractical.com
Thu Mar 3 20:11:23 EST 2011
The branch, 4.2/per-user-dashboards-in-menu has been updated
via 3c9794e976bedb90ae466767e0a726304fd9e1f1 (commit)
via 63cec0058ea868c12ecf53bfc92684b5289f0e27 (commit)
from b695551cdd46949761f04f70ce48f0ef527c0500 (commit)
Summary of changes:
share/html/Elements/Tabs | 3 ++-
share/html/Prefs/DashboardsInMenu.html | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit 63cec0058ea868c12ecf53bfc92684b5289f0e27
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Mar 3 20:03:13 2011 -0500
dashboards_in_menu can be a empty hashref when you Reset your pref
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 00d8952..76ef2ce 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -65,9 +65,10 @@ my $build_main_nav = sub {
unless ($session{'dashboards_in_menu'}) {
my $dashboards_in_menu = $session{CurrentUser}->UserObj->Preferences(
'DashboardsInMenu',
+ {},
);
- if (!$dashboards_in_menu) {
+ unless ($dashboards_in_menu->{dashboards}) {
my ($default_dashboards) =
RT::System->new( $session{'CurrentUser'} )
->Attributes
commit 3c9794e976bedb90ae466767e0a726304fd9e1f1
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Mar 3 20:05:29 2011 -0500
Manage session{'dashboards_in_menu'} only in /Elements/Tabs
This has a side effect of making the logic for Reset clearer and
possibly even more correct :)
diff --git a/share/html/Prefs/DashboardsInMenu.html b/share/html/Prefs/DashboardsInMenu.html
index 3bdebae..0038010 100644
--- a/share/html/Prefs/DashboardsInMenu.html
+++ b/share/html/Prefs/DashboardsInMenu.html
@@ -89,7 +89,8 @@ RT::System->new($session{'CurrentUser'})->Attributes->Named('DashboardsInMenu');
my $dashboard_pref =
$session{CurrentUser}->UserObj->Preferences( 'DashboardsInMenu',
$default_dashboards ? $default_dashboards->Content : () );
-$session{'dashboards_in_menu'} ||= $dashboard_pref->{dashboards} || [];
+
+my $current_dashboards = $dashboard_pref->{dashboards} || [];
my @dashboards = map { [$_->id, $_->Name] } $m->comp("/Dashboards/Elements/ListOfDashboards");
@@ -98,7 +99,7 @@ my @panes = $m->comp(
Action => 'DashboardsInMenu.html',
panes => ['dashboards_in_menu'],
items => \@dashboards,
- current_portlets => $session{'dashboards_in_menu'},
+ current_portlets => $current_dashboards,
OnSave => sub {
my ( $conf ) = @_;
my ( $ok, $msg ) =
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list