summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-11-28 19:49:38 +0100
committerbbaetz%student.usyd.edu.au <>2002-11-28 19:49:38 +0100
commite47e36a6821a4f954f5d03643cdb5be988568798 (patch)
tree9c91c6b9f795bed422c040c01d6039fac80db3fa /post_bug.cgi
parent0fcc20760ab4c49ec7e3b93f9025a9b0b8d2046b (diff)
downloadbugzilla-e47e36a6821a4f954f5d03643cdb5be988568798.tar.gz
bugzilla-e47e36a6821a4f954f5d03643cdb5be988568798.tar.xz
Bug 171493 - make show_bug use Bug.pm and remove bug_form.pl
r=justdave, joel a=justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi45
1 files changed, 28 insertions, 17 deletions
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 <PMAIL>;
+ my $mail = "";
+ open(PMAIL, "-|") or exec('./processmail', $i, $::COOKIE{'Bugzilla_login'});
+ $mail .= $_ while <PMAIL>;
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");