Index: bug_update_advanced_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_update_advanced_page.php,v retrieving revision 1.69 diff -c -r1.69 bug_update_advanced_page.php *** bug_update_advanced_page.php 26 Jun 2004 14:05:42 -0000 1.69 --- bug_update_advanced_page.php 3 Jul 2004 21:58:01 -0000 *************** *** 221,227 **** --- 221,227 ---- Index: bug_update_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_update_page.php,v retrieving revision 1.70 diff -c -r1.70 bug_update_page.php *** bug_update_page.php 26 Jun 2004 14:05:42 -0000 1.70 --- bug_update_page.php 3 Jul 2004 21:58:02 -0000 *************** *** 153,159 **** $p_bug_id ) ); --- 744,752 ---- function html_button_bug_resolve( $p_bug_id ) { $t_status = bug_get_field( $p_bug_id, 'status' ); ! if ( ( $t_status < config_get( 'bug_resolved_status_threshold' ) ) && ! access_has_bug_level( config_get( 'handle_bug_threshold' ), $p_bug_id ) && ! bug_check_workflow($t_status, RESOLVED) ) { html_button( 'bug_resolve_page.php', lang_get( 'resolve_bug_button' ), array( 'bug_id' => $p_bug_id ) ); *************** *** 758,766 **** # -------------------- # Print a button to reopen the given bug function html_button_bug_reopen( $p_bug_id ) { ! if ( access_has_bug_level( config_get( 'reopen_bug_threshold' ), $p_bug_id ) || ! ( bug_get_field( $p_bug_id, 'reporter_id' ) == auth_get_current_user_id() && ! ( ON == config_get( 'allow_reporter_reopen' ) ) ) ) { html_button( 'bug_reopen_page.php', lang_get( 'reopen_bug_button' ), array( 'bug_id' => $p_bug_id ) ); --- 768,779 ---- # -------------------- # Print a button to reopen the given bug function html_button_bug_reopen( $p_bug_id ) { ! if ( bug_check_workflow( $t_status, config_get( 'bug_reopen_status' ) ) && ! ( access_has_bug_level( config_get( 'reopen_bug_threshold' ), $p_bug_id ) || ! ( ( bug_get_field( $p_bug_id, 'reporter_id' ) == auth_get_current_user_id() ) && ! ( ON == config_get( 'allow_reporter_reopen' ) ) ! ) ) ! ) { html_button( 'bug_reopen_page.php', lang_get( 'reopen_bug_button' ), array( 'bug_id' => $p_bug_id ) ); *************** *** 772,778 **** function html_button_bug_close( $p_bug_id ) { $t_status = bug_get_field( $p_bug_id, 'status' ); ! if ( access_can_close_bug ( $p_bug_id ) && ( $t_status < CLOSED ) ) { html_button( 'bug_close_page.php', lang_get( 'close_bug_button' ), array( 'bug_id' => $p_bug_id ) ); --- 785,793 ---- function html_button_bug_close( $p_bug_id ) { $t_status = bug_get_field( $p_bug_id, 'status' ); ! if ( access_can_close_bug ( $p_bug_id ) && ! ( $t_status < CLOSED ) && ! bug_check_workflow($t_status, CLOSED) ) { html_button( 'bug_close_page.php', lang_get( 'close_bug_button' ), array( 'bug_id' => $p_bug_id ) ); Index: core/print_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/print_api.php,v retrieving revision 1.88 diff -c -r1.88 print_api.php *** core/print_api.php 26 Jun 2004 12:30:38 -0000 1.88 --- core/print_api.php 3 Jul 2004 21:58:04 -0000 *************** *** 586,591 **** --- 586,618 ---- } # end for } # -------------------- + # Select the proper enum values for status based on workflow + # or the input parameter if workflows are not used + # we use variable variables in order to achieve this + function print_enum_string_option_list_workflow( $p_enum_name, $p_val=0 ) { + $g_var = 'g_'.$p_enum_name.'_enum_string'; + global $$g_var; + global $g_status_enum_states; + + if (count($g_status_enum_states) < 1) { + # workflow not defined, use default enum + $t_arr = explode_enum_string( $$g_var ); + } else { + # workflow defined - find allowed states + $allowed_states = $g_status_enum_states[$p_val]; + $t_arr = explode_enum_string( $allowed_states ); + } + $enum_count = count( $t_arr ); + + for ($i=0;$i<$enum_count;$i++) { + $t_elem = explode_enum_arr( $t_arr[$i] ); + $t_elem2 = get_enum_element( $p_enum_name, $t_elem[0] ); + PRINT ""; + } # end for + } + # -------------------- # prints the list of a project's users # if no project is specified uses the current project function print_project_user_option_list( $p_project_id=null ) {