Blame Identity/Models/Html/Mantis/1.1.2-1.fc9/manage_config_workflow_page.php

d6e8d8
d6e8d8
# Mantis - a php based bugtracking system
d6e8d8
d6e8d8
# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
d6e8d8
# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
d6e8d8
d6e8d8
# Mantis is free software: you can redistribute it and/or modify
d6e8d8
# it under the terms of the GNU General Public License as published by
d6e8d8
# the Free Software Foundation, either version 2 of the License, or
d6e8d8
# (at your option) any later version.
d6e8d8
#
d6e8d8
# Mantis is distributed in the hope that it will be useful,
d6e8d8
# but WITHOUT ANY WARRANTY; without even the implied warranty of
d6e8d8
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
d6e8d8
# GNU General Public License for more details.
d6e8d8
#
d6e8d8
# You should have received a copy of the GNU General Public License
d6e8d8
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
d6e8d8
d6e8d8
	# --------------------------------------------------------
d6e8d8
	# $Id: manage_config_workflow_page.php,v 1.21.2.1 2007-10-13 22:33:25 giallu Exp $
d6e8d8
	# --------------------------------------------------------
d6e8d8
d6e8d8
	require_once( 'core.php' );
d6e8d8
d6e8d8
	$t_core_path = config_get( 'core_path' );
d6e8d8
	require_once( $t_core_path . 'email_api.php' );
d6e8d8
d6e8d8
	auth_reauthenticate();
d6e8d8
d6e8d8
	html_page_top1( lang_get( 'manage_workflow_config' ) );
d6e8d8
	html_page_top2();
d6e8d8
d6e8d8
	print_manage_menu( 'adm_permissions_report.php' );
d6e8d8
	print_manage_config_menu( 'manage_config_workflow_page.php' );
d6e8d8
d6e8d8
	$t_access = current_user_get_access_level();
d6e8d8
	$t_project = helper_get_current_project();
d6e8d8
	$t_can_change_workflow = $t_access >= config_get_access( 'status_enum_workflow' );
d6e8d8
	$t_can_change_flags = $t_can_change_workflow;
d6e8d8
	$t_overrides = array();
d6e8d8
	
d6e8d8
	function set_overrides( $p_config ) {
d6e8d8
	   global $t_overrides;
d6e8d8
	   if ( ! in_array( $p_config, $t_overrides ) ) {
d6e8d8
	       $t_overrides[] = $p_config;
d6e8d8
	   }
d6e8d8
	}
