aboutsummaryrefslogtreecommitdiffstats
path: root/extensions/Example
diff options
context:
space:
mode:
authorrojanu <aliustek@gmail.com>2011-04-04 16:46:00 -0700
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-04-04 16:46:00 -0700
commit15358df929791346fbd8cd7876b089e1fb7e646d (patch)
tree63f2b64920464b0c235fbbb94c12c95ec9b1beaa /extensions/Example
parente1c91cd842cc2193309a284b3bd49488342ca8a1 (diff)
downloadbugs-15358df929791346fbd8cd7876b089e1fb7e646d.tar
bugs-15358df929791346fbd8cd7876b089e1fb7e646d.tar.gz
bugs-15358df929791346fbd8cd7876b089e1fb7e646d.tar.bz2
bugs-15358df929791346fbd8cd7876b089e1fb7e646d.tar.xz
bugs-15358df929791346fbd8cd7876b089e1fb7e646d.zip
Bug 468375: Add example code for hooks that were missing it.
r=mkanat, a=mkanat
Diffstat (limited to 'extensions/Example')
-rw-r--r--extensions/Example/Extension.pm46
1 files changed, 43 insertions, 3 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index 5b95335b8..81cebf4fa 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -278,6 +278,25 @@ sub config_modify_panels {
checker => \&check_numeric });
}
+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) = @_;
@@ -320,6 +339,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) = @_;
@@ -430,11 +456,18 @@ sub install_filesystem {
# };
}
-#sub install_update_db_fielddefs {
-# my $dbh = Bugzilla->dbh;
+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 install_update_db_fielddefs {
+ my $dbh = Bugzilla->dbh;
# $dbh->bz_add_column('fielddefs', 'example_column',
# {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => ''});
-#}
+}
sub job_map {
my ($self, $args) = @_;
@@ -630,6 +663,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) = @_;