From 374efe3279c19daaf9a35e36b639570b550bb342 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 30 May 2018 19:20:38 +0300 Subject: [PATCH] Fix CSV format --- Bugzilla/Language/en.pm | 2 ++ Bugzilla/Report.pm | 4 ++-- report.cgi | 2 ++ template/en/default/reports/report-table.csv.tmpl | 11 +++++++---- template/en/default/reports/report.csv.tmpl | 6 ------ template/en/default/reports/report.html.tmpl | 5 ++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Bugzilla/Language/en.pm b/Bugzilla/Language/en.pm index 35f48fe71..2deebf8ce 100644 --- a/Bugzilla/Language/en.pm +++ b/Bugzilla/Language/en.pm @@ -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', diff --git a/Bugzilla/Report.pm b/Bugzilla/Report.pm index 581cd60d3..f9ab9a993 100644 --- a/Bugzilla/Report.pm +++ b/Bugzilla/Report.pm @@ -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) { diff --git a/report.cgi b/report.cgi index 377f567b4..6e59dbce8 100755 --- a/report.cgi +++ b/report.cgi @@ -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') diff --git a/template/en/default/reports/report-table.csv.tmpl b/template/en/default/reports/report-table.csv.tmpl index 07304a76f..e254098c2 100644 --- a/template/en/default/reports/report-table.csv.tmpl +++ b/template/en/default/reports/report-table.csv.tmpl @@ -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 %] diff --git a/template/en/default/reports/report.csv.tmpl b/template/en/default/reports/report.csv.tmpl index 105531fcb..d98c7b5fb 100644 --- a/template/en/default/reports/report.csv.tmpl +++ b/template/en/default/reports/report.csv.tmpl @@ -18,11 +18,5 @@ # Contributor(s): Gervase Markham #%] [% 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 %] diff --git a/template/en/default/reports/report.html.tmpl b/template/en/default/reports/report.html.tmpl index deab36b0e..aec30be2c 100644 --- a/template/en/default/reports/report.html.tmpl +++ b/template/en/default/reports/report.html.tmpl @@ -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" }, ] %] [% FOR m = measure_descs.keys.sort %]