X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FChart;h=2a28d62c4a41137c759f223b7fe798b1078dfd6a;hp=429fea52f3705aaa07bf8476ae0c66b19f5836b1;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941 diff --git a/rt/share/html/Search/Chart b/rt/share/html/Search/Chart index 429fea52f..2a28d62c4 100644 --- a/rt/share/html/Search/Chart +++ b/rt/share/html/Search/Chart @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -48,8 +48,7 @@ <%args> $Query => "id > 0" $PrimaryGroupBy => 'Queue' -$SecondaryGroupBy => undef -$ChartStyle => 'bars' +$ChartStyle => 'bar' <%init> my $chart_class; @@ -66,7 +65,8 @@ if ($ChartStyle eq 'pie') { use RT::Report::Tickets; my $tix = RT::Report::Tickets->new( $session{'CurrentUser'} ); - +my %AllowedGroupings = reverse $tix->Groupings( Query => $Query ); +$PrimaryGroupBy = 'Queue' unless exists $AllowedGroupings{$PrimaryGroupBy}; my ($count_name, $value_name) = $tix->SetupGroupings( Query => $Query, GroupBy => $PrimaryGroupBy, ); @@ -169,9 +169,8 @@ if ($chart_class eq "GD::Graph::bars") { # refine values' colors, with both Color::Scheme's help and my own tweak $chart->{dclrs} = [ '66cc66', 'ff6666', 'ffcc66', '663399', - '3333cc', - '339933', '993333', '996633', '663399', - '33cc33', 'cc3333', 'cc9933', '6633cc' + '3333cc', '339933', '993333', '996633', + '33cc33', 'cc3333', 'cc9933', '6633cc', ]; {