Fix CSV format

beta
Vitaliy Filippov 2018-05-30 19:20:38 +03:00
parent 0191669861
commit 374efe3279
6 changed files with 15 additions and 15 deletions

View File

@ -86,6 +86,8 @@ $Bugzilla::messages->{en} = {
CONTROLMAPMANDATORY() => 'Mandatory',
},
field_descs => {
count => 'Number of '.$terms->{Bugs},
times => 'Estimated/Actual/Remaining',
alias => 'Alias',
assigned_to => 'Assignee',
blocked => 'Blocks',

View File

@ -135,8 +135,8 @@ sub get_measures
{
my $cols = Bugzilla::Search->REPORT_COLUMNS();
my $descs = {
count => '',
times => '',
count => Bugzilla->messages->{field_descs}->{count},
times => Bugzilla->messages->{field_descs}->{times},
};
for my $f (keys %$cols)
{

View File

@ -110,6 +110,8 @@ $vars->{saved_report_id} = $ARGS->{saved_report_id};
$vars->{debug} = $ARGS->{debug};
$vars->{report_columns} = Bugzilla::Search->REPORT_COLUMNS();
$ARGS->{ctype} = $ARGS->{format} eq 'csv' ? 'csv' : 'html';
$ARGS->{format} = $ARGS->{format} eq 'csv' ? 'table' : $ARGS->{format};
my $formatparam = $ARGS->{format};
if ($action eq 'wrap')

View File

@ -35,13 +35,16 @@
[% ELSE %]
[% tbl_disp = tbl %]
[% END %]
[% tbl_field_disp FILTER csv %]: [% tbl_disp FILTER csv %]
[% tbl_field_disp _ ": " _ tbl_disp | csv %]
[% END %]
[% IF row_field %]
[% IF col_field AND row_field %]
[% row_field_disp _ " / " _ col_field_disp | csv %]
[% ELSIF row_field %]
[% row_field_disp FILTER csv %]
[% ELSIF col_field %]
[% col_field_disp FILTER csv %]
[% END %]
[% " / " IF col_field AND row_field %]
[% col_field_disp FILTER csv %]
[% IF col_field -%]
[% FOREACH col = col_names -%]
[% colsepchar %]

View File

@ -18,11 +18,5 @@
# Contributor(s): Gervase Markham <gerv@gerv.net>
#%]
[% FOREACH tbl = tbl_names %]
[% measure_descs = {
rtime => 'Remaining time'
etime => 'Estimated time'
wtime => 'Actual time'
count => "Number of $terms.bugs"
} %]
[% PROCESS "reports/report-table.csv.tmpl" %]
[% END %]

View File

@ -125,7 +125,8 @@
{ name => "pie", description => "Pie" },
{ name => "bar", description => "Bar" },
{ name => "line", description => "Line" },
{ name => "table", description => "Table" }
{ name => "table", description => "Table" },
{ name => "csv", description => "CSV" },
] %]
<select name="format" style="width: 100%; border: 0; margin-top: 2px">
[% FOR f = formats %]
@ -139,8 +140,6 @@
Show:
</th>
<td>
[% measure_descs.times = 'Estimated/Actual/Remaining' %]
[% measure_descs.count = "Number of $terms.bugs" %]
<select name="measure" style="width: 100%; border: 0; margin-top: 2px">
[% FOR m = measure_descs.keys.sort %]
<option value="[% m %]"[% IF measure == m %] selected="selected"[% END %]>[% measure_descs.$m %]</option>