]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 471324: Don't build mail headers for existing bugs (too many calls to multiline_s...
authorlpsolit%gmail.com <>
Mon, 29 Dec 2008 00:35:57 +0000 (00:35 +0000)
committerlpsolit%gmail.com <>
Mon, 29 Dec 2008 00:35:57 +0000 (00:35 +0000)
Bugzilla/BugMail.pm

index 9aa373dc547c9eb31efb02e387f933db42d5c710..46f5597186db6b1bce30b9dd3212a4e51a51d358 100644 (file)
@@ -552,26 +552,7 @@ sub sendMail {
     my %mailhead = %$dmhRef;
     my %fielddescription = %$fdRef;
     my @diffparts = @$diffRef;    
-    my $head = "";
     
-    foreach my $f (@headerlist) {
-      if ($mailhead{$f}) {
-        my $value = $values{$f};
-        # If there isn't anything to show, don't include this header
-        if (! $value) {
-          next;
-        }
-        # Only send estimated_time if it is enabled and the user is in the group
-        if (($f ne 'estimated_time' && $f ne 'deadline') ||
-             $user->groups->{Bugzilla->params->{'timetrackinggroup'}}) {
-
-            my $desc = $fielddescription{$f};
-            $head .= multiline_sprintf(FORMAT_DOUBLE, ["$desc:", $value], 
-                                       FORMAT_2_SIZE);
-        }
-      }
-    }
-
     # Build difftext (the actions) by verifying the user should see them
     my $difftext = "";
     my $diffheader = "";
@@ -625,6 +606,21 @@ sub sendMail {
 
     my $diffs = $difftext . "\n\n" . $newcomments;
     if ($isnew) {
+        my $head = "";
+        foreach my $f (@headerlist) {
+            next unless $mailhead{$f};
+            my $value = $values{$f};
+            # If there isn't anything to show, don't include this header.
+            next unless $value;
+            # Only send estimated_time if it is enabled and the user is in the group.
+            if (($f ne 'estimated_time' && $f ne 'deadline')
+                || $user->groups->{Bugzilla->params->{'timetrackinggroup'}})
+            {
+                my $desc = $fielddescription{$f};
+                $head .= multiline_sprintf(FORMAT_DOUBLE, ["$desc:", $value],
+                                           FORMAT_2_SIZE);
+            }
+        }
         $diffs = $head . ($difftext ? "\n\n" : "") . $diffs;
     }