You need to sign in or sign up before continuing.
Commit bfe71901 authored by Michael J Tosh's avatar Michael J Tosh Committed by Max Kanat-Alexander

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
parent 739d3a20
...@@ -1130,6 +1130,10 @@ if ($format->{'extension'} eq "csv") { ...@@ -1130,6 +1130,10 @@ if ($format->{'extension'} eq "csv") {
# We set CSV files to be downloaded, as they are designed for importing # We set CSV files to be downloaded, as they are designed for importing
# into other programs. # into other programs.
$disposition = "attachment"; $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. # Suggest a name for the bug list if the user wants to save it as a file.
......
...@@ -17,15 +17,23 @@ ...@@ -17,15 +17,23 @@
# #
# Contributor(s): Myk Melez <myk@mozilla.org> # Contributor(s): Myk Melez <myk@mozilla.org>
# Gervase Markham <gerv@gerv.net> # Gervase Markham <gerv@gerv.net>
# miketosh
#%] #%]
[% PROCESS "global/field-descs.none.tmpl" %] [% PROCESS "global/field-descs.none.tmpl" %]
[% colsepchar = user.settings.csv_colsepchar.value %] [% colsepchar = user.settings.csv_colsepchar.value %]
bug_id [% IF human %]
[% FOREACH column = displaycolumns %] [% field_descs.bug_id FILTER csv %]
[% colsepchar %][% column FILTER csv %] [% FOREACH column = displaycolumns %]
[% colsepchar %][% field_descs.$column FILTER csv %]
[% END %]
[% ELSE %]
bug_id
[% FOREACH column = displaycolumns %]
[% colsepchar %][% column FILTER csv %]
[% END %]
[% END %] [% END %]
[% FOREACH bug = bugs %] [% FOREACH bug = bugs %]
......
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
<td valign="middle" class="bz_query_links"> <td valign="middle" class="bz_query_links">
<a href="buglist.cgi? <a href="buglist.cgi?
[% urlquerypart FILTER html %]&amp;ctype=csv">CSV</a> | [% urlquerypart FILTER html %]&amp;ctype=csv&human=1">CSV</a> |
<a href="buglist.cgi? <a href="buglist.cgi?
[% urlquerypart FILTER html %]&amp;title= [% urlquerypart FILTER html %]&amp;title=
[%- title FILTER html %]&amp;ctype=atom">Feed</a> | [%- title FILTER html %]&amp;ctype=atom">Feed</a> |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment