diff options
author | jocuri%softhome.net <> | 2004-12-12 10:40:31 +0100 |
---|---|---|
committer | jocuri%softhome.net <> | 2004-12-12 10:40:31 +0100 |
commit | ebcb71f97ff25dfad53f8b1a7ded8b34f60053db (patch) | |
tree | dafd3b3f7d87136ca67fa50b0c204a9e8f606882 /enter_bug.cgi | |
parent | 1986e290b8d554f9e2c12f44dd7e119792378139 (diff) | |
download | bugzilla-ebcb71f97ff25dfad53f8b1a7ded8b34f60053db.tar.gz bugzilla-ebcb71f97ff25dfad53f8b1a7ded8b34f60053db.tar.xz |
Patch for bug 273873: bug-creation template for UNCONFIRMED shouldn't set status to NEW; patch by Nick.Barnes@pobox.com, r=justdave, a=justdave.
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-x | enter_bug.cgi | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi index c8ceed212..4bda17ac4 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -355,18 +355,38 @@ if (formvalue('version')) { $default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}]; } -# There must be at least one status in @status. -my @status = "NEW"; +# List of status values for drop-down. +my @status; -if (UserInGroup("editbugs") || UserInGroup("canconfirm")) { - SendSQL("SELECT votestoconfirm FROM products WHERE name = " . - SqlQuote($product)); - push(@status, $unconfirmedstate) if (FetchOneColumn()); +# Construct the list of allowable values. There are three cases: +# +# case values +# product does not have confirmation NEW +# confirmation, user cannot confirm UNCONFIRMED +# confirmation, user can confirm NEW, UNCONFIRMED. + +SendSQL("SELECT votestoconfirm FROM products WHERE name = " . + SqlQuote($product)); +if (FetchOneColumn()) { + if (UserInGroup("editbugs") || UserInGroup("canconfirm")) { + push(@status, "NEW"); + } + push(@status, $unconfirmedstate); +} else { + push(@status, "NEW"); } $vars->{'bug_status'} = \@status; -$default{'bug_status'} = $status[0]; +# Get the default from a template value if it is legitimate. +# Otherwise, set the default to the first item on the list. + +if (formvalue('bug_status') && (lsearch(\@status, formvalue('bug_status')) >= 0)) { + $default{'bug_status'} = formvalue('bug_status'); +} else { + $default{'bug_status'} = $status[0]; +} + SendSQL("SELECT DISTINCT groups.id, groups.name, groups.description, " . "membercontrol, othercontrol " . "FROM groups LEFT JOIN group_control_map " . |