[Rt-commit] rt branch, 4.2/dashboard-in-menu, updated. rt-3.9.7-1235-g39bf4d6
Shawn Moore
sartak at bestpractical.com
Tue Jan 25 21:24:31 EST 2011
The branch, 4.2/dashboard-in-menu has been updated
via 39bf4d684f9ac352ed8dab29501cf72cf5cb1bee (commit)
via d7bd82040a4baabf0263a2d2cb59246d9fe67c7c (commit)
via 1ab514e0327ee9c7b8aeda95a8513ed849d4f73d (commit)
via 768a4189e6632b9e92aec0c87e064b2ae528d3ea (commit)
via db2032b92424449057ee6ba520d141d3c7c940a6 (commit)
from c619fc22cc8e8ba39aa50ce42291957fffe79de6 (commit)
Summary of changes:
lib/RT/Dashboard.pm | 7 ++++---
share/html/Dashboards/Elements/ListOfDashboards | 4 ++--
share/html/Dashboards/Modify.html | 21 +++++++++++----------
share/html/Elements/Tabs | 2 +-
4 files changed, 18 insertions(+), 16 deletions(-)
- Log -----------------------------------------------------------------
commit db2032b92424449057ee6ba520d141d3c7c940a6
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Jan 25 21:06:04 2011 -0500
Only update ShowInMenu if previous updates were successful
diff --git a/lib/RT/Dashboard.pm b/lib/RT/Dashboard.pm
index 8efc0cf..9e1e8b3 100644
--- a/lib/RT/Dashboard.pm
+++ b/lib/RT/Dashboard.pm
@@ -137,7 +137,7 @@ sub UpdateAttribute {
);
}
- if ( defined $args->{'ShowInMenu'} ) {
+ if ($status && defined $args->{'ShowInMenu'}) {
( $status, $msg ) =
$self->{'Attribute'}->SetSubValues( ShowInMenu => $args->{'ShowInMenu'}, );
}
commit 768a4189e6632b9e92aec0c87e064b2ae528d3ea
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Jan 25 21:07:58 2011 -0500
ListOfDashboards can't filter for ShowInMenu
We use this component in other places like Dashboards/Queries.html,
so ListOfDashboards is not the right place for the filtering
diff --git a/share/html/Dashboards/Elements/ListOfDashboards b/share/html/Dashboards/Elements/ListOfDashboards
index 312f331..e4ddc0e 100644
--- a/share/html/Dashboards/Elements/ListOfDashboards
+++ b/share/html/Dashboards/Elements/ListOfDashboards
@@ -56,10 +56,10 @@ my %dashboard_map;
for my $object (@objs) {
my $new_dashboards = $m->comp("/Dashboards/Elements/DashboardsForObject", Object => $object);
- push @{ $dashboard_map{$_} }, grep { $_->ShowInMenu } @{ $new_dashboards->{$_} || [] }
+ push @{ $dashboard_map{$_} }, @{ $new_dashboards->{$_} || [] }
for qw/personal system/;
- push @{ $dashboard_map{group}{$_} }, grep { $_->ShowInMenu } @{ $new_dashboards->{group}{$_} }
+ push @{ $dashboard_map{group}{$_} }, @{ $new_dashboards->{group}{$_} }
for keys %{ $new_dashboards->{group} || {} };
}
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 0abee79..e5d5451 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -61,7 +61,7 @@ my $query_string = sub {
my $build_main_nav = sub {
my $home = Menu->child( home => title => loc('Homepage'), path => '/' );
- my @dashboards = $m->comp("/Dashboards/Elements/ListOfDashboards");
+ my @dashboards = grep { $_->ShowInMenu } $m->comp("/Dashboards/Elements/ListOfDashboards");
my $dashes = Menu()->child('home');
if (@dashboards) {
for my $dash (@dashboards) {
commit 1ab514e0327ee9c7b8aeda95a8513ed849d4f73d
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Jan 25 21:11:33 2011 -0500
Tidy
diff --git a/lib/RT/Dashboard.pm b/lib/RT/Dashboard.pm
index 9e1e8b3..ad1943b 100644
--- a/lib/RT/Dashboard.pm
+++ b/lib/RT/Dashboard.pm
@@ -138,8 +138,9 @@ sub UpdateAttribute {
}
if ($status && defined $args->{'ShowInMenu'}) {
- ( $status, $msg ) =
- $self->{'Attribute'}->SetSubValues( ShowInMenu => $args->{'ShowInMenu'}, );
+ ($status, $msg) = $self->{'Attribute'}->SetSubValues(
+ ShowInMenu => $args->{'ShowInMenu'},
+ );
}
if ($status && $args->{'Name'}) {
diff --git a/share/html/Dashboards/Modify.html b/share/html/Dashboards/Modify.html
index 75d23d7..f1fa0a5 100644
--- a/share/html/Dashboards/Modify.html
+++ b/share/html/Dashboards/Modify.html
@@ -111,9 +111,9 @@ else {
$tried_create = 1;
my ($val, $msg) = $Dashboard->Save(
- Name => $ARGS{'Name'},
- Privacy => $ARGS{'Privacy'},
- ShowInMenu => $ARGS{ShowInMenu},
+ Name => $ARGS{'Name'},
+ Privacy => $ARGS{'Privacy'},
+ ShowInMenu => $ARGS{'ShowInMenu'},
);
if (!$val) {
@@ -143,10 +143,11 @@ else {
}
if (!$Create && !$tried_create && $id && $ARGS{'Save'}) {
- my ($ok, $msg) = $Dashboard->Update(Privacy => $ARGS{'Privacy'},
- Name => $ARGS{'Name'},
- ShowInMenu => $ARGS{ShowInMenu},
- );
+ my ($ok, $msg) = $Dashboard->Update(
+ Privacy => $ARGS{'Privacy'},
+ Name => $ARGS{'Name'},
+ ShowInMenu => $ARGS{'ShowInMenu'},
+ );
if ($ok) {
push @results, loc("Dashboard updated");
commit d7bd82040a4baabf0263a2d2cb59246d9fe67c7c
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Jan 25 21:22:58 2011 -0500
Better capitalization for the Show in Menu label
diff --git a/share/html/Dashboards/Modify.html b/share/html/Dashboards/Modify.html
index f1fa0a5..17af0b0 100644
--- a/share/html/Dashboards/Modify.html
+++ b/share/html/Dashboards/Modify.html
@@ -68,7 +68,7 @@
<td><& /Dashboards/Elements/SelectPrivacy, Name => "Privacy", Objects => \@privacies, Default => $Dashboard->Privacy &></td>
</tr>
<tr>
- <td class="label"><&|/l&>Show In menu</&>:</td>
+ <td class="label"><&|/l&>Show in Menu</&>:</td>
<td class="value">
<input name="ShowInMenu" type="radio" value="1"
<% $Dashboard->ShowInMenu ? 'checked="checked"' : '' %> ><&|/l&>yes</&>
commit 39bf4d684f9ac352ed8dab29501cf72cf5cb1bee
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Jan 25 21:24:17 2011 -0500
Convert to a checkbox for ShowInMenu
diff --git a/share/html/Dashboards/Modify.html b/share/html/Dashboards/Modify.html
index 17af0b0..792ebcb 100644
--- a/share/html/Dashboards/Modify.html
+++ b/share/html/Dashboards/Modify.html
@@ -70,10 +70,8 @@
<tr>
<td class="label"><&|/l&>Show in Menu</&>:</td>
<td class="value">
- <input name="ShowInMenu" type="radio" value="1"
- <% $Dashboard->ShowInMenu ? 'checked="checked"' : '' %> ><&|/l&>yes</&>
- <input name="ShowInMenu" type="radio" value="0"
- <% $Dashboard->ShowInMenu ? '' : 'checked="checked"' %> ><&|/l&>no</&>
+ <input type="hidden" class="hidden" name="SetShowInMenu" value="1" />
+ <input type="checkbox" class="checkbox" name="ShowInMenu" value="1" <% $Dashboard->ShowInMenu ? 'checked="checked"' : '' %> />
</td>
</tr>
</table>
@@ -111,9 +109,9 @@ else {
$tried_create = 1;
my ($val, $msg) = $Dashboard->Save(
- Name => $ARGS{'Name'},
- Privacy => $ARGS{'Privacy'},
- ShowInMenu => $ARGS{'ShowInMenu'},
+ Name => $ARGS{'Name'},
+ Privacy => $ARGS{'Privacy'},
+ ($SetShowInMenu ? (ShowInMenu => $ShowInMenu) : ()),
);
if (!$val) {
@@ -144,9 +142,9 @@ else {
if (!$Create && !$tried_create && $id && $ARGS{'Save'}) {
my ($ok, $msg) = $Dashboard->Update(
- Privacy => $ARGS{'Privacy'},
- Name => $ARGS{'Name'},
- ShowInMenu => $ARGS{'ShowInMenu'},
+ Privacy => $ARGS{'Privacy'},
+ Name => $ARGS{'Name'},
+ ($SetShowInMenu ? (ShowInMenu => $ShowInMenu) : ()),
);
if ($ok) {
@@ -185,5 +183,7 @@ $Create => undef
$Name => undef
$id => '' unless defined $id
$Delete => undef
+$SetShowInMenu => undef
+$ShowInMenu => 0
</%ARGS>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list