summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-08-22 03:48:41 +0200
committermkanat%bugzilla.org <>2006-08-22 03:48:41 +0200
commit3f5c73cce7d1cc1b4e7323013a690d2eab225c1a (patch)
treeccebf0e1330533c8dfb4f3842ead771685bf006e /post_bug.cgi
parentdc9ce3a8bc08c8f7c35b926bfaf7cfdd007c6380 (diff)
downloadbugzilla-3f5c73cce7d1cc1b4e7323013a690d2eab225c1a.tar.gz
bugzilla-3f5c73cce7d1cc1b4e7323013a690d2eab225c1a.tar.xz
Bug 348537: Move bug status validation out of post_bug and into Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bkor, a=myk
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi20
1 files changed, 2 insertions, 18 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index 7ceeffc3a..bef248836 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -184,23 +184,8 @@ if (Bugzilla->params->{"useqacontact"}) {
}
}
-# Check the bug status.
-# This order is important, see below.
-my @valid_statuses = ('UNCONFIRMED', 'NEW', 'ASSIGNED');
-
-my $bug_status = 'UNCONFIRMED';
-if ($user->in_group('editbugs') || $user->in_group('canconfirm')) {
- # Default to NEW if the user with privs hasn't selected another status.
- $bug_status = scalar($cgi->param('bug_status')) || 'NEW';
-}
-elsif (!$product->votes_to_confirm) {
- $bug_status = 'NEW';
-}
-$cgi->param(-name => 'bug_status', -value => $bug_status);
-
-# Reject 'UNCONFIRMED' as a valid status if the product
-# doesn't require votes to confirm its bugs.
-shift @valid_statuses if !$product->votes_to_confirm;
+$cgi->param('bug_status', Bugzilla::Bug::_check_bug_status(
+ scalar $cgi->param('bug_status'), $product));
if (!defined $cgi->param('target_milestone')) {
$cgi->param(-name => 'target_milestone', -value => $product->default_milestone);
@@ -215,7 +200,6 @@ check_field('rep_platform', scalar $cgi->param('rep_platform'));
check_field('bug_severity', scalar $cgi->param('bug_severity'));
check_field('priority', scalar $cgi->param('priority'));
check_field('op_sys', scalar $cgi->param('op_sys'));
-check_field('bug_status', scalar $cgi->param('bug_status'), \@valid_statuses);
check_field('version', scalar $cgi->param('version'),
[map($_->name, @{$product->versions})]);
check_field('target_milestone', scalar $cgi->param('target_milestone'),