]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 373411: The bug resolution can be set independently of the bug status - Patch...
authorlpsolit%gmail.com <>
Sat, 10 Mar 2007 18:22:14 +0000 (18:22 +0000)
committerlpsolit%gmail.com <>
Sat, 10 Mar 2007 18:22:14 +0000 (18:22 +0000)
process_bug.cgi
template/en/default/global/user-error.html.tmpl

index 6c0384973692d868567bc22b2e9a0ec126e39029..ffca2fab4ae4a436f2134648a72b5143922d4ac0 100755 (executable)
@@ -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;
index b2a3624b28e4cdef40cad963095c3043909f394b..01368f06dc233a3f5b2ded39410895a68c025d20 100644 (file)
     [% 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'} %]