diff --git a/Source/Source.API.php b/Source/Source.API.php index 45dd184..bd19385 100644 --- a/Source/Source.API.php +++ b/Source/Source.API.php @@ -261,6 +261,7 @@ $t_bugfix_status = config_get( 'plugin_Source_bugfix_status' ); $t_resolution = config_get( 'plugin_Source_bugfix_resolution' ); + $t_handler = config_get( 'plugin_Source_bugfix_handler' ); $t_message_template = str_replace( array( '$1', '$2', '$3', '$4', '$5' ), array( '%1$s', '%2$s', '%3$s', '%4$s', '%5$s' ), @@ -318,7 +319,7 @@ # Resolve any fixed bugs that are not already marked as resolved 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 ); + bug_resolve( $t_bug_id, $t_resolution, $t_version, $t_message, null, $t_handler == ON ? $t_user_id : null ); # Optionally update the resoltion, fixed-in version, or add a bugnote } else { @@ -332,6 +333,9 @@ $t_bug->resolution = $t_resolution; $t_update = true; } + if ( $t_handler && !is_null( $t_user_id ) ) { + $t_bug->handler_id = $t_user_id; + } if ( is_blank( $t_bug->fixed_in_version ) ) { $t_bug->fixed_in_version = $t_version; $t_update = true; diff --git a/Source/Source.php b/Source/Source.php index 325ef97..b8a9e79 100644 --- a/Source/Source.php +++ b/Source/Source.php @@ -54,6 +54,7 @@ 'bugfix_regex_2' => '/#?(\d+)/', 'bugfix_status' => -1, 'bugfix_resolution' => FIXED, + 'bugfix_handler' => ON, 'bugfix_message' => 'Fix committed to $1 branch.', 'remote_checkin' => OFF, diff --git a/Source/lang/strings_english.txt b/Source/lang/strings_english.txt index 8a3615c..f5b10d7 100644 --- a/Source/lang/strings_english.txt +++ b/Source/lang/strings_english.txt @@ -89,6 +89,7 @@ $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_handler = 'Bug Fixed Assign To Committer'; $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.'; $s_plugin_Source_reset = 'Reset to default'; diff --git a/Source/pages/manage_config.php b/Source/pages/manage_config.php index d10f4a4..097e1e4 100644 --- a/Source/pages/manage_config.php +++ b/Source/pages/manage_config.php @@ -32,6 +32,7 @@ $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_handler = gpc_get_bool( 'bugfix_handler' ); $f_bugfix_message = gpc_get_string( 'bugfix_message' ); function check_urls( $t_urls_in ) { @@ -105,6 +106,7 @@ maybe_set_option( 'bugfix_status', $f_bugfix_status ); maybe_set_option( 'bugfix_resolution', $f_bugfix_resolution ); +maybe_set_option( 'bugfix_handler', $f_bugfix_handler ); maybe_set_option( 'bugfix_message', $f_bugfix_message ); maybe_set_option( 'remote_checkin', $f_remote_checkin ); diff --git a/Source/pages/manage_config_page.php b/Source/pages/manage_config_page.php index cfad2d5..20ead4f 100644 --- a/Source/pages/manage_config_page.php +++ b/Source/pages/manage_config_page.php @@ -130,6 +130,11 @@ +