Code: Select all
view_all_bug_page.php
Thank you very much in advance!!!!
Moderators: Developer, Contributor
Code: Select all
view_all_bug_page.php
Code: Select all
status_enum_string
Code: Select all
/**
* Print the color legend for the status colors
* @param string
* @return null
*/
function html_status_legend() {
echo '<br />';
echo '<table class="width100" cellspacing="1">';
echo '<tr>';
$t_status_array = MantisEnum::getAssocArrayIndexedByValues( config_get( 'status_enum_string' ) );
$t_status_names = MantisEnum::getAssocArrayIndexedByValues( lang_get( 'status_enum_string' ) );
$enum_count = count( $t_status_array );
# read through the list and eliminate unused ones for the selected project
# assumes that all status are are in the enum array
$t_workflow = config_get( 'status_enum_workflow' );
if( !empty( $t_workflow ) ) {
foreach( $t_status_array as $t_status => $t_name ) {
if( !isset( $t_workflow[$t_status] ) ) {
# drop elements that are not in the workflow
unset( $t_status_array[$t_status] );
}
}
}
# draw the status bar
$width = (int)( 100 / count( $t_status_array ) );
foreach( $t_status_array as $t_status => $t_name ) {
$t_val = isset( $t_status_names[$t_status] ) ? $t_status_names[$t_status] : $t_status_array[$t_status];
$t_color = get_status_color( $t_status );
echo "<td class=\"small-caption\" width=\"$width%\" bgcolor=\"$t_color\">$t_val</td>";
}
echo '</tr>';
echo '</table>';
if( ON == config_get( 'status_percentage_legend' ) ) {
html_status_percentage_legend();
}
}