d6e8d8
d6e8d8
	function parse_workflow( $p_enum_workflow ) {
d6e8d8
        $t_status_arr  = get_enum_to_array( config_get( 'status_enum_string' ) );
d6e8d8
        if ( 0 == count( $p_enum_workflow ) ) {
d6e8d8
            # workflow is not set, default it to all transitions
d6e8d8
	        foreach ( $t_status_arr as $t_status => $t_label ) {
d6e8d8
		        $t_temp_workflow = array();
d6e8d8
			    foreach ( $t_status_arr as $t_next => $t_next_label ) {
d6e8d8
				    if ( $t_status <> $t_next ) {
d6e8d8
				       $t_temp_workflow[] = $t_next . ':' . $t_next_label;
d6e8d8
				    }
d6e8d8
			    }
d6e8d8
		        $p_enum_workflow[$t_status] = implode( ',', $t_temp_workflow );
d6e8d8
		    }
d6e8d8
	    }
d6e8d8
d6e8d8
    	$t_entry = array();
d6e8d8
    	$t_exit = array();
d6e8d8
d6e8d8
    	# prepopulate new bug state (bugs go from nothing to here)
d6e8d8
    	$t_submit_status_array = config_get( 'bug_submit_status' );
d6e8d8
    	$t_new_label = get_enum_to_string( lang_get( 'status_enum_string' ), NEW_ );
d6e8d8
    	if ( is_array( $t_submit_status_array ) ) {
d6e8d8
    		# @@@ (thraxisp) this is not implemented in bug_api.php
d6e8d8
    		foreach ($t_submit_status_array as $t_access => $t_status ) {
d6e8d8
    			$t_entry[$t_status][0] = $t_new_label;
d6e8d8
    			$t_exit[0][$t_status] = $t_new_label;
d6e8d8
    		}
d6e8d8
    	} else {
d6e8d8
			$t_status = $t_submit_status_array;
d6e8d8
			$t_entry[$t_status][0] = $t_new_label;
d6e8d8
			$t_exit[0][$t_status] = $t_new_label;
d6e8d8
    	}
d6e8d8
d6e8d8
        # add user defined arcs and implicit reopen arcs
d6e8d8
    	$t_reopen = config_get( 'bug_reopen_status' );
d6e8d8
    	$t_reopen_label = get_enum_to_string( lang_get( 'resolution_enum_string' ), REOPENED );
d6e8d8
    	$t_resolved_status = config_get( 'bug_resolved_status_threshold' );
d6e8d8
    	$t_default = array();
d6e8d8
    	foreach ( $t_status_arr as $t_status => $t_status_label ) {
d6e8d8
    		if ( isset( $p_enum_workflow[$t_status] ) ) {
d6e8d8
    			$t_next_arr = get_enum_to_array( $p_enum_workflow[$t_status] );
d6e8d8
    			foreach ( $t_next_arr as $t_next => $t_next_label) {
d6e8d8
                    if ( ! isset( $t_default[$t_status] ) ) {
d6e8d8
    	                $t_default[$t_status] = $t_next;
d6e8d8
    	            }
d6e8d8
					$t_exit[$t_status][$t_next] = '';
d6e8d8
					$t_entry[$t_next][$t_status] = '';
d6e8d8
				}
d6e8d8
    		} else {
d6e8d8
    			$t_exit[$t_status] = array();
d6e8d8
    		}
d6e8d8
    		if ( $t_status >= $t_resolved_status ) {
d6e8d8
    			$t_exit[$t_status][$t_reopen] = $t_reopen_label;
d6e8d8
    			$t_entry[$t_reopen][$t_status] = $t_reopen_label;
d6e8d8
    		}
d6e8d8
    		if ( ! isset( $t_entry[$t_status] ) ) {
d6e8d8
    			$t_entry[$t_status] = array();
d6e8d8
    		}
d6e8d8
    	}
d6e8d8
        return array( 'entry' => $t_entry, 'exit' => $t_exit, 'default' => $t_default );
d6e8d8
    }
d6e8d8
d6e8d8
d6e8d8
	# Get the value associated with the specific action and flag.
d6e8d8
	function show_flag( $p_from_status_id, $p_to_status_id ) {
d6e8d8
		global $t_can_change_workflow, $t_overrides, $t_file_workflow, $t_global_workflow, $t_project_workflow, $t_colour_global, $t_colour_project;
d6e8d8
		if ( $p_from_status_id <> $p_to_status_id ) {
d6e8d8
            $t_file = isset( $t_file_workflow['exit'][$p_from_status_id][$p_to_status_id] ) ? 1 : 0 ;
d6e8d8
            $t_global = isset( $t_global_workflow['exit'][$p_from_status_id][$p_to_status_id] ) ? 1 : 0 ;
d6e8d8
            $t_project = isset( $t_project_workflow['exit'][$p_from_status_id][$p_to_status_id] ) ? 1 : 0;
d6e8d8
d6e8d8
            $t_colour = '';
d6e8d8
            if ( $t_global != $t_file ) {
d6e8d8
                $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
d6e8d8
                if ( $t_can_change_workflow ) {
d6e8d8
                    set_overrides( 'status_enum_workflow' );
d6e8d8
                }
d6e8d8
            }
d6e8d8
            if ( $t_project != $t_global ) {
d6e8d8
                $t_colour = ' bgcolor="' . $t_colour_project . '" '; # project overrides
d6e8d8
                if ( $t_can_change_workflow ) {
d6e8d8
                    set_overrides( 'status_enum_workflow' );
d6e8d8
                }
d6e8d8
            }
d6e8d8
            $t_value = '';
d6e8d8
d6e8d8
			$t_flag = ( 1 == $t_project );
d6e8d8
			$t_label = $t_flag ? $t_project_workflow['exit'][$p_from_status_id][$p_to_status_id] : '';
d6e8d8
d6e8d8
			if ( $t_can_change_workflow ) {
d6e8d8
				$t_flag_name = $p_from_status_id . ':' . $p_to_status_id;
d6e8d8
				$t_set = $t_flag ? "CHECKED" : "";
d6e8d8
				$t_value .= "<input type=\"checkbox\" name=\"flag[]\" value=\"$t_flag_name\" $t_set />";
d6e8d8
			} else {
d6e8d8
				$t_value .= $t_flag ? 'X' : ' ';
d6e8d8
			}
d6e8d8
d6e8d8
			if ( $t_flag && ( '' != $t_label ) ) {
d6e8d8
				$t_value .= '
(' . $t_label . ')';
d6e8d8
			}
d6e8d8
		} else {
d6e8d8
            $t_value = ' ';
d6e8d8
		}
d6e8d8
d6e8d8
		$t_value .= '';
d6e8d8
d6e8d8
		return $t_value;
d6e8d8
	}
