/**
 * @param $amount_stat_columns
 * @param $print_flag
 * @param $version
 * @param $version_spec_bugs
 * @param $null_issues_flag
 */
function print_issue_amount($amount_stat_columns, $print_flag, $version, $version_spec_bugs, $null_issues_flag)
{
    if (plugin_config_get('ShowSpecStatCols') == ON) {
        for ($column_index = 1; $column_index <= $amount_stat_columns; $column_index++) {
            $column_spec_status = plugin_config_get('CStatSelect' . $column_index);
            $column_spec_bug_count = 0;
            if (!$null_issues_flag) {
                foreach ($version_spec_bugs as $version_spec_bug) {
                    if (bug_get_field($version_spec_bug, 'status') == $column_spec_status) {
                        $column_spec_bug_count++;
                    }
                }
                echo '<td class="status" bgcolor="' . get_status_color($column_spec_status) . '">';
                print_amount($print_flag, $column_spec_bug_count, $version);
            } else {
                echo '<td class="status" bgcolor="' . get_status_color($column_spec_status) . '">0';
            }
            echo '</td>';
        }
    }
    $version_spec_bug_count = count($version_spec_bugs);
    echo '<td class="status">';
    print_amount($print_flag, $version_spec_bug_count, $version);
    echo '</td>';
}
Ejemplo n.º 2
0
Archivo: code.php Proyecto: bas2/trav
function print_content2($checkindate, $locposttext)
{
    $ret = get_content($checkindate, $locposttext);
    $cntr = 0;
    $ajax = '<table><tr class="daterow">';
    $checkindate_mysql = implode('-', array_reverse(explode('/', "{$checkindate}")));
    # Convert to YYYY-MM-DD.
    for ($i = -3; $i < 4; $i++) {
        # Dates.
        // Check in date should not be less than three days from current date
        $i2 = $i + 3;
        $inthreedays = new Datetime("+ {$i2} days", new DateTimeZone('Europe/London'));
        $dayofweek = new DateTime("{$checkindate_mysql} {$i} days", new DateTimeZone('Europe/London'));
        $diff = $inthreedays->diff($dayofweek);
        if ($diff->format('%R%a') <= 0) {
            $dayofweek = $inthreedays;
        }
        // End if.
        $ajax .= '<th>' . substr($dayofweek->format('D '), 0, 1) . ' ' . $dayofweek->format('d') . '</th>';
        #
    }
    // End for.
    $ajax .= '</tr>';
    foreach ($ret as $test => $test2) {
        if ($cntr < 8) {
            # First location.
            if ($cntr == 0) {
                $ajax .= "<tr><th colspan=\"7\">{$test2}</th></tr>";
            }
            # Location.
            if ($cntr > 0 && $cntr < 7) {
                $ajax .= print_amount($test2);
            }
            if ($cntr == 7) {
                # Get second location.
                $test3 = $test2;
                list($lastamount, $secondlocation) = explode('&nbsp;', $test3);
                $ajax .= print_amount($lastamount) . '</tr>';
            }
            // End if first location.
        } else {
            if ($cntr < 15) {
                # Location #2
                list($ajax2, $nextlocation) = get_row(15, $cntr, $secondlocation, $test2);
                $ajax .= $ajax2;
            } else {
                if ($cntr < 22) {
                    # Location #3
                    list($ajax2, $nextlocation) = get_row(22, $cntr, $nextlocation, $test2);
                    $ajax .= $ajax2;
                } else {
                    if ($cntr < 29) {
                        # Location #4
                        list($ajax2, $nextlocation) = get_row(29, $cntr, $nextlocation, $test2);
                        $ajax .= $ajax2;
                    } else {
                        if ($cntr < 36) {
                            # Location #5
                            list($ajax2, $nextlocation) = get_row(36, $cntr, $nextlocation, $test2);
                            $ajax .= $ajax2;
                        } else {
                            if ($cntr < 43) {
                                # Location #6
                                list($ajax2, $nextlocation) = get_row(43, $cntr, $nextlocation, $test2);
                                $ajax .= $ajax2;
                            } else {
                                if ($cntr < 50) {
                                    # Location #7
                                    list($ajax2, $nextlocation) = get_row(50, $cntr, $nextlocation, $test2);
                                    $ajax .= $ajax2;
                                } else {
                                    if ($cntr < 57) {
                                        # Location #8
                                        list($ajax2, $nextlocation) = get_row(57, $cntr, $nextlocation, $test2);
                                        $ajax .= $ajax2;
                                    } else {
                                        if ($cntr < 64) {
                                            # Location #9
                                            list($ajax2, $nextlocation) = get_row(64, $cntr, $nextlocation, $test2);
                                            $ajax .= $ajax2;
                                        } else {
                                            if ($cntr < 71) {
                                                # Location #10
                                                list($ajax2, $nextlocation) = get_row(71, $cntr, $nextlocation, $test2);
                                                $ajax .= $ajax2;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        // End if
        $cntr++;
    }
    // End foreach.
    $ajax .= '</table>';
    return "{$checkindate}==||=={$locposttext}==||==" . $ajax;
    # Output to handle via ajax.
}