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', CONTROLMAPMANDATORY() => 'Mandatory',
}, },
field_descs => { field_descs => {
count => 'Number of '.$terms->{Bugs},
times => 'Estimated/Actual/Remaining',
alias => 'Alias', alias => 'Alias',
assigned_to => 'Assignee', assigned_to => 'Assignee',
blocked => 'Blocks', blocked => 'Blocks',

View File

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

View File

@ -110,6 +110,8 @@ $vars->{saved_report_id} = $ARGS->{saved_report_id};
$vars->{debug} = $ARGS->{debug}; $vars->{debug} = $ARGS->{debug};
$vars->{report_columns} = Bugzilla::Search->REPORT_COLUMNS(); $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}; my $formatparam = $ARGS->{format};
if ($action eq 'wrap') if ($action eq 'wrap')

View File

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

View File

@ -18,11 +18,5 @@
# Contributor(s): Gervase Markham <gerv@gerv.net> # Contributor(s): Gervase Markham <gerv@gerv.net>
#%] #%]
[% FOREACH tbl = tbl_names %] [% 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" %] [% PROCESS "reports/report-table.csv.tmpl" %]
[% END %] [% END %]

View File

@ -125,7 +125,8 @@
{ name => "pie", description => "Pie" }, { name => "pie", description => "Pie" },
{ name => "bar", description => "Bar" }, { name => "bar", description => "Bar" },
{ name => "line", description => "Line" }, { 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"> <select name="format" style="width: 100%; border: 0; margin-top: 2px">
[% FOR f = formats %] [% FOR f = formats %]
@ -139,8 +140,6 @@
Show: Show:
</th> </th>
<td> <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"> <select name="measure" style="width: 100%; border: 0; margin-top: 2px">
[% FOR m = measure_descs.keys.sort %] [% FOR m = measure_descs.keys.sort %]
<option value="[% m %]"[% IF measure == m %] selected="selected"[% END %]>[% measure_descs.$m %]</option> <option value="[% m %]"[% IF measure == m %] selected="selected"[% END %]>[% measure_descs.$m %]</option>