d6e8d8
d6e8d8
	function section_begin( $p_section_name ) {
d6e8d8
		$t_enum_status = explode_enum_string( config_get( 'status_enum_string' ) );
d6e8d8
		echo '';
d6e8d8
		echo ''
d6e8d8
			. strtoupper( $p_section_name ) . '' . "\n";
d6e8d8
		echo '' . lang_get( 'current_status' ) . '';
d6e8d8
		echo ''
d6e8d8
			. lang_get( 'next_status' ) . '';
d6e8d8
		echo "\n";
d6e8d8
		foreach( $t_enum_status as $t_status ) {
d6e8d8
			$t_entry_array = explode_enum_arr( $t_status );
d6e8d8
			echo ' ' . string_no_break( get_enum_to_string( lang_get( 'status_enum_string' ), $t_entry_array[0] ) ) . ' ';
d6e8d8
		}
d6e8d8
			echo '' . lang_get( 'custom_field_default_value' ) . '';
d6e8d8
		echo '' . "\n";
d6e8d8
	}
d6e8d8
d6e8d8
	function capability_row( $p_from_status ) {
d6e8d8
		global $t_file_workflow, $t_global_workflow, $t_project_workflow, $t_colour_global, $t_colour_project, $t_can_change_workflow;
d6e8d8
		$t_enum_status = get_enum_to_array( config_get( 'status_enum_string' ) );
d6e8d8
		echo '' . string_no_break( get_enum_to_string( lang_get( 'status_enum_string' ), $p_from_status ) ) . '';
d6e8d8
		foreach ( $t_enum_status as $t_to_status_id => $t_to_status_label ) {
d6e8d8
			echo show_flag( $p_from_status, $t_to_status_id );
d6e8d8
		}
d6e8d8
d6e8d8
        $t_file = isset( $t_file_workflow['default'][$p_from_status] ) ? $t_file_workflow['default'][$p_from_status] : 0 ;
d6e8d8
        $t_global = isset( $t_global_workflow['default'][$p_from_status] ) ? $t_global_workflow['default'][$p_from_status] : 0 ;
d6e8d8
        $t_project = isset( $t_project_workflow['default'][$p_from_status] ) ? $t_project_workflow['default'][$p_from_status] : 0;
d6e8d8
d6e8d8
        $t_colour = '';
d6e8d8
        if ( $t_global != $t_file ) {
d6e8d8
            $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
d6e8d8
            if ( $t_can_change_workflow ) {
d6e8d8
                set_overrides( 'status_enum_workflow' );
d6e8d8
            }
d6e8d8
        }
d6e8d8
        if ( $t_project != $t_global ) {
d6e8d8
            $t_colour = ' bgcolor="' . $t_colour_project . '" '; # project overrides
d6e8d8
            if ( $t_can_change_workflow ) {
d6e8d8
                set_overrides( 'status_enum_workflow' );
d6e8d8
            }
d6e8d8
        }
d6e8d8
		echo '';
d6e8d8
		if ( $t_can_change_workflow ) {
d6e8d8
            echo '<select name="default_' . $p_from_status . '">';
d6e8d8
            print_enum_string_option_list( 'status', $t_project );
d6e8d8
            echo '</select>';
d6e8d8
        } else {
d6e8d8
            echo get_enum_to_string( lang_get( 'status_enum_string' ), $t_project );
d6e8d8
        }
d6e8d8
        echo ' ';
d6e8d8
		echo '' . "\n";
d6e8d8
	}
