From e47e36a6821a4f954f5d03643cdb5be988568798 Mon Sep 17 00:00:00 2001 From: "bbaetz%student.usyd.edu.au" <> Date: Thu, 28 Nov 2002 18:49:38 +0000 Subject: Bug 171493 - make show_bug use Bug.pm and remove bug_form.pl r=justdave, joel a=justdave --- post_bug.cgi | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index 3ddfbe689..2a65c2436 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -28,7 +28,8 @@ use lib qw(.); use Bugzilla::Constants; require "CGI.pl"; -require "bug_form.pl"; + +use Bug; use Bugzilla::User; @@ -491,28 +492,38 @@ close(PMAIL); # Tell the user all about it $vars->{'id'} = $id; -$vars->{'mail'} = $mailresults; -$vars->{'type'} = "created"; +my $bug = new Bug($id, $::userid); +$vars->{'bug'} = $bug; -print "Content-type: text/html\n\n"; -$template->process("bug/create/created.html.tmpl", $vars) - || ThrowTemplateError($template->error()); +ThrowCodeError("bug_error") if $bug->error; + +$vars->{'sentmail'} = []; + +push (@{$vars->{'sentmail'}}, { type => 'created', + id => $id, + mail => $mailresults + }); foreach my $i (@all_deps) { - $vars->{'mail'} = ""; - open(PMAIL, "-|") or exec('./processmail', $i, $::COOKIE{'Bugzilla_login'}); $vars->{'mail'} .= $_ while ; + my $mail = ""; + open(PMAIL, "-|") or exec('./processmail', $i, $::COOKIE{'Bugzilla_login'}); + $mail .= $_ while ; close(PMAIL); - $vars->{'id'} = $i; - $vars->{'type'} = "dep"; + push (@{$vars->{'sentmail'}}, { type => 'dep', + id => $i, + mail => $mail + }); +} - # Let the user know we checked to see if we should email notice - # of this new bug to users with a relationship to the depenedant - # bug and who did and didn't receive email about it - $template->process("bug/process/results.html.tmpl", $vars) - || ThrowTemplateError($template->error()); +my @bug_list; +if ($::COOKIE{"BUGLIST"}) { + @bug_list = split(/:/, $::COOKIE{"BUGLIST"}); } +$vars->{'bug_list'} = \@bug_list; + +print "Content-type: text/html\n\n"; +$template->process("bug/create/created.html.tmpl", $vars) + || ThrowTemplateError($template->error()); -$::FORM{'id'} = $id; -show_bug("header is already done"); -- cgit v1.2.3-24-g4f1b