Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bdd4325

Browse files
committedApr 6, 2013
Fix up config_workflow_page to work without using lang_get
1 parent 763a22c commit bdd4325

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed
 

‎manage/config_workflow_page.php

+28-13
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ function access_row() {
372372
$t_status_arr = MantisEnum::getAssocArrayIndexedByValues( $t_enum_status );
373373

374374
$t_extra_enum_status = '0:non-existent,' . $t_enum_status;
375-
$t_lang_enum_status = '0:' . _( 'non-existent' ) . ',' . lang_get( 'status_enum_string' );
376375
$t_all_status = explode( ',', $t_extra_enum_status);
377376

378377
# gather all versions of the workflow
@@ -384,36 +383,52 @@ function access_row() {
384383
$t_validation_result = '';
385384
foreach ( $t_status_arr as $t_status => $t_label ) {
386385
if ( isset( $t_project_workflow['exit'][$t_status][$t_status] ) ) {
387-
$t_validation_result .= '<tr><td>'
388-
. MantisEnum::getLabel( $t_lang_enum_status, $t_status )
389-
. '</td><td bgcolor="#FFED4F">' . _( 'Arc from status to itself is implied, and need not be given explicitly' ) . '</td>';
386+
$t_validation_result .= '<tr><td>';
387+
if( $t_status == 0 ) {
388+
$t_validation_result .= _( '0:non-existent' );
389+
} else {
390+
$t_validation_result .= get_enum_element( 'status', $t_status );
391+
}
392+
$t_validation_result .= '</td><td bgcolor="#FFED4F">' . _( 'Arc from status to itself is implied, and need not be given explicitly' ) . '</td>';
390393
}
391394
}
392395

393396
# check for entry == 0 without exit == 0, unreachable state
394397
foreach ( $t_status_arr as $t_status => $t_status_label) {
395398
if ( ( 0 == count( $t_project_workflow['entry'][$t_status] ) ) && ( 0 < count( $t_project_workflow['exit'][$t_status] ) ) ){
396-
$t_validation_result .= '<tr><td>'
397-
. MantisEnum::getLabel( $t_lang_enum_status, $t_status )
398-
. '</td><td bgcolor="#FF0088">' . _( 'You cannot move an issue into this status' ) . '</td>';
399+
$t_validation_result .= '<tr><td>';
400+
if( $t_status == 0 ) {
401+
$t_validation_result .= _( '0:non-existent' );
402+
} else {
403+
$t_validation_result .= get_enum_element( 'status', $t_status );
404+
}
405+
$t_validation_result .= '</td><td bgcolor="#FF0088">' . _( 'You cannot move an issue into this status' ) . '</td>';
399406
}
400407
}
401408

402409
# check for exit == 0 without entry == 0, unleaveable state
403410
foreach ( $t_status_arr as $t_status => $t_status_label ) {
404411
if ( ( 0 == count( $t_project_workflow['exit'][$t_status] ) ) && ( 0 < count( $t_project_workflow['entry'][$t_status] ) ) ){
405-
$t_validation_result .= '<tr><td>'
406-
. MantisEnum::getLabel( $t_lang_enum_status, $t_status )
407-
. '</td><td bgcolor="#FF0088">' . _( 'You cannot move an issue out of this status' ) . '</td>';
412+
$t_validation_result .= '<tr><td>';
413+
if( $t_status == 0 ) {
414+
$t_validation_result .= _( '0:non-existent' );
415+
} else {
416+
$t_validation_result .= get_enum_element( 'status', $t_status );
417+
}
418+
$t_validation_result .= '</td><td bgcolor="#FF0088">' . _( 'You cannot move an issue out of this status' ) . '</td>';
408419
}
409420
}
410421

411422
# check for exit == 0 and entry == 0, isolated state
412423
foreach ( $t_status_arr as $t_status => $t_status_label ) {
413424
if ( ( 0 == count( $t_project_workflow['exit'][$t_status] ) ) && ( 0 == count( $t_project_workflow['entry'][$t_status] ) ) ){
414-
$t_validation_result .= '<tr><td>'
415-
. MantisEnum::getLabel( $t_lang_enum_status, $t_status )
416-
. '</td><td bgcolor="#FF0088">' . _( 'You cannot move an issue into this status' ) . '<br />' . _( 'You cannot move an issue out of this status' ) . '</td>';
425+
$t_validation_result .= '<tr><td>';
426+
if( $t_status == 0 ) {
427+
$t_validation_result .= _( '0:non-existent' );
428+
} else {
429+
$t_validation_result .= get_enum_element( 'status', $t_status );
430+
}
431+
$t_validation_result .= '</td><td bgcolor="#FF0088">' . _( 'You cannot move an issue into this status' ) . '<br />' . _( 'You cannot move an issue out of this status' ) . '</td>';
417432
}
418433
}
419434

0 commit comments

Comments
 (0)
Please sign in to comment.