Exemple #1
0
function html_status_legend()
{
    print '<br />';
    print '<table class="width100" cellspacing="1">';
    print '<tr>';
    $t_arr = explode_enum_string(config_get('status_enum_string'));
    $enum_count = count($t_arr);
    $width = (int) (100 / $enum_count);
    for ($i = 0; $i < $enum_count; $i++) {
        $t_s = explode_enum_arr($t_arr[$i]);
        $t_val = get_enum_element('status', $t_s[0]);
        $t_color = get_status_color($t_s[0]);
        print "<td class=\"small-caption\" width=\"{$width}%\" bgcolor=\"{$t_color}\">{$t_val}</td>";
    }
    print '</tr>';
    print '</table>';
    if (ON == config_get('status_percentage_legend')) {
        html_status_percentage_legend();
    }
}
Exemple #2
0
/**
 * Print the color legend for the status colors
 * @param string
 * @return null
 */
function html_status_legend()
{
    # Don't show the legend if only one status is selected by the current filter
    $t_current_filter = current_user_get_bug_filter();
    if ($t_current_filter === false) {
        $t_current_filter = filter_get_default();
    }
    $t_simple_filter = $t_current_filter['_view_type'] == 'simple';
    if ($t_simple_filter) {
        if (!filter_field_is_any($t_current_filter[FILTER_PROPERTY_STATUS][0])) {
            return null;
        }
    }
    $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]);
            }
        }
    }
    # Remove status values that won't appear as a result of the current filter
    foreach ($t_status_array as $t_status => $t_name) {
        if ($t_simple_filter) {
            if (!filter_field_is_none($t_current_filter[FILTER_PROPERTY_HIDE_STATUS][0]) && $t_status >= $t_current_filter[FILTER_PROPERTY_HIDE_STATUS][0]) {
                unset($t_status_array[$t_status]);
            }
        } else {
            if (!in_array(META_FILTER_ANY, $t_current_filter[FILTER_PROPERTY_STATUS]) && !in_array($t_status, $t_current_filter[FILTER_PROPERTY_STATUS])) {
                unset($t_status_array[$t_status]);
            }
        }
    }
    # If there aren't at least two statuses showable by the current filter,
    # don't draw the status bar
    if (count($t_status_array) <= 1) {
        return null;
    }
    echo '<br />';
    echo '<table class="status-legend width100" cellspacing="1">';
    echo '<tr>';
    # draw the status bar
    $width = (int) (100 / count($t_status_array));
    $t_status_enum_string = config_get('status_enum_string');
    foreach ($t_status_array as $t_status => $t_name) {
        $t_val = $t_status_names[$t_status];
        $t_status_label = MantisEnum::getLabel($t_status_enum_string, $t_status);
        echo "<td class=\"small-caption {$t_status_label}-color\">{$t_val}</td>";
    }
    echo '</tr>';
    echo '</table>';
    if (ON == config_get('status_percentage_legend')) {
        html_status_percentage_legend();
    }
}
<div align="center">
<table class="hide" border="0" cellspacing="3" cellpadding="0">

<?php 
if (STATUS_LEGEND_POSITION_TOP == config_get('status_legend_position')) {
    echo '<tr>';
    echo '<td colspan="2">';
    html_status_legend();
    echo '</td>';
    echo '</tr>';
}
if (ON == config_get('status_percentage_legend')) {
    echo '<tr>';
    echo '<td colspan="2">';
    html_status_percentage_legend();
    echo '</td>';
    echo '</tr>';
}
?>

<?php 
$t_number_of_boxes = count($t_boxes);
$t_boxes_position = config_get('my_view_boxes_fixed_position');
$t_counter = 0;
while (list($t_box_title, $t_box_display) = each($t_boxes)) {
    # don't display bugs that are set as 0
    if ($t_box_display == 0) {
        $t_number_of_boxes = $t_number_of_boxes - 1;
    } else {
        if ($t_box_title == 'assigned' && (current_user_is_anonymous() or user_get_assigned_open_bug_count($t_current_user_id, $t_project_id) == 0)) {
Exemple #4
0
/**
 * 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();
    }
}
Exemple #5
0
/**
 * Print the color legend for the status colors at the requested position
 * @param int  $p_display_position   STATUS_LEGEND_POSITION_TOP or STATUS_LEGEND_POSITION_BOTTOM
 * @param bool $p_restrict_by_filter If true, only display status visible in current filter
 * @return void
 */
function html_status_legend($p_display_position, $p_restrict_by_filter = false)
{
    if ($p_restrict_by_filter) {
        # Don't show the legend if only one status is selected by the current filter
        $t_current_filter = current_user_get_bug_filter();
        if ($t_current_filter === false) {
            $t_current_filter = filter_get_default();
        }
        $t_simple_filter = $t_current_filter['_view_type'] == 'simple';
        if ($t_simple_filter) {
            if (!filter_field_is_any($t_current_filter[FILTER_PROPERTY_STATUS][0])) {
                return;
            }
        }
    }
    $t_status_array = MantisEnum::getAssocArrayIndexedByValues(config_get('status_enum_string'));
    $t_status_names = MantisEnum::getAssocArrayIndexedByValues(lang_get('status_enum_string'));
    # 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]);
            }
        }
    }
    if ($p_restrict_by_filter) {
        # Remove status values that won't appear as a result of the current filter
        foreach ($t_status_array as $t_status => $t_name) {
            if ($t_simple_filter) {
                if (!filter_field_is_none($t_current_filter[FILTER_PROPERTY_HIDE_STATUS][0]) && $t_status >= $t_current_filter[FILTER_PROPERTY_HIDE_STATUS][0]) {
                    unset($t_status_array[$t_status]);
                }
            } else {
                if (!in_array(META_FILTER_ANY, $t_current_filter[FILTER_PROPERTY_STATUS]) && !in_array($t_status, $t_current_filter[FILTER_PROPERTY_STATUS])) {
                    unset($t_status_array[$t_status]);
                }
            }
        }
        # If there aren't at least two statuses showable by the current filter,
        # don't draw the status bar
        if (count($t_status_array) <= 1) {
            return;
        }
    }
    # Display the legend
    $t_legend_position = config_get('status_legend_position') & $p_display_position;
    if (STATUS_LEGEND_POSITION_NONE != $t_legend_position) {
        echo '<br />';
        echo '<table class="status-legend width100" cellspacing="1">';
        echo '<tr>';
        # draw the status bar
        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];
            echo '<td class="small-caption status-legend-width ' . html_get_status_css_class($t_status) . '">' . $t_val . '</td>';
        }
        echo '</tr>';
        echo '</table>';
        if (ON == config_get('status_percentage_legend')) {
            html_status_percentage_legend();
        }
    }
    if (STATUS_LEGEND_POSITION_TOP == $t_legend_position) {
        echo '<br />';
    }
}