@@ -372,7 +372,6 @@ function access_row() {
372
372
$ t_status_arr = MantisEnum::getAssocArrayIndexedByValues ( $ t_enum_status );
373
373
374
374
$ t_extra_enum_status = '0:non-existent, ' . $ t_enum_status ;
375
- $ t_lang_enum_status = '0: ' . _ ( 'non-existent ' ) . ', ' . lang_get ( 'status_enum_string ' );
376
375
$ t_all_status = explode ( ', ' , $ t_extra_enum_status );
377
376
378
377
# gather all versions of the workflow
@@ -384,36 +383,52 @@ function access_row() {
384
383
$ t_validation_result = '' ;
385
384
foreach ( $ t_status_arr as $ t_status => $ t_label ) {
386
385
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> ' ;
390
393
}
391
394
}
392
395
393
396
# check for entry == 0 without exit == 0, unreachable state
394
397
foreach ( $ t_status_arr as $ t_status => $ t_status_label ) {
395
398
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> ' ;
399
406
}
400
407
}
401
408
402
409
# check for exit == 0 without entry == 0, unleaveable state
403
410
foreach ( $ t_status_arr as $ t_status => $ t_status_label ) {
404
411
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> ' ;
408
419
}
409
420
}
410
421
411
422
# check for exit == 0 and entry == 0, isolated state
412
423
foreach ( $ t_status_arr as $ t_status => $ t_status_label ) {
413
424
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> ' ;
417
432
}
418
433
}
419
434
0 commit comments