summaryrefslogtreecommitdiffstats
path: root/extensions/Example
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-11 21:32:08 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-11 21:32:08 +0100
commita7196a73cec5af3aa91f0af93d6316df1db7f433 (patch)
tree626dbd7866fb497f063767868d8c428a30d8b8f6 /extensions/Example
parent5721ab05a01ea3dacfc6f07669469b3868a4df06 (diff)
downloadbugzilla-a7196a73cec5af3aa91f0af93d6316df1db7f433.tar.gz
bugzilla-a7196a73cec5af3aa91f0af93d6316df1db7f433.tar.xz
Bug 545715: New Hook: bugmail_relationships
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'extensions/Example')
-rw-r--r--extensions/Example/Extension.pm25
1 files changed, 21 insertions, 4 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index fd75cbf64..6acf3e135 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -36,6 +36,9 @@ use Bugzilla::Extension::Example::Util;
use Data::Dumper;
+# See bugmail_relationships.
+use constant REL_EXAMPLE => -127;
+
our $VERSION = '1.0';
sub attachment_process_data {
@@ -193,14 +196,28 @@ sub bugmail_recipients {
my ($self, $args) = @_;
my $recipients = $args->{recipients};
my $bug = $args->{bug};
+
+ my $user =
+ new Bugzilla::User({ name => Bugzilla->params->{'maintainer'} });
+
if ($bug->id == 1) {
- # Uncomment the line below to add the second user in the Bugzilla
- # database to the recipients list of every bugmail sent out about
- # bug 1 as though that user were on the CC list.
- #$recipients->{2}->{+REL_CC} = 1;
+ # Uncomment the line below to add the maintainer to the recipients
+ # list of every bugmail from bug 1 as though that the maintainer
+ # were on the CC list.
+ #$recipients->{$user->id}->{+REL_CC} = 1;
+
+ # And this line adds the maintainer as though he had the "REL_EXAMPLE"
+ # relationship from the bugmail_relationships hook below.
+ #$recipients->{$user->id}->{+REL_EXAMPLE} = 1;
}
}
+sub bugmail_relationships {
+ my ($self, $args) = @_;
+ my $relationships = $args->{relationships};
+ $relationships->{+REL_EXAMPLE} = 'Example';
+}
+
sub colchange_columns {
my ($self, $args) = @_;