Skip to content

Commit

Permalink
missed a corner case in fix for 0004537: "Change Status To" shows @@ …
Browse files Browse the repository at this point in the history
…sometimes

 - allow workflow for a state not to be defined
 - extra current status values showed up in view.php


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2985 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
thraxisp committed Sep 23, 2004
1 parent 0846498 commit 498f87a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions core/print_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: print_api.php,v 1.101 2004-09-23 21:22:12 thraxisp Exp $
# $Id: print_api.php,v 1.102 2004-09-23 22:04:51 thraxisp Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -601,15 +601,21 @@ function get_status_option_list( $p_user_auth = 0, $p_current_value = 0, $p_show
$t_arr = explode_enum_string( $t_config_var_value );
} else {
# workflow defined - find allowed states
$t_arr = explode_enum_string( $t_enum_workflow[$p_current_value] );
if ( isset( $t_enum_workflow[$p_current_value] ) ) {
$t_arr = explode_enum_string( $t_enum_workflow[$p_current_value] );
}else{
# workflow was not set for this status, this shouldn't happen
$t_arr = explode_enum_string( $t_config_var_value );
}
}

$t_enum_count = count( $t_arr );
$t_enum_list = array();

for ( $i = 0; $i < $t_enum_count; $i++ ) {
$t_elem = explode_enum_arr( $t_arr[$i] );
if ( $p_user_auth >= access_get_status_threshold( $t_elem[0] ) ) {
if ( ( $p_user_auth >= access_get_status_threshold( $t_elem[0] ) ) &&
( ! ( ( false == $p_show_current ) && ( $p_current_value == $t_elem[0] ) ) ) ) {
$t_enum_list[$t_elem[0]] = get_enum_element( 'status', $t_elem[0] );
}
} # end for
Expand Down

0 comments on commit 498f87a

Please sign in to comment.