From: rojanu Date: Mon, 4 Apr 2011 23:49:53 +0000 (-0700) Subject: Bug 468375: Add example code for hooks that were missing it. X-Git-Tag: bugzilla-4.0.1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0e0eb5ead6bceeb02f3c6a9f676300607a4f7c3;p=thirdparty%2Fbugzilla.git Bug 468375: Add example code for hooks that were missing it. r=mkanat, a=mkanat --- diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm index 714054fd07..74bd5ff0a4 100644 --- a/Bugzilla/Hook.pm +++ b/Bugzilla/Hook.pm @@ -1162,6 +1162,24 @@ your template. =back + +=head2 post_bug_after_creation + +B (Use L instead.) + +This happens after a bug is created and before bug mail is sent +during C. Note that this only happens during C, +it doesn't happen during any of the other methods of creating a bug. + +Params: + +=over + +=item C - The template vars hashref. + +=back + + =head2 product_confirm_delete B - Use L instead. diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index 09c839e626..fa9b8ae165 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -276,6 +276,25 @@ sub config_modify_panels { push(@{ $verify_class->{choices} }, 'Example'); } +sub db_schema_abstract_schema { + my ($self, $args) = @_; +# $args->{'schema'}->{'example_table'} = { +# FIELDS => [ +# id => {TYPE => 'SMALLSERIAL', NOTNULL => 1, +# PRIMARYKEY => 1}, +# for_key => {TYPE => 'INT3', NOTNULL => 1, +# REFERENCES => {TABLE => 'example_table2', +# COLUMN => 'id', +# DELETE => 'CASCADE'}}, +# col_3 => {TYPE => 'varchar(64)', NOTNULL => 1}, +# ], +# INDEXES => [ +# id_index_idx => {FIELDS => ['col_3'], TYPE => 'UNIQUE'}, +# for_id_idx => ['for_key'], +# ], +# }; +} + sub email_in_before_parse { my ($self, $args) = @_; @@ -318,6 +337,13 @@ sub email_in_after_parse { } } +sub enter_bug_entrydefaultvars { + my ($self, $args) = @_; + + my $vars = $args->{vars}; + $vars->{'example'} = 1; +} + sub flag_end_of_update { my ($self, $args) = @_; @@ -428,6 +454,13 @@ sub install_filesystem { # }; } +sub install_update_db { + my $dbh = Bugzilla->dbh; +# $dbh->bz_add_column('example', 'new_column', +# {TYPE => 'INT2', NOTNULL => 1, DEFAULT => 0}); +# $dbh->bz_add_index('example', 'example_new_column_idx', [qw(value)]); +} + sub mailer_before_send { my ($self, $args) = @_; @@ -608,6 +641,13 @@ sub page_before_template { } } +sub post_bug_after_creation { + my ($self, $args) = @_; + + my $vars = $args->{vars}; + $vars->{'example'} = 1; +} + sub product_confirm_delete { my ($self, $args) = @_;