d6e8d8
d6e8d8
	function section_end() {
d6e8d8
		echo '
' . "\n";
d6e8d8
	}
d6e8d8
d6e8d8
	function threshold_begin( $p_section_name ) {
d6e8d8
		echo '';
d6e8d8
		echo '' . strtoupper( $p_section_name ) . '' . "\n";
d6e8d8
		echo '' . lang_get( 'threshold' ) . '';
d6e8d8
		echo '' . lang_get( 'status_level' ) . '';
d6e8d8
		echo '' . lang_get( 'alter_level' ) . '';
d6e8d8
		echo "\n";
d6e8d8
	}
d6e8d8
d6e8d8
	function threshold_row( $p_threshold ) {
d6e8d8
		global $t_access, $t_can_change_flags, $t_colour_project, $t_colour_global;
d6e8d8
d6e8d8
        $t_file = config_get_global( $p_threshold );
d6e8d8
        $t_global = config_get( $p_threshold, null, null, ALL_PROJECTS );
d6e8d8
        $t_project = config_get( $p_threshold );
d6e8d8
		$t_can_change_threshold = $t_access >= config_get_access( $p_threshold );
d6e8d8
        $t_colour = '';
d6e8d8
        if ( $t_global != $t_file ) {
d6e8d8
            $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
d6e8d8
            if ( $t_can_change_threshold ) {
d6e8d8
                set_overrides( $p_threshold );
d6e8d8
            }
d6e8d8
        }
d6e8d8
        if ( $t_project != $t_global ) {
d6e8d8
            $t_colour = ' bgcolor="' . $t_colour_project . '" '; # project overrides
d6e8d8
            if ( $t_can_change_threshold ) {
d6e8d8
                set_overrides( $p_threshold );
d6e8d8
            }
d6e8d8
        }
d6e8d8
d6e8d8
		echo '' . lang_get( 'desc_' . $p_threshold ) . '';
d6e8d8
		if ( $t_can_change_threshold ) {
d6e8d8
			echo '<td' . $t_colour . '><select name="threshold_' . $p_threshold . '">';
d6e8d8
			print_enum_string_option_list( 'status', $t_project );
d6e8d8
			echo '</select> ';
d6e8d8
			echo '<select name="access_' . $p_threshold . '">';
d6e8d8
			print_enum_string_option_list( 'access_levels', config_get_access( $p_threshold ) );
d6e8d8
			echo '</select> ';
d6e8d8
			$t_can_change_flags = true;
d6e8d8
		} else {
d6e8d8
			echo '<td' . $t_colour . '>' . get_enum_to_string( lang_get( 'status_enum_string' ), $t_project ) . ' ';
d6e8d8
			echo '' . get_enum_to_string( lang_get( 'access_levels_enum_string' ), config_get_access( $p_threshold ) ) . ' ';
d6e8d8
		}
d6e8d8
d6e8d8
		echo '' . "\n";
d6e8d8
	}
d6e8d8
d6e8d8
	function threshold_end() {
d6e8d8
		echo '
' . "\n";
d6e8d8
	}
d6e8d8
d6e8d8
	function access_begin( $p_section_name ) {
d6e8d8
		$t_enum_status = explode_enum_string( config_get( 'status_enum_string' ) );
d6e8d8
		echo '';
d6e8d8
		echo ''
d6e8d8
			. strtoupper( $p_section_name ) . '' . "\n";
d6e8d8
		echo '' . lang_get( 'access_change' ) . '';
d6e8d8
	}
