diff --git a/Source/Source.API.php b/Source/Source.API.php index c69056e..45dd184 100644 --- a/Source/Source.API.php +++ b/Source/Source.API.php @@ -259,6 +259,7 @@ $t_enable_message = config_get( 'plugin_Source_enable_message' ); $t_enable_mapping = config_get( 'plugin_Source_enable_mapping' ); + $t_bugfix_status = config_get( 'plugin_Source_bugfix_status' ); $t_resolution = config_get( 'plugin_Source_bugfix_resolution' ); $t_message_template = str_replace( array( '$1', '$2', '$3', '$4', '$5' ), @@ -316,13 +317,17 @@ $t_bug = bug_get( $t_bug_id ); # Resolve any fixed bugs that are not already marked as resolved - if ( $t_enable_resolving && $t_bug->status < $t_resolved_threshold ) { + if ( $t_enable_resolving && $t_bugfix_status == -1 && $t_bug->status < $t_resolved_threshold ) { bug_resolve( $t_bug_id, $t_resolution, $t_version, $t_message, null, $t_user_id ); # Optionally update the resoltion, fixed-in version, or add a bugnote } else { $t_update = false; + if ( $t_bugfix_status > 0 && $t_bug->status != $t_bugfix_status ) { + $t_bug->status = $t_bugfix_status; + $t_update = true; + } if ( $t_bug->resolution < $t_fixed_threshold || $t_bug->resolution >= $t_notfixedthreshold ) { $t_bug->resolution = $t_resolution; $t_update = true; diff --git a/Source/Source.php b/Source/Source.php index 77ac9ab..325ef97 100644 --- a/Source/Source.php +++ b/Source/Source.php @@ -52,6 +52,7 @@ 'bugfix_regex_1' => '/(?:fixe?d?s?|resolved?s?)+\s+(?:#(?:\d+)[,\.\s]*)+/i', 'bugfix_regex_2' => '/#?(\d+)/', + 'bugfix_status' => -1, 'bugfix_resolution' => FIXED, 'bugfix_message' => 'Fix committed to $1 branch.', diff --git a/Source/lang/strings_english.txt b/Source/lang/strings_english.txt index c53d96f..8a3615c 100644 --- a/Source/lang/strings_english.txt +++ b/Source/lang/strings_english.txt @@ -85,6 +85,9 @@ $s_plugin_Source_buglink_regex_2 = 'Bug Link Regex Pass 2'; $s_plugin_Source_bugfix_regex_1 = 'Bug Fixed Regex Pass 1'; $s_plugin_Source_bugfix_regex_2 = 'Bug Fixed Regex Pass 2'; +$s_plugin_Source_bugfix_status = 'Bug Fixed Status'; +$s_plugin_Source_bugfix_status_off = '[Disabled]'; +$s_plugin_Source_bugfix_status_default = '[Resolved Status]'; $s_plugin_Source_bugfix_resolution = 'Bug Fixed Resolution'; $s_plugin_Source_bugfix_message = 'Bug Fixed Message Template'; $s_plugin_Source_bugfix_message_info = 'Use $1 for branch, $2 for revision, $3 for timestamp, $4 for commit message, or $5 for repository name.'; diff --git a/Source/pages/manage_config.php b/Source/pages/manage_config.php index a14ec6a..d10f4a4 100644 --- a/Source/pages/manage_config.php +++ b/Source/pages/manage_config.php @@ -30,6 +30,7 @@ $f_bugfix_reset_1 = gpc_get_string( 'bugfix_reset_1', OFF ); $f_bugfix_regex_2 = gpc_get_string( 'bugfix_regex_2' ); $f_bugfix_reset_2 = gpc_get_string( 'bugfix_reset_2', OFF ); +$f_bugfix_status = gpc_get_int( 'bugfix_status' ); $f_bugfix_resolution = gpc_get_int( 'bugfix_resolution' ); $f_bugfix_message = gpc_get_string( 'bugfix_message' ); @@ -102,6 +103,7 @@ plugin_config_delete( 'bugfix_regex_2' ); } +maybe_set_option( 'bugfix_status', $f_bugfix_status ); maybe_set_option( 'bugfix_resolution', $f_bugfix_resolution ); maybe_set_option( 'bugfix_message', $f_bugfix_message ); diff --git a/Source/pages/manage_config_page.php b/Source/pages/manage_config_page.php index 9208c02..cfad2d5 100644 --- a/Source/pages/manage_config_page.php +++ b/Source/pages/manage_config_page.php @@ -111,6 +111,15 @@