From 33beebf4cb42eba3e1dd868ad5e0af102de961da Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sat, 29 Sep 2012 16:36:46 -0700 Subject: update address standardization for cust_location changes --- rt/share/html/Search/Chart.html | 61 +++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 12 deletions(-) (limited to 'rt/share/html/Search/Chart.html') diff --git a/rt/share/html/Search/Chart.html b/rt/share/html/Search/Chart.html index 1a80ee385..571c3d3a0 100644 --- a/rt/share/html/Search/Chart.html +++ b/rt/share/html/Search/Chart.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -47,12 +47,10 @@ %# END BPS TAGGED BLOCK }}} <%args> $PrimaryGroupBy => 'Queue' -$SecondaryGroupBy => '' $ChartStyle => 'bars' $Description => undef <%init> -$ARGS{SecondaryGroupBy} ||= ''; $ARGS{Query} ||= 'id > 0'; # FIXME: should be factored with RT::Report::Tickets::Label :( @@ -74,25 +72,64 @@ my $title = loc( "Search results grouped by [_1]", $PrimaryGroupByLabel ); my $saved_search = $m->comp( '/Widgets/SavedSearch:new', SearchType => 'Chart', - SearchFields => [qw(Query PrimaryGroupBy SecondaryGroupBy ChartStyle)] ); + SearchFields => [qw(Query PrimaryGroupBy ChartStyle)] ); my @actions = $m->comp( '/Widgets/SavedSearch:process', args => \%ARGS, self => $saved_search ); +my %query; + +{ + if ($saved_search->{'CurrentSearch'}->{'Object'}) { + foreach my $search_field (@{ $saved_search->{'SearchFields'} }) { + $query{$search_field} = $saved_search->{'CurrentSearch'}->{'Object'}->Content->{$search_field}; + } + } + + my $current = $session{'CurrentSearchHash'}; + + my @session_fields = qw( + Query + SavedChartSearchId + SavedSearchDescription + SavedSearchLoad + SavedSearchLoadButton + SavedSearchOwner + ); + + for(@session_fields) { + $query{$_} = $current->{$_} unless defined $query{$_}; + $query{$_} = $DECODED_ARGS->{$_} unless defined $query{$_}; + } + + if ($DECODED_ARGS->{'SavedSearchLoadSubmit'}) { + $query{'SavedChartSearchId'} = $DECODED_ARGS->{'SavedSearchLoad'}; + } + + if ($DECODED_ARGS->{'SavedSearchSave'}) { + $query{'SavedChartSearchId'} = $saved_search->{'SearchId'}; + } + +} + <& /Elements/Header, Title => $title &> -<& /Ticket/Elements/Tabs, Title => $title, Query => $ARGS{Query}, - SavedChartSearchId => $saved_search->{SearchId} &> +<& /Elements/Tabs, QueryArgs => \%query &> <& /Elements/ListActions, actions => \@actions &> <& /Search/Elements/Chart, %ARGS &> -
-<&| /Widgets/TitleBox, title => loc('Graph Properties')&> +
+
+<&| /Widgets/TitleBox, title => loc('Chart Properties')&>
-<&|/l, $m->scomp('Elements/SelectChartType', Name => 'ChartStyle', Default => $ChartStyle), $m->scomp('Elements/SelectGroupBy', Name => 'PrimaryGroupBy', Query => $ARGS{Query}, Default => $PrimaryGroupBy) -&>[_1] chart by [_2] + +<&|/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/SavedSearch:show, %ARGS, Action => 'Chart.html', self => $saved_search, Title => loc('Saved charts') &> +
+ +
-- cgit v1.2.1