From: lpsolit%gmail.com <> Date: Sat, 10 Mar 2007 18:22:14 +0000 (+0000) Subject: Bug 373411: The bug resolution can be set independently of the bug status - Patch... X-Git-Tag: bugzilla-3.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d61aa59669e58620611a5162fb8a5df5d5a24ea;p=thirdparty%2Fbugzilla.git Bug 373411: The bug resolution can be set independently of the bug status - Patch by Frédéric Buclin r=mkanat a=LpSolit --- diff --git a/process_bug.cgi b/process_bug.cgi index 6c03849736..ffca2fab4a 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1106,6 +1106,17 @@ SWITCH: for ($cgi->param('knob')) { ChangeStatus('RESOLVED'); } + else { + # You cannot use change_resolution if there is at least + # one open bug. + my $open_states = join(',', map {$dbh->quote($_)} BUG_STATE_OPEN); + my $idlist = join(',', @idlist); + my $is_open = + $dbh->selectrow_array("SELECT 1 FROM bugs WHERE bug_id IN ($idlist) + AND bug_status IN ($open_states)"); + + ThrowUserError('resolution_not_allowed') if $is_open; + } ChangeResolution($bug, $cgi->param('resolution')); last SWITCH; diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index b2a3624b28..01368f06dc 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1286,6 +1286,10 @@ [% title = "Summary Needed" %] You must enter a summary for this [% terms.bug %]. + [% ELSIF error == "resolution_not_allowed" %] + [% title = "Resolution Not Allowed" %] + You cannot set a resolution for open [% terms.bugs %]. + [% ELSIF error == "saved_search_used_by_whines" %] [% title = "Saved Search In Use" %] [% docslinks = {'whining.html' => 'About Whining'} %]