diff options
author | bbaetz%student.usyd.edu.au <> | 2002-11-28 18:49:38 +0000 |
---|---|---|
committer | bbaetz%student.usyd.edu.au <> | 2002-11-28 18:49:38 +0000 |
commit | e47e36a6821a4f954f5d03643cdb5be988568798 (patch) | |
tree | 9c91c6b9f795bed422c040c01d6039fac80db3fa /show_bug.cgi | |
parent | Bug 67077 - We now include the timezone (as configured in editparams.cgi) on ... (diff) | |
download | bugzilla-e47e36a6821a4f954f5d03643cdb5be988568798.tar.gz bugzilla-e47e36a6821a4f954f5d03643cdb5be988568798.tar.bz2 bugzilla-e47e36a6821a4f954f5d03643cdb5be988568798.zip |
Bug 171493 - make show_bug use Bug.pm and remove bug_form.pl
r=justdave, joel
a=justdave
Diffstat (limited to 'show_bug.cgi')
-rwxr-xr-x | show_bug.cgi | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/show_bug.cgi b/show_bug.cgi index 6711ff7e6..377c7905d 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -25,10 +25,13 @@ use strict; use lib qw(.); require "CGI.pl"; -require "bug_form.pl"; ConnectToDatabase(); +use vars qw($template $vars $userid); + +use Bug; + if ($::FORM{'GoAheadAndLogIn'}) { confirm_login(); } else { @@ -39,11 +42,20 @@ if ($::FORM{'GoAheadAndLogIn'}) { # Begin Data/Security Validation ###################################################################### +unless (defined ($::FORM{'id'})) { + my $format = GetFormat("bug/choose", $::FORM{'format'}, $::FORM{'ctype'}); + + print "Content-type: $format->{'contenttype'}\n\n"; + $template->process("$format->{'template'}", $vars) || + ThrowTemplateError($template->error()); + exit; +} + +my $format = GetFormat("bug/show", $::FORM{'format'}, $::FORM{'ctype'}); + # Make sure the bug ID is a positive integer representing an existing # bug that the user is authorized to access. -if (defined ($::FORM{'id'})) { - ValidateBugID($::FORM{'id'}); -} +ValidateBugID($::FORM{'id'}); ###################################################################### # End Data/Security Validation @@ -51,6 +63,20 @@ if (defined ($::FORM{'id'})) { GetVersionTable(); -print "Content-type: text/html\n\n"; +my $bug = new Bug($::FORM{'id'}, $userid); + +$vars->{'bug'} = $bug; + +ThrowCodeError("bug_error") if $bug->error; + +# Next bug in list (if there is one) +my @bug_list; +if ($::COOKIE{"BUGLIST"}) { + @bug_list = split(/:/, $::COOKIE{"BUGLIST"}); +} +$vars->{'bug_list'} = \@bug_list; + +print "Content-type: $format->{'ctype'}\n\n"; +$template->process("$format->{'template'}", $vars) + || ThrowTemplateError($template->error()); -show_bug(); |