X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=share%2Fhtml%2FSearch%2FChart.html;h=d038a55defe8ed5204e6df36ed8c015c3031fadc;hb=af59614dbbf895bf0b0ab155fe158b6152edf32b;hp=6e86d4b9e29b4aebff467a2377631f9689b7c7b4;hpb=632513a6db31ba1c9e5151dc69cff85f7925c8bc;p=usit-rt.git diff --git a/share/html/Search/Chart.html b/share/html/Search/Chart.html index 6e86d4b..d038a55 100644 --- a/share/html/Search/Chart.html +++ b/share/html/Search/Chart.html @@ -46,33 +46,21 @@ %# %# END BPS TAGGED BLOCK }}} <%args> -$PrimaryGroupBy => 'Queue' +@GroupBy => 'Status' $ChartStyle => 'bars' +@ChartFunction => ('COUNT') $Description => undef +$Width => undef +$Height => undef <%init> $ARGS{Query} ||= 'id > 0'; -# FIXME: should be factored with RT::Report::Tickets::Label :( -my $PrimaryGroupByLabel; -if ( $PrimaryGroupBy =~ /^(?:CF|CustomField)\.\{(.*)\}$/ ) { - my $cf = $1; - if ( $cf =~ /\D/ ) { - $PrimaryGroupByLabel = loc( "custom field '[_1]'", $cf ); - } else { - my $obj = RT::CustomField->new( $session{'CurrentUser'} ); - $obj->Load( $cf ); - $PrimaryGroupByLabel = loc( "custom field '[_1]'", $obj->Name ); - } -} else { - $PrimaryGroupByLabel = loc( $PrimaryGroupBy ); -} - -my $title = loc( "Search results grouped by [_1]", $PrimaryGroupByLabel ); +my $title = loc( "Grouped search results"); my $saved_search = $m->comp( '/Widgets/SavedSearch:new', SearchType => 'Chart', - SearchFields => [qw(Query PrimaryGroupBy ChartStyle)] ); + SearchFields => [qw(Query GroupBy ChartStyle ChartFunction Width Height)] ); my @actions = $m->comp( '/Widgets/SavedSearch:process', args => \%ARGS, self => $saved_search ); @@ -97,8 +85,8 @@ my %query; ); for(@session_fields) { - $query{$_} = $current->{$_} unless defined $query{$_}; $query{$_} = $DECODED_ARGS->{$_} unless defined $query{$_}; + $query{$_} = $current->{$_} unless defined $query{$_}; } if ($DECODED_ARGS->{'SavedSearchLoadSubmit'}) { @@ -119,15 +107,69 @@ my %query;
-<&| /Widgets/TitleBox, title => loc('Chart Properties')&> -
+ + -<&|/l_unsafe, $m->scomp('Elements/SelectChartType', Name => 'ChartStyle', Default => $ChartStyle), $m->scomp('Elements/SelectGroupBy', Name => 'PrimaryGroupBy', Query => $ARGS{Query}, Default => $PrimaryGroupBy) -&>[_1] chart by [_2] -
+<&| /Widgets/TitleBox, title => loc('Group by'), class => "chart-group-by" &> +
<% loc('Group tickets by') %> +<& Elements/SelectGroupBy, + Name => 'GroupBy', + Query => $ARGS{Query}, + Default => $GroupBy[0], + &> +
+
<% loc('and then') %> +<& Elements/SelectGroupBy, + Name => 'GroupBy', + Query => $ARGS{Query}, + Default => $GroupBy[1], + ShowEmpty => 1, + &> +
+
<% loc('and then') %> +<& Elements/SelectGroupBy, + Name => 'GroupBy', + Query => $ARGS{Query}, + Default => $GroupBy[2], + ShowEmpty => 1, + &> +
+ + +<&| /Widgets/TitleBox, title => loc("Calculate"), class => "chart-calculate" &> + +
<% loc('Calculate values of') %> +<& Elements/SelectChartFunction, Default => $ChartFunction[0] &> +
+
<% loc('and then') %> +<& Elements/SelectChartFunction, Default => $ChartFunction[1], ShowEmpty => 1 &> +
+
<% loc('and then') %> +<& Elements/SelectChartFunction, Default => $ChartFunction[2], ShowEmpty => 1 &> +
+ + + +<&| /Widgets/TitleBox, title => loc('Picture'), class => "chart-picture" &> + + + + × + + + + +<& /Elements/Submit, Label => loc('Update Chart'), Name => 'Update' &> + +