summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-07-17 07:53:08 +0200
committerlpsolit%gmail.com <>2006-07-17 07:53:08 +0200
commit146d47f6c92fc7f64ca940ca4629bf8997195b58 (patch)
tree6453e97f0a65641fa8c04f10ff4e06d994b7c3a9 /post_bug.cgi
parentfe1d0e18e5f58c0a3d1c59941e736928b154aea7 (diff)
downloadbugzilla-146d47f6c92fc7f64ca940ca4629bf8997195b58.tar.gz
bugzilla-146d47f6c92fc7f64ca940ca4629bf8997195b58.tar.xz
Bug 238819: enter_bug.cgi should offer ASSIGNED as a possible initial state - Patch by Frédéric Buclin <LpSolit@gmail.com> r=vladd a=justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi19
1 files changed, 13 insertions, 6 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index 2fa6576f2..b3f668e3f 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -202,17 +202,24 @@ 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 ($product->votes_to_confirm) {
+if ($user->in_group('editbugs') || $user->in_group('canconfirm')) {
# Default to NEW if the user with privs hasn't selected another status.
- if (UserInGroup('editbugs') || UserInGroup('canconfirm')) {
- $bug_status = scalar($cgi->param('bug_status')) || 'NEW';
- }
-} else {
+ $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;
+
if (!defined $cgi->param('target_milestone')) {
$cgi->param(-name => 'target_milestone', -value => $product->default_milestone);
}
@@ -226,7 +233,7 @@ 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'), ['UNCONFIRMED', 'NEW']);
+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'),