summaryrefslogtreecommitdiffstats
path: root/show_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 /show_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 'show_bug.cgi')
-rwxr-xr-xshow_bug.cgi38
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();