]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 377025: email_in.pl doesn't allow you to close a bug - Patch by Frédéric Buclin...
authorlpsolit%gmail.com <>
Mon, 24 Mar 2008 01:25:07 +0000 (01:25 +0000)
committerlpsolit%gmail.com <>
Mon, 24 Mar 2008 01:25:07 +0000 (01:25 +0000)
email_in.pl

index 5fd28337e5d5647df950b9e18eb2a90600a46e42..422b886f76472526b6ba3b5e4ce6b25db2cdf720 100644 (file)
@@ -190,15 +190,22 @@ sub process_bug {
     if (my $status = $fields{'bug_status'}) {
         $fields{'knob'} = 'confirm' if $status =~ /NEW/i;
         $fields{'knob'} = 'accept'  if $status =~ /ASSIGNED/i;
-        $fields{'knob'} = 'clearresolution' if $status =~ /REOPENED/i;
+        $fields{'knob'} = 'reopen' if $status =~ /REOPENED/i;
+        $fields{'knob'} = 'resolve' if $status =~ /RESOLVED/i;
         $fields{'knob'} = 'verify'  if $status =~ /VERIFIED/i;
         $fields{'knob'} = 'close'   if $status =~ /CLOSED/i;
+        # Only @bug_status = RESOLVED can have a @resolution.
+        delete $fields{'resolution'} if $status !~ /RESOLVED/i;
     }
     if ($fields{'dup_id'}) {
         $fields{'knob'} = 'duplicate';
     }
     if ($fields{'resolution'}) {
-        $fields{'knob'} = 'resolve';
+        # If @bug_status is defined and we come here, then we know
+        # @bug_status = RESOLVED as the resolution would be ignored otherwise.
+        # If bug_status is undefined, then all we want to do is to change
+        # the resolution of the bug, leaving its status alone.
+        $fields{'knob'} = 'change_resolution' unless $fields{'bug_status'};
     }
 
     # Make sure we don't get prompted if we have to change the default