function loadRows() { global $Conf, $Me, $prow, $paperTable, $crow, $Error; $Conf->paper = $prow = PaperTable::paperRow($whyNot); if (!$prow) { exit_to_paper(); } $paperTable = new PaperTable($prow, make_qreq()); $paperTable->resolveReview(false); $paperTable->resolveComments(); $cid = defval($_REQUEST, "commentId", "xxx"); $crow = null; foreach ($paperTable->crows as $row) { if ($row->commentId == $cid || $cid == "response" && $row->commentType & COMMENTTYPE_RESPONSE) { $crow = $row; } } if (!$crow && $cid != "xxx" && $cid != "new" && $cid != "response" && $cid != "newresponse") { Conf::msg_error("No such comment."); $Conf->ajaxExit(array("ok" => false)); } if (isset($Error["paperId"]) && $Error["paperId"] != $prow->paperId) { $Error = array(); } }
function complete_assignment($callback) { global $Me; $assignset = new AssignmentSet($Me, false); $assignset->parse($_POST["file"], get($_POST, "filename"), assignment_defaults(), $callback); $SSel = SearchSelection::make(make_qreq(), $Me); $assignset->restrict_papers($SSel->selection()); return $assignset->execute(true); }
function loadRows() { global $Conf, $Me, $prow, $paperTable, $editRrowLogname, $Error; $Conf->paper = $prow = PaperTable::paperRow($whyNot); if (!$prow) { errorMsgExit(whyNotText($whyNot, "view")); } $paperTable = new PaperTable($prow, make_qreq()); $paperTable->resolveReview(true); if ($paperTable->editrrow && $paperTable->editrrow->contactId == $Me->contactId) { $editRrowLogname = "Review " . $paperTable->editrrow->reviewId; } else { if ($paperTable->editrrow) { $editRrowLogname = "Review " . $paperTable->editrrow->reviewId . " by " . $paperTable->editrrow->email; } } if (isset($Error["paperId"]) && $Error["paperId"] != $prow->paperId) { $Error = array(); } }
$Conf->ajaxExit(array("error" => true, "message" => $err)); } function user_pset_info() { global $Conf, $User, $Pset, $Info, $Commit, $Qreq; $Info = ContactView::user_pset_info($User, $Pset); if (($Commit = $Qreq->newcommit) == null) { $Commit = $Qreq->commit; } if (!$Info->set_commit($Commit)) { $Conf->ajaxExit(array("ok" => false, "error" => $Info->repo ? "No repository." : "Commit " . htmlspecialchars($Commit) . " isn’t connected to this repository.")); } return $Info; } ContactView::set_path_request(array("/@", "/@/p", "/@/p/h/f", "/@/p/f", "/p/h/f", "/p/f")); $Qreq = make_qreq(); // user, pset, runner $User = $Me; if (isset($Qreq->u) && !($User = ContactView::prepare_user($Qreq->u))) { exit; } assert($User == $Me || $Me->isPC); $Pset = ContactView::find_pset_redirect($Qreq->pset); $Psetid = $Pset->id; // repo $Info = user_pset_info(); $Repo = $Info->repo; $Commit = $Info->commit_hash(); $RecentCommits = $Info->recent_commits(); if (!$Repo || !$Commit || !$Info->can_view_repo_contents || !$Qreq->file) { exit;
unset($_REQUEST["name"], $_GET["name"], $_POST["name"]); } // add primary or secondary reviewer if (isset($_REQUEST["addpc"]) && $Me->allow_administer($prow) && check_post()) { if (($pcid = cvtint(@$_REQUEST["pcid"])) <= 0) { Conf::msg_error("Enter a PC member."); } else { if (($pctype = cvtint(@$_REQUEST["pctype"])) == REVIEW_PRIMARY || $pctype == REVIEW_SECONDARY || $pctype == REVIEW_PC) { $Me->assign_review($prow->paperId, $pcid, $pctype); $Conf->update_rev_tokens_setting(false); } } loadRows(); } // paper table $paperTable = new PaperTable($prow, make_qreq(), "assign"); $paperTable->initialize(false, false); confHeader(); // begin form and table $loginUrl = hoturl_post("assign", "p={$prow->paperId}"); $paperTable->paptabBegin(); // reviewer information $proposals = null; if (setting("extrev_chairreq")) { if ($Me->allow_administer($prow)) { $q = ""; } else { $q = " and requestedBy={$Me->contactId}"; } $result = Dbl::qe_raw("select name, ReviewRequest.email, firstName as reqFirstName, lastName as reqLastName, ContactInfo.email as reqEmail, requestedBy, reason, reviewRound from ReviewRequest join ContactInfo on (ContactInfo.contactId=ReviewRequest.requestedBy) where ReviewRequest.paperId={$prow->paperId}" . $q); $proposals = edb_orows($result);
$old_grade = $info->current_grade_entry($ge->name); if ((string) $old_grade != trim($values["old;" . $ge->name]) && $old_grade !== $g) { json_exit(["ok" => false, "error" => "Someone else updated this grade concurrently—please reload."]); } } $grades[$ge->name] = $g; } } $key = $isauto ? "autogrades" : "grades"; if (!empty($grades)) { $info->update_current_info([$key => $grades]); } return $grades; } if ($Me->isPC && $Me != $User && check_post() && isset($_REQUEST["setgrade"]) && $Info->can_have_grades()) { $grades = save_grades($Pset, $Info, make_qreq(), false); if (isset($_REQUEST["ajax"])) { json_exit(["ok" => true, "grades" => $grades]); } redirectSelf(); } if ($Me->isPC && $Me != $User && check_post() && isset($_REQUEST["setlatehours"]) && $Info->can_have_grades()) { if (isset($_REQUEST["late_hours"]) && preg_match('_\\A(?:0|[1-9]\\d*)\\z_', $_REQUEST["late_hours"])) { $Info->update_current_info(["late_hours" => intval($_REQUEST["late_hours"])]); $result = true; } else { $result = false; } if (isset($_REQUEST["ajax"])) { $Conf->ajaxExit($result); }
foreach ($col as $thecol) { if (count($thecol)) { echo "<td class='top'><table>"; foreach ($thecol as $td) { echo "<tr><td style='padding:0 2em 1ex 0'>", $td, "</td></tr>"; } echo "</table></td>\n"; } } echo "</tr></table>\n"; } // ajax assignment form echo Ht::form(hoturl_post("assign", "update=1"), array("id" => "assrevform")), "<div class='clear'>", Ht::hidden("kind", $qreq->kind), Ht::hidden("p", ""), Ht::hidden("pcs{$reviewer}", ""), Ht::hidden("reviewer", $reviewer), Ht::hidden("rev_roundtag", $qreq->rev_roundtag), "</div></form>\n\n"; // main assignment form $search = new PaperSearch($Me, array("t" => $qreq->t, "q" => $qreq->q, "urlbase" => hoturl_site_relative_raw("manualassign", "reviewer={$reviewer}"))); $paperList = new PaperList($search, ["sort" => true, "list" => true, "reviewer" => $pcm[$reviewer]], make_qreq()); $paperList->display .= " topics "; if ($qreq->kind != "c") { $paperList->display .= "reviewers "; } if (isset($showau)) { $search->overrideMatchPreg = true; $search->matchPreg = array(); if ($showau) { $search->matchPreg["authorInformation"] = make_match_preg($showau); } if ($showco) { $search->matchPreg["collaborators"] = make_match_preg($showco); } } $a = isset($qreq->sort) ? "&sort=" . urlencode($qreq->sort) : "";
$pfd = " "; foreach ($_REQUEST as $k => $v) { if (substr($k, 0, 4) == "show" && $v) { $pfd .= substr($k, 4) . " "; } } $Conf->save_session("pfdisplay", $pfd); redirectSelf(); } $pldisplay = displayOptionsSet("pfdisplay"); // Header and body $Conf->header("Review preferences", "revpref", actionBar()); $Conf->infoMsg($Conf->message_html("revprefdescription")); // search $search = new PaperSearch($Me, array("t" => "rable", "urlbase" => hoturl_site_relative_raw("reviewprefs", "reviewer={$reviewer}"), "q" => defval($_REQUEST, "q", "")), $reviewer); $pl = new PaperList($search, ["sort" => true, "list" => true, "row_id_pattern" => "p#", "foldtype" => "pf", "reviewer" => $reviewer_contact], make_qreq()); $pl_text = $pl->table_html("editReviewPreference", array("class" => "pltable_full", "table_id" => "foldpl", "attributes" => array("data-fold-session" => "pfdisplay.\$"), "footer_extra" => "<div id='plactr'>" . Ht::submit("update", "Save changes", array("class" => "hb")) . "</div>", "list_properties" => ["revprefs" => true])); // DISPLAY OPTIONS echo "<table id='searchform' class='tablinks1'>\n<tr><td>"; // <div class='tlx'><div class='tld1'>"; $showing_au = !$Conf->subBlindAlways() && strpos($pldisplay, " au ") !== false; $showing_anonau = (!$Conf->subBlindNever() || $Me->privChair) && strpos($pldisplay, " anonau ") !== false; echo Ht::form_div(hoturl("reviewprefs"), array("method" => "get", "id" => "redisplayform", "class" => $showing_au || $showing_anonau && $Conf->subBlindAlways() ? "fold10o" : "fold10c")), "<table>"; if ($Me->privChair) { echo "<tr><td class='lxcaption'><strong>Preferences:</strong> </td><td class='lentry'>"; $prefcount = array(); $result = $Conf->qe("select contactId, count(preference) from PaperReviewPreference where preference!=0 group by contactId"); while ($row = edb_row($result)) { $prefcount[$row[0]] = $row[1]; } $revopt = pc_members_selector_options(false);