diff options
author | bbaetz%student.usyd.edu.au <> | 2002-12-15 18:23:55 +0100 |
---|---|---|
committer | bbaetz%student.usyd.edu.au <> | 2002-12-15 18:23:55 +0100 |
commit | 1cee4770ca5e09e3b56c0de0e8c77c2684542d18 (patch) | |
tree | a31b3c625607961094750db3f7619619a9d7767f /xml.cgi | |
parent | ee84183ca9efa0839c49ad02f293d60db0a4d76f (diff) | |
download | bugzilla-1cee4770ca5e09e3b56c0de0e8c77c2684542d18.tar.gz bugzilla-1cee4770ca5e09e3b56c0de0e8c77c2684542d18.tar.xz |
Bug 158499 - Templatise XML bug output
r=gerv, justdave
a=justdave
Diffstat (limited to 'xml.cgi')
-rwxr-xr-x | xml.cgi | 29 |
1 files changed, 7 insertions, 22 deletions
@@ -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"); |