d6e8d8
d6e8d8
	function access_row( ) {
d6e8d8
		global $t_access, $t_can_change_flags, $t_colour_project, $t_colour_global;
d6e8d8
d6e8d8
		$t_enum_status = get_enum_to_array( config_get( 'status_enum_string' ) );
d6e8d8
d6e8d8
		$t_file_new = config_get_global( 'report_bug_threshold' );
d6e8d8
		$t_global_new = config_get( 'report_bug_threshold', null, null, ALL_PROJECTS );
d6e8d8
		$t_project_new = config_get( 'report_bug_threshold' );
d6e8d8
d6e8d8
		$t_file_set = config_get_global( 'set_status_threshold' );
d6e8d8
		foreach ( $t_enum_status as $t_status => $t_status_label) {
d6e8d8
		    if ( ! isset( $t_file_set[$t_status] ) ) {
d6e8d8
		        $t_file_set[$t_status] = config_get_global('update_bug_status_threshold');
d6e8d8
		    }
d6e8d8
		}
d6e8d8
d6e8d8
		$t_global_set = config_get( 'set_status_threshold', null, null, ALL_PROJECTS );
d6e8d8
		foreach ( $t_enum_status as $t_status => $t_status_label) {
d6e8d8
		    if ( ! isset( $t_file_set[$t_status] ) ) {
d6e8d8
		        $t_file_set[$t_status] = config_get('update_bug_status_threshold', null, null, ALL_PROJECTS );
d6e8d8
		    }
d6e8d8
		}
d6e8d8
d6e8d8
		$t_project_set = config_get( 'set_status_threshold' );
d6e8d8
		foreach ( $t_enum_status as $t_status => $t_status_label) {
d6e8d8
		    if ( ! isset( $t_file_set[$t_status] ) ) {
d6e8d8
		        $t_file_set[$t_status] = config_get('update_bug_status_threshold' );
d6e8d8
		    }
d6e8d8
		}
d6e8d8
d6e8d8
		foreach ( $t_enum_status as $t_status => $t_status_label) {
d6e8d8
			echo '' . string_no_break( get_enum_to_string( lang_get( 'status_enum_string' ), $t_status ) ) . '';
d6e8d8
			if ( NEW_ == $t_status ) {
d6e8d8
				$t_level = $t_project_new;
d6e8d8
				$t_can_change = ( $t_access >= config_get_access( 'report_bug_threshold' ) );
d6e8d8
                $t_colour = '';
d6e8d8
                if ( $t_global_new != $t_file_new ) {
d6e8d8
                    $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
d6e8d8
                    if ( $t_can_change ) {
d6e8d8
                        set_overrides( 'report_bug_threshold' );
d6e8d8
                    }
d6e8d8
                }
d6e8d8
                if ( $t_project_new != $t_global_new ) {
d6e8d8
                    $t_colour = ' bgcolor="' . $t_colour_project . '" '; # project overrides
d6e8d8
                    if ( $t_can_change ) {
d6e8d8
                        set_overrides( 'report_bug_threshold' );
d6e8d8
                    }
d6e8d8
                }
d6e8d8
			} else {
d6e8d8
				$t_level = ( isset( $t_project_set[$t_status] ) ? $t_project_set[$t_status] : false );
d6e8d8
				$t_level_global = ( isset( $t_global_set[$t_status] ) ? $t_global_set[$t_status] : false );
d6e8d8
				$t_level_file = ( isset( $t_file_set[$t_status] ) ? $t_file_set[$t_status] : false );
d6e8d8
				$t_can_change = ( $t_access >= config_get_access( 'set_status_threshold' ) );
d6e8d8
                $t_colour = '';
d6e8d8
                if ( $t_level_global != $t_level_file ) {
d6e8d8
                    $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
d6e8d8
                    if ( $t_can_change ) {
d6e8d8
                        set_overrides( 'set_status_threshold' );
d6e8d8
                    }
d6e8d8
                }
d6e8d8
                if ( $t_level != $t_level_global ) {
d6e8d8
                    $t_colour = ' bgcolor="' . $t_colour_project . '" '; # project overrides
d6e8d8
                    if ( $t_can_change ) {
d6e8d8
                        set_overrides( 'set_status_threshold' );
d6e8d8
                    }
d6e8d8
                }
d6e8d8
			}
d6e8d8
			if ( $t_can_change ) {
d6e8d8
				echo '<td' . $t_colour . '><select name="access_change_' . $t_status . '">';
d6e8d8
				print_enum_string_option_list( 'access_levels', $t_level );
d6e8d8
				echo '</select> ';
d6e8d8
			    $t_can_change_flags = true;
d6e8d8
			} else {
d6e8d8
				echo '' . get_enum_to_string( lang_get( 'access_levels_enum_string' ), $t_level ) . '';
d6e8d8
			}
d6e8d8
			echo '' . "\n";
d6e8d8
		}
d6e8d8
	}
d6e8d8
d6e8d8
	echo '

';
d6e8d8
d6e8d8
	# count arcs in and out of each status
d6e8d8
	$t_enum_status = config_get( 'status_enum_string' );
