diff options
author | gerv%gerv.net <> | 2002-04-27 13:57:11 +0000 |
---|---|---|
committer | gerv%gerv.net <> | 2002-04-27 13:57:11 +0000 |
commit | 2fbdc1d838a990be1faba320618eae6fadae878a (patch) | |
tree | d770d45181c7ae6fa5be31462ed18b94589fcd72 /enter_bug.cgi | |
parent | Bug 105960 - xml.cgi has wrong content type, and should be standalone (diff) | |
download | bugzilla-2fbdc1d838a990be1faba320618eae6fadae878a.tar.gz bugzilla-2fbdc1d838a990be1faba320618eae6fadae878a.tar.bz2 bugzilla-2fbdc1d838a990be1faba320618eae6fadae878a.zip |
Bug 138284 - prepare for Bugzilla Helper replacement enter_bug template. Patch by gerv; r=bbaetz, myk.
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-x | enter_bug.cgi | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi index f2836a5fa..4b46b36d4 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -86,6 +86,7 @@ if (!defined $::FORM{'product'}) { $vars->{'proddesc'} = \%products; $vars->{'target'} = "enter_bug.cgi"; + $vars->{'format'} = $::FORM{'format'}; $vars->{'title'} = "Enter Bug"; $vars->{'h2'} = "First, you must pick a product on which to enter a bug."; @@ -258,9 +259,23 @@ elsif (1 == @{$::components{$product}}) { $::FORM{'component'} = $::components{$product}->[0]; } +my @components; +SendSQL("SELECT value, description FROM components " . + "WHERE program = " . SqlQuote($product) . " ORDER BY value"); +while (MoreSQLData()) { + my ($name, $description) = FetchSQLData(); + + my %component; + + $component{'name'} = $name; + $component{'description'} = $description; + + push @components, \%component; +} + my %default; -$vars->{'component_'} = $::components{$product}; +$vars->{'component_'} = \@components; $default{'component_'} = formvalue('component'); $vars->{'assigned_to'} = formvalue('assigned_to'); @@ -359,7 +374,8 @@ if ($::usergroupset ne '0') { $vars->{'default'} = \%default; -print "Content-type: text/html\n\n"; -$template->process("bug/create/create.html.tmpl", $vars) +my $format = ValidateOutputFormat($::FORM{'format'}, "create"); + +print "Content-type: $format->{'contenttype'}\n\n"; +$template->process("bug/create/$format->{'template'}", $vars) || ThrowTemplateError($template->error()); -exit; |