From 2c7fe1e4a9ed6fa3a1c96e067630b1e24c183495 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" Date: Sat, 10 Mar 2007 12:22:14 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20373411:=20The=20bug=20resolution=20can=20?= =?UTF-8?q?be=20set=20independently=20of=20the=20bug=20status=20-=20Patch?= =?UTF-8?q?=20by=20Fr=C3=83=C2=A9d=C3=83=C2=A9ric=20Buclin=20=20r=3Dmkanat=20a=3DLpSolit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.0.0.236/trunk@221697 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/process_bug.cgi | 11 +++++++++++ .../template/en/default/global/user-error.html.tmpl | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/mozilla/webtools/bugzilla/process_bug.cgi b/mozilla/webtools/bugzilla/process_bug.cgi index fd0c3eb9d1d..18097d084b9 100755 --- a/mozilla/webtools/bugzilla/process_bug.cgi +++ b/mozilla/webtools/bugzilla/process_bug.cgi @@ -1110,6 +1110,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/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl index b2a3624b28e..01368f06dc2 100644 --- a/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl +++ b/mozilla/webtools/bugzilla/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'} %]