Пример #1
0
    $newdirection = "asc";
} else {
    $newdirection = "desc";
}
echo "<td align='center'><b><a href='tlist.php?" . $tname . "tstart={$tstart}&order=member_count&direction={$newdirection}'>" . _("Total Members") . "</a></b></td>";
echo "<td align='center'><b>" . _("Options") . "</b></td>";
echo "</tr>\n";
if (!empty($tRows)) {
    $i = 0;
    while ($row = mysql_fetch_assoc($tResult)) {
        if ($i % 2 == 0) {
            echo "<tr bgcolor='" . $theme['color_mainbody_bg'] . "'>";
        } else {
            echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>";
        }
        echo "<td align='center'><a href='tdetail.php?tid=" . $row['id'] . "'><img src='{$team_icons_url}/" . $row['icon'] . "' width='25' height='25' alt='" . attr_safe($row['teamname']) . "' border='0'></a></td>";
        echo "<td align='center'><b>" . $row['id'] . "</b></td>";
        echo "<td>" . $row['teamname'] . "</td>";
        echo "<td align='center'>" . $row['member_count'] . "</td>";
        echo "<td align='center'><b><a href='tdetail.php?tid=" . $row['id'] . "'>" . _("View") . "</a>&nbsp;";
        if ($userP['team_1'] != $row['id'] && $userP['team_2'] != $row['id'] && $userP['team_3'] != $row['id']) {
            echo "<a href='../members/jointeam.php?tid=" . $row['id'] . "'>" . _("Join") . "</a></b></td>";
        } else {
            echo "<a href='../members/quitteam.php?tid=" . $row['id'] . "'>" . _("Quit") . "</a></b></td>";
        }
        echo "</tr>\n";
        $i++;
    }
} else {
    echo "<tr bgcolor='" . $theme['color_mainbody_bg'] . "'><td colspan='6' align='center'><b>" . _("No more teams available.") . "</b></td></tr>\n";
}
Пример #2
0
<area shape="rect" coords="443,27,462,48" href="javascript:addChar('ps')" title="<?php 
echo attr_safe(_("psi"));
?>
">
<area shape="rect" coords="463,27,480,48" href="javascript:addChar('ô')" title="<?php 
echo attr_safe(_("omega"));
?>
">

<!-- Gamma exceptions -->
<area shape="rect" coords="488,27,511,48" href="javascript:addChar('ng')" title="<?php 
echo attr_safe(_("gamma") . " " . _("gamma"));
?>
">
<area shape="rect" coords="512,27,538,48" href="javascript:addChar('nk')" title="<?php 
echo attr_safe(_("gamma") . " " . _("kappa"));
?>
">
<area shape="rect" coords="539,27,564,48" href="javascript:addChar('nx')" title="<?php 
echo attr_safe(_("gamma") . " " . _("xi"));
?>
">
<area shape="rect" coords="565,27,594,48" href="javascript:addChar('nch')" title="<?php 
echo attr_safe(_("gamma") . " " . _("chi"));
?>
">

