From: Michael J Tosh Date: Mon, 14 Feb 2011 19:50:25 +0000 (-0800) Subject: Bug 417551: Make it possible for CSV headers to be the field description X-Git-Tag: bugzilla-4.1.1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfe719017240bceaf7c686baf4d30f9dcc35b943;p=thirdparty%2Fbugzilla.git Bug 417551: Make it possible for CSV headers to be the field description instead of the field name, and have the buglist.cgi link give you CSV like this by default. r=mkanat, a=mkanat --- diff --git a/buglist.cgi b/buglist.cgi index 4b7fe8f5ad..64681b2cdf 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -1130,6 +1130,10 @@ if ($format->{'extension'} eq "csv") { # We set CSV files to be downloaded, as they are designed for importing # into other programs. $disposition = "attachment"; + + # If the user clicked the CSV link in the search results, + # They should get the Field Description, not the column name in the db + $vars->{'human'} = $cgi->param('human'); } # Suggest a name for the bug list if the user wants to save it as a file. diff --git a/template/en/default/list/list.csv.tmpl b/template/en/default/list/list.csv.tmpl index 6114d6fae7..be0a5bc690 100644 --- a/template/en/default/list/list.csv.tmpl +++ b/template/en/default/list/list.csv.tmpl @@ -17,15 +17,23 @@ # # Contributor(s): Myk Melez # Gervase Markham + # miketosh #%] [% PROCESS "global/field-descs.none.tmpl" %] [% colsepchar = user.settings.csv_colsepchar.value %] -bug_id -[% FOREACH column = displaycolumns %] - [% colsepchar %][% column FILTER csv %] +[% IF human %] + [% field_descs.bug_id FILTER csv %] + [% FOREACH column = displaycolumns %] + [% colsepchar %][% field_descs.$column FILTER csv %] + [% END %] +[% ELSE %] + bug_id + [% FOREACH column = displaycolumns %] + [% colsepchar %][% column FILTER csv %] + [% END %] [% END %] [% FOREACH bug = bugs %] diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index 924ce23dcf..a669aecb92 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -204,7 +204,7 @@ CSV | + [% urlquerypart FILTER html %]&ctype=csv&human=1">CSV | Feed |