summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-12-01 08:30:40 +0100
committerByron Jones <glob@mozilla.com>2015-12-01 08:30:40 +0100
commit944f4c76700090704b1d4100fac2db4d647ede67 (patch)
tree83095fce9233b39f230c9c2d22e265940a879896
parent7bf9ad78543d0f95c655afab376de6fc4687f3d2 (diff)
downloadbugzilla-944f4c76700090704b1d4100fac2db4d647ede67.tar.gz
bugzilla-944f4c76700090704b1d4100fac2db4d647ede67.tar.xz
Bug 1229198 - When saving a buglist from a saved search as a CSV file, set the filename to <saved-query-name>.csv
-rw-r--r--Bugzilla/CGI.pm9
-rw-r--r--Bugzilla/Error.pm2
-rwxr-xr-xbuglist.cgi4
-rw-r--r--template/en/default/list/list.html.tmpl3
4 files changed, 9 insertions, 9 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index d24722fcc..7d111063d 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -335,16 +335,15 @@ sub multipart_start {
}
sub close_standby_message {
- my ($self, $contenttype, $disposition) = @_;
+ my ($self, $contenttype, $disp, $disp_prefix, $extension) = @_;
+ $self->set_dated_content_disp($disp, $disp_prefix, $extension);
if ($self->{_multipart_in_progress}) {
print $self->multipart_end();
- print $self->multipart_start(-type => $contenttype,
- -content_disposition => $disposition);
+ print $self->multipart_start(-type => $contenttype);
}
else {
- print $self->header(-type => $contenttype,
- -content_disposition => $disposition);
+ print $self->header($contenttype);
}
}
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm
index 8c6888b49..fa898fba4 100644
--- a/Bugzilla/Error.pm
+++ b/Bugzilla/Error.pm
@@ -118,7 +118,7 @@ sub _throw_error {
}
my $cgi = Bugzilla->cgi;
- $cgi->close_standby_message('text/html', 'inline');
+ $cgi->close_standby_message('text/html', 'inline', 'error', 'html');
$template->process($name, $vars)
|| ThrowTemplateError($template->error());
print $cgi->multipart_final() if $cgi->{_multipart_in_progress};
diff --git a/buglist.cgi b/buglist.cgi
index 18a9a7fc2..48c3ac57a 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -344,7 +344,7 @@ $params ||= new Bugzilla::CGI($cgi);
# at the end, because the fact that there is a remembered query gets
# forgotten in the process of retrieving it.
my $disp_prefix = "bugs";
-if ($cmdtype eq "dorem" && $remaction =~ /^run/) {
+if (($cmdtype eq "dorem" && $remaction =~ /^run/) || ($format->{extension} ne 'html' && defined $cgi->param('namedcmd'))) {
$disp_prefix = $cgi->param('namedcmd');
}
@@ -1087,7 +1087,7 @@ if ($format->{'extension'} eq "csv") {
$vars->{'human'} = $cgi->param('human');
}
-$cgi->close_standby_message($contenttype, $disposition);
+$cgi->close_standby_message($contenttype, $disposition, $disp_prefix, $format->{'extension'});
################################################################################
# Content Generation
diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl
index 0920a0669..d825cf9ce 100644
--- a/template/en/default/list/list.html.tmpl
+++ b/template/en/default/list/list.html.tmpl
@@ -213,7 +213,8 @@
[% Hook.process("links") %]
<a href="buglist.cgi?
- [% urlquerypart FILTER html %]&amp;ctype=csv&amp;human=1">CSV</a> |
+ [% urlquerypart FILTER html %]&amp;ctype=csv&amp;human=1
+ [%~ IF searchname %]&amp;namedcmd=[% searchname FILTER uri %][% END %]">CSV</a> |
<a href="buglist.cgi?
[% urlquerypart FILTER html %]&amp;title=
[%- title FILTER uri %]&amp;ctype=atom">Feed</a> |