Abstract
Note
New Installation | Upgrade |
---|---|
Note
php -m
on the command line, or by using the php_info()
function in a PHP script.
Note
Category | Package | Minimum Version | Recommended | Comments |
---|---|---|---|---|
RDBMS | MySQL | 5.5.35 | 5.6 or later | PHP extension: mysqli with MySQL Native driver (mysqlnd) |
MariaDB | 5.5.35 | 10.4 or later | PHP extension: mysqli | |
PostgreSQL | 9.2 | 11.20 or later | PHP extension: pgsql | |
MS SQL Server | 2012 | 2019 or later | PHP extension: sqlsrv | |
Oracle | 11gR2 | 19c or later | PHP extension: oci8 | |
PHP | PHP | 7.4 | 8.0 or later | See above for PHP extensions |
Web Server | Apache | 2.2.x | 2.4.x | |
lighttpd | 1.4.x | 1.4.x | ||
nginx | 1.10.x | 1.16.x or later | ||
IIS | 7.5 | 10 | Windows Server 2016 or later |
Warning
Note
tar -xzf filename.tar.gz
OR (2 steps):
gunzip filename.tar.gz tar -xf filename.tarOther file archiving tools such as 7-Zip should also be able to handle decompression of the archive.
mv mantisbt-1.3.x mantisbt
https://yoursite/mantisbt/admin/install.phpThe installation procedure will go through the following steps:
config_inc.php
file to define the database connection parameters.
cp mantis_offline.php.sample mantis_offline.phpThis will prevent users from using the system while the upgrade is in progress.
config
of the new installation.
config_inc.php
,
custom_strings_inc.php
,
custom_constants_inc.php
and
custom_functions_inc.php
.
Note
plugins
subdirectory.
cd /path/to/mantisbt-OLD/plugins find -maxdepth 1 ! -path . -type d -o -type l | grep -Pv "(Gravatar|MantisCoreFormatting|MantisGraph|XmlImportExport)" | xargs -Idirs cp -r dirs /path/to/mantisbt-NEW/plugins
Warning
Gravatar
)
MantisCoreFormatting
)
MantisGraph
)
XmlImportExport
)
https://yoursite/mantisbt-NEW/admin/install.phpwhere mantisbt-NEW is the name of the directory where the new release was extracted
Upgrading large databases
config_defaults_inc.php
file for in depth explanations of the available options. Check out also Chapter 7, Customizing MantisBT for further options to personalize your installation.
config_inc.php
in subfolder config in an editor and add or modify any values as required. These will override the default values.
config_inc.php.sample
file as a starting point.
Warning
config_defaults_inc.php
file directly, as it could cause issues with future upgrades. Always store your custom configuration in your own config_inc.php
file.
Warning
config_inc.php
as well as custom_strings_inc.php
, custom_constants_inc.php
, custom_functions_inc.php
, etc.) should always be saved as UTF-8 without BOM. Failure to do so may lead to unexpected display issues.
rm -r admin
Warning
mv mantisbt mantisbt-old mv mantisbt-1.3.x mantisbt
rm mantis_offline.phpThis should be the final step in the upgrade process, as it will let users login again.
Warning
mysqldump -u<username> -p<password> <database name> > <output file>
mysql -u<username> -p<password> <database name> < <input file>
$g_status_enum_workflow[NEW_] ='30:acknowledged,20:feedback,40:confirmed,50:assigned,80:resolved'; $g_status_enum_workflow[FEEDBACK] ='30:acknowledged,40:confirmed,50:assigned,80:resolved'; $g_status_enum_workflow[ACKNOWLEDGED] ='40:confirmed,20:feedback,50:assigned,80:resolved'; $g_status_enum_workflow[CONFIRMED] ='50:assigned,20:feedback,30:acknowledged,80:resolved'; $g_status_enum_workflow[ASSIGNED] ='80:resolved,20:feedback,30:acknowledged,40:confirmed'; $g_status_enum_workflow[RESOLVED] ='90:closed,20:feedback,50:assigned'; $g_status_enum_workflow[CLOSED] ='20:feedback,50:assigned';
Note
Note
RDBMS | db_type (ADOdb) | PHP extension | Comments |
---|---|---|---|
MySQL | mysqli | mysqli | default |
PostgreSQL | pgsql | pgsql | |
MS SQL Server | mssqlnative | sqlsrv | |
Oracle | oci8 | oci8 |
Warning
m
).
plg
).
mantis
.
bug
table, the actual table name with the default prefix would be mantis_bug
.
table
.
bug
table, the actual table name with the default suffix would be bug_table
.
plugin
.
foo
in the Example
plugin, with default values for prefixes and suffix the physical table name would be mantis_plugin_Example_foo_table
.
Warning
https://www.example.com/mantisbt/
. Requires trailing `/`.
Warning
Warning
Warning
$g_custom_headers = array( 'P3P: CP="CUR ADM"' );in your config file, but make sure to check that your policy actually matches with what you are promising. See MSDN for more information.
$g_custom_headers = array( 'Content-Security-Policy:' );
Warning
Note
config_inc.php
file (see Section 5.4, “Webserver”).
Warning
cat /dev/urandom | head -c 64 | base64
Warning
$g_default_notify_flags = array( 'reporter' => ON, 'handler' => ON, 'monitor' => ON, 'bugnotes' => ON, 'category' => ON, 'explicit' => ON, 'threshold_min' => NOBODY, 'threshold_max' => NOBODY );threshold_min and threshold_max are used to send messages to all members of the project whose status is
$g_notify_flags['new'] = array( 'bugnotes' => OFF, 'monitor' => OFF, );See Section 7.4, “Email Notifications” for further examples of customizing the notification flags.
Note
Warning
Note
Note
scripts/send_emails.php
at regular intervals (e.g. every few minutes). This script can only be run from the CLI, not from the web interface, for security reasons.
Note
Note
openssl
commands to extract and convert the individual elements:
openssl pkcs12 -in cert.pfx -clcerts -nokeys -out cert.crt
openssl pkcs12 -in cert.pfx -cacerts -nokeys -out ca-chain.crt
-passout
specifies the private key's password)
openssl pkcs12 -in cert.pfx -nocerts -out cert.key -passout pass:
-passin pass:PASSWORD
Note
X-Mantis-Version
header, even if the request fails.
<address>
element. This string is treated as raw HTML and thus you must use &
instead of &
. Default is ''.
$g_language_choices_arr = array( 'english', 'french', 'german' );Of course, administrators can also add their own languages by translating the strings and creating their own language files. You are encouraged to share any translation work that you do with the MantisBT team. This will ensure that the newly created language file is maintained with future MantisBT releases.All language files reside in the lang/ folder. They are all named according to the following pattern: strings_<language>.txt.
Note
custom_
, e.g. xyz should be included as custom_xyz
.
eta
column will only be shown if usage of the ETA field is enabled (see $g_enable_eta in Section 5.35, “Field Visibility”), and the custom_xyz
column will be removed if the xyz Custom Field is not available in the current Project.
Y-m-d
.
Y-m-d H:i
.
Y-m-d H:i T
.
Y-MM-DD HH:mm
.
Note
Warning
$g_severity_multipliers = array ( FEATURE => 1, TRIVIAL => 2, TEXT => 3, TWEAK => 2, MINOR => 5, MAJOR => 8, CRASH => 8, BLOCK => 10 );The keys of the array are severity constants from constant_inc.php or from custom_constants_inc.php if you have custom severities defined. The values are integers, typically in the range of 0 to 10. If you would like for a severity to not count towards effectiveness, set the value to 0 for that severity.
$g_resolution_multipliers = array( UNABLE_TO_REPRODUCE => 2, NOT_FIXABLE => 1, DUPLICATE => 3, NOT_A_BUG => 5, SUSPENDED => 1, WONT_FIX => 1 );The keys of the array are resolution constants from constant_inc.php or from custom_constants_inc.php if you have custom resolutions defined. Resolutions not included here will be assumed to have a multiplier value of 0. The values are integers, typically in the range of 0 to 10. If you would like for a resolution to not count towards effectiveness, set the value to 0 for that resolution or remove it from the array completely. Note that these resolution multipliers are stacked on top of the severity multipliers. Therefore by default, a user reporting many duplicate bugs at severity level BLOCK will be far worse off than a user reporting many duplicate bugs at severity level FEATURE.
'bmp,gif,jpg,png,txt,zip'
.
'php,html,java,exe,pl,svg'
.
Warning
Warning
href
or img
or any tags that have parameters, as the HTML code is stored in the database as-is.
Warning
href
or img
or any tags that have parameters, as the HTML code is stored in the database as-is.
$g_logo_image
(see Section 5.11, “Display”) will not be shown, and the include file will have to handle display of the logo. To do so you can use the html_print_logo()
API function, which will display the logo with an URL link if one has been specified in $g_logo_url
<div id="banner" style="display: flex; align-items: center;"> <div style="width: 10%;"> <?php html_print_logo(); ?> </div> <div class="center"> <span class="pagetitle"> <?php global $g_window_title; echo $g_window_title; ?> </span> </div> <div style="width: 10%;"> </div> </div>
$g_main_menu_custom_options = array( array( 'title' => 'My Link', 'access_level' => MANAGER, 'url' => 'my_link.php', 'icon' => 'fa-plug' ), array( 'title' => 'My Link2', 'access_level' => ADMINISTRATOR, 'url' => 'my_link2.php', 'icon' => 'fa-plug' ) );Note that if the caption is found in
custom_strings_inc.php
(see Section 7.1, “Strings / Translations”), it will be replaced by the corresponding translated string. Options will only be added to the menu if the current logged in user has the appropriate access level.
LDAP
.
protocol://hostname:port
)
ldap
- unencrypted or opportunistic TLS (STARTTLS)
ldaps
- TLS encryption
389
.
636
(ldaps); for Active Directory Global Catalog forest-wide search, use 3268
(ldap) or 3269
(ldaps).
ldap://ldap.example.com/ ldaps://ldap.example.com:3269/
Note
ON
.
Warning
ldap://
scheme (not ldaps://
).
LDAP_OPT_X_TLS_PROTOCOL_TLS1_2
.
OFF
(protocol version not set).
Note
Warning
dc=example, dc=com
.
(organizationname=*Traffic)
. Defaults to ''
(empty string).
3
.
Note
0
, then the protocol version is not set, and you get whatever default the underlying LDAP library uses.
3
. LDAPv3 was introduced back in 1997, and LDAPv2 was deprecated in 2003 by RFC3494.
0
(infinite).
ON
.
OFF
. If you have only one LDAP server, setting to this to OFF is advisable to prevent any man-in-the-middle attacks.
cn=ldap,ou=Administrators,dc=example,dc=com
. Leave empty for anonymous binding.
uid
.
sAMAccountName
.
mail
.
cn
.
OFF
.
Note
OFF
.
Note
Warning
''
(This is the default).
Warning
Warning
,
).
=
, @
, -
or +
), will be prefixed with a tab character (\t
) in order to prevent CSV injection.
Warning
Strict
, Lax
(default) or None
.
Note
Strict
provides stronger protection against CSRF attacks, it actually prevents the user's session from being recognized when clicking a link from a notification e-mail, causing MantisBT to start an anonymous session even if the user is already logged in.
Note
Note
$g_my_view_boxes = array( 'assigned' => '1', 'unassigned' => '2', 'reported' => '3', 'resolved' => '4', 'recent_mod' => '5', 'monitored' => '6', 'feedback' => '0', 'verify' => '0', 'my_comments' => '0' );If you want to change the definition, copy the default value and apply the changes.
Important
bin
directory
dot -c
from an Administrator command prompt.
$g_notify_flags['new']['monitor'] = ON;
config_inc.php
settings for developers:
$g_display_errors = array( E_WARNING => DISPLAY_ERROR_HALT, E_ALL => DISPLAY_ERROR_INLINE, );
Note
$g_display_errors = array( E_USER_WARNING => DISPLAY_ERROR_INLINE, E_WARNING => DISPLAY_ERROR_INLINE, );
Note
E_USER_ERROR
, E_RECOVERABLE_ERROR
and E_ERROR
will always be set to DISPLAY_ERROR_HALT internally, regardless of the actual configured value. This ensures that program execution stops, to prevent potential integrity issues and/or MantisBT from functioning incorrectly.
DISPLAY_ERROR_HALT
in $g_display_errors.
Warning
Note
DISPLAY_ERROR_INLINE
in $g_display_errors.
Note
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;or
$g_log_level = LOG_ALL & ~LOG_DATABASE;
'file:/var/log/mantis.log'
(Unix) or 'file:c:/temp/mantisbt.log'
(Windows)
Note
Note
/api/soap/mantisconnect.php
below the MantisBT root. A WSDL file which describes the web service is available at /api/soap/mantisconnect.php?wsdl
below the MantisBT root.
/api/rest/swagger/
below the MantisBT root.
$g_webservice_readonly_access_level_threshold = $g_webservice_readwrite_access_level_threshold = $g_webservice_admin_access_level_threshold = NOBODY;
today
or +2 days
, or empty string for no due date set (default).
0
, meaning that issues will be marked overdue as soon as their due date has passed. However, it is also possible to set it to a higher value to flag overdue issues earlier, or even use a negative value to allow a "grace period" after due date.
due-N
CSS rules (where N is the array's index) must be created otherwise the extra levels will not be highlighted in the UI.
$g_private_bug_threshold
.
$g_limit_view_unless_threshold
option allows the administrator to configure access limitations for users, letting them view only those issues that they are involved with, i.e. if:
$g_limit_reporters
is enabled, users that are reporters in a project, or lower access level, are only allowed to see the issues they reported. Issues reported by other users are not accessible by them.
$g_report_bug_threshold
. Additionally, that threshold can have different values in each project. Being dependant on that threshold, the behaviour of this option is not well defined when the reporting threshold is configured as discrete values with gaps, instead of a simple threshold. In that scenario, the visibilty is determined by the minimum access level contained in the $g_report_bug_threshold
access levels array.
Note
$g_limit_view_unless_threshold
. The new option will be available by default on new installations, or after disabling $g_limit_reporters
if enabled in an existing instance.
^-?([0-9])*$
can be used to constrain an integer.
Title | Variable | Description |
---|---|---|
Report an Issue | $g_report_bug_threshold | threshold to report an issue |
Status to which a new issue is set | $g_bug_submit_status | status issue is set to when submitted |
Update an Issue | $g_update_bug_threshold | threshold to update an issue |
Allow Reporter to close an issue | $g_allow_reporter_close | allow reporter to close issues they reported |
Monitor an issue | $g_monitor_bug_threshold | threshold to monitor an issue |
Handle Issue | $g_handle_bug_threshold | threshold to handle (be assigned) an issue |
Assign Issue | $g_update_bug_assign_threshold | threshold to be in the assign to list |
Move Issue | $g_move_bug_threshold | threshold to move an issue to another project. This setting is for all projects. |
Delete Issue | $g_delete_bug_threshold | threshold to delete an issue |
Reopen Issue | $g_reopen_bug_threshold | threshold to reopen an issue |
Allow reporter to reopen Issue | $g_allow_reporter_reopen | allow reporter to reopen issues they reported |
Status to which a reopened Issue is set | $g_bug_reopen_status | status issue is set to when reopened |
Resolution to which a reopened Issue is set | $g_bug_reopen_resolution | resolution issue is set to when reopened |
Status where an issue is considered resolved | $g_bug_resolved_status_threshold | status where bug is resolved |
Status where an issue becomes read-only | $g_bug_readonly_status_threshold | status where bug is read-only (see update_readonly_bug_threshold) |
Update readonly issue | $g_update_readonly_bug_threshold | threshold to update an issue marked as read-only |
Update Issue Status | $g_update_bug_status_threshold | threshold to update an issue's status |
View Private Issues | $g_private_bug_threshold | threshold to view a private issue |
Set View Status | $g_set_view_status_threshold | threshold to set an issue to Private/Public |
Update View Status | $g_change_view_status_threshold | threshold needed to update the view status while updating an issue or an issue note |
Show list of users monitoring issue | $g_show_monitor_list_threshold | threshold to see who is monitoring an issue |
Add monitors to an issue | $g_monitor_add_others_bug_threshold | threshold to add users to the list of users monitoring an issue |
Remove monitors from an issue | $g_monitor_delete_others_bug_threshold | threshold to remove users from the list of users monitoring an issue |
Set status on assignment of handler | $g_auto_set_status_to_assigned | change status when an issue is assigned |
Status to set auto-assigned issues to | $g_bug_assigned_status | status to use when an issue is auto-assigned |
Limit reporter's access to their own issues (deprecated option) | $g_limit_reporters | reporters can see only issues they reported. This setting is for all projects. |
Limit access only to those issues reported, handled, or monitored by the user | $g_limit_view_unless_threshold | threshold that, if not met, hides other users' issues. |
Title | Variable | Description |
---|---|---|
Add Notes | $g_add_bugnote_threshold | threshold to add an issue note |
Update Others' Notes | $g_update_bugnote_threshold | threshold at which a user can edit issue notes created by other users |
Update Own Notes | $g_bugnote_user_edit_threshold | threshold at which a user can edit issue notes created by themselves |
Delete Others' Notes | $g_delete_bugnote_threshold | threshold at which a user can delete issue notes created by other users |
Delete Own Notes | $g_bugnote_user_delete_threshold | threshold at which a user can delete issue notes created by themselves |
View private notes | $g_private_bugnote_threshold | threshold to view a private issue note |
Change view state of own notes | $g_bugnote_user_change_view_state_threshold | threshold at which a user can change the view state of issue notes created by themselves |
Title | Variable | Description |
---|---|---|
View Change Log | $g_view_changelog_threshold | threshold to view the changelog |
View Roadmap | $g_roadmap_view_threshold | threshold to view the roadmap |
View Summary | $g_view_summary_threshold | threshold to view the summary |
View Assigned To | $g_view_handler_threshold | threshold to see who is handling an issue |
View Issue History | $g_view_history_threshold | threshold to view the issue history |
Send Reminders | $g_bug_reminder_threshold | threshold to send a reminder |
Table 6.1. Issues
Title | Variable | Description |
---|---|---|
Status to which a new issue is set | $g_bug_submit_status | status issue is set to when submitted |
Status where an issue is considered resolved | $g_bug_resolved_status_threshold | status where issue is resolved |
Status to which a reopened Issue is set | $g_bug_reopen_status | status issue is set to when reopened |
config/custom_strings_inc.php
), which is automatically detected and included by MantisBT code.
Note
<?php $s_CODE = STRING; $MANTIS_ERROR[ERROR_NUMBER] = STRING;
lang_get()
function. Search in lang/strings_english.txt
for existing codes.
constant_inc.php
.
Note
custom_strings_inc.php
file should only contain variable assignments and basic PHP control structures. In particular, calling MantisBT core functions in it is not recommended, as it could lead to unexpected behavior and even errors depending on context.
<?php if( db_is_connected() ) { if( helper_get_current_project() == 1 ) { $s_summary = 'Title'; } }
Warning
lang_get_current()
from the custom_strings_inc.php
. Doing so will reset the active_language, causing the code to return incorrect translations if the default language is different from English. Always use the $g_active_language
global variable instead.
Note
custom_strings_inc.php
, then it will be displayed as-is.
string
, for strings of up to 255 characters.
numeric
, for numerical integer values.
float
, for real (float / double) numbers.
email
, for storing email addresses.
enumeration
is used when a user selects one entry from a list. The user interface for this type is a combo-box.
checkbox
is like enumeration, but the options are shown as checkboxes and the user is allowed to tick more than one item.
RED|YELLOW|BLUE
.
radio
is like enumeration, but the list is shown as radio buttons and the user is only allowed to tick a single option.
RED|YELLOW|BLUE
, and default YELLOW
.
Note
list
is like enumeration but the list is shown as a list box where the user is only allowed to select one option.
RED|YELLOW|BLUE
, and default YELLOW
.
Note
multi-selection list
is like enumeration, but the list is shown as a list box where the user is allowed to select multiple options.
RED|YELLOW|BLUE
, and default RED|BLUE
.
Note
date
, for date values.
tomorrow
, next week
, last month
, +3 days
, last day of this month
, etc.
Note
{tomorrow}
) is still supported for backwards-compatibility, but no longer necessary. This is considered a deprecated feature, that will be removed in a future released of MantisBT.
RED|YELLOW|BLUE
). Use the pipe (|
) character to separate the enumeration's values. It is possible for one of the values to be empty (e.g. |RED|YELLOW|BLUE
, note the leading |
).
=versions
would automatically resolve into all the versions defined for the current project. See Section 7.2.7, “Dynamic values for Enumeration Custom Fields” for more information.
Note
config
directory, locate and edit custom_strings_inc.php
(see Section 7.1, “Strings / Translations”), create it if it does not exist.
<?php switch( $g_active_language ) { case 'french': $s_my_start_date = 'Date de début'; break; default: # Default language, as defined in config/config_inc.php # ($g_default_language, English in this case) $s_my_start_date = 'Start Date'; break; }
Note
custom_strings_inc.php
(see Section 7.1, “Strings / Translations”), since MantisBT would have used the existing, already localized string from the standard language files. To check for standard strings, inspect lang/strings_english.txt
.
=categories
a list of categories defined in the current project (or the project to which the issue belongs).
=versions
a list of all versions defined in the current project (or the project to which the issue belongs).
=future_versions
a list of all versions that belong to the current project with released flag set to false.
=released_versions
a list of all versions that belong to the current project with released flag set to true.
Note
=
before the list of options tells MantisBT that this is a dynamic list, rather than a static one with a single option.
=versions
, the actual custom function that is executed is custom_function_*_enum_versions(). The reason why the "enum_" is not included is to have a fixed prefix for all custom functions used for this purpose and protect against users using custom functions that were not intended for this purpose.
/** * Construct an enumeration for all categories for the current project. * * The enumeration will be empty if current project is ALL PROJECTS. * Enumerations format is: "abc|lmn|xyz" * To use this in a custom field type "=categories" in the possible values field. */ function custom_function_override_enum_categories() { $t_categories = category_get_all_rows( helper_get_current_project() ); $t_enum = array(); foreach( $t_categories as $t_category ) { $t_enum[] = $t_category['category']; } $t_possible_values = implode( '|', $t_enum ); return $t_possible_values; }
Note
mine
, you will have to define it with the following signature:
/** * Use this in a custom field type "=mine" in the possible values field. */ function custom_function_override_enum_mine() { # Populate $t_enum values as appropriate here $t_enum = array(); $t_possible_values = implode( '|', $t_enum ); return $t_possible_values; }
Note
core/constant_inc.php
defines the constants that correspond to those in the enumeration. These are useful to refer to these enumerations in the configs and the code.
define( 'VIEWER', 10 ); define( 'REPORTER', 25 ); define( 'UPDATER', 40 ); define( 'DEVELOPER', 55 ); define( 'MANAGER', 70 ); define( 'ADMINISTRATOR', 90 );
config_defaults_inc.php
includes the defaults for the enumerations. The configuration options that are defaulted here are used in specifying which enumerations are active and should be used in MantisBT.
$g_access_levels_enum_string = '10:viewer,25:reporter,40:updater,55:developer,70:manager,90:administrator';
Note
lang/strings_german.txt
) provide the localised strings (German in this case) for enumerations. But again, the master list is the enumeration in the configs themselves, the ones in the language files are just used for finding the localised equivalent for an entry. Hence, if a user changes the config to have only two types of users developers and administrators, then only those will be prompted to the users even if the enumerations in the language files still includes the full list.
$s_access_levels_enum_string = '10:Betrachter,25:Reporter,40:Updater,55:Entwickler,70:Manager,90:Administrator';
config/custom_constants_inc.php
is supported for the exclusive purpose of allowing administrators to define their own constants while maintaining a simple upgrade path for future releases of MantisBT. Note that this file is not distributed with MantisBT and you will need to create it if you need such customisation. In our example, we need to define a constant for the new access level.
define( 'SENIOR_DEVELOPER', 60 );
config/config_inc.php
// Remove Updater and add Senior Developer $g_access_levels_enum_string = '10:viewer,25:reporter,55:developer,60:senior_developer,70:manager,90:administrator'; // Give access to Senior developers to create/delete custom field. $g_manage_custom_fields_threshold = SENIOR_DEVELOPER;
custom_strings_inc.php
(see Section 7.1, “Strings / Translations”)
$s_access_levels_enum_string = '10:Betrachter,25:Reporter,40:Updater,55:Entwickler,60:Senior Developer,70:Manager,90:Administrator';
Note
config_defaults_inc.php
. This section defines all enumerations that are used by MantisBT.
$g_notify_flags['new'] = array( 'threshold_min' => MANAGER, 'threshold_max' => MANAGER, );
$g_default_notify_flags = array( 'threshold_min' => DEVELOPER, 'threshold_max' => MANAGER, ); $g_notify_flags['closed'] = array( 'threshold_min' => MANAGER, 'threshold_max' => MANAGER, );
$g_default_notify_flags['bugnotes'] = OFF;
$g_notify_flags['closed']['monitor'] = OFF;
$g_notify_flags['bugnote'] = array( 'threshold_min' => DEVELOPER, 'threshold_max' => DEVELOPER, );
$g_notify_flags['sponsor'] = array( 'threshold_min' => MANAGER, 'threshold_max' => MANAGER, );
$g_notify_flags['owner'] = array( 'threshold_min' => MANAGER, 'threshold_max' => MANAGER, 'reporter' => ON, );
$g_email_receive_own = OFF; $g_default_notify_flags = array( 'reporter' => ON, 'handler' => ON, 'monitor' => ON, 'bugnotes' => ON, 'category' => ON, 'threshold_min' => NOBODY, 'threshold_max' => NOBODY ); $g_notify_flags['new'] = array( 'threshold_min' => MANAGER, 'threshold_max' => MANAGER, );
<?php # Custom status code define( 'TESTING', 60 );
# Revised enum string with new 'testing' status $g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:testing,80:resolved,90:closed'; # Status color additions $g_status_colors['testing'] = '#ACE7AE';Note that the key in the $g_status_colors array must be equal to the value defined for the new status code in $g_status_enum_string.
config
subfolder, locate and edit custom_strings_inc.php
(see Section 7.1, “Strings / Translations”), create it if it does not exist
<?php
# Translation for Custom Status Code: testing
switch( $g_active_language ) {
case 'french':
$s_status_enum_string = '10:nouveau,20:commentaire,30:accepté,40:confirmé,50:affecté,60:à tester,80:résolu,90:fermé';
$s_testing_bug_title = 'Mettre le bogue en test';
$s_testing_bug_button = 'A tester';
$s_email_notification_title_for_status_bug_testing = 'Le bogue suivant est prêt à être TESTE.';
break;
default: # english
$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:testing,80:resolved,90:closed';
$s_testing_bug_title = 'Mark issue Ready for Testing';
$s_testing_bug_button = 'Ready for Testing';
$s_email_notification_title_for_status_bug_testing = 'The following issue is ready for TESTING.';
break;
}
$g_status_enum_workflow[NEW_] ='30:acknowledged,20:feedback,40:confirmed,50:assigned,80:resolved'; $g_status_enum_workflow[FEEDBACK] ='30:acknowledged,40:confirmed,50:assigned,80:resolved'; $g_status_enum_workflow[ACKNOWLEDGED] ='40:confirmed,20:feedback,50:assigned,80:resolved'; $g_status_enum_workflow[CONFIRMED] ='50:assigned,20:feedback,30:acknowledged,80:resolved'; $g_status_enum_workflow[ASSIGNED] ='60:testing,20:feedback,30:acknowledged,40:confirmed,80:resolved'; $g_status_enum_workflow[TESTING] ='80:resolved,20:feedback,50:assigned'; $g_status_enum_workflow[RESOLVED] ='90:closed,20:feedback,50:assigned'; $g_status_enum_workflow[CLOSED] ='20:feedback,50:assigned';
core/custom_function_api.php
, and are named custom_function_default_descriptive_name, where descriptive_name describes the particular function. See Section 7.6.1, “Default Custom Functions” for a description of the specific functions.
custom_functions_inc.php
that must be saved in MantisBT's config directory. In normal processing, the system will look for override functions and execute them instead of the provided default functions.
custom_functions_inc.php
), and rename it (i.e. replacing 'default' by 'override'). The specific functionality you need can then be coded into the override function.
core/custom_functions_api.php
for further details.
Custom Function Name | Description | Return value |
---|---|---|
custom_function_default_auth_can_change_password() | Determines whether MantisBT can update the password | True if yes, False if not |
custom_function_default_changelog_include_issue( $p_issue_id ) | Determines whether the specified issue should be included in the Changelog or not. | True to include, False to exclude |
custom_function_default_changelog_print_issue( $p_issue_id, $p_issue_level = 0 ) | Prints one entry in the Changelog | None |
custom_function_default_enum_categories() | Build a list of all categories for the current project | Enumeration, delimited by "|" |
custom_function_default_enum_future_versions() | Build a list of all future versions for the current project | Enumeration, delimited by "|" |
custom_function_default_enum_released_versions() | Build a list of all released versions for the current project | Enumeration, delimited by "|" |
custom_function_default_enum_versions() | Build a list of all versions for the current project | Enumeration, delimited by "|" |
custom_function_default_format_issue_summary( $p_issue_id, $p_context = 0 ) | Format the bug summary | Formatted string |
custom_function_default_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAGE, $p_user_id = null ) | Defines which columns should be displayed | Array of the column names |
custom_function_default_issue_create_notify( $p_issue_id ) | Notify after an issue has been created | In case of invalid data, this function should call trigger_error() |
custom_function_default_issue_create_validate( $p_new_issue_data ) | Validate field settings before creating an issue | In case of invalid data, this function should call trigger_error() |
custom_function_default_issue_delete_notify( $p_issue_data ) | Notify after an issue has been deleted | In case of invalid data, this function should call trigger_error() |
custom_function_default_issue_delete_validate( $p_issue_id ) | Validate field settings before deleting an issue | In case of invalid data, this function should call trigger_error() |
custom_function_default_issue_update_notify( $p_issue_id ) | Notify after an issue has been updated | In case of invalid data, this function should call trigger_error() |
custom_function_default_issue_update_validate( $p_issue_id, $p_new_issue_data, $p_bugnote_text ) | Validate field issue data before updating | In case of invalid data, this function should call trigger_error() |
custom_function_default_print_bug_view_page_custom_buttons( $p_bug_id ) | Prints the custom buttons on the current view page | None |
custom_function_default_print_column_title( $p_column, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE, array $p_sort_properties = null ) | Print a column's title based on its name | None |
custom_function_default_print_column_value( $p_column, $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) | Print a column's value based on its name | None |
custom_function_default_roadmap_include_issue( $p_issue_id ) | Determines whether the specified issue should be included in the Roadmap or not. | True to include, False to exclude |
custom_function_default_roadmap_print_issue( $p_issue_id, $p_issue_level = 0 ) | Prints one entry in the Roadmap | None |
<?php /** * Hook to validate Validate field settings before resolving * verify that the resolution is not set to OPEN * verify that the fixed in version is set (if versions of the product exist) */ function custom_function_override_issue_update_validate( $p_issue_id, $p_bug_data, $p_bugnote_text ) { if( $p_bug_data->status == RESOLVED ) { if( $p_bug_data->resolution == OPEN ) { error_parameters( 'the resolution cannot be open to resolve the issue' ); trigger_error( ERROR_VALIDATE_FAILURE, ERROR ); } $t_version_count = count( version_get_all_rows( $p_bug_data->project_id ) ); if( ( $t_version_count > 0 ) && ( $p_bug_data->fixed_in_version == '' ) ) { error_parameters( 'fixed in version must be set to resolve the issue' ); trigger_error( ERROR_VALIDATE_FAILURE, ERROR ); } } } ?>
custom_constants_inc.php
define( 'ERROR_VALIDATE_FAILURE', 2000 );
custom_strings_inc.php
(see Section 7.1, “Strings / Translations”)
$MANTIS_ERROR['ERROR_VALIDATE_FAILURE'] = 'This change cannot be made because %s';
<?php # -------------------- # Checks the provided bug and determines whether it should be included in the changelog # or not. # returns true: to include, false: to exclude. function custom_function_override_changelog_include_issue( $p_issue_id ) { $t_issue = bug_get( $p_issue_id ); return ( ( $t_issue->resolution == FIXED || $t_issue->resolution == IMPLEMENTED ) && ( $t_issue->status >= config_get( 'bug_resolved_status_threshold' ) ) ); }
<?php # -------------------- # Prints one entry in the changelog. function custom_function_override_changelog_print_issue( $p_issue_id, $p_issue_level = 0 ) { $t_bug = bug_get( $p_issue_id ); if( $t_bug->category_id ) { $t_category_name = category_get_name( $t_bug->category_id ); } else { $t_category_name = ''; } $t_category = is_blank( $t_category_name ) ? '' : '<b>[' . $t_category_name . ']</b> '; echo str_pad( '', $p_issue_level * 6, ' ' ), '- ', string_get_bug_view_link( $p_issue_id ), ': ', $t_category, string_display_line_links( $t_bug->summary ); if( $t_bug->handler_id != 0 ) { echo ' (', prepare_user_name( $t_bug->handler_id ), ')'; } echo ' - ', get_enum_element( 'status', $t_bug->status ), '.<br />'; }
http://www.example.com/mantisbt/changelog_page.php?project=myproject&version=ver1
http://www.example.com/mantisbt/changelog_page.php?project=myproject
http://www.example.com/mantisbt/changelog_page.php?project_id=1
http://www.example.com/mantisbt/changelog_page.php?version_id=1
http://www.example.com/mantisbt/project_page.php?project_id=1
<?php # -------------------- # Checks the provided bug and determines whether it should be included in the roadmap or not. # returns true: to include, false: to exclude. function custom_function_override_roadmap_include_issue( $p_issue_id ) { return ( true ); }
<?php # -------------------- # Prints one entry in the roadmap. function custom_function_override_roadmap_print_issue( $p_issue_id, $p_issue_level = 0 ) { $t_bug = bug_get( $p_issue_id ); if( bug_is_resolved( $p_issue_id ) ) { $t_strike_start = '<strike>'; $t_strike_end = '</strike>'; } else { $t_strike_start = $t_strike_end = ''; } if( $t_bug->category_id ) { $t_category_name = category_get_name( $t_bug->category_id ); } else { $t_category_name = ''; } $t_category = is_blank( $t_category_name ) ? '' : '<b>[' . $t_category_name . ']</b> '; echo str_pad( '', $p_issue_level * 6, ' ' ), '- ', $t_strike_start, string_get_bug_view_link( $p_issue_id ), ': ', $t_category, string_display_line_links( $t_bug->summary ); if( $t_bug->handler_id != 0 ) { echo ' (', prepare_user_name( $t_bug->handler_id ), ')'; } echo ' - ', get_enum_element( 'status', $t_bug->status ), $t_strike_end, '.<br />'; }
http://www.example.com/mantisbt/roadmap_page.php?project=myproject&version=ver1
http://www.example.com/mantisbt/roadmap_page.php?project=myproject
http://www.example.com/mantisbt/roadmap_page.php?project_id=1
http://www.example.com/mantisbt/roadmap_page.php?version_id=1
http://www.example.com/mantisbt/project_page.php?project_id=1
Revision History | |||
---|---|---|---|
Revision 2.26-0 | Sun Oct 15 2023 | ||
| |||
Revision 2.25-0 | Mon Mar 8 2021 | ||
| |||
Revision 2.24-1 | Sun May 3 2020 | ||
| |||
Revision 2.24-0 | Sun Mar 15 2020 | ||
| |||
Revision 2.23-0 | Sun Dec 9 2019 | ||
| |||
Revision 2.22-1 | Thu Sep 26 2019 | ||
| |||
Revision 2.22-0 | Sun Aug 25 2019 | ||
| |||
Revision 2.21-2 | Mon Aug 19 2019 | ||
| |||
Revision 2.21-1 | Thu Jun 13 2019 | ||
| |||
Revision 2.21-0 | Sat Apr 20 2019 | ||
| |||
Revision 2.20-0 | Sat Mar 16 2019 | ||
| |||
Revision 2.19-0 | Wed Jan 2 2019 | ||
| |||
Revision 2.18-0 | Tue Oct 16 2018 | ||
| |||
Revision 2.17-1 | Mon Sep 24 2018 | ||
| |||
Revision 2.17-0 | Mon Sep 3 2018 | ||
| |||
Revision 2.16-0 | Sun Jul 29 2018 | ||
| |||
Revision 2.15-0 | Tue Jun 5 2018 | ||
| |||
Revision 2.14-0 | Sun Apr 29 2018 | ||
| |||
Revision 2.13-1 | Wed Apr 4 2018 | ||
| |||
Revision 2.13-0 | Sun Apr 1 2018 | ||
| |||
Revision 2.12-0 | Sat Mar 3 2018 | ||
| |||
Revision 2.11-0 | Tue Feb 6 2018 | ||
| |||
Revision 2.10-0 | Sat Dec 30 2017 | ||
| |||
Revision 2.9-0 | Sun Dec 3 2017 | ||
| |||
Revision 2.8-0 | Sat Oct 28 2017 | ||
| |||
Revision 2.7-0 | Sun Oct 8 2017 | ||
| |||
Revision 2.6-0 | Sun Sep 3 2017 | ||
| |||
Revision 2.5-1 | Sat Jun 17 2017 | ||
| |||
Revision 2.5-0 | Sun Jun 4 2017 | ||
| |||
Revision 2.4-1 | Sat May 20 2017 | ||
| |||
Revision 2.4-0 | Sun Apr 30 2017 | ||
| |||
Revision 2.3-3 | Sun Apr 30 2017 | ||
| |||
Revision 2.3-2 | Sun Apr 17 2017 | ||
| |||
Revision 2.3-1 | Fri Mar 31 2017 | ||
| |||
Revision 2.2-3 | Wed Mar 22 2017 | ||
| |||
Revision 2.2-2 | Sun Mar 12 2017 | ||
| |||
Revision 2.2-1 | Sun Feb 26 2017 | ||
| |||
Revision 2.1-2 | Sun Feb 26 2017 | ||
| |||
Revision 2.1-1 | Tue Jan 31 2017 | ||
| |||
Revision 2.0-2 | Fri Dec 30 2016 | ||
| |||
Revision 2.0-1 | Sat Nov 26 2016 | ||
|