From 1cee4770ca5e09e3b56c0de0e8c77c2684542d18 Mon Sep 17 00:00:00 2001 From: "bbaetz%student.usyd.edu.au" <> Date: Sun, 15 Dec 2002 17:23:55 +0000 Subject: Bug 158499 - Templatise XML bug output r=gerv, justdave a=justdave --- xml.cgi | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'xml.cgi') diff --git a/xml.cgi b/xml.cgi index 91f8e8c03..f93c0e5c0 100755 --- a/xml.cgi +++ b/xml.cgi @@ -28,30 +28,15 @@ use lib qw(.); require "CGI.pl"; -use Bug; +our $cgi; -use vars qw($template $vars $userid %COOKIE); +# Convert comma/space separated elements into separate params +my @ids = (); -ConnectToDatabase(); -quietly_check_login(); - -if (!defined $::FORM{'id'} || !$::FORM{'id'}) { - print "Content-Type: text/html\n\n"; - $template->process("bug/choose-xml.html.tmpl", $vars) - || ThrowTemplateError($template->error()); - exit; +if (defined $cgi->param('id')) { + @ids = split (/[, ]+/, $cgi->param('id')); } -my $exporter = $::COOKIE{"Bugzilla_login"} || undef; - -my @ids = split (/[, ]+/, $::FORM{'id'}); - -print "Content-type: text/xml\n\n"; -print Bug::XML_Header(Param("urlbase"), $Bugzilla::Config::VERSION, - Param("maintainer"), $exporter); -foreach my $id (@ids) { - my $bug = new Bug(trim($id), $::userid); - print $bug->emitXML; -} +my $ids = join('', map { $_ = "&id=" . $_ } @ids); -print Bug::XML_Footer; +print $cgi->redirect("show_bug.cgi?ctype=xml$ids"); -- cgit v1.2.3-24-g4f1b