Index: bug_actiongroup.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_actiongroup.php,v retrieving revision 1.33 diff -u -r1.33 bug_actiongroup.php --- bug_actiongroup.php 5 Aug 2004 10:22:38 -0000 1.33 +++ bug_actiongroup.php 8 Aug 2004 14:32:10 -0000 @@ -28,14 +28,21 @@ foreach( $f_bug_arr as $t_bug_id ) { bug_ensure_exists( $t_bug_id ); + $t_status = bug_get_field( $t_bug_id, 'status' ); switch ( $f_action ) { case 'CLOSE': - if ( access_can_close_bug( $t_bug_id ) ) { + if ( access_can_close_bug( $t_bug_id ) && + ( $t_status < CLOSED ) && + bug_check_workflow($t_status, CLOSED) ) { bug_close( $t_bug_id ); } else { - $t_failed_ids[] = $t_bug_id; + if ( ! access_can_close_bug( $t_bug_id ) ) { + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); + }else{ + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_status' ); + } } break; @@ -43,7 +50,7 @@ if ( access_has_bug_level( config_get( 'delete_bug_threshold' ), $t_bug_id ) ) { bug_delete( $t_bug_id ); } else { - $t_failed_ids[] = $t_bug_id; + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); } break; @@ -52,7 +59,7 @@ $f_project_id = gpc_get_int( 'project_id' ); bug_set_field( $t_bug_id, 'project_id', $f_project_id ); } else { - $t_failed_ids[] = $t_bug_id; + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); } break; @@ -62,28 +69,46 @@ if ( access_has_project_level( config_get( 'report_bug_threshold' ), $f_project_id ) ) { bug_copy( $t_bug_id, $f_project_id, true, true, true, true, true, true ); } else { - $t_failed_ids[] = $t_bug_id; + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); } break; case 'ASSIGN': - if ( access_has_bug_level( config_get( 'update_bug_threshold' ), $t_bug_id ) ) { - // @@@ Check that $f_assign has access to handle a bug. - $f_assign = gpc_get_int( 'assign' ); + $f_assign = gpc_get_int( 'assign' ); + if ( ON == config_get( 'auto_set_status_to_assigned' ) ) { + $t_ass_val = config_get( 'bug_assigned_status' ); + } else { + $t_ass_val = $t_status; + } + if ( access_has_bug_level( config_get( 'update_bug_threshold' ), $t_bug_id ) && + access_has_bug_level( config_get( 'handle_bug_threshold' ), $t_bug_id, $f_assign ) && + bug_check_workflow($t_status, $t_ass_val ) ) { bug_assign( $t_bug_id, $f_assign ); } else { - $t_failed_ids[] = $t_bug_id; + if ( bug_check_workflow($t_status, $t_ass_val ) ) { + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); + } else { + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_status' ); + } } break; case 'RESOLVE': + $t_resolved_status = config_get( 'bug_resolved_status_threshold' ); if ( access_has_bug_level( config_get( 'update_bug_threshold' ), $t_bug_id ) && - access_has_bug_level( config_get( 'handle_bug_threshold' ), $t_bug_id )) { + access_has_bug_level( config_get( 'handle_bug_threshold' ), $t_bug_id ) && + ( $t_status < $t_resolved_status ) && + bug_check_workflow($t_status, $t_resolved_status ) ) { $f_resolution = gpc_get_int( 'resolution' ); $f_fixed_in_version = gpc_get_string( 'fixed_in_version', '' ); bug_resolve( $t_bug_id, $f_resolution, $f_fixed_in_version ); } else { - $t_failed_ids[] = $t_bug_id; + if ( ( $t_status < $t_resolved_status ) && + bug_check_workflow($t_status, $t_resolved_status ) ) { + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); + } else { + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_status' ); + } } break; @@ -92,7 +117,7 @@ $f_priority = gpc_get_int( 'priority' ); bug_set_field( $t_bug_id, 'priority', $f_priority ); } else { - $t_failed_ids[] = $t_bug_id; + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); } break; @@ -101,7 +126,7 @@ $f_status = gpc_get_int( 'status' ); bug_set_field( $t_bug_id, 'status', $f_status ); } else { - $t_failed_ids[] = $t_bug_id; + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); } break; @@ -110,7 +135,7 @@ $f_view_status = gpc_get_int( 'view_status' ); bug_set_field( $t_bug_id, 'view_state', $f_view_status ); } else { - $t_failed_ids[] = $t_bug_id; + $t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' ); } break; @@ -125,13 +150,10 @@ html_page_top1(); html_page_top2(); - $t_links = array(); - foreach( $t_failed_ids as $t_id ) { - $t_links[] = string_get_bug_view_link( $t_id ); - } - echo '
'; - echo lang_get( 'bug_actiongroup_failed' ) . implode( ', ', $t_links ) . '
'; + foreach( $t_failed_ids as $t_id => $t_reason ) { + printf("

%s: %s

\n", string_get_bug_view_link( $t_id ), $t_reason); + } print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) ); echo '
'; Index: bug_actiongroup_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_actiongroup_page.php,v retrieving revision 1.40 diff -u -r1.40 bug_actiongroup_page.php --- bug_actiongroup_page.php 24 Jul 2004 11:48:33 -0000 1.40 +++ bug_actiongroup_page.php 8 Aug 2004 14:32:11 -0000 @@ -153,6 +153,12 @@ project_id ) ) > 0 ) ); + if ( $t_show_version ) { ?> @@ -160,17 +166,14 @@