<area shape="default" nohref>
</map>
<?php 
// vim: sw=4 ts=4 expandtab
 // it was pulled in the raw format
 $word_suggestions = array();
 foreach ($suggestions as $suggestion) {
     list($time, $round, $page, $proofer, $words) = $suggestion;
     if (in_array($word, $words)) {
         array_push($word_suggestions, $suggestion);
     }
 }
 slim_header(_("Suggestion Detail"));
 $project_name = get_project_name($projectid);
 echo "<h2>", sprintf(_("Suggestion context for '%1\$s' in %2\$s"), $word, $project_name), "</h2>";
 echo_word_freq_style();
 echo "<p>";
 echo "<a href='show_word_context.php?projectid={$projectid}&amp;word={$encWord}' target='_PARENT'>" . _("Show full context set for this word") . "</a>";
 echo " | ";
 echo "<a target='_PARENT' href='" . attr_safe($_SERVER['PHP_SELF']) . "?projectid={$projectid}&amp;word={$encWord}&amp;timeCutoff={$timeCutoff}&amp;";
 if ($layout == LAYOUT_HORIZ) {
     echo "layout=" . LAYOUT_VERT . "'>" . _("Change to vertical layout");
 } else {
     echo "layout=" . LAYOUT_HORIZ . "'>" . _("Change to horizontal layout");
 }
 echo "</a>";
 echo "</p>";
 foreach ($word_suggestions as $suggestion) {
     list($time, $round, $page, $proofer, $words) = $suggestion;
     // get a context string
     list($context_strings, $totalLines) = _get_word_context_on_page($projectid, $page, $round, $word);
     # If the word was suggested on a page, but then changed before
     # being saved, let the PM know about it.
     if (!count($context_strings)) {
         echo "<p>" . sprintf(_('The word was suggested in round %1$s for page %2$s, but no longer exists in the saved text for that round.'), $round, $page) . "</p>";
function show_toggles_form($username, $user_settings)
{
    global $boolean_user_settings, $value_user_settings, $freeform_user_settings;
    echo "<form method='POST'>\n";
    echo "<input type='hidden' name='username' value='{$username}'>\n";
    echo "<input type='hidden' name='action' value='update'>\n";
    echo "<table>\n";
    echo "<tr>\n";
    echo "<th>" . _("Enable") . "</th>\n";
    echo "<th>" . _("Setting") . "</th>\n";
    echo "<th>" . _("Description") . "</th>\n";
    echo "</tr>\n";
    foreach ($boolean_user_settings as $setting_name => $setting_description) {
        $user_current_value = $user_settings->get_boolean($setting_name);
        $checked_attr = $user_current_value == 'yes' ? 'checked' : '';
        echo "<tr>\n";
        echo "<td><input name='{$setting_name}' type='checkbox' {$checked_attr}></td>\n";
        echo "<td>{$setting_name}</td>\n";
        echo "<td>{$setting_description}</td>\n";
        echo "</tr>\n";
    }
    foreach ($value_user_settings as $setting_name => $options) {
        echo "<tr>\n";
        echo "<td></td>";
        echo "<td>{$setting_name}</td>\n";
        echo "<td>";
        foreach ($options as $value => $label) {
            echo "<input type='radio' name='{$setting_name}' value='{$value}'";
            if ($user_settings->get_value($setting_name, '') == $value) {
                echo 'checked';
            }
            echo ">";
            if ($value) {
                echo " {$value}: {$label}<br>";
            } else {
                echo " {$label}<br>";
            }
        }
        echo "</td>";
        echo "</tr>\n";
    }
    foreach ($freeform_user_settings as $setting_name => $setting_description) {
        $user_current_value = $user_settings->get_value($setting_name);
        echo "<tr>";
        echo "<td></td>";
        echo "<td>{$setting_name}</td>\n";
        echo "<td>{$setting_description}<br>\n";
        echo "<input type='text' name='{$setting_name}' value='{$user_current_value}'>";
        echo "</td>";
        echo "</tr>";
    }
    echo "</table>\n";
    echo "<p><input type='submit' name='submit' value='" . attr_safe(_("Update")) . "'></p>\n";
    echo "</form>\n";
}
Пример #5
0
    echo "    curr_state = {$curr_state}\n";
    echo "    next_state = {$next_state}\n";
    echo "\n";
    echo "{$msg}\n";
    echo "</pre>\n";
    exit;
}
// -----------------------------------------------------------------------------
// If there's a question associated with this transition,
// and we haven't just asked it, ask it now.
if (!is_null($transition->confirmation_question) && $confirmed != 'yes') {
    echo "<p><b>" . _("Project ID") . ":</b> {$projectid}<br>\n";
    echo "<b>" . _("Title") . ":</b> {$project->nameofwork}<br>\n";
    echo "<b>" . _("Author") . ":</b> {$project->authorsname}</p>\n";
    echo $transition->confirmation_question;
    echo "<br>\n        <form action='changestate.php' method='POST'>\n        <input type='hidden' name='projectid'  value='{$projectid}'>\n        <input type='hidden' name='curr_state' value='{$curr_state}'>\n        <input type='hidden' name='next_state' value='{$next_state}'>\n        <input type='hidden' name='confirmed'  value='yes'>\n        <input type='hidden' name='return_uri' value='{$return_uri}'>" . sprintf(_("If so, %1\$s, otherwise go back to <a href='%2\$s'>where you were</a>"), "<input type='submit' value='" . attr_safe(_("confirm transition change")) . "'>", $return_uri) . "</form>";
    exit;
}
// At this point, we know that either there's no question associated
// with the transition, or there is and it has been answered yes.
if (!empty($transition->detour)) {
    // Detour (to collect data).
    $title = _("Transferring...");
    $body = "";
    $refresh_url = prepare_url($transition->detour);
    metarefresh(2, $refresh_url, $title, $body);
    exit;
}
$extras = array();
// -------------------------------------------------------------------------
$error_msg = $transition->do_state_change($project, $pguser, $extras);
    }
    echo "<select name='round_id'>";
    foreach ($expanded_rounds as $round) {
        echo "<option value='{$round}'";
        if ($round_id && $round == $round_id) {
            echo " selected";
        }
        echo ">{$round}</option>\n";
    }
    echo "</select>";
    if (!$project) {
        echo " " . _("(optional)");
    }
    echo " &nbsp; &nbsp;<input type='submit' value='" . attr_safe(_("View")) . "'>";
    if ($project) {
        echo " &nbsp; <input type='submit' name='reset' value='" . attr_safe(_("Reset")) . "'>";
    }
    echo "</form>";
    exit;
} elseif ($frame == "image") {
    slim_header(_("Image Frame"));
    if (!count($error_messages)) {
        $percent = get_integer_param($_GET, 'percent', 100, 1, 999);
        $width = 10 * $percent;
        ?>
<form method="get" action="view_page_text_image.php">
<input type="hidden" name="projectid" value="<?php 
        echo $projectid;
        ?>
">
<input type="hidden" name="page" value="<?php 
Пример #7
0
    echo sprintf(_("For assistance, please contact <a href='%s'>%s</a>."), $mailto_url, $general_help_email_addr);
    echo "\n";
    echo sprintf(_("Please include the account activation code %s in your email for assistance."), $ID);
    echo "</p>\n";
    exit;
}
// Delete record in non_activated_users.
mysql_query("DELETE FROM non_activated_users WHERE id='{$ID}'");
// Insert into 'real' table -- users
$query = sprintf("INSERT INTO users (id, real_name, username, email, manager, date_created, email_updates, u_plist, u_top10, u_neigh, u_intlang) VALUES ('%s', '%s', '%s', '%s', 'no', {$date_created}, {$email_updates}, 3, 1, 10, '%s')", mysql_real_escape_string($ID), mysql_real_escape_string($real_name), mysql_real_escape_string($username), mysql_real_escape_string($email), mysql_real_escape_string($u_intlang));
$result = mysql_query($query) or die(mysql_error());
$u_id = mysql_insert_id($db_Connection->db_lk);
// auto-incremented users.u_id
// create profile
$profileString = "INSERT INTO user_profiles SET u_ref={$u_id}";
$makeProfile = mysql_query($profileString);
$profile_id = mysql_insert_id($db_Connection->db_lk);
// auto-incremented user_profiles.id
// add ref to profile
$refString = sprintf("UPDATE users SET u_profile={$profile_id} WHERE id='%s' AND username='******'", mysql_real_escape_string($ID), mysql_real_escape_string($username));
$makeRef = mysql_query($refString);
// Send them an introduction e-mail
maybe_welcome_mail($email, $real_name, $username);
printf(_("User %s activated successfully."), $username);
echo " ";
// TRANSLATORS: %s is the site name
printf(_("Please check the e-mail being sent to you for further information about %s."), $site_name);
echo "<center>";
echo "<br><font size=+1>" . _("Enter your password below to sign in and start proofreading!!");
echo "<form action='login.php' method='post'>\n<input type='hidden' name='userNM' value='" . attr_safe($username) . "'>\n<input type='password' name='userPW'>\n<input type='submit' value='" . attr_safe(_("Sign In")) . "'></form>";
// vim: sw=4 ts=4 expandtab
Пример #8
0
<tr><td align="right">
<label for='is_regex'><?php 
echo _("Regular Expression?");
?>
</label>
</td><td>
<input type="checkbox" name="is_regex" id='is_regex' checked disabled />
</td></tr>
</table>
<center>
    <input type="button" value="<?php 
echo attr_safe(_("Replace all."));
?>
" onClick="do_replace()">
    <input type="button" id='undo' value="<?php 
echo attr_safe(_("Undo."));
?>
" onClick="restore_saved_text()" disabled />
</center>
</form>
<p><?php 
echo _("Warning: Undo is only possible for the most recent replace!");
?>
</p>
<p id='regex_help_title' onclick='toggle_regex_help();'><span id='regex_arrow'>&#9654;</span>
<?php 
echo _('Regular Expression?');
?>
</p>
<p id='regex_help'><?php 
// TRANSLATORS: Description of the . character in a regualar expression
Пример #9
0
        }
    } else {
        $bgcolor = "#FF0000";
        if ($show_image_size) {
            $imagesize = 0;
        }
    }
    echo "<td bgcolor='{$bgcolor}'><a href=../project_manager/displayimage.php?project={$projectid}&imagefile={$image}>{$image}</a></td>\n";
    // Original Page Number
    echo "<td bgcolor='{$bgcolor}'><input type ='textbox' name='orig_page_num_[{$image}]' value = {$orig_page_num}></td>";
    // Set up existing page metadata if there is any, page defaults to nonblank
    $metadata_possibles = array('illustration' => _("Illustration"), 'blank' => _("Blank"), 'missing' => _("Page Missing After This One"), 'badscan' => _("Bad Scan"), 'sequence' => _("Page Out of Sequence"), 'nonblank' => _("Non-Blank"));
    if (!array_key_exists($metadata, $metadata_possibles)) {
        // e.g., $metadata == ''
        $metadata = 'nonblank';
    }
    echo "<td bgcolor='{$bgcolor}' align='left'>\n";
    foreach ($metadata_possibles as $code => $label) {
        $checked = $code == $metadata ? 'checked' : '';
        echo "<input type='radio' name='metadata_[{$image}]' value='{$code}' {$checked}>{$label}<br>\n";
    }
    echo "</td>";
    // Show Thumbnail
    echo "<td bgcolor='{$bgcolor}' align='right'>\n                <a href=\"../project_manager/displayimage.php?project={$projectid}&imagefile={$image}\"><img src =\"{$projects_url}/{$projectid}/thumbs/{$image}\" alt = \"{$image}\" border =\"0\"></a>\n            </td>";
    echo "</tr>";
}
echo "</table>";
echo "<INPUT TYPE=SUBMIT VALUE=\"" . attr_safe(_("Save and Continue Working")) . "\" NAME =\"continue\">\n        <INPUT TYPE=SUBMIT VALUE=\"" . attr_safe(_("Save as Done")) . "\" NAME =\"done\">\n        <INPUT TYPE=SUBMIT VALUE=\"" . attr_safe(_("Leave As-Is and Quit")) . "\" NAME =\"return\">";
echo "</form></center>";
echo "<br>";
// vim: sw=4 ts=4 expandtab
Пример #10
0
function TaskForm($task)
{
    global $requester_u_id, $tasks_array, $severity_array, $categories_array, $tasks_status_array;
    global $os_array, $browser_array, $versions_array, $percent_complete_array;
    global $task_assignees_array;
    global $priority_array, $tasks_url;
    // Non-managers can only set the task status to New.
    if (!user_is_a_sitemanager() && !user_is_taskcenter_mgr()) {
        $tasks_status_array = array(1 => "New");
    }
    $task_summary_enc = attr_safe($task->task_summary);
    $task_details_enc = html_safe($task->task_details);
    echo "<form action='{$tasks_url}' method='post'>";
    if (empty($task->task_id)) {
        echo "<input type='hidden' name='action' value='create'>\n";
    } else {
        echo "<input type='hidden' name='action' value='edit'>\n";
        echo "<input type='hidden' name='task_id' value='{$task->task_id}'>";
    }
    echo "<table class='tasks'>\n";
    echo "<tr>";
    echo "<td colspan='2'>";
    echo "<b>" . property_get_label('task_summary', FALSE) . "&nbsp;</b>";
    echo "&nbsp;&nbsp;";
    echo "<input type='text' name='task_summary' value=\"{$task_summary_enc}\" size='60' maxlength='80' class='taskinp1'>";
    echo "</td>";
    echo "</tr>\n";
    echo "<tr><td width='50%'><table class='taskplain'>\n";
    property_echo_select_tr('task_type', $task->task_type, $tasks_array);
    property_echo_select_tr('task_category', $task->task_category, $categories_array);
    property_echo_select_tr('task_status', $task->task_status, $tasks_status_array);
    property_echo_select_tr('task_assignee', $task->task_assignee, $task_assignees_array);
    property_echo_select_tr('task_os', $task->task_os, $os_array);
    echo "</table></td><td width='50%'><table class='taskplain'>\n";
    property_echo_select_tr('task_browser', $task->task_browser, $browser_array);
    property_echo_select_tr('task_severity', $task->task_severity, $severity_array);
    property_echo_select_tr('task_priority', $task->task_priority, $priority_array);
    property_echo_select_tr('task_version', $task->task_version, $versions_array);
    if ((user_is_a_sitemanager() || user_is_taskcenter_mgr()) && !empty($task->task_id)) {
        property_echo_select_tr('percent_complete', $task->percent_complete, $percent_complete_array);
    } elseif ($task->opened_by == $requester_u_id && !user_is_a_sitemanager() && !user_is_taskcenter_mgr()) {
        echo "<input type='hidden' name='percent_complete' value='{$task->percent_complete}'>";
    }
    echo "</table></td></tr><tr><td>\n";
    echo "<table class='taskplain'><tr><td width='5%'><b>Details</b>&nbsp;&nbsp;</td>\n";
    echo "<td width='95%'>";
    echo "<textarea name='task_details' cols='60' rows='5'>{$task_details_enc}</textarea>";
    echo "</td>";
    echo "</tr>";
    echo "</table>\n";
    echo "</td></tr><tr><td colspan='2'><center>\n";
    echo "<input type='submit' value='";
    if (empty($task->task_id)) {
        echo "Add Task";
    } else {
        echo "Submit Edit";
    }
    echo "' class='taskinp2'>\n";
    echo "</center></td></tr></table></form><br />\n";
}
 function show_edit_form()
 {
     global $page_url;
     echo "<table class='source'><form method='post' action='{$page_url}'>";
     echo "<input type='hidden' name='action' value='update_oneshot'>\n";
     if ($this->new_source) {
         $this->_show_edit_row('spec_code', _('Special Day ID'), false, 20);
     } else {
         echo "<input type='hidden' name='editing' value='true' />" . "<input type='hidden' name='spec_code' value='" . attr_safe($this->spec_code) . "' />";
         $this->_show_summary_row(_('Special Day ID'), $this->spec_code);
     }
     $this->_show_edit_row('display_name', _('Display Name'), false, 80);
     echo "  <tr><td class='pa'>Enable</th><td><input type='checkbox' name='enable'";
     if ($this->enable == 1) {
         echo " value='1' checked";
     }
     echo "></td></tr>\n";
     $this->_show_edit_row('comment', _('Comment'), true);
     $this->_show_edit_row('color', _('Color'), false, 8);
     $this->_show_edit_row('open_month', _('Open Month'), false, 2);
     $this->_show_edit_row('open_day', _('Open Day'), false, 2);
     $this->_show_edit_row('close_month', _('Close Month'), false, 2);
     $this->_show_edit_row('close_day', _('Close Day'), false, 2);
     $this->_show_edit_row('date_changes', _('Date Changes'), false);
     $this->_show_edit_row('info_url', _('Info URL'), false);
     $this->_show_edit_row('image_url', _('Image URL'), false);
     echo "<tr><td colspan='2' style='text-align:center;'>\n            <input type='submit' name='save_edits' value='" . attr_safe(_('Save')) . "' />\n            </td> </tr> </form> </table>\n\n";
 }
 function show_edit_form()
 {
     global $page_url;
     echo "<table class='source'><form method='post'\n            action='{$page_url}&amp;action=update_oneshot#{$this->code_name}'>\n";
     if ($this->new_source) {
         $this->_show_edit_row('code_name', _('Image Source ID'), false, 10);
     } else {
         echo "<input type='hidden' name='editing' value='true' />" . "<input type='hidden' name='code_name' value='" . attr_safe($this->code_name) . "' />";
         $this->_show_summary_row(_('Image Source ID'), $this->code_name);
     }
     $this->_show_edit_row('display_name', _('Display Name'), false, 30);
     $this->_show_edit_row('full_name', _('Full Name'));
     $this->_show_edit_row('url', _('Website'));
     $this->_show_edit_row('credit', _('Credits Line'), true);
     $this->_show_edit_permissions_row();
     $this->_show_edit_row('public_comment', _('Description (public comments)'), true);
     $this->_show_edit_row('internal_comment', _('Notes (internal comments)'), true);
     echo "<tr><td colspan='2' class='center'>\n            <input type='submit' name='save_edits' value='" . attr_safe(_('Save')) . "' />\n            </td> </tr> </form> </table>\n\n";
 }
