Ejemplo n.º 1
0
function summary_print_by_date($p_date_array)
{
    $arr_count = count($p_date_array);
    foreach ($p_date_array as $t_days) {
        $t_new_count = summary_new_bug_count_by_date($t_days);
        $t_resolved_count = summary_resolved_bug_count_by_date($t_days);
        $t_start_date = mktime(0, 0, 0, date('m'), date('d') - $t_days, date('Y'));
        $t_new_bugs_link = '<a class="subtle" href="' . config_get('bug_count_hyperlink_prefix') . '&amp;' . FILTER_PROPERTY_FILTER_BY_DATE . '=on&amp;' . FILTER_PROPERTY_START_YEAR . '=' . date('Y', $t_start_date) . '&amp;' . FILTER_PROPERTY_START_MONTH . '=' . date('m', $t_start_date) . '&amp;' . FILTER_PROPERTY_START_DAY . '=' . date('d', $t_start_date) . '&amp;' . FILTER_PROPERTY_HIDE_STATUS_ID . '=">';
        print "<tr " . helper_alternate_class() . ">\n";
        print "    <td width=\"50%\">" . $t_days . "</td>\n";
        if ($t_new_count > 0) {
            print "    <td class=\"right\">{$t_new_bugs_link}{$t_new_count}</a></td>\n";
        } else {
            print "    <td class=\"right\">{$t_new_count}</td>\n";
        }
        print "    <td class=\"right\">{$t_resolved_count}</td>\n";
        $t_balance = $t_new_count - $t_resolved_count;
        $t_style = '';
        if ($t_balance > 0) {
            # we are talking about bugs: a balance > 0 is "negative" for the project...
            $t_style = " negative";
            $t_balance = sprintf('%+d', $t_balance);
            # "+" modifier added in PHP >= 4.3.0
        } else {
            if ($t_balance < 0) {
                $t_style = ' positive';
                $t_balance = sprintf('%+d', $t_balance);
            }
        }
        print "\n<td class=\"right{$t_style}\">{$t_balance}</td>\n";
        print "</tr>\n";
    }
    # end foreach
}
Ejemplo n.º 2
0
/**
 * This function shows the number of bugs submitted in the last X days
 *
 * @param array $p_date_array An array of integers representing days is passed in.
 * @return void
 */
function summary_print_by_date(array $p_date_array)
{
    foreach ($p_date_array as $t_days) {
        $t_new_count = summary_new_bug_count_by_date($t_days);
        $t_resolved_count = summary_resolved_bug_count_by_date($t_days);
        $t_start_date = mktime(0, 0, 0, date('m'), date('d') - $t_days, date('Y'));
        $t_new_bugs_link = '<a class="subtle" href="' . config_get('bug_count_hyperlink_prefix') . '&amp;' . FILTER_PROPERTY_FILTER_BY_DATE . '=on&amp;' . FILTER_PROPERTY_START_YEAR . '=' . date('Y', $t_start_date) . '&amp;' . FILTER_PROPERTY_START_MONTH . '=' . date('m', $t_start_date) . '&amp;' . FILTER_PROPERTY_START_DAY . '=' . date('d', $t_start_date) . '&amp;' . FILTER_PROPERTY_HIDE_STATUS . '=">';
        echo '<tr>' . "\n";
        echo '    <td class="width50">' . $t_days . '</td>' . "\n";
        if ($t_new_count > 0) {
            echo '    <td class="right">' . $t_new_bugs_link . $t_new_count . '</a></td>' . "\n";
        } else {
            echo '    <td class="right">' . $t_new_count . '</td>' . "\n";
        }
        echo '    <td class="right">' . $t_resolved_count . '</td>' . "\n";
        $t_balance = $t_new_count - $t_resolved_count;
        $t_style = '';
        if ($t_balance > 0) {
            # we are talking about bugs: a balance > 0 is "negative" for the project...
            $t_style = ' negative';
            $t_balance = sprintf('%+d', $t_balance);
            # "+" modifier added in PHP >= 4.3.0
        } else {
            if ($t_balance < 0) {
                $t_style = ' positive';
                $t_balance = sprintf('%+d', $t_balance);
            }
        }
        echo '    <td class="right' . $t_style . '">' . $t_balance . "</td>\n";
        echo '</tr>' . "\n";
    }
}
Ejemplo n.º 3
0
function summary_print_by_date($p_date_array)
{
    $arr_count = count($p_date_array);
    foreach ($p_date_array as $t_days) {
        $t_new_count = summary_new_bug_count_by_date($t_days);
        $t_resolved_count = summary_resolved_bug_count_by_date($t_days);
        $t_start_date = mktime(0, 0, 0, date('m'), date('d') - $t_days, date('Y'));
        $t_new_bugs_link = '<a class="subtle" href="' . config_get('bug_count_hyperlink_prefix') . '&amp;do_filter_by_date=on&amp;start_year=' . date('Y', $t_start_date) . '&amp;start_month=' . date('m', $t_start_date) . '&amp;start_day=' . date('d', $t_start_date) . '&amp;hide_status=">';
        print "<tr " . helper_alternate_class() . ">\n";
        print "    <td width=\"50%\">" . $t_days . "</td>\n";
        if ($t_new_count > 0) {
            print "    <td class=\"right\">{$t_new_bugs_link}{$t_new_count}</a></td>\n";
        } else {
            print "    <td class=\"right\">{$t_new_count}</td>\n";
        }
        print "    <td class=\"right\">{$t_resolved_count}</td>\n";
        $t_balance = $t_new_count - $t_resolved_count;
        $t_style = "";
        if ($t_balance > 0) {
            # we are talking about bugs: a balance > 0 is "negative" for the project...
            $t_style = " negative";
            $t_balance = sprintf('%+d', $t_balance);
            # "+" modifier added in PHP >= 4.3.0
        } elseif ($t_balance < 0) {
            $t_style = " positive";
            $t_balance = sprintf('%+d', $t_balance);
        }
        print "\n<td class=\"right{$t_style}\">{$t_balance}</td>\n";
        print "</tr>\n";
    }
    # end foreach
}