From 2bd4676289bd83be3740a76ee446f5f2a377503b Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 4 Jul 2006 16:51:56 +0000 Subject: [PATCH] =?utf8?q?Bug=20341867:=20post=5Fbug.cgi=20lets=20users=20?= =?utf8?q?with=20editbugs=20and=20canconfirm=20privs=20enter=20bugs=20as?= =?utf8?q?=20UNCONFIRMED=20even=20when=20votes=5Fto=5Fconfirm=20is=200=20-?= =?utf8?q?=20Patch=20by=20Fr=C3=A9d=C3=A9ric=20Buclin=20=20r=3Dbkor=20a=3Dmyk?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- post_bug.cgi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/post_bug.cgi b/post_bug.cgi index 94f224940e..5213549940 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -171,19 +171,19 @@ if (Param("useqacontact")) { } } -if (UserInGroup("editbugs") || UserInGroup("canconfirm")) { - # Default to NEW if the user hasn't selected another status - if (!defined $cgi->param('bug_status')) { - $cgi->param(-name => 'bug_status', -value => "NEW"); +my $votes_to_confirm = $dbh->selectrow_array('SELECT votestoconfirm + FROM products WHERE id = ?', + undef, $product_id); +my $bug_status = 'UNCONFIRMED'; +if ($votes_to_confirm) { + # 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 { - # Default to UNCONFIRMED if we are using it, NEW otherwise - $cgi->param(-name => 'bug_status', -value => 'UNCONFIRMED'); - SendSQL("SELECT votestoconfirm FROM products WHERE id = $product_id"); - if (!FetchOneColumn()) { - $cgi->param(-name => 'bug_status', -value => "NEW"); - } + $bug_status = 'NEW'; } +$cgi->param(-name => 'bug_status', -value => $bug_status); if (!defined $cgi->param('target_milestone')) { SendSQL("SELECT defaultmilestone FROM products WHERE name=$sql_product"); -- 2.47.2