d6e8d8
	$t_status_arr  = get_enum_to_array( $t_enum_status );
d6e8d8
d6e8d8
	$t_extra_enum_status = '0:non-existent,' . $t_enum_status;
d6e8d8
	$t_lang_enum_status = '0:' . lang_get( 'non_existent' ) . ',' . lang_get( 'status_enum_string' );
d6e8d8
	$t_all_status = explode( ',', $t_extra_enum_status);
d6e8d8
d6e8d8
	# gather all versions of the workflow
d6e8d8
	$t_file_workflow = parse_workflow( config_get_global( 'status_enum_workflow' ) );
d6e8d8
	$t_global_workflow = parse_workflow( config_get( 'status_enum_workflow', null, null, ALL_PROJECTS ) );
d6e8d8
	$t_project_workflow = parse_workflow( config_get( 'status_enum_workflow' ) );
d6e8d8
d6e8d8
    # validate the project workflow
d6e8d8
	$t_validation_result = '';
d6e8d8
	foreach ( $t_status_arr as $t_status => $t_label ) {
d6e8d8
		if ( isset( $t_project_workflow['exit'][$t_status][$t_status] ) ) {
d6e8d8
			$t_validation_result .= ''
d6e8d8
							. get_enum_to_string( $t_lang_enum_status, $t_status )
d6e8d8
							. '' . lang_get( 'superfluous' ) . '';
d6e8d8
		}
d6e8d8
	}
d6e8d8
d6e8d8
	# check for entry == 0 without exit == 0, unreachable state
d6e8d8
	foreach ( $t_status_arr as $t_status => $t_status_label) {
d6e8d8
		if ( ( 0 == count( $t_project_workflow['entry'][$t_status] ) ) && ( 0 < count( $t_project_workflow['exit'][$t_status] ) ) ){
d6e8d8
			$t_validation_result .= ''
d6e8d8
							. get_enum_to_string( $t_lang_enum_status, $t_status )
d6e8d8
							. '' . lang_get( 'unreachable' ) . '';
d6e8d8
		}
d6e8d8
	}
d6e8d8
d6e8d8
	# check for exit == 0 without entry == 0, unleaveable state
d6e8d8
	foreach ( $t_status_arr as $t_status => $t_status_label ) {
d6e8d8
		if ( ( 0 == count( $t_project_workflow['exit'][$t_status] ) ) && ( 0 < count( $t_project_workflow['entry'][$t_status] ) ) ){
d6e8d8
			$t_validation_result .= ''
d6e8d8
							. get_enum_to_string( $t_lang_enum_status, $t_status )
d6e8d8
							. '' . lang_get( 'no_exit' ) . '';
d6e8d8
		}
d6e8d8
	}
d6e8d8
d6e8d8
	# check for exit == 0 and entry == 0, isolated state
d6e8d8
	foreach ( $t_status_arr as $t_status => $t_status_label ) {
d6e8d8
		if ( ( 0 == count( $t_project_workflow['exit'][$t_status] ) ) && ( 0 == count( $t_project_workflow['entry'][$t_status] ) ) ){
d6e8d8
			$t_validation_result .= ''
d6e8d8
							. get_enum_to_string( $t_lang_enum_status, $t_status )
d6e8d8
							. '' . lang_get( 'unreachable' ) . '
' . lang_get( 'no_exit' ) . '';
d6e8d8
		}
d6e8d8
	}
d6e8d8
d6e8d8
	$t_colour_project = config_get( 'colour_project');
d6e8d8
	$t_colour_global = config_get( 'colour_global');
d6e8d8
d6e8d8
	echo "<form name=\"workflow_config_action\" method=\"post\" action=\"manage_config_workflow_set.php\">\n";
d6e8d8
d6e8d8
	if ( ALL_PROJECTS == $t_project ) {
d6e8d8
	    $t_project_title = lang_get( 'config_all_projects' );
d6e8d8
	} else {
d6e8d8
	    $t_project_title = sprintf( lang_get( 'config_project' ) , string_display( project_get_name( $t_project ) ) );
d6e8d8
	}
d6e8d8
	echo '

' . $t_project_title . '

' . "\n";
d6e8d8
	echo '

' . lang_get( 'colour_coding' ) . '
';

