From: lpsolit%gmail.com <> Date: Wed, 17 Sep 2008 16:03:59 +0000 (+0000) Subject: Bug 417290: Add an email pref to get notifications for newly created bugs - Patch... X-Git-Tag: bugzilla-3.3.1~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fafc1b6ca0b40c72fa636a08661f6d585d2cc6eb;p=thirdparty%2Fbugzilla.git Bug 417290: Add an email pref to get notifications for newly created bugs - Patch by Frédéric Buclin r/a=mkanat --- diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index e06fee00c8..abe1fe248b 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -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; diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index f495132b11..aa3baa2438 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -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 \(/) { diff --git a/template/en/default/account/prefs/email.html.tmpl b/template/en/default/account/prefs/email.html.tmpl index ad9b370dec..57c76a93ef 100644 --- a/template/en/default/account/prefs/email.html.tmpl +++ b/template/en/default/account/prefs/email.html.tmpl @@ -119,6 +119,8 @@ document.write('