Custom Functions Custom functions are used to extend the functionaloty of Mantis by integrating user written functions into the processing at strategic places. This allows the system administrator to change the functionality without re-writing parts of the internals of the code. User versions of these functions are placed in a file called "custom_functions_inc.php" in the root directory of Mantis. This is the same place that the "config_inc.php" file modifying Mantis defaults is placed. In normal processing, Mantis will look for override functions and execute them instead of the provided default functions. Custom functions have names like "custom_function_override_descriptive_name" where "descriptive name" described the particular function. The specific functions are described below. The simplest way to create a custom function is to copy the default function, named "custom_function_default_descriptive_name" from the "core/custom_function_api.php" file to your override file ("custom_functions_inc.php"), and rename it. The specific functionality you need can then be coded into the override function. Defined Functions custom_function_default_changelog_include_issue( $p_issue_id ) returns true or false if the issue if to be included in the Changelog custom_function_default_changelog_print_issue( $p_issue_id ) returns a formatted string to be included for the issue in the Changelog custom_function_default_checkin( $p_issue_id, $p_comment, $p_file, $p_new_version ) registers a checkin in source control in Mantis custom_function_default_issue_update_validate( $p_issue_id, $p_new_bug, $p_bug_note_text ) validate bug field settings before an update occurs. It returns true or fails with an error. custom_function_default_issue_update_notify( $p_issue_id ) notify after a bug has been updated custom_function_default_issue_create_validate( $p_new_bug ) validate bug field settings before an issue is created. It returns true or fails with an error. custom_function_default_issue_create_notify( $p_issue_id ) notify after a bug has been opened custom_function_default_issue_delete_validate( $p_issue_id ) validate bug field settings before an issue can be deleted. It returns true or fails with an error. custom_function_default_issue_delete_notify( $p_issue_id ) { notify after a bug has been deleted Example Function The following function is used to validate an issue before it is resolved. status == RESOLVED ) { if ( $p_bug_data->resolution == OPEN ) { error_parameters( 'Resolution cannot be open to resolve' ); trigger_error( ERROR_BUG_VALIDATE_FAILURE, ERROR ); } $t_version_count = count( version_get_all_rows( $t_bug_data->project_id ) ); if ( ( $t_version_count > 0 ) && ( $t_bug_data->fixed_in_version == '' ) ) { error_parameters( 'fixed in version must be set to resolve' ); trigger_error( ERROR_BUG_VALIDATE_FAILURE, ERROR ); } } } ?>