email) $Me->escape(); $rf = $Conf->review_form(); // general error messages if ($Qreq->post && $Qreq->post_empty()) $Conf->post_missing_msg(); // download blank review form action if (isset($Qreq->downloadForm)) { $text = $rf->textFormHeader("blank") . $rf->textForm(null, null, $Me, null) . "\n"; downloadText($text, "review"); } // upload review form action if (isset($Qreq->uploadForm) && $Qreq->has_file("uploadedFile") && $Qreq->post_ok()) { $tf = ReviewValues::make_text($rf, $Qreq->file_contents("uploadedFile"), $Qreq->file_filename("uploadedFile")); while ($tf->parse_text($Qreq->override)) $tf->check_and_save($Me, null, null); $tf->report(); // Uploading forms may have completed the reviewer's task; recheck roles. Contact::update_rights(); } else if (isset($Qreq->uploadForm)) Conf::msg_error("Choose a file first."); // upload tag indexes action function saveTagIndexes($tag, $filename, &$settings, &$titles, &$linenos, &$errors) { global $Conf, $Me; foreach ($Me->paper_set(array_keys($settings)) as $row) { if ($settings[$row->paperId] !== null && !$Me->can_change_tag($row, $tag, null, 1)) { $errors[$linenos[$row->paperId]] = "You cannot rank paper #$row->paperId."; unset($settings[$row->paperId]); } else if ($titles[$row->paperId] !== "" && strcmp($row->title, $titles[$row->paperId]) != 0 && strcasecmp($row->title, simplify_whitespace($titles[$row->paperId])) != 0) $errors[$linenos[$row->paperId]] = "Warning: Title doesn’t match."; } if (!$tag) $errors["0tag"] = "Tag missing."; else if (count($settings)) { $x = array("paper,tag,lineno"); foreach ($settings as $pid => $value) $x[] = "$pid,$tag#" . ($value === null ? "clear" : $value) . "," . $linenos[$pid]; $assigner = new AssignmentSet($Me); $assigner->parse(join("\n", $x) . "\n", $filename); $assigner->report_errors(); $assigner->execute(); } $settings = $titles = $linenos = array(); } function check_tag_index_line(&$line) { if ($line && count($line) >= 2 && preg_match('/\A\s*(|[Xx=]|>*|\(?([-+]?\d+)\)?)\s*\z/', $line[0], $m1) && preg_match('/\A\s*(\d+)\s*\z/', $line[1], $m2)) { $line[0] = isset($m1[2]) && $m1[2] !== "" ? $m1[2] : $m1[1]; $line[1] = $m2[1]; return true; } else return false; } function setTagIndexes($qreq) { global $Conf, $Me; $filename = null; if (isset($qreq->upload) && $qreq->has_file("file")) { if (($text = $qreq->file_contents("file")) === false) { Conf::msg_error("Internal error: cannot read file."); return; } $filename = $qreq->file_filename("file"); } else if (!($text = $qreq->data)) { Conf::msg_error("Choose a file first."); return; } $RealMe = $Me; $tagger = new Tagger; if (($tag = $qreq->tag)) $tag = $tagger->check($tag, Tagger::NOVALUE); $curIndex = 0; $lineno = 1; $settings = $titles = $linenos = $errors = array(); $csvp = new CsvParser("", CsvParser::TYPE_GUESS); foreach (explode("\n", rtrim(cleannl($text))) as $l) { if (substr($l, 0, 4) == "Tag:" || substr($l, 0, 6) == "# Tag:") { if (!$tag) $tag = $tagger->check(trim(substr($l, ($l[0] == "#" ? 6 : 4))), Tagger::NOVALUE); } else if (trim($l) !== "" && $l[0] !== "#") { $csvp->unshift($l); $line = $csvp->next(); if ($line && check_tag_index_line($line)) { if (isset($settings[$line[1]])) $errors[$lineno] = "Paper #$line[1] already given on line " . $linenos[$line[1]]; if ($line[0] === "X" || $line[0] === "x") $settings[$line[1]] = null; else if ($line[0] === "" || $line[0] === ">") $settings[$line[1]] = $curIndex = $curIndex + 1; else if (is_numeric($line[0])) $settings[$line[1]] = $curIndex = intval($line[0]); else if ($line[0] === "=") $settings[$line[1]] = $curIndex; else $settings[$line[1]] = $curIndex = $curIndex + strlen($line[0]); $titles[$line[1]] = trim(get($line, 2, "")); $linenos[$line[1]] = $lineno; } else $errors[$lineno] = "Syntax error"; } ++$lineno; } if (count($settings) && $Me) saveTagIndexes($tag, $filename, $settings, $titles, $linenos, $errors); $Me = $RealMe; if (count($errors)) { ksort($errors); foreach ($errors as $lineno => &$error) { if ($filename && $lineno) $error = '' . htmlspecialchars($filename) . ':' . $lineno . ': ' . $error; else if ($filename) $error = '' . htmlspecialchars($filename) . ': ' . $error; } Conf::msg_error('
' . join("
\n", $errors) . '
Download forms\n";
if ($Me->is_reviewer()) {
echo "Your reviews
Tip: Use Search > Download to choose individual papers.\n";
} else
echo "Blank form\n";
echo "\n"; if ($Me->has_outstanding_review()) echo "Your incomplete reviews \n"; echo "Blank form | \n";
if ($Me->is_reviewer()) {
$disabled = ($pastDeadline && !$Me->privChair ? " disabled='disabled'" : "");
echo "Upload filled-out forms\n", Ht::form(hoturl_post("offline", "uploadForm=1")), Ht::hidden("postnonempty", 1), " ", Ht::submit("Go", array("disabled" => !!$disabled)); if ($pastDeadline && $Me->privChair) echo "", Ht::checkbox("override"), " ", Ht::label("Override deadlines"); echo " Tip: You may upload a file containing several forms."; echo " | \n";
}
echo "
Download ranking file\n | \n";
$disabled = ($pastDeadline && !$Me->privChair ? " disabled='disabled'" : "");
echo "Upload ranking file\n", Ht::form(hoturl_post("offline", "setrank=1&tag=%7E$ranktag")), Ht::hidden("upload", 1), " ", Ht::submit("Go", array("disabled" => !!$disabled)); if ($pastDeadline && $Me->privChair) echo "", Ht::checkbox("override"), " ", Ht::label("Override deadlines"); echo " Tip: Use “editsort:#~$ranktag” to drag and drop your ranking."; echo " Tip: “order:~$ranktag” searches by your ranking."; echo " | \n";
echo "