function get_mentoring_round($round_id) { global $mentoring_rounds; if ($round_id != '') { $round = get_Round_for_round_id($round_id); if (!$round->is_a_mentor_round()) { die("{$mentoring_round->id} is not a mentoring round!"); } return $round; } // Consider the page they came from. $referer = @$_SERVER['HTTP_REFERER']; // If they're coming to this page from a MENTORS ONLY book in X2, // referrer should contain &expected_state=X2.proj_avail. foreach ($mentoring_rounds as $mround) { if (strpos($referer, $mround->project_available_state)) { return $mround; } } // Just take the first. return $mentoring_rounds[0]; }
<input type="submit" value="<?php echo _("Resize"); ?> " size="3"> </form> <?php echo "<img src='{$projects_url}/{$projectid}/{$page}' width='{$width}' border='1'>"; } exit; } elseif ($frame == "text") { slim_header(_("Text Frame")); if (!count($error_messages)) { if ($round_id == "OCR") { $text_column_name = 'master_text'; } else { $round = get_Round_for_round_id($round_id); if (is_null($round)) { die("unexpected parameter round_id = '{$round_id}'"); } $text_column_name = $round->text_column_name; } $result = mysql_query(sprintf("SELECT {$text_column_name} FROM {$projectid} WHERE image = '%s'", mysql_real_escape_string($page))); $data = mysql_result($result, 0, $text_column_name); // Use the font and wrap prefs for the user's default interface layout, // since they're more likely to have set those prefs if ($userP['i_layout'] == 1) { $font_face_i = $userP['v_fntf']; $font_size_i = $userP['v_fnts']; $line_wrap = $userP['v_twrap']; } else { $font_face_i = $userP['h_fntf'];
$activity_ids[] = $activity_id; } } // ---------------------------------- mysql_query("\n CREATE TEMPORARY TABLE access_log_summary\n SELECT \n activity,\n subject_username,\n MAX( timestamp * (action='request' ) ) AS t_latest_request,\n MAX( timestamp * (action='deny_request_for') ) AS t_latest_deny\n FROM access_log\n GROUP BY activity, subject_username\n") or die(mysql_error()); foreach ($activity_ids as $activity_id) { echo "<h3>"; echo sprintf(_('Users requesting access to %s'), $activity_id); echo "</h3>\n"; $access_name = "{$activity_id}.access"; $res = mysql_query("\n SELECT\n usersettings.username,\n users.u_id,\n access_log_summary.t_latest_request,\n access_log_summary.t_latest_deny,\n users.t_last_activity\n FROM usersettings\n LEFT OUTER JOIN users USING (username)\n LEFT OUTER JOIN access_log_summary ON (\n access_log_summary.subject_username = usersettings.username\n AND\n access_log_summary.activity = '{$activity_id}'\n )\n WHERE setting = '{$access_name}' AND value='requested'\n ORDER BY username\n ") or die(mysql_error()); if (mysql_num_rows($res) == 0) { $word = _('none'); echo "({$word})"; } else { $review_round = get_Round_for_round_id($activity_id); if ($review_round && $review_round->after_satisfying_minima == 'REQ-HUMAN') { $can_review_work = TRUE; // These users are all requesting access to round Y. For each, we will // provide a link to allow the requestor to review their round X work, // by considering each page they worked on in X, and comparing // their X result to the subsequent Y result (if it exists yet). // // (We assume that X is the round immediately preceding Y.) $work_round = get_Round_for_round_number($review_round->round_number - 1); $round_params = "work_round_id={$work_round->id}&review_round_id={$review_round->id}"; } else { $can_review_work = FALSE; } echo "<table border='1'>\n"; echo "<tr>";
} if (empty($sampleLimit)) { $sampleLimit = $default_sampleLimit; } if (empty($days)) { $days = $default_days; } // confirm the review_round_id is later than work_round_id if (array_search($review_round_id, $rounds) <= array_search($work_round_id, $rounds)) { echo "<p class='error'>" . _("Review Round should be a round later than Work Round.") . "</p>"; exit; } echo "<hr>"; // we should have valid information at this point $work_round = get_Round_for_round_id($work_round_id); $review_round = get_Round_for_round_id($review_round_id); $time_limit = time() - $days * 24 * 60 * 60; $res2 = dpsql_query("\n SELECT\n page_events.projectid,\n state,\n nameofwork,\n deletion_reason,\n FROM_UNIXTIME(MAX(timestamp)) AS time_of_latest_save\n FROM page_events LEFT OUTER JOIN projects USING (projectid)\n WHERE round_id='{$work_round->id}' AND \n page_events.username='******' AND \n event_type='saveAsDone' AND\n timestamp>{$time_limit}\n GROUP BY page_events.projectid\n ORDER BY time_of_latest_save DESC\n") or die("Aborting"); $num_projects = mysql_num_rows($res2); echo "<p>" . sprintf(_("<b>%d</b> projects with pages saved in <b>%s</b> by <b>%s</b> within the last <b>%d</b> days."), $num_projects, $work_round->id, $username, $days) . "</p>"; // --------------------------------------------- // snippets for use in queries $has_been_saved_in_review_round = "(state='{$review_round->page_save_state}'"; for ($rn = $review_round->round_number + 1; $rn <= MAX_NUM_PAGE_EDITING_ROUNDS; $rn++) { $round = get_Round_for_round_number($rn); $has_been_saved_in_review_round .= " OR state LIKE '{$round->id}.%'"; } $has_been_saved_in_review_round .= ")"; // echo "$has_been_saved_in_review_round<br>\n"; $there_is_a_diff = "\n {$work_round->text_column_name}\n !=\n BINARY {$review_round->text_column_name}\n"; // ---------------------------------------------
include_once $relPath . 'prefs_options.inc'; // for PRIVACY_* constants include_once $relPath . 'theme.inc'; // for page marginalia include_once $relPath . 'project_states.inc'; // for PROJ_ declarations include_once $relPath . 'TallyBoard.inc'; // for TallyBoard require_login(); // Display page header. output_header(_("For Mentors")); // --------------------------------------------------------------- // Decide which mentoring-round we're dealing with. $round_id = get_enumerated_param($_GET, 'round_id', null, array_keys($Round_for_round_id_), true); if ($round_id != '') { $mentoring_round = get_Round_for_round_id($round_id); } else { // Consider the page they came from. $referer = @$_SERVER['HTTP_REFERER']; // If they're coming to this page from a MENTORS ONLY book in X2, // referrer should contain &expected_state=X2.proj_avail. foreach ($Round_for_round_id_ as $round) { if (strpos($referer, $round->project_available_state)) { $mentoring_round = $round; break; } } if (!isset($mentoring_round)) { // Just take the first. foreach ($Round_for_round_id_ as $round) { if ($round->is_a_mentor_round()) {