d6e8d8
	if ( ALL_PROJECTS <> $t_project ) {
d6e8d8
	    echo '' . lang_get( 'colour_project' ) .'
';
d6e8d8
	}
d6e8d8
	echo '' . lang_get( 'colour_global' ) . '

';
d6e8d8
d6e8d8
	# show the settings used to derive the table
d6e8d8
	threshold_begin( lang_get( 'workflow_thresholds' ) );
d6e8d8
	if ( ! is_array( config_get( 'bug_submit_status' ) ) ) {
d6e8d8
		threshold_row( 'bug_submit_status' );
d6e8d8
	}
d6e8d8
	threshold_row( 'bug_resolved_status_threshold' );
d6e8d8
	threshold_row( 'bug_reopen_status' );
d6e8d8
	threshold_end();
d6e8d8
	echo '
';
d6e8d8
d6e8d8
	if ( '' <> $t_validation_result ) {
d6e8d8
		echo '';
d6e8d8
		echo '' . strtoupper( lang_get( 'validation' ) ) . '' . "\n";
d6e8d8
		echo '' . lang_get( 'status' ) . '';
d6e8d8
		echo '' . lang_get( 'comment' ) . '';
d6e8d8
		echo "\n";
d6e8d8
		echo $t_validation_result;
d6e8d8
		echo '

';
d6e8d8
	}
d6e8d8
d6e8d8
	# display the graph as a matrix
d6e8d8
	section_begin( lang_get( 'workflow' ) );
d6e8d8
	foreach ( $t_status_arr as $t_from_status => $t_from_label) {
d6e8d8
		capability_row( $t_from_status );
d6e8d8
	}
d6e8d8
	section_end();
d6e8d8
d6e8d8
	if ( $t_can_change_workflow ) {
d6e8d8
		echo '

' . lang_get( 'workflow_change_access' ) . ':';

d6e8d8
		echo '<select name="workflow_access">';
d6e8d8
		print_enum_string_option_list( 'access_levels', config_get_access( 'status_enum_workflow' ) );
d6e8d8
		echo '</select> 


';
d6e8d8
	}
d6e8d8
d6e8d8
	# display the access levels required to move an issue
d6e8d8
	access_begin( lang_get( 'access_levels' ) );
d6e8d8
	access_row( );
d6e8d8
	section_end();
d6e8d8
d6e8d8
	if ( $t_access >= config_get_access( 'set_status_threshold' ) ) {
d6e8d8
		echo '

' . lang_get( 'access_change_access' ) . ':';

d6e8d8
		echo '<select name="status_access">';
d6e8d8
		print_enum_string_option_list( 'access_levels', config_get_access( 'set_status_threshold' ) );
d6e8d8
		echo '</select> 


';
d6e8d8
	}
d6e8d8
d6e8d8
	if ( $t_can_change_flags ) {
d6e8d8
		echo "<input type=\"submit\" class=\"button\" value=\"" . lang_get( 'change_configuration' ) . "\" />\n";
d6e8d8
		echo "</form>\n";
d6e8d8
d6e8d8
        if ( 0 < count( $t_overrides ) ) {
d6e8d8
            echo "
<form name=\"mail_config_action\" method=\"post\" action=\"manage_config_revert.php\">\n";
d6e8d8
            echo "<input name=\"revert\" type=\"hidden\" value=\"" . implode( ',', $t_overrides ) . "\"></input>";
d6e8d8
            echo "<input name=\"project\" type=\"hidden\" value=\"$t_project\"></input>";
d6e8d8
            echo "<input name=\"return\" type=\"hidden\" value=\"" . $_SERVER['PHP_SELF'] ."\"></input>";
d6e8d8
            echo "
d6e8d8
            if ( ALL_PROJECTS == $t_project ) {
d6e8d8
                echo lang_get( 'revert_to_system' );
d6e8d8
            } else {
d6e8d8
                echo lang_get( 'revert_to_all_project' );
d6e8d8
            }
d6e8d8
            echo "\" />\n";
d6e8d8
            echo "</form>\n";
d6e8d8
        }
d6e8d8
d6e8d8
	} else {
d6e8d8
        echo "</form>\n";
d6e8d8
    }
d6e8d8
d6e8d8
	html_page_bottom1( __FILE__ );
d6e8d8
?>