diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-07 22:12:31 +0100 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-07 22:12:31 +0100 |
commit | 36b5893ba963132cfcfa394aa1a67badeb3aa53e (patch) | |
tree | 06b4e7d6cbdd46e8a04d69810072fea9149ab9ac /extensions/Example | |
parent | fcf51896ea64862b43e651657ea775319c1abd31 (diff) | |
download | bugzilla-36b5893ba963132cfcfa394aa1a67badeb3aa53e.tar.gz bugzilla-36b5893ba963132cfcfa394aa1a67badeb3aa53e.tar.xz |
Bug 496488: Hooks for creating, updating, and deleting groups
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'extensions/Example')
-rw-r--r-- | extensions/Example/Extension.pm | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index c0e44aa59..1a483ad53 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -246,6 +246,51 @@ sub flag_end_of_update { # warn $result; } +sub group_before_delete { + my ($self, $args) = @_; + # This code doesn't actually *do* anything, it's just here to show you + # how to use this hook. + + my $group = $args->{'group'}; + my $group_id = $group->id; + # Uncomment this line to see a line in your webserver's error log whenever + # you file a bug. + # warn "Group $group_id is about to be deleted!"; +} + +sub group_end_of_create { + my ($self, $args) = @_; + # This code doesn't actually *do* anything, it's just here to show you + # how to use this hook. + my $group = $args->{'group'}; + + my $group_id = $group->id; + # Uncomment this line to see a line in your webserver's error log whenever + # you create a new group. + #warn "Group $group_id has been created!"; +} + +sub group_end_of_update { + my ($self, $args) = @_; + # This code doesn't actually *do* anything, it's just here to show you + # how to use this hook. + + my ($group, $changes) = @$args{qw(group changes)}; + + foreach my $field (keys %$changes) { + my $used_to_be = $changes->{$field}->[0]; + my $now_it_is = $changes->{$field}->[1]; + } + + my $group_id = $group->id; + my $num_changes = scalar keys %$changes; + my $result = + "There were $num_changes changes to fields on group $group_id."; + # Uncomment this line to see $result in your webserver's error log whenever + # you update a group. + #warn $result; +} + sub install_before_final_checks { my ($self, $args) = @_; print "Install-before_final_checks hook\n" unless $args->{silent}; |