[Rt-commit] rt branch, 4.2/chart-ui-gc-settings, repushed
Wallace Reis
wreis at bestpractical.com
Wed Apr 16 15:53:06 EDT 2014
The branch 4.2/chart-ui-gc-settings was deleted and repushed:
was 29d33f2cb9714c85520c6d976e812f4a214c79f9
now 0b17020664d572d5c60b170436e18be7a6458a66
1: 29d33f2 ! 1: 0b17020 Issues#29015 - Saved chart should load settings
@@ -29,9 +29,9 @@
-</%args>
<%init>
+my $default_value = {
-+ Query => ['id > 0'],
++ Query => 'id > 0',
+ GroupBy => ['Status'],
-+ ChartStyle => 'bars',
++ ChartStyle => ['bars'],
+ ChartFunction => ['COUNT'],
+};
+
@@ -56,9 +56,16 @@
-$m->callback( ARGSRef => \%ARGS, QueryArgsRef => \%query );
+foreach (@search_fields) {
-+ $query{$_} = ref $ARGS{$_} ? $ARGS{$_} : [ $ARGS{$_} ];
-+ $query{$_} = $default_value->{$_}
-+ unless defined $query{$_} && defined $query{$_}[0];
++ if ( ref $default_value->{$_} ) {
++ $query{$_} = ref $ARGS{$_} ? $ARGS{$_} : [ $ARGS{$_} ];
++ $query{$_} = $default_value->{$_}
++ unless defined $query{$_} && defined $query{$_}[0];
++ }
++ else {
++ $query{$_} = ref $ARGS{$_} ? $ARGS{$_} : $ARGS{$_};
++ $query{$_} = $default_value->{$_}
++ unless defined $query{$_};
++ }
+}
+
+$m->callback( ARGSRef => \%ARGS, QueryArgsRef => \%ARGS );
@@ -71,7 +78,7 @@
<form method="get" action="<% RT->Config->Get('WebPath') %>/Search/Chart.html">
-<input type="hidden" class="hidden" name="Query" value="<% $ARGS{Query} %>" />
-+<input type="hidden" class="hidden" name="Query" value="<% $query{Query}[0] %>" />
++<input type="hidden" class="hidden" name="Query" value="<% $query{Query} %>" />
<input type="hidden" class="hidden" name="SavedChartSearchId" value="<% $saved_search->{SearchId} || 'new' %>" />
<&| /Widgets/TitleBox, title => loc('Group by'), class => "chart-group-by" &>
@@ -80,7 +87,7 @@
Name => 'GroupBy',
- Query => $ARGS{Query},
- Default => $GroupBy[0],
-+ Query => $query{Query}[0],
++ Query => $query{Query},
+ Default => $query{'GroupBy'}[0],
&>
</fieldset>
@@ -89,7 +96,7 @@
Name => 'GroupBy',
- Query => $ARGS{Query},
- Default => $GroupBy[1],
-+ Query => $query{Query}[0],
++ Query => $query{Query},
+ Default => $query{'GroupBy'}[1] // q{},
ShowEmpty => 1,
&>
@@ -99,7 +106,7 @@
Name => 'GroupBy',
- Query => $ARGS{Query},
- Default => $GroupBy[2],
-+ Query => $query{Query}[0],
++ Query => $query{Query},
+ Default => $query{'GroupBy'}[2] // q{},
ShowEmpty => 1,
&>
@@ -125,7 +132,7 @@
<&| /Widgets/TitleBox, title => loc('Picture'), class => "chart-picture" &>
-<label><% loc('Style') %>: <& Elements/SelectChartType, Default => $ChartStyle, Name => 'ChartStyle' &></label>
-<label><% loc("Width") %>: <input type="text" name="Width" value="<% $Width || "" %>"> <% loc("px") %></label>
-+<label><% loc('Style') %>: <& Elements/SelectChartType, Default => $query{ChartStyle}, Name => 'ChartStyle' &></label>
++<label><% loc('Style') %>: <& Elements/SelectChartType, Default => $query{ChartStyle}[0], Name => 'ChartStyle' &></label>
+<label><% loc("Width") %>: <input type="text" name="Width" value="<% $query{Width}[0] || "" %>"> <% loc("px") %></label>
<span class="height">
×
More information about the rt-commit
mailing list