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