示例#1
0
    $output .= "<hr noshade size=\"1\">\n\n";
    // render obsolete translated level 2
    $output .= "<a name=\"obsolete\"></a><h3>Obsolete Translated PO files</h3>\n";
    $result = @mysql_query("SELECT package,filename,translated,fuzzy,untranslated FROM stats WHERE team='{$teamcode}' " . "AND rev='{$rev}' AND have_po=1 AND have_pot=0 " . "ORDER BY package", $dbh) or die("SQL error: partial level 2 - 3");
    $package = "";
    $count = 0;
    while ($row = @mysql_fetch_array($result)) {
        if ($package != $row['package']) {
            if ($package != "") {
                $output .= "</table>\n\n";
            }
            $output .= "<h4><a href=\"../../" . $teamcode . "/" . $row['package'] . "/index.php\">" . $row['package'] . "</a></h4>\n" . "<table border=\"0\" cellpadding=\"2\">\n" . "<tr bgcolor=\"#f0f0ff\"><td><i>filename</i></td><td><i>translated</i></td>" . "<td><i>fuzzy</i></td><td><i>untranslated</i></td></tr>\n";
            $package = $row['package'];
        }
        $filename = preg_replace('/\\.po$/', "", $row['filename']);
        $cvsurl = cvsweburl($rev, $teamcode, $package, $row['filename']);
        $output .= "<tr bgcolor=\"#f8f8f8\"><td><a href=\"{$cvsurl}\">{$filename}</a></td><td>" . $row['translated'] . "</td><td>" . $row['fuzzy'] . "</td><td>" . $row['untranslated'] . "</td></tr>\n";
        $count++;
    }
    if ($count == 0) {
        $output .= "<table border=\"0\" cellpadding=\"2\">\n" . "<tr><td>There's no files available.</td></tr>\n";
    }
    $output .= "</table>\n\n";
    $tplp4->assign(array(TXT_TEAMNAME => $teamname, TXT_TEAMCODE => $teamcode, TXT_TEAMCODE2 => strtoupper($teamcode), TEAMLIST => $teamlist, CONTENT => $output));
    $tplp4->parse(MAIN, "level2partial");
    writefile("{$outdir}/{$rev}/partial/{$teamcode}/index.php", $tplp4->fetch());
}
// render HTML/PHP pages by KDE package for level 2 & 3
foreach ($m_packages as $package) {
    debug(10, "render level2 for '{$package}' package");
    $output = "";
示例#2
0
function byteam_line3($file, $error, $translated, $fuzzy, $untranslated, $teamcode, $package, $type)
{
    global $rev, $okbg, $okbg2, $errorbg, $errorbg2, $nopotbg, $nopotbg2;
    $total = $translated + $fuzzy + $untranslated;
    // color by with POT or without POT
    if ($type == 0) {
        $bgcolor = $okbg;
        $bgcolor2 = $okbg2;
    } else {
        $bgcolor = $nopotbg;
        $bgcolor2 = $nopotbg2;
    }
    // color by error
    if ($error == 1) {
        $bgcolor = $errorbg;
        $bgcolor2 = $errorbg2;
    }
    $cvsurl = cvsweburl($rev, $teamcode, $package, $file);
    if ($total > 0) {
        $ptranslated = (int) (100 * $translated / $total);
        $pfuzzy = (int) (100 * $fuzzy / $total);
        $puntranslated = 100 - $pfuzzy - $ptranslated;
        $ptranslated = 2 * $ptranslated;
        $pfuzzy = 2 * $pfuzzy;
        $puntranslated = 2 * $puntranslated;
        $ptranslated2 = sprintf("%2.2f", 100 * $translated / $total);
        $pfuzzy2 = sprintf("%2.2f", 100 * $fuzzy / $total);
        $puntranslated2 = sprintf("%2.2f", 100 - $pfuzzy2 - $ptranslated2);
        $output = "<tr bgcolor=\"{$bgcolor}\">\n" . "  <td><font size=\"2\"><a href=\"{$cvsurl}\">{$file}</a></font></td>\n" . "  <td align=\"right\"><font size=\"2\">{$translated}</font></td>\n" . "  <td bgcolor=\"{$bgcolor2}\" align=\"right\"><font size=\"2\">{$ptranslated2}</font></td>\n" . "  <td align=\"right\"><font size=\"2\">{$fuzzy}</font></td>\n" . "  <td bgcolor=\"{$bgcolor2}\" align=\"right\"><font size=\"2\">{$pfuzzy2}</font></td>\n" . "  <td align=\"right\"><font size=\"2\">{$untranslated}</font></td>\n" . "  <td bgcolor=\"{$bgcolor2}\" align=\"right\"><font size=\"2\">{$puntranslated2}</font></td>\n" . "  <td align=\"right\"><font size=\"2\">{$total}</font></td>\n" . "  <td>";
        if ($ptranslated == 200) {
            $output .= "<img src=\"../../../img/bar0.png\" height=\"15\" width=\"200\">";
        } else {
            if ($pfuzzy == 200) {
                $output .= "<img src=\"../../../img/bar4.png\" height=\"15\" width=\"200\">";
            } else {
                if ($puntranslated == 200) {
                    $output .= "<img src=\"../../../img/bar1.png\" height=\"15\" width=\"200\">";
                } else {
                    $output .= "<img src=\"../../../img/bar0.png\" height=\"15\" width=\"{$ptranslated}\">" . "<img src=\"../../../img/bar4.png\" height=\"15\" width=\"{$pfuzzy}\">" . "<img src=\"../../../img/bar1.png\" height=\"15\" width=\"{$puntranslated}\">";
                }
            }
        }
        $output .= "</td>\n" . "</tr>\n";
    } else {
        $output = "<tr bgcolor=\"{$bgcolor}\">\n" . "  <td><font size=\"2\"><a href=\"{$cvsurl}\">{$file}</a></font></td>\n" . "  <td align=\"right\"><font size=\"2\"><nobr>n/a</nobr></font></td>\n" . "  <td bgcolor=\"{$bgcolor2}\" align=\"right\"><font size=\"2\"><nobr>n/a</nobr></font></td>\n" . "  <td align=\"right\"><font size=\"2\"><nobr>n/a</nobr></font></td>\n" . "  <td bgcolor=\"{$bgcolor2}\" align=\"right\"><font size=\"2\"><nobr>n/a</nobr></font></td>\n" . "  <td align=\"right\"><font size=\"2\"><nobr>n/a</nobr></font></td>\n" . "  <td bgcolor=\"{$bgcolor2}\" align=\"right\"><font size=\"2\"><nobr>n/a</nobr></font></td>\n" . "  <td align=\"right\"><font size=\"2\"><nobr>n/a</nobr></font></td>\n" . "  <td>" . "<img src=\"../../../img/bar6.png\" height=\"15\" width=\"200\">" . "</td>\n" . "</tr>\n";
    }
    return $output;
}