Ejemplo n.º 1
0
function pages_indicate_bad_project($projectid, $round)
{
    global $trace;
    // If it has no bad pages, it's good.
    //
    $n_bad_pages = Project_getNumPagesInState($projectid, $round->page_bad_state);
    if ($trace) {
        echo "n_bad_pages = {$n_bad_pages}\n";
    }
    //
    if ($n_bad_pages == 0) {
        return FALSE;
    }
    // If it has at least 10 bad pages,
    // reported by at least 3 different users, it's bad.
    //
    $n_unique_reporters = Project_getNumPagesInState($projectid, $round->page_bad_state, "DISTINCT(b_user)");
    if ($trace) {
        echo "n_unique_reporters = {$n_unique_reporters}\n";
    }
    //
    if ($n_bad_pages >= 10 && $n_unique_reporters >= 3) {
        return TRUE;
    }
    // In round 2, if it has any bad pages
    // and no available pages, it's bad.
    //
    if ($round->round_number == 2) {
        $n_avail_pages = Project_getNumPagesInState($projectid, $round->page_avail_state);
        if ($trace) {
            echo "n_avail_pages = {$n_avail_pages}\n";
        }
        if ($n_avail_pages == 0) {
            return TRUE;
        }
    }
    // Otherwise, it's good.
    //
    return FALSE;
}
Ejemplo n.º 2
0
echo "    <td align='center' colspan='1'><b>" . _("Title") . "</b></td>\n";
echo "    <td align='center' colspan='1'><b>" . _("Author") . "</b></td>\n";
echo "    <td align='center' colspan='1'><b>" . _("Total Pages") . "</b></td>\n";
echo "    <td align='center' colspan='1'><b>" . _("Remaining Pages") . "</b></td>\n";
echo "</tr>\n";
$result = mysql_query("SELECT projectid, nameofwork, authorsname, language, username, state FROM projects\n                WHERE state = 'project_md_second'");
$numrows = mysql_num_rows($result);
$rownum = 0;
while ($rownum < $numrows) {
    $projectid = mysql_result($result, $rownum, "projectid");
    $state = mysql_result($result, $rownum, "state");
    $name = mysql_result($result, $rownum, "nameofwork");
    $author = mysql_result($result, $rownum, "authorsname");
    $language = mysql_result($result, $rownum, "language");
    $numpages = Project_getNumPages($projectid);
    $availpages = Project_getNumPagesInState($projectid, 'avail_md_second');
    if ($rownum % 2) {
        $row_color = $theme['color_mainbody_bg'];
    } else {
        $row_color = $theme['color_navbar_bg'];
    }
    echo "<tr bgcolor='{$row_color}'>";
    echo "<td align='right'><a href = \"md_phase2.php?projectid={$projectid}\">{$name}</a></td>\n";
    echo "<td align='right'>{$author}</td>\n";
    echo "<td align='right'>{$numpages}</td>\n";
    echo "<td align='right'>{$availpages}</td>\n";
    $rownum++;
    echo "</tr>";
}
echo "</table>";
echo "</center>";
Ejemplo n.º 3
0
function do_page_summary()
{
    global $project;
    $projectid = $project->projectid;
    if (!$project->pages_table_exists) {
        return;
    }
    echo "<center>";
    echo "<h3>" . _("Page Summary") . "</h3>\n";
    // page counts by state.
    $total_num_pages = Project_getNumPages($projectid);
    echo "<table border=0>\n";
    global $PAGE_STATES_IN_ORDER;
    foreach ($PAGE_STATES_IN_ORDER as $page_state) {
        $num_pages = Project_getNumPagesInState($projectid, $page_state);
        if ($num_pages != 0) {
            // TRANSLATORS: %s is a page state, this is a label in a table for the number of pages in this state
            echo "<tr><td align='right'>{$num_pages}</td><td>" . sprintf(_("in %s"), $page_state) . "</td></tr>\n";
        }
    }
    echo "<tr><td colspan='2'><hr></td></tr>\n";
    echo "<tr><td align='right'>{$total_num_pages}</td><td align='center'>" . _("Pages Total") . "</td></tr>\n";
    echo "</table>\n";
    echo "</center>";
}