]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 389916: The "remaining_time_zeroed" message is displayed even if none of the...
authorlpsolit%gmail.com <>
Sat, 28 Jul 2007 17:47:55 +0000 (17:47 +0000)
committerlpsolit%gmail.com <>
Sat, 28 Jul 2007 17:47:55 +0000 (17:47 +0000)
Bugzilla/Bug.pm

index 4793c87da3a926811b24ca6e45308a6e9dc47f09..5f37e9ff4bb37c718dc574ad6fcd89c370361049 100755 (executable)
@@ -2003,8 +2003,13 @@ sub check_status_change_triggers {
         $vars->{DuplicateUserConfirm} = 1;
 
         # DUPLICATE bugs should have no time remaining.
-        $_->_zero_remaining_time() foreach @$bugs;
-        $vars->{'message'} = "remaining_time_zeroed";
+        foreach my $bug (@$bugs) {
+            # Note that 0.00 is *true* for Perl!
+            next unless ($bug->remaining_time > 0);
+            $bug->_zero_remaining_time;
+            $vars->{'message'} = "remaining_time_zeroed"
+              if Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'});
+        }
     }
     elsif ($action eq 'change_resolution' || !is_open_state($action)) {
         # don't resolve as fixed while still unresolved blocking bugs
@@ -2038,8 +2043,11 @@ sub check_status_change_triggers {
         if ($action ne 'change_resolution') {
             foreach my $b (@$bugs) {
                 if ($b->bug_status ne $action) {
+                    # Note that 0.00 is *true* for Perl!
+                    next unless ($b->remaining_time > 0);
                     $b->_zero_remaining_time;
-                    $vars->{'message'} = "remaining_time_zeroed";
+                    $vars->{'message'} = "remaining_time_zeroed"
+                      if Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'});
                 }
             }
         }