예제 #1
0
include_once 'page_table.inc';
require_login();
$projectid = validate_projectID('project', @$_GET['project']);
$show_image_size = get_integer_param($_GET, 'show_image_size', 0, 0, 1);
$project = new Project($projectid);
if (isset($_GET['select_by_user'])) {
    $sbu = $_GET['select_by_user'];
    if (empty($sbu)) {
        // Show just the current user's pages.
        $username_for_page_selection = $pguser;
    } else {
        // Explicitly specify a particular user.
        // This is only available to PFs & SAs.
        // (Yes, even though it merely filters
        // information that is available to all.)
        if (user_is_a_sitemanager() || user_is_proj_facilitator()) {
            $username_for_page_selection = $sbu;
        } else {
            // Just show the current user's pages.
            $username_for_page_selection = $pguser;
        }
    }
} else {
    // No 'select_by_user' parameter, so show all pages.
    $username_for_page_selection = NULL;
}
// this only has any effect if the user is set too.
$round_for_page_selection = NULL;
if (isset($_GET['select_by_round'])) {
    $sbr = $_GET['select_by_round'];
    if (!empty($sbr) && $sbr != 'ALL') {
예제 #2
0
 function show_visible_controls()
 {
     global $site_abbreviation, $pguser;
     $can_set_difficulty_tofrom_beginner = $pguser == "BEGIN" || user_is_a_sitemanager();
     $can_edit_PPer = TRUE;
     $is_checked_out = FALSE;
     if (!empty($this->projectid)) {
         $this->row(_("Project ID"), 'just_echo', $this->projectid);
         // do some things that depend on the project state
         if ($this->state == PROJ_DELETE) {
             $this->row(_("Reason for Deletion"), 'text_field', $this->deletion_reason, 'deletion_reason');
         } else {
             if ($this->state == PROJ_POST_FIRST_CHECKED_OUT) {
                 // once the project is in PP, PPer can only be changed by an SA, PF,
                 // or if it's checked out to the PM
                 $is_checked_out = TRUE;
                 $can_edit_PPer = $this->projectmanager == $this->checkedoutby || user_is_a_sitemanager() || user_is_proj_facilitator();
             } else {
                 if ($this->state == PROJ_POST_SECOND_CHECKED_OUT) {
                     $is_checked_out = TRUE;
                     $can_edit_PPer = user_is_a_sitemanager();
                 }
             }
         }
     }
     if (!empty($this->up_projectid)) {
         $res2 = mysql_query("\n                SELECT up_nameofwork\n                FROM uber_projects\n                WHERE up_projectid = '{$this->up_projectid}'\n            ");
         $up_nameofwork = mysql_result($res2, 0, "up_nameofwork");
         $this->row(_("Related Uber Project"), 'just_echo', $up_nameofwork);
     }
     $this->row(_("Name of Work"), 'text_field', $this->nameofwork, 'nameofwork');
     $this->row(_("Author's Name"), 'text_field', $this->authorsname, 'authorsname');
     if (user_is_a_sitemanager()) {
         // SAs are the only ones who can change this
         $this->row(_("Project Manager"), 'DP_user_field', $this->projectmanager, 'username', sprintf(_("%s username only."), $site_abbreviation));
     }
     $this->row(_("Language"), 'language_list', $this->language);
     $this->row(_("Genre"), 'genre_list', $this->genre);
     if ($this->difficulty_level == "beginner" && !$can_set_difficulty_tofrom_beginner) {
         // allow PF to edit a BEGIN project, but without altering the difficulty
         $this->row(_("Difficulty Level"), 'just_echo', _("Beginner"));
         echo "<input type='hidden' name='difficulty_level' value='{$this->difficulty_level}'>";
     } else {
         $this->row(_("Difficulty Level"), 'difficulty_list', $this->difficulty_level);
     }
     $this->row(_("Special Day (optional)"), 'special_list', $this->special_code);
     if ($can_edit_PPer) {
         $this->row(_("PPer/PPVer"), 'DP_user_field', $this->checkedoutby, 'checkedoutby', sprintf(_("Optionally reserve for a PPer. %s username only."), $site_abbreviation));
     } else {
         $this->row(_("PPer/PPVer"), 'just_echo', $this->checkedoutby);
         echo "<input type='hidden' name='checkedoutby' value='{$this->checkedoutby}'>";
     }
     $this->row(_("Original Image Source"), 'image_source_list', $this->image_source);
     $this->row(_("Image Preparer"), 'DP_user_field', $this->image_preparer, 'image_preparer', sprintf(_("%s user who scanned or harvested the images."), $site_abbreviation));
     $this->row(_("Text Preparer"), 'DP_user_field', $this->text_preparer, 'text_preparer', sprintf(_("%s user who prepared the text files."), $site_abbreviation));
     $this->row(_("Extra Credits<br>(to be included in list of names)"), 'extra_credits_field', $this->extra_credits);
     if ($this->scannercredit != '') {
         $this->row(_("Scanner Credit (deprecated)"), 'text_field', $this->scannercredit, 'scannercredit');
     }
     $this->row(_("Clearance Information"), 'text_field', $this->clearance, 'clearance');
     $this->row(_("Posted Number"), 'text_field', $this->postednum, 'postednum');
     $this->row(_("Project Comments"), 'proj_comments_field', $this->comments);
     // don't show the word list line if we're in the process of cloning
     if (!empty($this->projectid)) {
         $this->row(_("Project Dictionary"), 'word_lists', null, null, '', $this->projectid);
     }
 }
예제 #3
0
 if ($project->checkedoutby != "") {
     // Maybe we should get this info via a
     // left outer join in the big select query.
     // (Actually, I tried it in a few cases and the left outer join was always slower.)
     $contact_url = get_url_to_compose_message_to_user($project->checkedoutby);
     print "<a href='{$contact_url}'>{$project->checkedoutby}</a>";
 }
 echo "</td>\n";
 // Project Status
 echo "<td valign='middle'>\n";
 echo_project_state_changer($project);
 echo "</td>\n";
 // Options
 if ($show_options_column) {
     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'>";
예제 #4
0
$relPath = '../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'dpsql.inc';
include_once $relPath . 'misc.inc';
// html_safe()
include_once $relPath . 'project_states.inc';
include_once $relPath . 'stages.inc';
include_once $relPath . 'user_is.inc';
include_once $relPath . 'theme.inc';
include_once $relPath . 'release_queue.inc';
require_login();
if ($ordinary_users_can_see_queue_settings) {
    $user_can_see_queue_settings = TRUE;
} else {
    // Only privileged users can see queue settings
    $user_can_see_queue_settings = user_is_a_sitemanager() || user_is_proj_facilitator();
}
$round_id = get_enumerated_param($_GET, 'round_id', null, array_keys($Round_for_round_id_), true);
$name = @$_GET['name'];
if (is_null($round_id)) {
    $title = _("Release Queues");
    output_header($title);
    echo "<br><h2>{$title}</h2>";
    echo _("Each round has its own set of release queues."), "\n";
    echo _("Please select the round that you're interested in:"), "\n";
    echo "<ul>\n";
    foreach (array_keys($Round_for_round_id_) as $round_id) {
        echo "<li><a href='release_queue.php?round_id={$round_id}'>{$round_id}</a></li>\n";
    }
    echo "</ul>\n";
    return;
예제 #5
0
include_once $relPath . 'DPage.inc';
include_once $relPath . 'project_states.inc';
include_once $relPath . 'Project.inc';
// project_get_auto_PPer
include_once $relPath . 'misc.inc';
// requester_is_localhost()
include_once 'autorelease.inc';
$one_project = validate_projectID('project', @$_GET['project'], true);
$refresh_url = @$_GET['return_uri'];
// The following users are authorized to run this script:
// 1) localhost (eg: run from crontab) - can operate on all projects
// 2) SA and PFs - can operates on all projects
// 3) PMs - can operate only on their own projects
if (!requester_is_localhost()) {
    require_login();
    if (!user_is_a_sitemanager() && !user_is_proj_facilitator()) {
        if ($one_project) {
            $project = new Project($one_project);
            if (!$project->can_be_managed_by_user($pguser)) {
                die('You are not authorized to invoke this script.');
            }
        } else {
            die('You are not authorized to invoke this script.');
        }
    }
}
if (!isset($refresh_url)) {
    $refresh_url = 'projectmgr.php';
}
$trace = FALSE;
// -----------------------------------------------------------------------------