Пример #13
0
    echo "<p>{$big_upload_blurb}</p>\n";
    echo "</li>\n";
    if ($stage != 'smooth_done') {
        echo "<li>";
        if ($stage != 'smooth_avail') {
            echo _("(optional) Leave comments for the next person who checks out this project:");
        } else {
            echo _("Leave instructions for smooth readers:");
        }
        echo "<br>\n";
        echo "<textarea style='margin-bottom: 1em;' name='postcomments' cols='75' rows='10'></textarea>\n";
        echo "</li>\n";
    }
    echo "<li>";
    // TRANSLATORS: %1$s is replaced with a form <input> containing separately translated text like 'Upload file'
    echo sprintf(_('%1$s or return to the <a href="%2$s">%3$s</a>.'), sprintf('<input type="submit" value="%s">', attr_safe($submit_button)), $back_url, $back_blurb);
    echo "<p>" . sprintf($submit_blurb, $submit_button) . "</p>";
    echo "</li>\n";
    echo "</ol>";
    echo "</form>\n";
} else {
    // Handle a submission from the upload page.
    // if files have been uploaded, process them
    // mangle the postcomments
    // make reasonably sure script does not timeout on large file uploads
    set_time_limit(14400);
    $path_to_file = "{$projects_dir}/{$projectid}";
    $files = $_FILES['files'];
    // do some checks. File must exist (except if we are returning to PP
    // or PPV available.
    // if we have a file, we need its name to end in .zip, and we need
Пример #14
0
function display_hiddens($projectid_, $from_image_, $page_name_handling, $transfer_notifications, $add_deletion_reason, $merge_wordcheck_files)
{
    echo "\n<input type='hidden' name='from_image_[lo]'        value='" . attr_safe($from_image_['lo']) . "'>";
    echo "\n<input type='hidden' name='from_image_[hi]'        value='" . attr_safe($from_image_['hi']) . "'>";
    echo "\n<input type='hidden' name='projectid_[from]'       value='" . attr_safe($projectid_['from']) . "'>";
    echo "\n<input type='hidden' name='projectid_[to]'         value='" . attr_safe($projectid_['to']) . "'>";
    echo "\n<input type='hidden' name='page_name_handling'     value='" . attr_safe($page_name_handling) . "'>";
    echo "\n<input type='hidden' name='transfer_notifications' value='" . attr_safe($transfer_notifications) . "'>";
    echo "\n<input type='hidden' name='add_deletion_reason'    value='" . attr_safe($add_deletion_reason) . "'>";
    echo "\n<input type='hidden' name='merge_wordcheck_files'  value='" . attr_safe($merge_wordcheck_files) . "'>";
}
Пример #15
0
function do_navigation($projectid, $image, $L_round_num, $R_round_num, $L_user_column_name, $L_user)
{
    global $navigation_text;
    $jump_to_js = "this.form.image.value=this.form.jumpto[this.form.jumpto.selectedIndex].value; this.form.submit();";
    $navigation_text .= "\n<form method='get' action='diff.php'>";
    $navigation_text .= "\n<input type='hidden' name='project' value='{$projectid}'>";
    $navigation_text .= "\n<input type='hidden' name='image' value='{$image}'>";
    $navigation_text .= "\n<input type='hidden' name='L_round_num' value='{$L_round_num}'>";
    $navigation_text .= "\n<input type='hidden' name='R_round_num' value='{$R_round_num}'>";
    $navigation_text .= "\n" . _("Jump to") . ": <select name='jumpto' onChange='{$jump_to_js}'>\n";
    $query = "SELECT image, {$L_user_column_name}  FROM {$projectid} ORDER BY image ASC";
    $res = mysql_query($query) or die(mysql_error());
    $prev_image = "";
    $next_image = "";
    $prev_from_proofer = "";
    $next_from_proofer = "";
    $got_there = FALSE;
    $got_to_next = FALSE;
    // construct the dropdown; work out where previous and next buttons should take us
    while (list($this_val, $this_user) = mysql_fetch_row($res)) {
        $navigation_text .= "\n<option value='{$this_val}'";
        if ($this_val == $image) {
            $navigation_text .= " selected";
            // make the correct element of the drop down selected
            $got_there = TRUE;
        } else {
            if ($got_there && !$got_to_next) {
                // we are at the one after the current one
                $got_to_next = TRUE;
                $next_image = $this_val;
            }
        }
        if ($got_to_next && $next_from_proofer == "" && $this_user == $L_user) {
            $next_from_proofer = $this_val;
        }
        if (!$got_there) {
            $prev_image = $this_val;
            // keep track of what the previous image was
            if ($this_user == $L_user) {
                $prev_from_proofer = $this_val;
            }
        }
        $navigation_text .= ">{$this_val}</option>";
    }
    $navigation_text .= "\n</select>";
    $previous_js = "this.form.image.value='{$prev_image}'; this.form.submit();";
    $next_js = "this.form.image.value='{$next_image}'; this.form.submit();";
    $previous_from_proofer_js = "this.form.image.value='{$prev_from_proofer}'; this.form.submit();";
    $next_from_proofer_js = "this.form.image.value='{$next_from_proofer}'; this.form.submit();";
    $navigation_text .= "\n<input type='button' value='" . attr_safe(_("Previous")) . "' onClick=\"{$previous_js}\"";
    if ($prev_image == "") {
        $navigation_text .= " disabled";
    }
    $navigation_text .= ">";
    $navigation_text .= "\n<input type='button' value='" . attr_safe(_("Next")) . "' onClick=\"{$next_js}\"";
    if ($next_image == "") {
        $navigation_text .= " disabled";
    }
    $navigation_text .= ">";
    if (can_navigate_by_proofer($projectid, $L_user)) {
        $navigation_text .= "\n<input type='button' value='" . attr_safe(_("Proofreader previous")) . "' onClick=\"{$previous_from_proofer_js}\"";
        if ($prev_from_proofer == "") {
            $navigation_text .= " disabled";
        }
        $navigation_text .= ">";
        $navigation_text .= "\n<input type='button' value='" . attr_safe(_("Proofreader next")) . "' onClick=\"{$next_from_proofer_js}\"";
        if ($next_from_proofer == "") {
            $navigation_text .= " disabled";
        }
        $navigation_text .= ">";
    }
    $navigation_text .= "\n</form>\n";
}
        $words = load_project_bad_words($projectid);
        $words = array_merge($words, $postedWords);
        save_project_bad_words($projectid, $words);
    }
    $format = "html";
}
$title = _("Ad Hoc Word Details");
$page_text = _("Insert words, one per line, in the box below and click the Show details button to get frequency and context details for them.");
$page_text2 = _("The results list below shows how many times each word occurs in the most recent project text.");
output_header($title, NO_STATSBAR);
echo_page_header($title, $projectid);
echo "<p>{$page_text}</p>";
echo "<form action='show_adhoc_word_details.php' method='post'>";
echo "<input type='hidden' name='projectid' value='{$projectid}'>";
echo "<p><textarea cols='20' rows='6' name='queryWordText'>{$queryWordText}</textarea></p>";
echo "<input type='submit' value='", attr_safe(_("Show details")), "'>";
echo "</form>";
if (count($queryWords)) {
    echo "<hr>";
    list($words_w_freq, $messages) = _get_word_list($projectid, $queryWords);
    // how many instances (ie: frequency sections) are there?
    $instances = 1;
    // what are the cutoff options?
    $cutoffOptions = array(1, 2, 3, 4, 5, 10, 25, 50);
    // what is the intial cutoff frequecny?
    $initialFreq = getInitialCutoff($freqCutoff, $cutoffOptions, $words_w_freq);
    // echo page support text, like JS and stylesheets
    echo_cutoff_script($cutoffOptions, $instances);
    echo_word_freq_style();
    echo_any_warnings_errors($messages);
    echo "<p>" . $page_text2 . "</p>";
Пример #17
0
 function show_form()
 {
     echo "<form method='post' enctype='multipart/form-data' action='" . attr_safe($_SERVER['PHP_SELF']) . "'>";
     $this->show_hidden_controls();
     echo "<br>";
     echo "<center>";
     echo "<table cellspacing='0' cellpadding='5' border='1' width='90%' style='border: 1px solid #000; border-collapse:collapse'>";
     $this->show_visible_controls();
     echo "<tr>";
     echo "<td bgcolor='#CCCCCC' colspan='2' align='center'>";
     echo "<input type='submit' name='saveAndQuit' value='" . attr_safe(_("Save and Go To PM Page")) . "'>";
     echo "<input type='submit' name='saveAndProject' value='" . attr_safe(_("Save and Go To Project")) . "'>";
     echo "<input type='submit' name='saveAndPreview' value='" . attr_safe(_("Save and Preview")) . "'>";
     echo "<input type='submit' name='quit' value='" . attr_safe(_("Quit Without Saving")) . "'>";
     echo "</td>";
     echo "</tr>\n";
     echo "</table>";
     echo "</center>";
     echo "</form>";
     echo "\n";
 }
Пример #18
0
function do_change_state()
{
    global $project, $pguser, $code_url, $charset;
    $valid_transitions = get_valid_transitions($project, $pguser);
    if (count($valid_transitions) == 0) {
        return;
    }
    echo "<h4>";
    echo _("Change Project State");
    echo "</h4>\n";
    if ($project->state == PROJ_NEW) {
        echo "<p>\n";
        echo _("Check for missing pages and make sure that all illustration files have been uploaded <b>before</b> moving this project into the rounds.");
        echo "</p>\n";
    }
    // print out a message if PM has project loads disabled,
    // as they can't move a project out of the unavailable state
    if ($project->can_be_managed_by_current_user) {
        check_user_can_load_projects(false);
    }
    $here = $_SERVER['REQUEST_URI'];
    // If the request URI included an 'expected_state' parameter, there's a wrinkle:
    // If the user clicks on this button, the project's state will (normally) change.
    // So if we then returned the user to exactly this URI, they'd get a warning:
    // "The project is no longer in 'this state'. It is now in 'that state'.
    // So we suppress the 'expected_state' parameter from the request URI.
    $here = preg_replace('/expected_state=[A-Za-z._0-9]+/', '', $here);
    // This can leave an extra &, but I suspect browsers can handle it.
    foreach ($valid_transitions as $transition) {
        echo "<form method='POST' action='{$code_url}/tools/changestate.php'>";
        echo "<input type='hidden' name='projectid'  value='{$project->projectid}'>\n";
        echo "<input type='hidden' name='curr_state' value='{$project->state}'>\n";
        echo "<input type='hidden' name='next_state' value='{$transition->to_state}'>\n";
        echo "<input type='hidden' name='confirmed'  value='yes'>\n";
        echo "<input type='hidden' name='return_uri' value='{$here}'>\n";
        $question = $transition->confirmation_question;
        if (is_null($question)) {
            $onClick_condition = "return true;";
        } else {
            $onClick_condition = "return confirm(\"" . javascript_safe($question, $charset) . "\");";
        }
        $onclick_attr = "onClick='{$onClick_condition}'";
        echo "<input type='submit' value='", attr_safe($transition->action_name), "' {$onclick_attr}>";
        if (1) {
            // Say who is allowed to do this transition.
            echo " [{$transition->who_restriction}]";
        }
        echo "</form>\n";
    }
}
function show_form($action, $cdrp, $form_content, $submit_label)
{
    // Display a div with a form containing action and cdrp hidden inputs; some content,
    // which can be abritrary HTML/other inputs; and finally a labeled submit button
    echo "<div style='border: 1px solid grey; margin-left: .5em; padding: .25em;'>\n";
    echo "<form style='margin: 0em;' action='?' method='POST' enctype='multipart/form-data'>\n";
    echo "<input type='hidden' name='action' value='" . attr_safe($action) . "'>\n";
    echo "<input type='hidden' name='cdrp' value='" . attr_safe($cdrp) . "'>\n";
    echo "{$form_content}&nbsp;<input type='submit' value='{$submit_label}'>\n";
    echo "</form>\n";
    echo "</div>\n";
}
Пример #20
0
 echo "<td align=center>";
 if (user_is_a_sitemanager() || user_is_proj_facilitator() || $project->username == $pguser) {
     echo _("Edit") . ":";
     echo " ";
     echo "<a href=\"editproject.php?action=edit&project={$projectid}\">" . _("Info") . "</a>";
     echo " | ";
     echo "<a href=\"edit_project_word_lists.php?projectid={$projectid}\">" . _("Word&nbsp;Lists") . "</a>";
     // Should we show an "attention" icon?
     // Currently, we only do this if suggestions have been added since
     // the Good Words file was last modified.
     // In future, there might be various reasons to do so.
     // (But then what would we put in the tooltip?)
     $f_g = get_project_word_file($projectid, 'good');
     $count = count_wordcheck_suggestion_events($projectid, $f_g->mod_time);
     if ($count >= 1) {
         $tooltip = attr_safe(_('"Suggestions from proofreaders" list has changed; click here to view'));
         echo " <a href='{$code_url}/tools/project_manager/show_good_word_suggestions.php?projectid={$projectid}' target='_blank'>";
         echo "<img src='{$code_url}/graphics/exclamation.gif' title='{$tooltip}' border='0'>";
         echo "</a>";
     }
     echo "<br>";
 }
 if ($user_can_see_download_links) {
     if ($project->state == PROJ_POST_FIRST_UNAVAILABLE || $project->state == PROJ_POST_FIRST_AVAILABLE || $project->state == PROJ_POST_FIRST_CHECKED_OUT) {
         echo " <a href=\"{$projects_url}/{$projectid}/{$projectid}.zip\">", _("D/L"), "</a>";
     }
     if ($project->state == PROJ_POST_SECOND_CHECKED_OUT || $project->state == PROJ_POST_COMPLETE) {
         echo " <a href=\"{$projects_url}/{$projectid}/" . $projectid . "_second.zip\">", _("D/L"), "</a>";
     }
 }
 echo "</td>\n";
Пример #21
0
function _show_textfield($field_name, $current_value, $extras)
{
    list($size, $rest) = $extras;
    $current_value_esc = attr_safe($current_value);
    echo "<input type='text' name='{$field_name}' value='{$current_value_esc}' size='{$size}'>{$rest}";
}
Пример #22
0
 if ($month == 0 && $current_month != 0) {
     $current_month = $month;
     echo "<tr class='month'><td><h2>" . _("Undated Entries") . "</h2></td></tr>\n";
     output_column_headers();
 }
 if ($month != $current_month) {
     $current_month = $month;
     echo "<tr class='month'><td><h2>";
     echo strftime("%B", mktime(0, 0, 0, $row['open_month'], 10)) . "</h2></td></tr>\n";
     output_column_headers();
 }
 echo "<tr>";
 echo "<td style='background-color: #" . $row['color'] . ";'>";
 echo "<a href=\"projectmgr.php?show=search&special_day[]=";
 echo attr_safe($row['spec_code']) . "&n_results_per_page=100\" title=\"";
 echo attr_safe($row['display_name']) . "\">\n";
 echo html_safe($row['display_name']) . "</a>";
 echo "</td>\n";
 echo "<td style='background-color: #" . $row['color'] . ";'>";
 echo "<div title=\"" . html_safe($row['comment']) . "\">";
 echo html_safe($row['comment']) . "</div></td>\n";
 echo "<td class='center'>";
 if ($current_month != 0) {
     echo html_safe($row['open_day']);
 } else {
     echo _("N/A");
 }
 // Translators: N/A = "Not applicable"
 echo "</td>\n";
 echo "<td>";
 echo "<a href='" . $row['info_url'] . "'>";
Пример #23
0
echo "</tr>\n<tr>";
echo "  <td class='label'>" . _("Confirm Password") . ":</td>";
echo "  <td class='field'><input type='password' maxlength='70' name='userPW2' size='20'></td>";
echo "</tr>\n<tr>";
if (!$testing) {
    echo "  <td class='label'>" . _("E-mail Address") . ":</td>";
    echo "  <td class='field'><input type='text' maxlength='70' name='email' size='20' value='" . attr_safe($email) . "'></td>";
    echo "</tr>\n<tr>";
    echo "  <td class='label'>" . _("Confirm E-mail Address") . ":</td>";
    echo "  <td class='field'><input type='text' maxlength='70' name='email2' size='20' value='" . attr_safe($email2) . "'></td>";
    echo "</tr>\n<tr>";
}
echo "  <td class='label'><b>" . _("E-mail Updates") . ":</td>";
echo "  <td class='field'>";
echo "    <input type='radio' name='email_updates' value='1' ";
if ($email_updates) {
    echo "checked";
}
echo ">" . _("Yes") . "&nbsp;&nbsp;";
echo "    <input type='radio' name='email_updates' value='0' ";
if (!$email_updates) {
    echo "checked";
}
echo ">" . _("No");
echo "  </td>";
echo "</tr>\n<tr>";
echo "  <td bgcolor='#336633' colspan='2' align='center'><input type='submit' value='" . attr_safe(_("Send E-Mail required to activate account")) . "'>&nbsp;&nbsp;<input type='reset'></td>";
echo "</tr></table></form>";
echo "</center>";
include $relPath . '/../faq/privacy.php';
// vim: sw=4 ts=4 expandtab
 echo "<input type='submit' value='Submit'></p>";
 echo "</form>";
 if ($timeCutoff == -1) {
     $time_cutoff_text = _("Suggestions since the project's Good Words List was last modified are included.");
 } elseif ($timeCutoff == 0) {
     $time_cutoff_text = _("<b>All proofreader suggestions</b> are included in the results.");
 } else {
     $time_cutoff_text = sprintf(_("Only proofreader suggestions made <b>after %s</b> are included in the results."), strftime($datetime_format, $timeCutoff));
 }
 echo "<p>" . $time_cutoff_text . "</p>";
 echo "<p>" . sprintf(_("Selecting any '%s' button will add all selected words to their corresponding project word list, not just the words in the section for the button itself."), $submitLabel) . "</p>";
 echo_cutoff_text($initialFreq, $cutoffOptions);
 $t_before = $watch->read();
 echo "<form action='" . attr_safe($_SERVER['PHP_SELF']) . "' method='post'>";
 echo "<input type='hidden' name='frame' value='update'>";
 echo "<input type='hidden' name='pm' value='" . attr_safe($pm) . "'>";
 echo "<input type='hidden' name='timeCutoff' value='{$timeCutoff}'>";
 $projectsNeedingAttention = 0;
 // loop through the projects
 foreach ($projects as $projectid => $projectdata) {
     list($projectname, $projectstate) = $projectdata;
     $goodFileObject = get_project_word_file($projectid, "good");
     // set the timeCutoff
     if ($timeCutoff == -1) {
         $timeCutoffActual = $goodFileObject->mod_time;
     } else {
         $timeCutoffActual = $timeCutoff;
     }
     // load suggestions since cutoff
     $suggestions = load_project_good_word_suggestions($projectid, $timeCutoffActual);
     // if there are no suggestions since the cutoff, skip it
             }
         }
     }
 } else {
     // no UP_ID supplied, so we're creating a brand new uberproject...
     // or possibly there was just a failed attempt to create one, so
     // we will reclaim any of the values that may have been set by not resetting them(!)
     // check that user is allowed to create new uberprojects
     $errorMsg = $errorMsg;
 }
 output_header(_("Create an Uber Project"));
 // want the "Create an Uber Project" version of this page to look a little different
 // from the normal "Create a Project" version, so we'll use a theme colour
 // instead of a grey for the left hand column
 $bgcol = $theme['color_navbar_bg'];
 echo "<form method='post' enctype='multipart/form-data' action='" . attr_safe($_SERVER['PHP_SELF']) . "'>";
 if (!empty($rec)) {
     echo "<input type='hidden' name='rec' value='" . base64_encode(serialize($rec)) . "'>";
 }
 if (isset($up_projectid)) {
     echo "<input type='hidden' name='up_projectid' value='{$up_projectid}'>";
 }
 if (isset($errorMsg)) {
     echo "<br><center><font size='+1' color='#ff0000'><b>{$errorMsg}</b></font></center>";
 }
 echo "<br><center><table cellspacing='0' cellpadding='5' border='1' width='90%' style='border: 1px solid #000; border-collapse:collapse'>";
 echo "<tr><td bgcolor='" . $theme['color_headerbar_bg'] . "' colspan='2'><center><b><font color='" . $theme['color_headerbar_font'] . "'>" . _("Uber Project Settings") . "</font></b></center></td></tr>\n";
 function row($label, $display_function, $field_value, $field_name = NULL)
 {
     global $bgcol;
     echo "<tr>";
Пример #26
0
function summarize_stage($stage, $desired_states, $show_filtered_projects = FALSE, $filter_type = "")
{
    global $pguser, $n_projects_in_state_, $n_projects_transitioned_to_state_;
    // Get the stage identifier.
    $stage_icon_url = get_dyn_image_url_for_file("stage_icons/{$stage->id}");
    if (!is_null($stage_icon_url)) {
        $stage_id_bit = "<img src='{$stage_icon_url}' alt='({$stage->id})' title='{$stage->id}'>";
    } else {
        $stage_id_bit = "{$stage->id}";
    }
    // Get the stage description for displaying in the title of the link.
    $description = attr_safe(strip_tags($stage->description));
    // Determine access eligibility for this stage.
    $uao = $stage->user_access($pguser);
    if ($uao->can_access) {
        $access_icon = "graphics/access_yes.png";
        $access_text = _("You can work in this activity");
        $access_link = '';
    } elseif ($uao->all_minima_satisfied) {
        $access_icon = "graphics/access_eligible.png";
        $access_text = _("You are eligible to work in this activity");
        $access_link = "{$stage->relative_url}#Entrance_Requirements";
    } else {
        $access_icon = "graphics/access_no.png";
        $access_text = _("You are not yet eligible to work in this activity");
        $access_link = "{$stage->relative_url}#Entrance_Requirements";
    }
    // If we're a round, get page information and calculate status.
    if (is_a($stage, 'Round')) {
        $round_stats = get_site_page_tally_summary($stage->id);
        list($progress_bar_width, $progress_bar_color, $percent_complete) = calculate_progress_bar_properties($round_stats->curr_day_actual, $round_stats->curr_day_goal);
    }
    // Calculate the total number of projects.
    $total_projects = 0;
    $stage_totals = array();
    foreach ($desired_states as $stage_state) {
        // Pull the number of completed projects from the project
        // transitions array and the others from the current state array.
        // Only sum the stats that aren't project_complete_state as they're
        // already included in the following round's numbers.
        // (Use '@' to suppress "Undefined property" notice:
        // not every stage has a 'project_complete_state'.)
        if ($stage_state == @$stage->project_complete_state) {
            $count = array_get($n_projects_transitioned_to_state_, $stage_state, 0);
        } else {
            $count = array_get($n_projects_in_state_, $stage_state, 0);
            $total_projects += $count;
        }
        $stage_totals[$stage_state] = $count;
    }
    // Pull the project filter
    $n_projects_in_state_by_filter_ = array();
    if ($show_filtered_projects) {
        $project_filter = get_project_filter_sql($pguser, $filter_type);
    }
    // We can't load filtered numbers without a filter and without
    // a list of desired states.
    $load_filtered_projects = FALSE;
    if ($show_filtered_projects && $project_filter != "" && count($desired_states) != 0) {
        $load_filtered_projects = TRUE;
    }
    // Load any projects based on filters
    if ($load_filtered_projects) {
        $states_list = '';
        foreach ($desired_states as $desired_state) {
            if ($states_list) {
                $states_list .= ',';
            }
            $states_list .= "'{$desired_state}'";
            $n_projects_in_state_by_filter_[$desired_state] = 0;
            // (Use '@' to suppress "Undefined property" notice:
            // not every stage has a 'project_complete_state'.)
            if ($desired_state == @$stage->project_complete_state) {
                $n_projects_in_state_by_filter_[$desired_state] = _("N/A");
            }
        }
        $res = mysql_query("\n            SELECT state, COUNT(*)\n            FROM projects\n            WHERE state IN ({$states_list}) {$project_filter}\n            GROUP BY state\n        ") or die(mysql_error());
        $total_projects = 0;
        while (list($project_state, $count) = mysql_fetch_row($res)) {
            $n_projects_in_state_by_filter_[$project_state] = $count;
            $total_projects += $count;
        }
    }
    // Output the table row.
    echo "<tr>";
    // If we're showing the filter for this line, we need the
    // round cell to span two rows.
    if ($show_filtered_projects) {
        $span_rows = "rowspan='2'";
    } else {
        $span_rows = "";
    }
    // Every row gets a label, name, and access information.
    echo "<td style='border-right: 0;' {$span_rows}>{$stage_id_bit}</td>";
    echo "<td style='text-align: left; border-left: 0; border-right: 0;' {$span_rows}><a href='{$stage->relative_url}' title='{$description}'>{$stage->name}</a></td>";
    // Output the access status icon. If the user does not yet have access
    // make the image a link to the access requirements.
    echo "<td style='border-left: 0;' {$span_rows}>";
    if ($access_link) {
        echo "<a href='{$access_link}'>";
    }
    echo "<img src='{$access_icon}' alt='" . attr_safe($access_text) . "' title='" . attr_safe($access_text) . "'>";
    if ($access_link) {
        echo "</a>";
    }
    echo "</td>";
    // Rounds and Pools also get project totals.
    if (is_a($stage, 'Round') || is_a($stage, 'Pool')) {
        echo "<td>{$total_projects}</td>";
        foreach ($desired_states as $desired_state) {
            echo "<td>";
            if ($load_filtered_projects) {
                echo $n_projects_in_state_by_filter_[$desired_state];
            } else {
                echo $stage_totals[$desired_state];
            }
            echo "</td>";
        }
    } else {
        echo "<td colspan='3' class='nocell'></td>";
    }
    // Rounds also get page totals.
    if (is_a($stage, 'Round')) {
        echo "<td>{$round_stats->curr_day_goal}</td>";
        echo "<td>{$round_stats->curr_day_actual}</td>";
        echo "<td><div class='progressbar' style='background-color: {$progress_bar_color}; width: {$progress_bar_width}%;'>&nbsp;</div><p style='clear: both; margin-top: 0;'>{$percent_complete}%</p></td>";
    } else {
        // IE6 & 7 do not display the top and left borders of a cell if
        // border-collapse=collapse and the border=1px. The following
        // tweak is to ensure that if we show the filter that the filter
        // cell has a border all the way around it.
        if ($show_filtered_projects) {
            echo "<td colspan='4' class='nocell' style='border-bottom: 1px solid black;'></td>";
        } else {
            echo "<td colspan='4' class='nocell'></td>";
        }
    }
    echo "</tr>\n";
    if ($show_filtered_projects) {
        if ($load_filtered_projects) {
            $display_filter = get_project_filter_display($pguser, $filter_type);
            $display_filter = preg_replace(array("/^<br>/", "/<br>/"), array("", " | "), $display_filter);
        } else {
            $display_filter = "<i>" . _("None") . "</i>";
        }
        echo "<tr>";
        echo "<td colspan='7' style='text-align: left;'>";
        echo "<small><a href='{$stage->relative_url}#filter_form'>" . _("Filter") . "</a>: {$display_filter}</small>";
        echo "</td>";
        echo "</tr>";
    }
}
Пример #27
0
 function _textbox($id, $label, $options = array())
 {
     global $action;
     if ($action == SHOW_BLANK_ENTRY_FORM) {
         $value = '';
     } else {
         if ($action == HANDLE_ENTRY_FORM_SUBMISSION) {
             $value = $_POST[$id];
         }
     }
     if ($value == '') {
         $value_attr = "";
     } else {
         $value_attr = sprintf(" value='%s'", attr_safe($value));
     }
     $size = array_get($options, 'size', 3);
     $use_a_label_element = array_get($options, 'use_a_label_element', FALSE);
     $put_label_on_left = array_get($options, 'put_label_on_left', FALSE);
     $input_element = "<input type='text' size='{$size}' name='{$id}' id='{$id}'{$value_attr}>";
     if ($use_a_label_element) {
         $label_thing = "<label for='{$id}'>{$label}</label>";
         $connector = " ";
     } else {
         $label_thing = $label;
         $connector = "&nbsp;&nbsp;";
     }
     if ($put_label_on_left) {
         $result = $label_thing . $connector . $input_element;
     } else {
         $result = $input_element . $connector . $label_thing;
     }
     return $result;
 }
Пример #28
0
$table->row("<a href='user_logon_stats.php'>" . _("User Logon Statistics") . "</a>", "<a href='pm_stats.php'>" . _("Project Management Statistics") . "</a>");
$table->row("<a href='pp_stats.php'>" . _("Post-Processing Statistics") . "</a>", "<a href='ppv_stats.php'>" . _("Post-Processing Verification Statistics") . "</a>");
$table->end();
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Pages in Rounds
$table = new ThemedTable(4, _("Pages in Rounds"), array('width' => 99));
foreach ($page_tally_names as $tally_name => $tally_title) {
    $qs = "tally_name={$tally_name}";
    $table->row($tally_name, "<a href='pages_proofed_graphs.php?{$qs}'>" . _("Pages Proofread Graphs") . "</a>", "<a href='misc_stats1.php?{$qs}'>" . _("Top Proofreading Days and Months, etc.") . "</a>", "<a href='proof_stats.php?{$qs}'>" . _("Top Proofreaders") . "</a>");
}
$table->end();
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Projects by Status
$table = new ThemedTable(3, _("Projects by Status"), array('width' => 99));
$table->column_headers('', _('Number So Far'), _('Graphed Over Time'));
foreach (array('created', 'proofed', 'PPd', 'posted') as $which) {
    $psd = get_project_status_descriptor($which);
    $res = mysql_query("\n        SELECT CAST(SUM(num_projects) AS SIGNED)\n        FROM project_state_stats\n        WHERE {$psd->state_selector}\n        GROUP BY date\n        ORDER BY date DESC\n        LIMIT 1\n    ");
    $num_so_far = number_format(mysql_result($res, 0));
    $table->row($psd->projects_Xed_title, $num_so_far, "<a href='projects_Xed_graphs.php?which={$which}'>{$psd->graphs_title}</a>");
}
$table->end();
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Total Projects Created, Proofread, Post-Processed and Posted
$table = new ThemedTable(1, _("Total Projects Created, Proofread, Post-Processed and Posted"), array('width' => 99));
$table->row('&nbsp;');
$img_url = "jpgraph_files/cumulative_total_proj_summary_graph.php";
$alt_text = _("Total Projects Created, Proofread, Post-Processed and Posted");
$table->row("<img src='{$img_url}' alt='" . attr_safe($alt_text) . "'>");
$table->end();
// vim: sw=4 ts=4 expandtab
         $status_text = _("Pending Review");
     }
     if ($row['is_active'] == 0) {
         $status_text = _("Disabled");
     }
     echo "[{$status_text}]</small>";
 }
 echo "</td>\n";
 echo "<th class='tl'>" . _("Full Name") . ":</th>\n";
 $source_fullname = $row['full_name'];
 // Since we apparently allow an empty full_name, check for that
 // and try to recover by using the display name, flagged with
 // an asterisk so even if display_name is blank, we get a visible
 // indication of the issue (and a visible link when applicable).
 if ($row['full_name'] == '') {
     $source_fullname .= "<span title='" . attr_safe(_("Record is missing a value for Full Name; Display Name used instead.")) . "'>*</span>" . $row['display_name'];
 }
 if (!is_null($row['url'])) {
     $link_name = "<br><a class='sourcelink' href='{$row['url']}'>{$row['url']}</a>";
 } else {
     $link_name = "";
 }
 echo "<td class='headerbg'><span class='fullname'>{$source_fullname}</span> {$link_name}</td>";
 if (is_null($row['projects_total'])) {
     $row['projects_total'] = 0;
 }
 if (is_null($row['projects_completed'])) {
     $row['projects_completed'] = 0;
 }
 $projects_inprogress = $row['projects_total'] - $row['projects_completed'];
 echo "<td rowspan='4' class='center'>";
