';
Note that while plugin_page() expects only the page's name without the extension,
plugin_file() requires the entire filename so that it can distinguish between foo.css and a potential file foo.png.
The plugin's filesystem structure at this point looks like this:
Example/
Example.php
pages/
foo.php
files/
foo.css
4.2.4. Events
Plugins have an integrated method for both declaring and hooking events, without needing to directly
call the event API functions. These take the form of class methods on your plugin.
To declare a new event, or a set of events, that your plugin will trigger, override the events() method
of your plugin class, and return an associative array with event names as the key, and the event type
as the value. Let's add an event "foo" to our Example plugin that does not expect a return value (an
"execute" event type), and another event 'bar' that expects a single value that gets modified by each
hooked function (a "chain" event type):
Example/Example.php
EVENT_TYPE_EXECUTE,
'EVENT_EXAMPLE_BAR' => EVENT_TYPE_CHAIN,
);
}
}
When the Example plugin is loaded, the event system in MantisBT will add these two events to
its list of events, and will then allow other plugins or functions to hook them. Naming the events
"EVENT_PLUGINNAME_EVENTNAME" is not necessary, but is considered best practice to avoid
conflicts between plugins.
Hooking other events (or events from your own plugin) is almost identical to declaring them. Instead
of passing an event type as the value, your plugin must pass the name of a class method on your plugin that will be called when the event is triggered. For our Example plugin, we'll create a foo() and
bar() method on our plugin class, and hook them to the events we declared earlier.
Example/Example.php
'foo',
'EVENT_EXAMPLE_BAR' => 'bar',
);
}
function foo( $p_event ) {
...
}
function bar( $p_event, $p_chained_param ) {
...
return $p_chained_param;
}
}
Note that both hooked methods need to accept the $p_event parameter, as that contains the event
name triggering the method (for cases where you may want a method hooked to multiple events). The
bar() method also accepts and returns the chained parameter in order to match the expectations of
the "bar" event.
Now that we have our plugin's events declared and hooked, let's modify our earlier page so that triggers the events, and add some real processing to the hooked methods:
Example/Example.php
Here is a link to page foo.';
'',
'
';
event_signal( 'EVENT_EXAMPLE_FOO' );
$t_string = 'A sentence with the word "foo" in it.';
$t_new_string = event_signal( 'EVENT_EXAMPLE_BAR', array( $t_string ) );
echo $t_new_string, '
';
When the first event "foo" is signaled, the Example plugin's foo() method will execute and echo a
string. After that, the second event "bar" is signaled, and the page passes a string parameter; the
plugin's bar() gets the string and replaces any instance of "foo" with "bar", and returns the resulting string. If any other plugin had hooked the event, that plugin could have further modified the new
string from the Example plugin, or vice versa, depending on the loading order of plugins. The page
then echos the modified string that was returned from the event.
4.2.5. Configuration
Similar to events, plugins have a simplified method for declaring configuration options, as well as API
functions for retrieving or setting those values at runtime.
Declaring a new configuration option is achieved just like declaring events. By overriding the config() method on your plugin class, your plugin can return an associative array of configuration options, with the option name as the key, and the default option as the array value. Our Example plugin
will declare an option "foo_or_bar", with a default value of "foo":
Example/Example.php
'foo',
);
}
}
Retrieving the current value of a plugin's configuration option is achieved by using the plugin API's
plugin_config_get() function, and can be set to a modified value in the database using
plugin_config_set(). With these functions, the config option is prefixed with the plugin's name, in
attempt to automatically avoid conflicts in naming. Our Example plugin will demonstrate this by adding
a secure form to the "config_page", and handling the form on a separate page "config_update" that will
modify the value in the database, and redirect back to page "config_page", just like any other form and
action page in MantisBT:
Example/pages/config_page.php
Example/pages/config_update.php
name = 'Example';
# Proper name of plugin
$this->description = '';
# Short description of the plugin
$this->page = '';
# Default plugin page
$this->version = '1.0';
$this->requires = array(
'MantisCore' => '2.0',
#
#
#
#
Plugin version string
Plugin dependencies
Should always depend on an appropriate
version of MantisBT
);
$this->author = '';
$this->contact = '';
$this->url = '';
# Author/team name
# Author/team e-mail address
# Support webpage
}
function events() {
return array(
'EVENT_EXAMPLE_FOO' => EVENT_TYPE_EXECUTE,
'EVENT_EXAMPLE_BAR' => EVENT_TYPE_CHAIN,
);
}
function hooks() {
return array(
'EVENT_EXAMPLE_FOO' => 'foo',
'EVENT_EXAMPLE_BAR' => 'bar',
);
}
function config() {
return array(
'foo_or_bar' => 'foo',
);
}
function foo( $p_event ) {
echo 'In method foo(). ';
}
function bar( $p_event, $p_chained_param ) {
return str_replace( 'foo', 'bar', $p_chained_param );
}
}
4.3.2. Example/files/foo.css
Example/files/foo.css
p.foo {
color: red;
}
4.3.3. Example/lang/strings_english.txt
Example/lang/strings_english.txt
26
Example/page/config_page.php
Here is a link to page foo.';
'',
'
';
event_signal( 'EVENT_EXAMPLE_FOO' );
$t_string = 'A sentence with the word "foo" in it.';
$t_new_string = event_signal( 'EVENT_EXAMPLE_BAR', array( $t_string ) );
echo $t_new_string, '
';
4.4. API Usage
This is a general overview of the plugin API. For more detailed analysis, you may reference the file
core/plugin_api.php in the codebase.
28
Chapter 5.
Events Reference
5.1. Introduction
In this chapter, an attempt will be made to list all events used (or planned for later use) in the MantisBT event system. Each listed event will include details for the event type, when the event is called,
and the expected parameters and return values for event callbacks.
Here we show an example event definition. For each event, the event identifier will be listed along with
the event types (see Section 3.3, “Event Types”) in parentheses. Below that should be a concise but
thorough description of how the event is called and how to use it. Following that should be a list of
event parameters (if any), as well as the expected return value (if any).
EVENT_EXAMPLE (Default)
This is an example event description.
Parameters
• : Description of parameter one
• : Description of parameter two
Return Value
• : Description of return value
5.2. System Events
These events are initiated by the plugin system itself to allow certain functionality to simplify plugin development.
EVENT_PLUGIN_INIT (Execute)
This event is triggered by the MantisBT plugin system after all registered and enabled plugins have been initialized (their init() functions have been called). This event should always be the first event
triggered for any page load. No parameters are passed to hooked
functions, and no return values are expected.
This event is the first point in page execution where all registered
plugins are guaranteed to be enabled (assuming dependencies and
such are met). At any point before this event, any or all plugins may
not yet be loaded. Note that the core system has not yet completed
the bootstrap process when this event is signalled.
Suggested uses for the event include:
• Checking for plugins that aren't require for normal usage.
• Interacting with other plugins outside the context of pages or
events.
EVENT_CORE_HEADERS (Execute)
This event is triggered by the MantisBT bootstrap process just before
emitting the headers. This enables plugins to emit their own headers
29
Chapter 5. Events Reference
or use API that enables tweaking values of headers emitted by core.
An example, of headers that can be tweaked is Content-Security-Policy header which can be tweaked using http_csp_*() APIs.
EVENT_CORE_READY (Execute)
This event is triggered by the MantisBT bootstrap process after all
core APIs have been initialized, including the plugin system, but before control is relinquished from the bootstrap process back to the
originating page. No parameters are passed to hooked functions, and
no return values are expected.
This event is the first point in page execution where the entire system
is considered loaded and ready.
EVENT_REST_API_ROUTES (Execute)
This event is triggered by MantisBT to enable plugins to register their
own routes to be accessible via the REST API. All APIs belonging to
a plugin named 'Example', MUST live under 'https://.../api/rest/plugins/Example/'. The route registration is done using the Slim Framework app instance that is passed as a parameter. A route group
should be used to include all routes for the plugin. The name of the
route group should be retrieved via calling plugin_route_group(). See
MantisGraph core plugin for an example and Slim Framework router
1
documentation .
Before calling into the plugin routes, the user would be already authenticated and authorized for API access in general. However, it is
the responsibility of the plugin to do its own plugin specific authorization.
EVENT_LOG (Execute)
This event is triggered by MantisBT to log a message. The contents
of the message should be hyper linked based on the following rules:
#123 means issue 123, ~123 means issue note 123, @P123 means
project 123, @U123 means user 123. Logging plugins can capture
extra context information like timestamp, current logged in user, etc.
This event receives the logging string as a parameter.
Parameters
• : the logging string
EVENT_AUTH_USER_FLAGS (First)
An event that enables plugins to return a set of flags that control the
authentication behaviors for the user who is logging in or logged in.
In some cases, the user will be in the system, but there will be cases
where the username provided by the user doesn't exist. In case the
user doesn't exist, it is up to the authentication plugin whether to fail
the login, validate credentials then fail, or validate credentials then auto-provision the user based on information the plugin is aware of (e.g.
1
https://www.slimframework.com/docs/objects/router.html
30
Output Modifier Events
IDP or some db of accounts). If no plugin is registered for events,
then defaults are used. If plugin sets a subset of the options, then the
default will be used for the rest.
2
Checkout SampleAuth plugin for more details.
5.3. Output Modifier Events
5.3.1. String Display
These events make it possible to dynamically modify output strings to interpret or add semantic meaning or markup. Examples include the creation of links to other bugs or bugnotes, as well as handling
urls to other sites in general.
EVENT_DISPLAY_BUG_ID (Chained)
This is an event to format bug ID numbers before being displayed, using the bug_format_id() API call. The result should be plain-text,
as the resulting string is used in various formats and locations.
Parameters
• : bug ID string to be displayed
• : bug ID number
Return Value
• : modified bug ID string
EVENT_DISPLAY_EMAIL (Chained)
This is an event to format text before being sent in an email. Callbacks should be used to process text and convert it into a plaintext-readable format so that users with textual email clients can best
utilize the information. Hyperlinks and other markup should be removed, leaving the core content by itself.
Parameters
• : input string to be displayed
Return Value
• : modified input string
EVENT_DISPLAY_EMAIL_BUILD_SUBJECT (Chained)
This is an event to format the subject line of an email before it is sent.
Parameters
• : input string for email subject
Return Value
• : modified subject string
2
https://github.com/mantisbt-plugins/SampleAuth
31
Chapter 5. Events Reference
EVENT_DISPLAY_FORMATTED (Chained)
This is an event to display generic formatted text. The string to be displayed is passed between hooked callbacks, each taking a turn to
modify the output in some specific manner. Text passed to this may
be processed for all types of formatting and markup, including clickable links, presentation adjustments, etc.
Parameters
• : input string to be displayed
Return Value
• : modified input string
• : multiline input string
EVENT_DISPLAY_RSS (Chained)
This is an event to format content before being displayed in an RSS
feed. Text should be processed to perform any necessary character
escaping to preserve hyperlinks and other appropriate markup.
Parameters
• : input string to be displayed
• : multiline input string
Return Value
• : modified input string
EVENT_DISPLAY_TEXT (Chained)
This is an event to display generic unformatted text. The string to be
displayed is passed between hooked callbacks, each taking a turn to
modify the output in some specific manner. Text passed to this event
should only be processed for the most basic formatting, such as preserving line breaks and special characters.
Parameters
• : input string to be displayed
• : multiline input string
Return Value
• : modified input string
5.3.2. Menu Items
These events allow new menu items to be inserted in order for new content to be added, such as new
pages or integration with other applications.
EVENT_MENU_ACCOUNT (Default)
This event gives plugins the opportunity to add new links to the user
account menu available to users from the 'My Account' link on the
main menu.
32
Menu Items
Return Value
• : List of HTML links for the user account menu.
EVENT_MENU_DOCS (Default)
This event gives plugins the opportunity to add new links to the documents menu available to users from the 'Docs' link on the main menu.
Return Value
• : List of HTML links for the documents menu.
EVENT_MENU_FILTER (Default)
This event gives plugins the opportunity to add new links to the issue
list menu available to users from the 'View Issues' link on the main
menu.
Return Value
• : List of HTML links for the issue list menu.
EVENT_MENU_ISSUE (Default)
This event gives plugins the opportunity to add new links to the issue
menu available to users when viewing issues.
Parameters
• : bug ID
Return Value
• : List of HTML links for the documents menu.
EVENT_MENU_MAIN (Default)
This event gives plugins the opportunity to add new menu options to
the main menu. New links will be added AFTER the standard menu
options.
Return Value
• : Hooked events may return an array of menu options.
Each array entry will contain an associate array with keys 'title', 'url',
3
'access_level', and 'icon' (e.g. fa-pencil from Font Awesome ).
return array(
array(
'title' => 'My Link',
'access_level' => DEVELOPER,
'url' => 'my_link.php',
'icon' => 'fa-random'
),
array(
'title' => 'My Link2',
'access_level' => DEVELOPER,
'url' => 'my_link2.php',
'icon' => 'fa-shield'
)
3
http://fontawesome.io/icons/
33
Chapter 5. Events Reference
);
EVENT_MENU_MAIN_FRONT (Default)
This event gives plugins the opportunity to add new menu options to
main menu. New links will be added BEFORE the standard menu options.
Return Value
• : Hooked events may return an array of menu options.
Each array entry will contain an associate array with keys 'title', 'url',
4
'access_level', and 'icon' (e.g. fa-pencil from Font Awesome ).
return array(
array(
'title' => 'My Link',
'access_level' => DEVELOPER,
'url' => 'my_link.php',
'icon' => 'fa-random'
),
array(
'title' => 'My Link2',
'access_level' => DEVELOPER,
'url' => 'my_link2.php',
'icon' => 'fa-shield'
)
);
EVENT_MENU_MANAGE (Default)
This event gives plugins the opportunity to add new links to the management menu available to site administrators from the 'Manage' link
on the main menu. Plugins should try to minimize use of these links to
functions dealing with core MantisBT management.
Return Value
• : List of HTML links for the management menu.
EVENT_MENU_MANAGE_CONFIG (Default)
This event gives plugins the opportunity to add new links to the configuration management menu available to site administrators from the
'Manage Configuration' link on the standard management menu. Plugins should try to minimize use of these links to functions dealing with
core MantisBT configuration.
Return Value
• : List of HTML links for the manage configuration menu.
EVENT_MENU_SUMMARY (Default)
This event gives plugins the opportunity to add new links to the summary menu available to users from the 'Summary' link on the main
menu.
4
http://fontawesome.io/icons/
34
Page Layout
Return Value
• : List of HTML links for the summary menu.
5.3.3. Page Layout
These events offer the chance to create output at points relevant to the overall page layout of MantisBT. Page headers, footers, stylesheets, and more can be created. Events listed below are in order of
runtime execution.
EVENT_LAYOUT_RESOURCES (Output)
This event allows plugins to output HTML code from inside the
tag, for use with CSS, Javascript, RSS, or any other similar resources. Note that this event is signaled after all other CSS and
Javascript resources are linked by MantisBT.
Return Value
• : HTML code to output.
EVENT_LAYOUT_BODY_BEGIN (Output)
This event allows plugins to output HTML code immediately after the
tag is opened, so that MantisBT may be integrated within another website's template, or other similar use.
Return Value
• : HTML code to output.
EVENT_LAYOUT_PAGE_HEADER (Output)
This event allows plugins to output HTML code immediately after the
MantisBT header content, such as the logo image.
Return Value
• : HTML code to output.
EVENT_LAYOUT_CONTENT_BEGIN (Output)
This event allows plugins to output HTML code after the top main
menu, but before any page-specific content begins.
Return Value
• : HTML code to output.
EVENT_LAYOUT_CONTENT_END (Output)
This event allows plugins to output HTML code after any page- specific content has completed, but before the bottom menu bar (or footer).
Return Value
• : HTML code to output.
EVENT_LAYOUT_PAGE_FOOTER (Output)
This event allows plugins to output HTML code after the MantisBT
version, copyright, and webmaster information, but before the query
information.
35
Chapter 5. Events Reference
Return Value
• : HTML code to output.
EVENT_LAYOUT_BODY_END (Output)
This event allows plugins to output HTML code immediately before
the end tag, to so that MantisBT may be integrated within
another website's template, or other similar use.
Return Value
• : HTML code to output.
EVENT_VIEW_BUG_ATTACHMENT (Output)
This event allows plugins to output HTML code immediately after the
line of an attachment. Receives the attachment data as a parameter,
in the form of an attachment array from within the array returned by
the file_get_visible_attachments() function.
Parameters
• : the attachment data as an array (see core/
file_api.php)
Return Value
• : HTML code to output.
5.4. Bug Filter Events
5.4.1. Custom Filters and Columns
EVENT_FILTER_FIELDS (Default)
This event allows a plugin to register custom filter objects (based on
the MantisFilter class) that will allow the user to search for issues based on custom criteria or datasets. The plugin can return either a class name (which will be instantiated at runtime) or an already
instantiated object. The plugin must ensure that the filter class has
been defined before returning the class name for this event.
Return Value
• : Array of class names or objects for custom filters
EVENT_FILTER_COLUMNS (Default)
This event allows a plugin to register custom column objects (based
on the MantisColumn class) that will allow the user to view data
for issues based on custom datasets. The plugin can return either a
class name (which will be instantiated at runtime) or an already instantiated object. The plugin must ensure that the column class has
been defined before returning the class name for this event.
Return Value
• : Array of class names or objects for custom columns
36
Bug and Bugnote Events
5.5. Bug and Bugnote Events
5.5.1. Bug View
EVENT_VIEW_BUG_DETAILS (Execute)
This event allows a plugin to either process information or display
some data in the bug view page. It is triggered after the row containing the target version and product build fields, and before the bug
summary is displayed.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Bug ID
EVENT_VIEW_BUG_EXTRA (Execute)
This event allows a plugin to either process information or display
some data in the bug view page. It is triggered after the bug notes
have been displayed, but before the history log is shown.
Any output here should be contained within its own
element.
Parameters
• : Bug ID
5.5.2. Bug Actions
EVENT_REPORT_BUG_FORM (Execute)
This event allows plugins to do processing or display form elements
on the Report Issue page. It is triggered immediately before the summary text field.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Project ID
EVENT_REPORT_BUG_FORM_TOP (Execute)
This event allows plugins to do processing or display form elements
at the top of the Report Issue page. It is triggered before any of the
visible form elements have been created.
37
Chapter 5. Events Reference
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Project ID
EVENT_REPORT_BUG_DATA (Chain)
This event allows plugins to perform pre-processing of the new bug
data structure after being reported from the user, but before the data
is saved to the database. At this point, the issue ID is not yet known,
as the data has not yet been persisted.
Parameters
• : Bug data structure (see core/bug_api.php)
Return Value
• : Bug data structure
EVENT_REPORT_BUG (Execute)
This event allows plugins to perform post-processing of the bug data structure after being reported from the user and being saved to the
database. At this point, the issue ID is actually known, and is passed
as a second parameter.
Parameters
• : Bug data structure (see core/bug_api.php)
• : Bug ID
EVENT_UPDATE_BUG_FORM (Execute)
This event allows plugins to do processing or display form elements
on the Update Issue page. It is triggered immediately before the summary text field.
Parameters
• : Bug ID
EVENT_UPDATE_BUG_FORM_TOP (Execute)
This event allows plugins to do processing or display form elements
on the Update Issue page. It is triggered immediately before before
any of the visible form elements have been created.
Parameters
• : Bug ID
EVENT_UPDATE_BUG_STATUS_FORM (Execute)
This event allows plugins to do processing or display form elements
in the bug change status form. It is triggered immediately before the
add bugnote fields.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
38
Bug Actions
Parameters
• : Bug ID
• : New Status
EVENT_UPDATE_BUG_DATA (Chain)
This event allows plugins to perform pre-processing of the updated
bug data structure after being modified by the user, but before being
saved to the database.
Parameters
• : Updated bug data structure (see core/
bug_api.php)
• : Original bug data structure (see core/bug_api.php)
Return Value
• : Updated bug data structure (see core/
bug_api.php)
EVENT_UPDATE_BUG (Execute)
This event allows plugins to perform post-processing of the bug data
structure after being updated.
Parameters
• : Original bug data structure (see core/bug_api.php)
• : Updated bug data structure (see core/
bug_api.php)
EVENT_BUG_ACTIONGROUP_FORM (Execute)
This event allows plugins to do processing or display form elements
in the bug group action page form. It is triggered immediately after the
standard fields, and before bugnote fields (if applicable).
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Array of event data elements
Parameter array contents
The parameter array contains elements for these indexes:
• 'action' => : Action title (see bug_actiongroup.php)
• 'bug_ids' => : Array of selected bug ids
• 'multiple_projects' => : Flag if selected bug ids span multiple projects
• 'has_bugnote' => : Flag if current group action form contains a bugnote input
Depending on the action, any of these indexes may appear:
39
Chapter 5. Events Reference
• 'custom_field_id' => : If action is 'CUSTOM', contains the
custom field id selected for update
EVENT_BUG_ACTION (Execute)
This event allows plugins to perform post-processing of group actions
performed from the View Issues page. The event will get called for
each bug ID that was part of the group action event.
Parameters
• : Action title (see bug_actiongroup.php)
• : Bug ID
EVENT_BUG_DELETED (Execute)
This event allows plugins to perform pre-processing of bug deletion
actions. The actual deletion will occur after execution of the event, for
compatibility reasons.
Parameters
• : Bug ID
5.5.3. Bugnote View
EVENT_VIEW_BUGNOTES_START (Execute)
This event allows a plugin to either process information or display
some data in the bug notes section, before any bug notes are displayed. It is triggered after the bug notes section title.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Bug ID
• : A list of all bugnotes to be displayed to the user
EVENT_VIEW_BUGNOTE (Execute)
This event allows a plugin to either process information or display
some data in the bug notes section, interleaved with the individual
bug notes. It gets triggered after every bug note is displayed.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Bug ID
• : Bugnote ID
• : Private bugnote (false if public)
EVENT_VIEW_BUGNOTES_END (Execute)
40
Bugnote Actions
This event allows a plugin to either process information or display
some data in the bug notes section, after all bugnotes have been displayed.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Bug ID
5.5.4. Bugnote Actions
EVENT_BUGNOTE_ADD_FORM (Execute)
This event allows plugins to do processing or display form elements
in the bugnote adding form. It is triggered immediately after the bugnote text field.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Bug ID
EVENT_BUGNOTE_ADD (Execute)
This event allows plugins to do post-processing of bugnotes added to
an issue.
Parameters
• : Bug ID
• : Bugnote ID
EVENT_BUGNOTE_EDIT_FORM (Execute)
This event allows plugins to do processing or display form elements
in the bugnote editing form. It is triggered immediately after the bugnote text field.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : Bug ID
• : Bugnote ID
EVENT_BUGNOTE_EDIT (Execute)
This event allows plugins to do post-processing of bugnote edits.
Parameters
• : Bug ID
• : Bugnote ID
EVENT_BUGNOTE_DELETED (Execute)
41
Chapter 5. Events Reference
This event allows plugins to do post-processing of bugnote deletions.
Parameters
• : Bug ID
• : Bugnote ID
EVENT_TAG_ATTACHED (Execute)
This event allows plugins to do post-processing of attached tags.
Parameters
• : Bug ID
• : Tag IDs
EVENT_TAG_DETACHED (Execute)
This event allows plugins to do post-processing of detached tags.
Parameters
• : Bug ID
• : Tag IDs
5.6. Notification Events
5.6.1. Recipient Selection
EVENT_NOTIFY_USER_INCLUDE (Default)
This event allows a plugin to specify a set of users to be included as
recipients for a notification. The set of users returned is added to the
list of recipients already generated from the existing notification flags
and selection process.
Parameters
• : Bug ID
• : Notification type
Return Value
• : User IDs to include as recipients
EVENT_NOTIFY_USER_EXCLUDE (Default)
This event allows a plugin to selectively exclude individual users from
the recipient list for a notification. The event is signalled for every
user in the final recipient list, including recipients added by the event
NOTIFY_USER_INCLUDE as described above.
Parameters
• : Bug ID
• : Notification type
• : User ID
42
User Account Events
Return Value
• : True to exclude the user, false otherwise
5.7. User Account Events
5.7.1. Account Preferences
EVENT_ACCOUNT_PREF_UPDATE_FORM (Execute)
This event allows plugins to do processing or display form elements
on the Account Preferences page. It is triggered immediately after the
last core preference element.
Any output here should follow the format found in
account_prefs_inc.php. As of 1.3.x this is no longer table elements.
Parameters
• : User ID
EVENT_ACCOUNT_PREF_UPDATE (Execute)
This event allows plugins to do pre-processing of form elements from
the Account Preferences page. It is triggered immediately before the
user preferences are saved to the database.
Parameters
• : User ID
EVENT_USER_AVATAR (First)
This event gets the user's avatar as an instance of the Avatar class.
The first plugin to respond with an avatar wins. Hence, in case of multiple avatar plugins, make sure to tweak the priorities. Avatars should
return null if they don't have an avatar for the specified user id.
Parameters
• : Avatar instance or null.
5.8. Management Events
EVENT_MANAGE_OVERVIEW_INFO (Output)
This event allows plugins to display special information on the Management Overview page.
Any output here should be defining appropriate rows and columns for
the surrounding
elements.
Parameters
• : whether user is administrator
5.8.1. Projects and Versions
EVENT_MANAGE_PROJECT_PAGE (Execute)
43
Chapter 5. Events Reference
This event allows plugins to do processing or display information on
the View Project page. It is triggered immediately before the project
access blocks.
Any output here should be contained within its own
element.
Parameters
• : Project ID
EVENT_MANAGE_PROJECT_CREATE_FORM (Execute)
This event allows plugins to do processing or display form elements
on the Create Project page. It is triggered immediately before the submit button.
Any output here should follow the format found in
manage_proj_create_page.php. As of 1.3.x this is no longer table elements.
EVENT_MANAGE_PROJECT_CREATE (Execute)
This event allows plugins to do post-processing of newly-created
projects and form elements from the Create Project page.
Parameters
• : Project ID
EVENT_MANAGE_PROJECT_UPDATE_FORM (Execute)
This event allows plugins to do processing or display form elements
in the Edit Project form on the View Project page. It is triggered immediately before the submit button.
Any output here should follow the format found in
manage_proj_edit_page.php. As of 1.3.x this is no longer table elements.
Parameters
• : Project ID
EVENT_MANAGE_PROJECT_UPDATE (Execute)
This event allows plugins to do post-processing of modified projects
and form elements from the Edit Project form.
Parameters
• : Project ID
EVENT_MANAGE_PROJECT_DELETE (Execute)
This event allows plugins to do pre-processing of project deletion.
This event is triggered prior to the project removal from the database.
Parameters
• : Project ID
EVENT_MANAGE_VERSION_CREATE (Execute)
44
Projects and Versions
This event allows plugins to do post-processing of newly-created
project versions from the View Project page, or versions copied from
other projects. This event is triggered for each version created.
Parameters
• : Version ID
EVENT_MANAGE_VERSION_UPDATE_FORM (Execute)
This event allows plugins to do processing or display form elements
on the Update Version page. It is triggered immediately before the
submit button.
Any output here should follow the format found in
manage_proj_ver_edit_page.php. As of 1.3.x this is no longer table
elements.
Parameters
• : Version ID
EVENT_MANAGE_VERSION_UPDATE (Execute)
This event allows plugins to do post-processing of modified versions
and form elements from the Edit Version page.
Parameters
• : Version ID
EVENT_MANAGE_VERSION_DELETE (Execute)
This event allows plugins to do pre-processing of version deletion.
This event is triggered prior to the version removal from the database.
Parameters
• : Version ID
• : Replacement version to set on issues that are currently
using the version that is about to be deleted.
EVENT_MANAGE_USER_CREATE_FORM (Execute)
This event allows plugins to do processing or display form elements
on the Create User page. It is triggered immediately before the submit
button.
Any output here should follow the format found in
manage_user_create_page.php.
EVENT_MANAGE_USER_CREATE (Execute)
This event allows plugins to do post-processing of newly-created
users. This event is triggered for each user created. The Manage
Users create form is one possible case for triggering such events, but
there can be other ways users can be created.
Parameters
• : User ID
45
Chapter 5. Events Reference
EVENT_MANAGE_USER_UPDATE_FORM (Execute)
This event allows plugins to do processing or display form elements
in the Manage User page. It is triggered immediately before the submit button.
Any output here should follow the format found in
manage_user_edit_page.php.
Parameters
• : User ID
EVENT_MANAGE_USER_UPDATE (Execute)
This event allows plugins to do post-processing of modified users.
This may be triggered by the Manage User page or some other path.
Parameters
• : User ID
EVENT_MANAGE_USER_DELETE (Execute)
This event allows plugins to do pre-processing of user deletion.
Parameters
• : User ID
EVENT_MANAGE_USER_PAGE (Execute)
This event allows plugins to do processing or display information on
the View User page. It is triggered immediately after the reset password segment.
Any output here should be contained within its own container.
Parameters
• : User ID
46
Chapter 6.
Integrating with MantisBT
The primary means of integrating with MantisBT with web services is with the bundled SOAP API,
which is accessible at http://server.com/mantis/api/soap/mantisconnect.php.
6.1. Java integration
6.1.1. Prebuilt SOAP stubs using Axis
For ease of integration of the Java clients, SOAP stubs are maintained and deployed in the Maven
1
central repository . For example:
biz.futureware.mantismantis-axis-soap-client1.2.15
2
To include them in your project, download the latest available version .
6.1.2. Usage in OSGi environments
If you would like to use Axis in an OSGi environment, it is recommended that you use a ready-made
3
bundle, such as the Axis bundle available from Eclipse Orbit
6.2. Compatibility between releases
The SOAP API signature will change between minor releases, typically to add new functionality or to
extend existing features.
Some of these changes might require a refresh of the client libraries generated, for instance Apache
Axis 1 SOAP stubs must be regenerated if a complex type receives a new property. Such changes will
4
be announced before the release of the new MantisBT version on the mantisbt-soap-dev mailing list .
Typically there will be two weeks time to integrate the new SOAP stubs.
6.3. Support
The primary means of obtaining support for Web Services and the SOAP API is through the mantis5
bt-soap-dev mailing list .
1
http://maven.org/
http://search.maven.org/#search|ga|1|g%3A%22biz.futureware.mantis%22
3
http://download.eclipse.org/tools/orbit/downloads/
4
http://lists.sourceforge.net/mailman/listinfo/mantisbt-soap-dev
5
http://lists.sourceforge.net/mailman/listinfo/mantisbt-soap-dev
2
47
48
Chapter 7.
Appendix
7.1. Git References
1
• The Git SCM web site offers a full reference of Git commands, as well Scott Chacon's excellent Pro
Git book.
2
• Github's Git Reference
• Official documentation (from kernel.org)
3
• Manual Page
• Tutorial
4
• Everyday Git With 20 Commands
5
6
• Git Crash Course for SVN Users
7
• Git From the Bottom Up (PDF)
1
http://git-scm.com/documentation/
http://gitref.org/
3
http://www.kernel.org/pub/software/scm/git/docs/
4
http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html
5
http://www.kernel.org/pub/software/scm/git/docs/everyday.html
6
https://git.wiki.kernel.org/index.php/GitSvnCrashCourse
7
http://ftp.newartisans.com/pub/git.from.bottom.up.pdf
2
49
50
Appendix A. Revision History
Revision
Mon Sep 3 2018
2.17-0
Release 2.17.0
Victor Boctor vboctor@mantisbt.org
Revision
Sun Jul 29 2018
2.16-0
Release 2.16.0
Victor Boctor vboctor@mantisbt.org
Revision
Tue Jun 5 2018
2.15-0
Release 2.15.0
Victor Boctor vboctor@mantisbt.org
Revision
Sun Apr 29 2018
2.14-0
Release 2.14.0
Victor Boctor vboctor@mantisbt.org
Revision
Wed Apr 4 2018
2.13-1
Release 2.13.1
Victor Boctor vboctor@mantisbt.org
Revision
Sun Apr 1 2018
2.13-0
Release 2.13.0
Victor Boctor vboctor@mantisbt.org
Revision
Sat Mar 3 2018
2.12-0
Release 2.12.0
Victor Boctor vboctor@mantisbt.org
Revision
2.11-0
Victor Boctor vboctor@mantisbt.org
Tue Feb 6 2018
Release 2.11.0
Revision
Sat Dec 30 2017
2.10-0
Release 2.10.0
Victor Boctor vboctor@mantisbt.org
Revision 2.9-0 Sun Dec 3 2017
Release 2.9.0
Victor Boctor vboctor@mantisbt.org
51
Appendix A. Revision History
Revision 2.8-0 Sat Oct 28 2017
Release 2.8.0
Victor Boctor vboctor@mantisbt.org
Revision 2.7-0 Sun Oct 8 2017
Release 2.7.0
Victor Boctor vboctor@mantisbt.org
Revision 2.6-0 Sun Sep 3 2017
Release 2.6.0
Victor Boctor vboctor@mantisbt.org
Revision 2.5-1 Sat Jun 17 2017
Release 2.5.1
Victor Boctor vboctor@mantisbt.org
Revision 2.5-0 Sun Jun 4 2017
Release 2.5.0
Victor Boctor vboctor@mantisbt.org
Revision 2.4-1 Sat May 20 2017
Release 2.4.1
Victor Boctor vboctor@mantisbt.org
Revision 2.4-0 Sun Apr 30 2017
Release 2.4.0
Victor Boctor vboctor@mantisbt.org
Revision 2.3-3 Sun Apr 30 2017
Release 2.3.2
Victor Boctor vboctor@mantisbt.org
Revision 2.3-2 Sun Apr 17 2017
Release 2.3.1
Victor Boctor vboctor@mantisbt.org
Revision 2.3-1 Fri Mar 31 2017
Release 2.3.0
Victor Boctor vboctor@mantisbt.org
Revision 2.2-3 Wed Mar 22 2017
Release 2.2.2
Damien Regad dregad@mantisbt.org
Revision 2.2-2 Sun Mar 12 2017
Release 2.2.1
Victor Boctor vboctor@mantisbt.org
Revision 2.2-1 Sun Feb 26 2017
Victor Boctor vboctor@mantisbt.org
52
Release 2.2.0
Revision 2.1-2 Sun Feb 26 2017
Release 2.1.1
Victor Boctor vboctor@mantisbt.org
Revision 2.1-1 Tue Jan 31 2017
Release 2.1.0
Victor Boctor vboctor@mantisbt.org
Revision 2.0-2 Fri Dec 30 2016
Release 2.0.0
Victor Boctor vboctor@mantisbt.org
Revision 2.0-1 Sat Nov 26 2016
Release 2.0.0-rc.2
Damien Regad dregad@mantisbt.org
53
54
Source Exif Data:
File Type : PDF
File Type Extension : pdf
MIME Type : application/pdf
Linearized : No
Page Count : 58
Profile CMM Type : Little CMS
Profile Version : 2.1.0
Profile Class : Display Device Profile
Color Space Data : RGB
Profile Connection Space : XYZ
Profile Date Time : 1998:02:09 06:49:00
Profile File Signature : acsp
Primary Platform : Apple Computer Inc.
CMM Flags : Not Embedded, Independent
Device Manufacturer : Hewlett-Packard
Device Model : sRGB
Device Attributes : Reflective, Glossy, Positive, Color
Rendering Intent : Perceptual
Connection Space Illuminant : 0.9642 1 0.82491
Profile Creator : Little CMS
Profile ID : 0
Profile Copyright : Copyright (c) 1998 Hewlett-Packard Company
Profile Description : sRGB IEC61966-2.1
Media White Point : 0.95045 1 1.08905
Media Black Point : 0 0 0
Red Matrix Column : 0.43607 0.22249 0.01392
Green Matrix Column : 0.38515 0.71687 0.09708
Blue Matrix Column : 0.14307 0.06061 0.7141
Device Mfg Desc : IEC http://www.iec.ch
Device Model Desc : IEC 61966-2.1 Default RGB colour space - sRGB
Viewing Cond Desc : Reference Viewing Condition in IEC61966-2.1
Viewing Cond Illuminant : 19.6445 20.3718 16.8089
Viewing Cond Surround : 3.92889 4.07439 3.36179
Viewing Cond Illuminant Type : D50
Luminance : 76.03647 80 87.12462
Measurement Observer : CIE 1931
Measurement Backing : 0 0 0
Measurement Geometry : Unknown
Measurement Flare : 0.999%
Measurement Illuminant : D65
Technology : Cathode Ray Tube Display
Red Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract)
Language : en
Format : application/pdf
Title : Developers Guide - Reference for developers and community members
Creator :
Date : 2018:09:04 04:58:10Z
PDF Version : 1.4
Producer : Apache FOP Version 1.1
Create Date : 2018:09:04 04:58:10Z
Creator Tool : DocBook XSL Stylesheets with Apache FOP
Metadata Date : 2018:09:04 04:58:10Z
Page Mode : UseOutlines
Author :