From 21b50cba4e08e723f8c2d8e8b5800d0a13e2c180 Mon Sep 17 00:00:00 2001 From: Gervase Markham Date: Wed, 2 Jan 2013 17:09:36 +0000 Subject: Bug 413851 - add CSV output option to request lists. r=LpSolit. --- request.cgi | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'request.cgi') diff --git a/request.cgi b/request.cgi index 17e6c926d..436f94bc4 100755 --- a/request.cgi +++ b/request.cgi @@ -26,8 +26,12 @@ my $cgi = Bugzilla->cgi; Bugzilla->switch_to_shadow_db; my $template = Bugzilla->template; my $action = $cgi->param('action') || ''; +my $format = $template->get_format('request/queue', + scalar($cgi->param('format')), + scalar($cgi->param('ctype'))); -print $cgi->header(); +$cgi->set_dated_content_disp("inline", "requests", $format->{extension}); +print $cgi->header($format->{'ctype'}); my $fields; $fields->{'requester'}->{'type'} = 'single'; @@ -42,7 +46,7 @@ unless (defined $cgi->param('requestee') Bugzilla::User::match_field($fields); if ($action eq 'queue') { - queue(); + queue($format); } else { my $flagtypes = get_flag_types(); @@ -60,7 +64,7 @@ else { } $vars->{'components'} = [ sort { $a cmp $b } keys %components ]; - $template->process('request/queue.html.tmpl', $vars) + $template->process($format->{'template'}, $vars) || ThrowTemplateError($template->error()); } exit; @@ -70,6 +74,7 @@ exit; ################################################################################ sub queue { + my $format = shift; my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; @@ -295,8 +300,10 @@ sub queue { } $vars->{'components'} = [ sort { $a cmp $b } keys %components ]; + $vars->{'urlquerypart'} = $cgi->canonicalise_query('ctype'); + # Generate and return the UI (HTML page) from the appropriate template. - $template->process("request/queue.html.tmpl", $vars) + $template->process($format->{'template'}, $vars) || ThrowTemplateError($template->error()); } -- cgit v1.2.3-24-g4f1b