]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 417290: Add an email pref to get notifications for newly created bugs - Patch...
authorlpsolit%gmail.com <>
Wed, 17 Sep 2008 16:03:59 +0000 (16:03 +0000)
committerlpsolit%gmail.com <>
Wed, 17 Sep 2008 16:03:59 +0000 (16:03 +0000)
Bugzilla/Constants.pm
Bugzilla/User.pm
template/en/default/account/prefs/email.html.tmpl

index e06fee00c81c6112138b2661bb709caaa9d0347d..abe1fe248b1a14d75d66239b2bdedfd6b393a7c0 100644 (file)
@@ -100,7 +100,8 @@ use File::Basename;
     POS_EVENTS
     EVT_OTHER EVT_ADDED_REMOVED EVT_COMMENT EVT_ATTACHMENT EVT_ATTACHMENT_DATA
     EVT_PROJ_MANAGEMENT EVT_OPENED_CLOSED EVT_KEYWORD EVT_CC EVT_DEPEND_BLOCK
-    
+    EVT_BUG_CREATED
+
     NEG_EVENTS
     EVT_UNCONFIRMED EVT_CHANGED_BY_ME 
         
@@ -303,11 +304,12 @@ use constant EVT_OPENED_CLOSED      => 6;
 use constant EVT_KEYWORD            => 7;
 use constant EVT_CC                 => 8;
 use constant EVT_DEPEND_BLOCK       => 9;
+use constant EVT_BUG_CREATED        => 10;
 
 use constant POS_EVENTS => EVT_OTHER, EVT_ADDED_REMOVED, EVT_COMMENT, 
                            EVT_ATTACHMENT, EVT_ATTACHMENT_DATA, 
                            EVT_PROJ_MANAGEMENT, EVT_OPENED_CLOSED, EVT_KEYWORD,
-                           EVT_CC, EVT_DEPEND_BLOCK;
+                           EVT_CC, EVT_DEPEND_BLOCK, EVT_BUG_CREATED;
 
 use constant EVT_UNCONFIRMED        => 50;
 use constant EVT_CHANGED_BY_ME      => 51;
index f495132b1137525f5b4dacb60ece509cc2034b59..aa3baa24380fd1bf1c78b6fdbe59f3e98ec3d814 100644 (file)
@@ -1430,14 +1430,18 @@ sub wants_bug_mail {
         }
     }
 
-    # You role is new if the bug itself is.
-    # Only makes sense for the assignee, QA contact and the CC list.
-    if ($bug_is_new
-        && ($relationship == REL_ASSIGNEE
+    if ($bug_is_new) {
+        # Notify about new bugs.
+        $events{+EVT_BUG_CREATED} = 1;
+
+        # You role is new if the bug itself is.
+        # Only makes sense for the assignee, QA contact and the CC list.
+        if ($relationship == REL_ASSIGNEE
             || $relationship == REL_QA
-            || $relationship == REL_CC))
-    {
-        $events{+EVT_ADDED_REMOVED} = 1;
+            || $relationship == REL_CC)
+        {
+            $events{+EVT_ADDED_REMOVED} = 1;
+        }
     }
 
     if ($commentField =~ /Created an attachment \(/) {
index ad9b370dec13d99f79415fcd3af206751f771a5b..57c76a93ef95a123f181921a1a864578ed0173b3 100644 (file)
@@ -119,6 +119,8 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
 [% events = [
     { id = constants.EVT_ADDED_REMOVED,
       description = "I'm added to or removed from this capacity" },
+    { id = constants.EVT_BUG_CREATED,
+      description = "A new $terms.bug is created" },
     { id = constants.EVT_OPENED_CLOSED,
       description = "The $terms.bug is resolved or reopened" },
     { id = constants.EVT_PROJ_MANAGEMENT,