Пример #30
0
    $err_msg = handle_upload($_FILES['replacement_image']);
    if ($err_msg == '') {
        echo "<p>", _('Image successfully replaced.'), "</p>\n";
        echo "<p>", "<a href='{$code_url}/tools/proofers/images_index.php?project={$projectid}'>", _('Return to Images Index'), "</a>", "</p>\n";
        exit;
    } else {
        echo "<p>";
        echo _('An error occurred.'), "\n";
        echo $err_msg, "\n";
        echo _('Please try again.'), "\n";
        echo "</p>\n";
        // Fall through to try again.
    }
}
echo "<p>", _('Select a replacement image to upload:'), "</p>\n";
echo "\n    <form enctype='multipart/form-data' action='replace_image.php' method='post'>\n    <input type='hidden' name='projectid' value='{$projectid}'>\n    <input type='hidden' name='image' value='{$image}'>\n    <input type='file' name='replacement_image' size='50'>\n    <br>\n    <input type='submit' value='", attr_safe(_("Upload Image")), "'>\n    </form>\n";
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function handle_upload($replacement_image_info)
{
    global $projectid, $image;
    global $projects_dir;
    // Check the error code.
    $error_code = $replacement_image_info['error'];
    if ($error_code != UPLOAD_ERR_OK) {
        return sprintf(_('Error code = %d.'), $error_code) . "\n" . "(" . get_upload_err_msg($error_code) . ")";
    }
    // Check that the extensions match.
    $curr_ext = pathinfo($image, PATHINFO_EXTENSION);
    $repl_ext = pathinfo($replacement_image_info['name'], PATHINFO_EXTENSION);
    if ($curr_ext != $repl_ext) {
        return sprintf(_("Replacement file's extension (%s) does not match current file's extension (%s)."), $repl_ext, $curr_ext);