Commit ebcb71f9 authored by jocuri%softhome.net's avatar jocuri%softhome.net

Patch for bug 273873: bug-creation template for UNCONFIRMED shouldn't set status…

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.
parent 1986e290
......@@ -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 " .
......
......@@ -71,12 +71,6 @@ function set_assign_to() {
<form name="Create" id="Create" method="post" action="post_bug.cgi">
<input type="hidden" name="product" value="[% product FILTER html %]">
[% IF bug_status.size <= 1 %]
<input type="hidden" name="bug_status"
value="[% default.bug_status FILTER html %]">
[% END %]
<table cellspacing="2" cellpadding="0" border="0">
<tr>
......@@ -169,14 +163,18 @@ function set_assign_to() {
<td colspan="3"></td>
</tr>
[% IF bug_status.size > 1 %]
<tr>
[% IF bug_status.size <= 1 %]
<input type="hidden" name="bug_status"
value="[% default.bug_status FILTER html %]">
<td align="right" valign="top"><strong>Initial State:</strong></td>
<td valign="top">[% default.bug_status FILTER html %]</td>
[% ELSE %]
[% sel = { description => 'Initial State', name => 'bug_status' } %]
[% INCLUDE select %]
[% END %]
<td colspan="2"></td>
</tr>
[% END %]
<tr>
<td align="right">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment