Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
15358df9
Commit
15358df9
authored
Apr 04, 2011
by
rojanu
Committed by
Max Kanat-Alexander
Apr 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 468375: Add example code for hooks that were missing it.
r=mkanat, a=mkanat
parent
e1c91cd8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
3 deletions
+61
-3
Hook.pm
Bugzilla/Hook.pm
+18
-0
Extension.pm
extensions/Example/Extension.pm
+43
-3
No files found.
Bugzilla/Hook.pm
View file @
15358df9
...
@@ -1193,6 +1193,24 @@ your template.
...
@@ -1193,6 +1193,24 @@ your template.
=back
=back
=head2 post_bug_after_creation
B<DEPRECATED> (Use L</bug_end_of_create> instead.)
This happens after a bug is created and before bug mail is sent
during C<post_bug.cgi>. Note that this only happens during C<post_bug.cgi>,
it doesn't happen during any of the other methods of creating a bug.
Params:
=over
=item C<vars> - The template vars hashref.
=back
=head2 product_confirm_delete
=head2 product_confirm_delete
B<DEPRECATED> - Use L</template_before_process> instead.
B<DEPRECATED> - Use L</template_before_process> instead.
...
...
extensions/Example/Extension.pm
View file @
15358df9
...
@@ -278,6 +278,25 @@ sub config_modify_panels {
...
@@ -278,6 +278,25 @@ sub config_modify_panels {
checker
=>
\&
check_numeric
});
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
{
sub
email_in_before_parse
{
my
(
$self
,
$args
)
=
@_
;
my
(
$self
,
$args
)
=
@_
;
...
@@ -320,6 +339,13 @@ sub email_in_after_parse {
...
@@ -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
{
sub
flag_end_of_update
{
my
(
$self
,
$args
)
=
@_
;
my
(
$self
,
$args
)
=
@_
;
...
@@ -430,11 +456,18 @@ sub install_filesystem {
...
@@ -430,11 +456,18 @@ sub install_filesystem {
# };
# };
}
}
#sub install_update_db_fielddefs {
sub
install_update_db
{
# my $dbh = Bugzilla->dbh;
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',
# $dbh->bz_add_column('fielddefs', 'example_column',
# {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => ''});
# {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => ''});
#
}
}
sub
job_map
{
sub
job_map
{
my
(
$self
,
$args
)
=
@_
;
my
(
$self
,
$args
)
=
@_
;
...
@@ -630,6 +663,13 @@ sub page_before_template {
...
@@ -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
{
sub
product_confirm_delete
{
my
(
$self
,
$args
)
=
@_
;
my
(
$self
,
$args
)
=
@_
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment