function goPaperForm($baseUrl = null, $args = array()) { global $Conf, $Me; if ($Me->is_empty()) { return ""; } $list = SessionList::active(); $x = Ht::form_div(hoturl($baseUrl ?: "paper", array("ls" => null)), array("method" => "get", "class" => "gopaper" . ($list ? " has_hotcrp_list" : ""), "data-hotcrp-list" => $list ? $list->listno : null)); if ($baseUrl == "profile") { $x .= Ht::entry("u", "(User)", array("id" => "quicksearchq", "size" => 10, "placeholder" => "(User)")); } else { $x .= Ht::entry("p", "(All)", array("id" => "quicksearchq", "size" => 10, "placeholder" => "(All)", "class" => "hotcrp_searchbox")); } foreach ($args as $what => $val) { $x .= Ht::hidden($what, $val); } $x .= " " . Ht::submit("Search") . "</div></form>"; return $x; }
function show_pset_table($pset) { global $Conf, $Me, $Now, $Profile, $LastPsetFix; echo '<div id="', $pset->urlkey, '">'; echo "<h3>", htmlspecialchars($pset->title), "</h3>"; if ($Me->privChair) { show_pset_actions($pset); } if ($pset->disabled) { echo "</div>\n"; return; } $t0 = $Profile ? microtime(true) : 0; // load students if ($Conf->opt("restrictRepoView")) { $view = "l2.link repoviewable"; $viewjoin = "left join ContactLink l2 on (l2.cid=c.contactId and l2.type=" . LINK_REPOVIEW . " and l2.link=l.link)\n"; } else { $view = "4 repoviewable"; $viewjoin = ""; } $result = Dbl::qe("select c.contactId, c.firstName, c.lastName, c.email,\n\tc.huid, c.github_username, c.seascode_username, c.anon_username, c.extension, c.disabled, c.dropped, c.roles, c.contactTags,\n\tgroup_concat(pl.link) pcid, group_concat(rpl.link) rpcid,\n\tr.repoid, r.cacheid, r.heads, r.url, r.open, r.working, r.lastpset, r.snapcheckat, {$view},\n\trg.gradehash, rg.gradercid, rg.placeholder, rg.placeholder_at\n\tfrom ContactInfo c\n\tleft join ContactLink l on (l.cid=c.contactId and l.type=" . LINK_REPO . " and l.pset={$pset->id})\n\t{$viewjoin}\n\tleft join Repository r on (r.repoid=l.link)\n\tleft join ContactLink pl on (pl.cid=c.contactId and pl.type=" . LINK_PARTNER . " and pl.pset={$pset->id})\n\tleft join ContactLink rpl on (rpl.cid=c.contactId and rpl.type=" . LINK_BACKPARTNER . " and rpl.pset={$pset->id})\n\tleft join RepositoryGrade rg on (rg.repoid=r.repoid and rg.pset={$pset->id})\n\twhere (c.roles&" . Contact::ROLE_PCLIKE . ")=0\n\tand (rg.repoid is not null or not c.dropped)\n\tgroup by c.contactId, r.repoid"); $t1 = $Profile ? microtime(true) : 0; $anonymous = $pset->anonymous; if (req("anonymous") !== null && $Me->privChair) { $anonymous = !!req("anonymous"); } $students = array(); while ($result && ($s = Contact::fetch($result))) { $s->set_anonymous($anonymous); Contact::set_sorter($s, req("sort")); $students[$s->contactId] = $s; // maybe lastpset links are out of order if ($s->lastpset < $pset) { $LastPsetFix = true; } } uasort($students, "Contact::compare"); $checkbox = $Me->privChair || !$pset->gitless && $pset->runners; $rows = array(); $max_ncol = 0; $incomplete = array(); $pcmembers = pcMembers(); $jx = []; foreach ($students as $s) { if (!$s->visited) { $row = (object) ["student" => $s, "text" => "", "ptext" => []]; $j = render_pset_row($pset, $students, $s, $row, $pcmembers, $anonymous); if ($s->pcid) { foreach (array_unique(explode(",", $s->pcid)) as $pcid) { if (isset($students[$pcid])) { $jj = render_pset_row($pset, $students, $students[$pcid], $row, $pcmembers, $anonymous); $j["partners"][] = $jj; } } } if ($row->sortprefix) { $j["boring"] = true; } $jx[$row->sortprefix . $s->sorter] = $j; $max_ncol = max($max_ncol, $row->ncol); if ($s->incomplete) { $u = $Me->user_linkpart($s); $incomplete[] = '<a href="' . hoturl("pset", array("pset" => $pset->urlkey, "u" => $u, "sort" => req("sort"))) . '">' . htmlspecialchars($u) . '</a>'; } } } if (count($incomplete)) { echo '<div id="incomplete_pset', $pset->id, '" style="display:none" class="merror">', '<strong>', htmlspecialchars($pset->title), '</strong>: ', 'Your grading is incomplete. Missing grades: ', join(", ", $incomplete), '</div>', '<script>jQuery("#incomplete_pset', $pset->id, '").remove().show().appendTo("#incomplete_notices")</script>'; } if ($checkbox) { echo Ht::form_div(hoturl_post("index", array("pset" => $pset->urlkey, "save" => 1))); } $sort_key = $anonymous ? "anon_username" : "username"; usort($jx, function ($a, $b) use($sort_key) { if (get($a, "boring") != get($b, "boring")) { return get($a, "boring") ? 1 : -1; } return strcmp($a[$sort_key], $b[$sort_key]); }); echo '<table class="s61', $anonymous ? " s61anonymous" : "", '" id="pa-pset' . $pset->id . '"></table>'; $jd = ["checkbox" => $checkbox, "anonymous" => $anonymous, "grade_keys" => array_keys($pset->grades), "gitless" => $pset->gitless, "gitless_grades" => $pset->gitless_grades, "urlpattern" => hoturl("pset", ["pset" => $pset->urlkey, "u" => "@", "sort" => req("sort")])]; $i = $nintotal = $last_in_total = 0; foreach ($pset->grades as $ge) { if (!$ge->no_total) { ++$nintotal; $last_in_total = $ge->name; } ++$i; } if ($nintotal > 1) { $jd["need_total"] = true; } else { if ($nintotal == 1) { $jd["total_key"] = $last_in_total; } } echo Ht::unstash(), '<script>pa_render_pset_table(', $pset->id, ',', json_encode($jd), ',', json_encode(array_values($jx)), ')</script>'; if ($Me->privChair && !$pset->gitless_grades) { echo "<div class='g'></div>"; $sel = array("none" => "N/A"); foreach (pcMembers() as $pcm) { $sel[$pcm->email] = Text::name_html($pcm); } $sel["__random__"] = "Random"; echo '<span class="nb" style="padding-right:2em">', Ht::select("grader", $sel, "none"), Ht::submit("setgrader", "Set grader"), '</span>'; } if (!$pset->gitless) { $sel = array(); foreach ($pset->runners as $r) { if ($Me->can_run($pset, $r)) { $sel[$r->name] = htmlspecialchars($r->title); } } if (count($sel)) { echo '<span class="nb" style="padding-right:2em">', Ht::select("runner", $sel), Ht::submit("runmany", "Run all"), '</span>'; } } if ($checkbox) { echo "</div></form>\n"; } if ($Profile) { $t2 = microtime(true); echo sprintf("<div>Δt %.06f DB, %.06f total</div>", $t1 - $t0, $t2 - $t0); } echo "</div>\n"; }
private function echo_prologue() { global $Conf, $Me; if ($this->started) { return; } echo Ht::form_div(hoturl_post("mail")); foreach (array("recipients", "subject", "emailBody", "cc", "replyto", "q", "t", "plimit", "newrev_since") as $x) { if (isset($_REQUEST[$x])) { echo Ht::hidden($x, $_REQUEST[$x]); } } if (!$this->group) { echo Ht::hidden("ungroup", 1); } $recipients = defval($_REQUEST, "recipients", ""); if ($this->sending) { echo "<div id='foldmail' class='foldc fold2c'>", "<div class='fn fx2 merror'>In the process of sending mail. <strong>Do not leave this page until this message disappears!</strong><br /><span id='mailcount'></span></div>", "<div id='mailwarnings'></div>", "<span id='mailinfo'></span>", "<div class='fx'><div class='confirm'>Sent mail as follows.</div>", "<div class='aa'>", Ht::submit("go", "Prepare more mail"), "</div></div>", "<div class='fn2 warning'>Sending mail. <strong>Do not leave this page until it finishes rendering!</strong></div>", "</div>"; } else { if (isset($_REQUEST["emailBody"]) && $Me->privChair && (strpos($_REQUEST["emailBody"], "%REVIEWS%") || strpos($_REQUEST["emailBody"], "%COMMENTS%"))) { if (!$Conf->timeAuthorViewReviews()) { echo "<div class='warning'>Although these mails contain reviews and/or comments, authors can’t see reviews or comments on the site. (<a href='", hoturl("settings", "group=dec"), "' class='nw'>Change this setting</a>)</div>\n"; } else { if (!$Conf->timeAuthorViewReviews(true)) { echo "<div class='warning'>Mails to users who have not completed their own reviews will not include reviews or comments. (<a href='", hoturl("settings", "group=dec"), "' class='nw'>Change the setting</a>)</div>\n"; } } } if (isset($_REQUEST["emailBody"]) && $Me->privChair && substr($recipients, 0, 4) == "dec:") { if (!$Conf->timeAuthorViewDecision()) { echo "<div class='warning'>You appear to be sending an acceptance or rejection notification, but authors can’t see paper decisions on the site. (<a href='", hoturl("settings", "group=dec"), "' class='nw'>Change this setting</a>)</div>\n"; } } echo "<div id='foldmail' class='foldc fold2c'>", "<div class='fn fx2 warning'>In the process of preparing mail. You will be able to send the prepared mail once this message disappears.<br /><span id='mailcount'></span></div>", "<div id='mailwarnings'></div>", "<div class='fx info'>Verify that the mails look correct, then select “Send” to send the checked mails.<br />", "Mailing to: ", $this->recip->unparse(), "<span id='mailinfo'></span>"; if (!preg_match('/\\A(?:pc\\z|pc:|all\\z)/', $recipients) && defval($_REQUEST, "plimit") && $_REQUEST["q"] !== "") { echo "<br />Paper selection: ", htmlspecialchars($_REQUEST["q"]); } echo "</div>"; $this->echo_actions(" fx"); // This next is only displayed when Javascript is off echo '<div class="fn2 warning">Scroll down to send the prepared mail once the page finishes loading.</div>', "</div>\n"; } $Conf->echoScript("fold('mail',0,2)"); $this->started = true; }
echo "<div class='helpside'><div class='helpinside'>\nAssignment methods:\n<ul><li><a href='", hoturl("autoassign"), "'>Automatic</a></li>\n <li><a href='", hoturl("manualassign"), "' class='q'><strong>Manual by PC member</strong></a></li>\n <li><a href='", hoturl("assign"), "'>Manual by paper</a></li>\n <li><a href='", hoturl("bulkassign"), "'>Bulk update</a></li>\n</ul>\n<hr class='hr' />\n"; if ($qreq->kind == "a") { echo "Types of PC review:\n<dl><dt>" . review_type_icon(REVIEW_PRIMARY) . " Primary</dt><dd>Mandatory, may not be delegated</dd>\n <dt>" . review_type_icon(REVIEW_SECONDARY) . " Secondary</dt><dd>Mandatory, may be delegated to external reviewers</dd>\n <dt>" . review_type_icon(REVIEW_PC) . " Optional</dt><dd>May be declined</dd></dl>\n<hr class='hr' />\n"; } echo "<dl><dt>Potential conflicts</dt><dd>Matches between PC member collaborators and paper authors, or between PC member and paper authors or collaborators</dd>\n"; if ($qreq->kind == "a") { echo "<dt>Preference</dt><dd><a href='", hoturl("reviewprefs"), "'>Review preference</a></dd>\n <dt>Topic score</dt><dd>+4 per high interest paper topic, −2 per low interest paper topic</dd>\n <dt>Desirability</dt><dd>High values mean many PC members want to review the paper</dd>\n"; } echo "</dl>\nClick a heading to sort.\n</div></div>"; if ($reviewer > 0) { echo "<h2 style='margin-top:1em'>Assignments for ", $Me->name_html_for($pcm[$reviewer]), $pcm[$reviewer]->affiliation ? " (" . htmlspecialchars($pcm[$reviewer]->affiliation) . ")" : "", "</h2>\n"; } else { echo "<h2 style='margin-top:1em'>Assignments by PC member</h2>\n"; } // Change PC member echo "<table><tr><td><div class='aahc assignpc_pcsel'>", Ht::form_div(hoturl("manualassign"), array("method" => "get", "id" => "selectreviewerform")); $result = $Conf->qe("select ContactInfo.contactId, count(reviewId)\n from ContactInfo\n left join PaperReview on (PaperReview.contactId=ContactInfo.contactId and PaperReview.reviewType>=" . REVIEW_SECONDARY . ")\n where (roles&" . Contact::ROLE_PC . ")!=0\n group by ContactInfo.contactId"); $rev_count = array(); while ($row = edb_row($result)) { $rev_count[$row[0]] = $row[1]; } $rev_opt = array(); if ($reviewer <= 0) { $rev_opt[0] = "(Select a PC member)"; } foreach ($pcm as $pc) { $rev_opt[$pc->contactId] = Text::name_html($pc) . " (" . plural(defval($rev_count, $pc->contactId, 0), "assignment") . ")"; } echo "<table><tr><td><strong>PC member:</strong> </td>", "<td>", Ht::select("reviewer", $rev_opt, $reviewer, array("onchange" => "hiliter(this)")), "</td></tr>", "<tr><td colspan='2'><div class='g'></div></td></tr>\n"; // Paper selection $q = $qreq->q == "" ? "(All)" : $qreq->q;
<path d="M 61.71,62.611 C 66.977,55.945 70.128,47.531 70.128,38.378 C 70.128,29.161 66.936,20.696 61.609,14.01" style="fill:none;stroke:#111111;stroke-width:5;stroke-linecap:round"/> </svg><svg id="muteicon" class="fx" width="1.5em" height="1.5em" viewBox="0 0 75 75" style="position:relative;bottom:-3px"> <polygon points="39.389,13.769 22.235,28.606 6,28.606 6,47.699 21.989,47.699 39.389,62.75 39.389,13.769" style="stroke:#111111;stroke-width:5;stroke-linejoin:round;fill:#111111;" /> <path d="M 48.651772,50.269646 69.395223,25.971024" style="fill:none;stroke:#111111;stroke-width:5;stroke-linecap:round"/> <path d="M 69.395223,50.269646 48.651772,25.971024" style="fill:none;stroke:#111111;stroke-width:5;stroke-linecap:round" /> </svg></button></td>'; //echo '<span class="hidden fhn_ib"> Mute</span>'; //echo '<span class="hidden fhx_ib"> Unmute</span></button></td>'; // show-papers if ($Me->has_database_account()) { echo '<td style="padding-left:2em">', Ht::checkbox("buzzer_showpapers", 1, $show_papers, array("id" => "buzzer_showpapers", "onclick" => "trackertable_showpapers()")), " ", Ht::label("Show papers"), '</td>'; Ht::stash_script("trackertable_showpapers()"); } // kiosk mode if ($Me->privChair) { echo '<td style="padding-left:2em">', Ht::js_button("Kiosk mode", "popup(this,'kiosk',0,true)"), '</td>'; $Conf->footerHtml('<div id="popup_kiosk" class="popupc"> <p>Kiosk mode is a discussion status page with no other site privileges. It’s safe to leave a browser in kiosk mode open in the hallway.</p> <p><b>Kiosk mode will sign you out of the site.</b> Do not use kiosk mode on your main browser. Instead, sign in to another browser and navigate to this page. Or use these URLs:</p> <p><table><tr><td class="lcaption nw">With papers</td> <td>' . hoturl_absolute("buzzer", array("__PATH__" => $kiosk_keys[1])) . '</td></tr> <tr><td class="lcaption nw">Conflicts only</td> <td>' . hoturl_absolute("buzzer", array("__PATH__" => $kiosk_keys[0])) . '</td></tr></table></p>' . Ht::form_div(hoturl_post("buzzer")) . '<div class="popup_actions">' . Ht::hidden("buzzer_showpapers", 1, array("class" => "popup_populate")) . Ht::js_button("Cancel", "popup(null,'kiosk',1)") . Ht::submit("signout_to_kiosk", "Enter kiosk mode", array("class" => "bb")) . '</div></div></form>'); } echo "</tr></table></form>\n"; $Conf->footer();
function searchbar() { global $Conf, $Eclass, $page, $start, $count, $nrows, $maxNrows, $nlinks, $offset; echo Ht::form_div(hoturl("log"), array("method" => "get")), "<table id='searchform'><tr>\n <td class='lxcaption", $Eclass['q'], "'>With <b>any</b> of the words</td>\n <td class='lentry", $Eclass['q'], "'><input type='text' size='40' name='q' value=\"", htmlspecialchars(defval($_REQUEST, "q", "")), "\" /><span class='sep'></span></td>\n <td rowspan='3'>", Ht::submit("search", "Search"), "</td>\n</tr><tr>\n <td class='lxcaption", $Eclass['pap'], "'>Concerning paper(s)</td>\n <td class='lentry", $Eclass['pap'], "'><input type='text' size='40' name='pap' value=\"", htmlspecialchars(defval($_REQUEST, "pap", "")), "\" /></td>\n</tr><tr>\n <td class='lxcaption", $Eclass['acct'], "'>Concerning account(s)</td>\n <td class='lentry'><input type='text' size='40' name='acct' value=\"", htmlspecialchars(defval($_REQUEST, "acct", "")), "\" /></td>\n</tr><tr>\n <td class='lxcaption", $Eclass['n'], "'>Show</td>\n <td class='lentry", $Eclass['n'], "'><input type='text' size='4' name='n' value=\"", htmlspecialchars($_REQUEST["n"]), "\" /> records at a time</td>\n</tr><tr>\n <td class='lxcaption", $Eclass['date'], "'>Starting at</td>\n <td class='lentry", $Eclass['date'], "'><input type='text' size='40' name='date' value=\"", htmlspecialchars($_REQUEST["date"]), "\" /></td>\n</tr></table></div></form>"; if ($nrows > $count || $page > 1) { $urls = array(); $_REQUEST["offset"] = $offset; foreach (array("q", "pap", "acct", "n", "offset") as $x) { if ($_REQUEST[$x]) { $urls[] = "{$x}=" . urlencode($_REQUEST[$x]); } } $url = hoturl("log", join("&", $urls)); echo "<table class='lognav'><tr><td id='newest'><div>"; if ($page > 1) { echo "<a href='{$url}&page=1'><strong>Newest</strong></a> | "; } echo "</div></td><td id='newer'><div>"; if ($page > 1) { echo "<a href='{$url}&page=", $page - 1, "'><strong>", Ht::img("_.gif", "<-", array("class" => "prev")), " Newer</strong></a>"; } echo "</div></td><td id='newnum'><div>"; if ($page - $nlinks > 1) { echo " ..."; } for ($p = max($page - $nlinks - 1, 0); $p + 1 < $page; $p++) { echo " <a href='{$url}&page=", $p + 1, "'>", $p + 1, "</a>"; } echo "</div></td><td id='thisnum'><div><strong class='thispage'> ", $page, " </strong></div></td><td id='oldnum'><div>"; $o = $offset ? $offset - $count : 0; for ($p = $page; $p * $count + $o < $start + min($nlinks * $count + 1, $nrows); $p++) { echo "<a href='{$url}&page=", $p + 1, "'>", $p + 1, "</a> "; } if ($nrows == $maxNrows) { echo "... "; } echo "</div></td><td id='older'><div>"; if ($nrows > $count) { echo "<a href='{$url}&page=", $page + 1, "'><strong>Older ", Ht::img("_.gif", "->", array("class" => "next")), "</strong></a>"; } echo "</div></td><td id='oldest'><div>"; if ($nrows > $count) { echo " | <a href='{$url}&page=earliest'><strong>Oldest</strong></a>"; } echo "</div></td></tr></table>"; } echo "<div class='g'></div>\n"; }
if ($fg->type & FormulaGraph::BARCHART) { $gtype = "barchart"; } else { if ($fg->type == FormulaGraph::BOXPLOT) { $gtype = "boxplot"; } else { if ($fg->type == FormulaGraph::CDF) { $gtype = "cdf"; } } } echo '$(function () { hotcrp_graphs.', $gtype, "(hotgraph_info) });\n</script>"; } else { echo "<h2>Formulas</h2>\n"; } echo Ht::form_div(hoturl("graph", "g=formula"), array("method" => "get")); echo '<table>'; // X axis echo '<tr><td class="lcaption"><label for="fx">X axis</label></td>', '<td class="lentry">', Ht::entry("fx", (string) @$_REQUEST["fx"] !== "" ? $_REQUEST["fx"] : "", array("id" => "fx", "size" => 32, "class" => $fg && @$fg->errf["fx"] ? "setting_error" : "")), '<span class="hint" style="padding-left:2em"><a href="', hoturl("help", "t=formulas"), '">Formula</a> or “search”</span>', '</td></tr>'; // Y axis echo '<tr><td class="lcaption"><label for="fy">Y axis</label></td>', '<td class="lentry" style="padding-bottom:0.8em">', Ht::entry("fy", (string) @$_REQUEST["fy"] !== "" ? $_REQUEST["fy"] : "", array("id" => "fy", "size" => 32, "class" => $fg && @$fg->errf["fy"] ? "setting_error" : "")), '<span class="hint" style="padding-left:2em"><a href="', hoturl("help", "t=formulas"), '">Formula</a> or “cdf”, “count”, “fraction”, “box <em>formula</em>”, “bar <em>formula</em>”</span>', '</td></tr>'; // Series echo '<tr><td class="lcaption"><label for="q">Search</label></td>', '<td class="lentry"><table><tbody id="qcontainer" data-row-template="', htmlspecialchars(formulas_qrow('$', "", "by-tag", false)), '">'; for ($i = 0; $i < count($styles); ++$i) { echo formulas_qrow($i + 1, $queries[$i], $styles[$i], $fg && @$fg->errf["q{$i}"]); } echo "</tbody></table>\n"; echo '<tr><td></td><td class="lentry">', Ht::js_button("Add search", "hotcrp_graphs.formulas_add_qrow()"), '</td></tr>'; echo '</table>'; echo '<div class="g"></div>'; echo Ht::submit(null, "Graph");
$Conf->infoMsg("Select “Apply changes” if this looks OK. (You can always alter the assignment afterwards.)"); list($atypes, $apids) = $assignset->types_and_papers(true); echo Ht::form_div(hoturl_post("bulkassign", ["saveassignment" => 1, "assigntypes" => join(" ", $atypes), "assignpids" => join(" ", $apids)])); $assignset->echo_unparse_display(); echo '<div class="g"></div>', '<div class="aahc"><div class="aa">', Ht::submit("Apply changes"), ' ', Ht::submit("cancel", "Cancel"), Ht::hidden("default_action", $defaults["action"]), Ht::hidden("rev_roundtag", $defaults["round"]), Ht::hidden("file", $text), Ht::hidden("assignment_size_estimate", $csv_lineno), Ht::hidden("filename", $filename), Ht::hidden("requestreview_notify", req("requestreview_notify")), Ht::hidden("requestreview_subject", req("requestreview_subject")), Ht::hidden("requestreview_body", req("requestreview_body")), Ht::hidden("bulkentry", req("bulkentry")), '</div></div></div></form>', "\n"; $Conf->footer(); exit; } } } } if (isset($_REQUEST["saveassignment"]) && check_post() && isset($_POST["file"]) && get($_POST, "assignment_size_estimate") >= 1000) { complete_assignment("keep_browser_alive"); finish_browser_alive(); } echo Ht::form_div(hoturl_post("bulkassign", "upload=1"), array("divstyle" => "margin-top:1em")); // Upload echo '<div class="f-contain"><div class="f-i"><div class="f-e">', Ht::textarea("bulkentry", req_s("bulkentry"), ["rows" => 1, "cols" => 80, "placeholder" => "Enter assignments"]), '</div></div></div>'; echo '<div class="g"><strong>OR</strong> ', '<input type="file" name="bulk" accept="text/plain,text/csv" size="30" /></div>'; echo '<div id="foldoptions" class="lg foldc fold2o">', 'By default, assign ', Ht::select("default_action", array("primary" => "primary reviews", "secondary" => "secondary reviews", "pcreview" => "optional PC reviews", "review" => "external reviews", "conflict" => "PC conflicts", "lead" => "discussion leads", "shepherd" => "shepherds", "tag" => "add tags", "settag" => "replace tags", "preference" => "reviewer preferences"), defval($_REQUEST, "default_action", "primary"), array("id" => "tsel", "onchange" => "fold(\"options\",this.value!=\"review\");fold(\"options\",!/^(?:primary|secondary|(?:pc)?review)\$/.test(this.value),2)")); $rev_rounds = $Conf->round_selector_options(); if (count($rev_rounds) > 1) { echo '<span class="fx2"> in round ', Ht::select("rev_roundtag", $rev_rounds, $_REQUEST["rev_roundtag"] ?: "unnamed"), '</span>'; } else { if (!get($rev_rounds, "unnamed")) { echo '<span class="fx2"> in round ', $Conf->current_round_name(), '</span>'; } } echo '<div class="g"></div>', "\n"; $requestreview_template = $null_mailer->expand_template("requestreview"); echo Ht::hidden("requestreview_subject", $requestreview_template["subject"]);
function reviewTokenGroup($non_reviews) { global $Conf, $reviewTokenGroupPrinted; if ($reviewTokenGroupPrinted) { return; } $tokens = array(); foreach ($Conf->session("rev_tokens", array()) as $tt) { $tokens[] = encode_token((int) $tt); } if ($non_reviews) { echo '<div class="homegrp" id="homerev">', "<h4>Review tokens: </h4>"; } else { echo '<table id="foldrevtokens" class="', count($tokens) ? "fold2o" : "fold2c", '" style="display:inline-table">', '<tr><td class="fn2"><a class="fn2" href="#" onclick="return foldup(this,event)">Add review tokens</a></td>', '<td class="fx2">Review tokens: '; } echo Ht::form_div(hoturl_post("index")), Ht::entry("token", join(" ", $tokens), array("size" => max(15, count($tokens) * 8))), " ", Ht::submit("Save"); if (!count($tokens)) { echo '<div class="hint">Enter tokens to gain access to the corresponding reviews.</div>'; } echo '</div></form>'; if ($non_reviews) { echo '<hr class="home" /></div>', "\n"; } else { echo '</td></tr></table>', "\n"; } $reviewTokenGroupPrinted = true; }
} $Conf->header($title, "accounts", actionBar()); $pl = new ContactList($Me, true); $pl_text = $pl->table_html($_REQUEST["t"], hoturl("users", ["t" => $_REQUEST["t"]]), $tOpt[$_REQUEST["t"]], 'uldisplay.$'); // form echo "<div class='g'></div>\n"; if (count($tOpt) > 1) { echo "<table id='contactsform' class='tablinks1'>\n<tr><td><div class='tlx'><div class='tld1'>"; echo Ht::form_div(hoturl("users"), array("method" => "get")); if (isset($_REQUEST["sort"])) { echo Ht::hidden("sort", $_REQUEST["sort"]); } echo Ht::select("t", $tOpt, $_REQUEST["t"], array("id" => "contactsform1_d")), " ", Ht::submit("Go"), "</div></form>"; echo "</div><div class='tld2'>"; // Display options echo Ht::form_div(hoturl("users"), array("method" => "get")); foreach (array("t", "sort") as $x) { if (isset($_REQUEST[$x])) { echo Ht::hidden($x, $_REQUEST[$x]); } } echo "<table><tr><td><strong>Show:</strong> </td>\n <td class='pad'>"; $Conf->footerScript('foldmap.ul={"aff":2,"tags":3,"topics":1};'); foreach (array("aff" => "Affiliations", "collab" => "Collaborators", "tags" => "Tags", "topics" => "Topics") as $fold => $text) { if (@$pl->have_folds[$fold] !== null) { echo Ht::checkbox("show{$fold}", 1, $pl->have_folds[$fold], array("onchange" => "fold('ul',!this.checked,'{$fold}')")), " ", Ht::label($text), "<br />\n"; } } echo "</td>"; if (isset($pl->scoreMax)) { echo "<td class='pad'>";
function show_pset_table($pset) { global $Conf, $Me, $Now, $Opt, $Profile, $LastPsetFix; echo '<div id="', $pset->urlkey, '">'; echo "<h3>", htmlspecialchars($pset->title), "</h3>"; if ($Me->privChair) { show_pset_actions($pset); } if ($pset->disabled) { return; } $t0 = $Profile ? microtime(true) : 0; // load students if (@$Opt["restrictRepoView"]) { $view = "l2.link repoviewable"; $viewjoin = "left join ContactLink l2 on (l2.cid=c.contactId and l2.type=" . LINK_REPOVIEW . " and l2.link=l.link)\n"; } else { $view = "4 repoviewable"; $viewjoin = ""; } $result = Dbl::qe("select c.contactId, c.firstName, c.lastName, c.email,\n\tc.huid, c.seascode_username, c.anon_username, c.extension, c.disabled, c.dropped, c.roles, c.contactTags,\n\tpl.link pcid, group_concat(rpl.link) rpcid,\n\tr.repoid, r.cacheid, r.heads, r.url, r.open, r.working, r.lastpset, r.snapcheckat, {$view},\n\trg.gradehash, rg.gradercid, rg.placeholder, rg.placeholder_at\n\tfrom ContactInfo c\n\tleft join ContactLink l on (l.cid=c.contactId and l.type=" . LINK_REPO . " and l.pset={$pset->id})\n\t{$viewjoin}\n\tleft join Repository r on (r.repoid=l.link)\n\tleft join ContactLink pl on (pl.cid=c.contactId and pl.type=" . LINK_PARTNER . " and pl.pset={$pset->id})\n\tleft join ContactLink rpl on (rpl.cid=c.contactId and rpl.type=" . LINK_BACKPARTNER . " and rpl.pset={$pset->id})\n\tleft join RepositoryGrade rg on (rg.repoid=r.repoid and rg.pset={$pset->id})\n\twhere (c.roles&" . Contact::ROLE_PCLIKE . ")=0\n\tand (rg.repoid is not null or not c.dropped)\n\tgroup by c.contactId"); $t1 = $Profile ? microtime(true) : 0; $students = array(); while ($result && ($s = $result->fetch_object("Contact"))) { $s->is_anonymous = $pset->anonymous; Contact::set_sorter($s, @$_REQUEST["sort"]); $students[$s->contactId] = $s; // maybe lastpset links are out of order if ($s->lastpset < $pset) { $LastPsetFix = true; } } uasort($students, "Contact::compare"); $checkbox = $Me->privChair || !$pset->gitless && $pset->runners; $rows = array(); $max_ncol = 0; $incomplete = array(); $pcmembers = pcMembers(); foreach ($students as $s) { if (!isset($s->printed)) { $row = (object) array("student" => $s); $row->text = render_pset_row($pset, $students, $s, $row, $pcmembers); if ($s->pcid && isset($students[$s->pcid])) { $row->ptext = render_pset_row($pset, $students, $students[$s->pcid], $row, $pcmembers); } $rows[$row->sortprefix . $s->sorter] = $row; $max_ncol = max($max_ncol, $row->ncol); if (@$s->incomplete) { $u = $Me->user_linkpart($s); $incomplete[] = '<a href="' . hoturl("pset", array("pset" => $pset->urlkey, "u" => $u, "sort" => @$_REQUEST["sort"])) . '">' . htmlspecialchars($u) . '</a>'; } } } ksort($rows, SORT_NATURAL | SORT_FLAG_CASE); if (count($incomplete)) { echo '<div id="incomplete_pset', $pset->id, '" style="display:none" class="merror">', '<strong>', htmlspecialchars($pset->title), '</strong>: ', 'Your grading is incomplete. Missing grades: ', join(", ", $incomplete), '</div>', '<script>jQuery("#incomplete_pset', $pset->id, '").remove().show().appendTo("#incomplete_notices")</script>'; } if ($checkbox) { echo Ht::form_div(hoturl_post("index", array("pset" => $pset->urlkey, "save" => 1))); } echo '<table class="s61"><tbody>'; $trn = 0; $sprefix = ""; foreach ($rows as $row) { ++$trn; if ($row->sortprefix !== $sprefix && $row->sortprefix[0] == "~") { echo "\n", '<tr><td colspan="' . ($max_ncol + ($checkbox ? 2 : 1)) . '"><hr></td></tr>', "\n"; } $sprefix = $row->sortprefix; echo '<tr class="k', $trn % 2, '">'; if ($checkbox) { echo '<td class="s61rownumber">', Ht::checkbox("s61_" . $Me->user_idpart($row->student), 1, array("class" => "s61check")), '</td>'; } echo '<td class="s61rownumber">', $trn, '.</td>', $row->text, "</tr>\n"; if (@$row->ptext) { echo '<tr class="k', $trn % 2, ' s61partner">'; if ($checkbox) { echo '<td></td>'; } echo '<td></td>', $row->ptext, "</tr>\n"; } } echo "</tbody></table>\n"; if ($Me->privChair && !$pset->gitless_grades) { echo "<div class='g'></div>"; $sel = array("none" => "N/A"); foreach (pcMembers() as $pcm) { $sel[$pcm->email] = Text::name_html($pcm); } $sel["__random__"] = "Random"; echo '<span class="nowrap" style="padding-right:2em">', Ht::select("grader", $sel, "none"), Ht::submit("setgrader", "Set grader"), '</span>'; } if (!$pset->gitless) { $sel = array(); foreach ($pset->runners as $r) { if ($Me->can_run($pset, $r)) { $sel[$r->name] = htmlspecialchars($r->title); } } if (count($sel)) { echo '<span class="nowrap" style="padding-right:2em">', Ht::select("runner", $sel), Ht::submit("runmany", "Run all"), '</span>'; } } if ($checkbox) { echo "</div></form>\n"; } if ($Profile) { $t2 = microtime(true); echo sprintf("<div>Δt %.06f DB, %.06f total</div>", $t1 - $t0, $t2 - $t0); } echo "</div>\n"; }
private function result_html() { global $Conf, $Me, $Qreq, $SSel, $pcsel; $assignments = $this->autoassigner->assignments(); ReviewAssigner::$prefinfo = $this->autoassigner->prefinfo; ob_start(); if (!$assignments) { $Conf->warnMsg("Nothing to assign."); return ob_get_clean(); } $assignset = new AssignmentSet($Me, true); $assignset->parse(join("\n", $assignments)); list($atypes, $apids) = $assignset->types_and_papers(true); $badpairs_inputs = $badpairs_arg = array(); for ($i = 1; $i <= 20; ++$i) { if ($Qreq["bpa{$i}"] && $Qreq["bpb{$i}"]) { array_push($badpairs_inputs, Ht::hidden("bpa{$i}", $Qreq["bpa{$i}"]), Ht::hidden("bpb{$i}", $Qreq["bpb{$i}"])); $badpairs_arg[] = $Qreq["bpa{$i}"] . "-" . $Qreq["bpb{$i}"]; } } echo Ht::form_div(hoturl_post("autoassign", ["saveassignment" => 1, "assigntypes" => join(" ", $atypes), "assignpids" => join(" ", $apids), "xbadpairs" => count($badpairs_arg) ? join(" ", $badpairs_arg) : null, "profile" => $Qreq->profile, "XDEBUG_PROFILE" => $Qreq->XDEBUG_PROFILE, "seed" => $Qreq->seed])); $atype = $assignset->type_description(); echo "<h3>Proposed " . ($atype ? $atype . " " : "") . "assignment</h3>"; Conf::msg_info("Select “Apply changes” if this looks OK. (You can always alter the assignment afterwards.) Reviewer preferences, if any, are shown as “P#”."); $assignset->report_errors(); $assignset->echo_unparse_display(); // print preference unhappiness if ($Qreq->profile && $this->atype_review) { $umap = $this->autoassigner->pc_unhappiness(); sort($umap); echo '<p style="font-size:65%">Preference unhappiness: '; $usum = 0; foreach ($umap as $u) { $usum += $u; } if (count($umap) % 2 == 0) { $umedian = ($umap[count($umap) / 2 - 1] + $umap[count($umap) / 2]) / 2; } else { $umedian = $umap[(count($umap) - 1) / 2]; } echo 'mean ', sprintf("%.2f", $usum / count($umap)), ', min ', $umap[0], ', 10% ', $umap[(int) (count($umap) * 0.1)], ', 25% ', $umap[(int) (count($umap) * 0.25)], ', median ', $umedian, ', 75% ', $umap[(int) (count($umap) * 0.75)], ', 90% ', $umap[(int) (count($umap) * 0.9)], ', max ', $umap[count($umap) - 1], '<br/>Time: ', sprintf("%.6f", microtime(true) - $this->start_at); foreach ($this->autoassigner->profile as $name => $time) { echo ', ', sprintf("%s %.6f", htmlspecialchars($name), $time); } echo '</p>'; } echo "<div class='g'></div>", "<div class='aahc'><div class='aa'>\n", Ht::submit("submit", "Apply changes"), "\n ", Ht::submit("download", "Download assignment file"), "\n ", Ht::submit("cancel", "Cancel"), "\n"; foreach (array("t", "q", "a", "revtype", "revaddtype", "revpctype", "cleartype", "revct", "revaddct", "revpcct", "pctyp", "balance", "badpairs", "rev_roundtag", "method", "haspap") as $t) { if (isset($Qreq[$t])) { echo Ht::hidden($t, $Qreq[$t]); } } echo Ht::hidden("pcs", join(" ", array_keys($pcsel))), join("", $badpairs_inputs), Ht::hidden("p", join(" ", $SSel->selection())), "\n"; // save the assignment echo Ht::hidden("assignment", join("\n", $assignments)), "\n"; echo "</div></div></div></form>"; return ob_get_clean(); }
$revopt[htmlspecialchars($reviewer_contact->email)] = Text::name_html($Me) . " (not on PC)"; } echo Ht::select("reviewer", $revopt, htmlspecialchars($reviewer_contact->email), array("onchange" => "\$\$(\"redisplayform\").submit()")), "<div class='g'></div></td></tr>\n"; } echo "<tr><td class='lxcaption'><strong>Search:</strong></td><td class='lentry'><input type='text' size='32' name='q' value=\"", htmlspecialchars(defval($_REQUEST, "q", "")), "\" /><span class='sep'></span></td>", "<td>", Ht::submit("redisplay", "Redisplay"), "</td>", "</tr>\n"; $show_data = array(); if (!$Conf->subBlindAlways() && ($Conf->subBlindNever() || $pl->any->openau)) { $show_data[] = '<span class="sep">' . Ht::checkbox("showau", 1, strpos($pldisplay, " au ") !== false, array("disabled" => !$Conf->subBlindNever() && !$pl->any->openau, "onchange" => "plinfo('au',this)", "id" => "showau")) . " " . Ht::label("Authors") . '</span>'; } if (!$Conf->subBlindNever() && $Me->privChair) { $show_data[] = '<span class="sep' . (!$Conf->subBlindAlways() ? " fx10" : "") . '">' . Ht::checkbox("showanonau", 1, strpos($pldisplay, " anonau ") !== false, array("disabled" => !$pl->any->anonau, "onchange" => (!$Conf->subBlindAlways() ? "" : "plinfo('au',this);") . "plinfo('anonau',this)", "id" => !$Conf->subBlindAlways() ? "showanonau" : "showau")) . " " . Ht::label(!$Conf->subBlindAlways() ? "Anonymous authors" : "Authors") . '</span>'; } if (!$Conf->subBlindAlways() || $Me->privChair) { $show_data[] = '<span class="sep fx10">' . Ht::checkbox("showaufull", 1, strpos($pldisplay, " aufull ") !== false, array("onchange" => "plinfo('aufull',this)", "id" => "showaufull")) . " " . Ht::label("Full author info") . "</span>"; $Conf->footerScript("plinfo.extra=function(type,dofold){var x=(type=='au'?!dofold:(\$\$('showau')||{}).checked);fold('redisplayform',!x,10)};"); } if ($pl->any->abstract) { $show_data[] = '<span class="sep">' . Ht::checkbox("showabstract", 1, strpos($pldisplay, " abstract ") !== false, array("onchange" => "plinfo('abstract',this)")) . " " . Ht::label("Abstracts") . '</span>'; } if ($pl->any->topics) { $show_data[] = '<span class="sep">' . Ht::checkbox("showtopics", 1, strpos($pldisplay, " topics ") !== false, array("onchange" => "plinfo('topics',this)")) . " " . Ht::label("Topics") . '</span>'; } if (count($show_data) && $pl->count) { echo '<tr><td class="lxcaption"><strong>Show:</strong> ', '</td><td colspan="2" class="lentry">', join('', $show_data), '</td></tr>'; } echo "</table></div></form>"; // </div></div> echo "</td></tr></table>\n"; // main form echo Ht::form_div(hoturl_post("reviewprefs", "reviewer={$reviewer}" . (defval($_REQUEST, "q") ? "&q=" . urlencode($_REQUEST["q"]) : "")), array("class" => "assignpc", "onsubmit" => "return plist_onsubmit.call(this)", "id" => "sel")), Ht::hidden("defaultact", "", array("id" => "defaultact")), Ht::hidden_default_submit("default", 1), "<div class='pltable_full_ctr'>\n", '<noscript><div style="text-align:center">', Ht::submit("update", "Save changes"), '</div></noscript>', $pl_text, "</div></div></form>\n"; $Conf->footer();
private function _review_buttons($prow, $rrow, $type, $reviewPostLink) { global $Conf, $Me; $buttons = array(); // refuse? if ($type == "top" && $rrow && !$rrow->reviewModified && $rrow->reviewType < REVIEW_SECONDARY) { $buttons[] = Ht::submit("accept", "Accept review", array("class" => "b")); $buttons[] = Ht::button("Decline review", array("class" => "b", "onclick" => "popup(this,'ref',0)")); // Also see $_REQUEST["refuse"] case in review.php. $Conf->footerHtml("<div id='popup_ref' class='popupc'>" . Ht::form_div($reviewPostLink) . Ht::hidden("refuse", "refuse") . "<p style='margin:0 0 0.3em'>Select “Decline review” to decline this review. Thank you for keeping us informed.</p>" . Ht::textarea("reason", null, array("id" => "refusereviewreason", "rows" => 3, "cols" => 40, "placeholder" => "Optional explanation", "spellcheck" => "true")) . '<div class="popup_actions">' . Ht::js_button("Cancel", "popup(null,'ref',1)") . Ht::submit("Decline review", array("class" => "bb")) . "</div></div></form></div>", "declinereviewform"); $buttons[] = ""; } $submitted = $rrow && $rrow->reviewSubmitted; if (!$Conf->time_review($rrow, $Me->act_pc($prow, true), true)) { $whyNot = array("deadline" => $rrow && $rrow->reviewType < REVIEW_PC ? "extrev_hard" : "pcrev_hard"); $override_text = whyNotText($whyNot, "review"); if (!$submitted) { $buttons[] = array(Ht::js_button("Submit review", "override_deadlines(this)", array("class" => "bb", "data-override-text" => $override_text, "data-override-submit" => "submitreview")), "(admin only)"); $buttons[] = array(Ht::js_button("Save as draft", "override_deadlines(this)", array("data-override-text" => $override_text, "data-override-submit" => "savedraft")), "(admin only)"); } else { $buttons[] = array(Ht::js_button("Save changes", "override_deadlines(this)", array("class" => "bb", "data-override-text" => $override_text, "data-override-submit" => "submitreview")), "(admin only)"); } } else { if (!$submitted) { $buttons[] = Ht::submit("submitreview", "Submit review", array("class" => "bb")); $buttons[] = Ht::submit("savedraft", "Save as draft"); } else { $buttons[] = Ht::submit("submitreview", "Save changes", array("class" => "bb")); } } if ($rrow && $type == "bottom" && $Me->allow_administer($prow)) { $buttons[] = ""; if ($submitted) { $buttons[] = array(Ht::submit("unsubmitreview", "Unsubmit review"), "(admin only)"); } $buttons[] = array(Ht::js_button("Delete review", "popup(this,'d',0)"), "(admin only)"); $Conf->footerHtml("<div id='popup_d' class='popupc'>\n <p>Be careful: This will permanently delete all information about this\n review assignment from the database and <strong>cannot be\n undone</strong>.</p>\n " . Ht::form_div($reviewPostLink, array("divclass" => "popup_actions")) . Ht::js_button("Cancel", "popup(null,'d',1)") . Ht::submit("deletereview", "Delete review", array("class" => "bb")) . "</div></form></div>"); } return $buttons; }
function _searchForm($forwhat, $other = null, $size = 20) { $text = ""; if ($other && preg_match_all('/(\\w+)=([^&]*)/', $other, $matches, PREG_SET_ORDER)) { foreach ($matches as $m) { $text .= Ht::hidden($m[1], urldecode($m[2])); } } return Ht::form_div(hoturl("search"), array("method" => "get", "divclass" => "nw")) . "<input type='text' name='q' value=\"" . htmlspecialchars($forwhat) . "\" size='{$size}' /> " . Ht::submit("go", "Search") . $text . "</div></form>"; }
if ($pastDeadline && $Me->privChair) { echo "<br />", Ht::checkbox("override"), " ", Ht::label("Override deadlines"); } echo "<br /><span class='hint'><strong>Tip:</strong> You may upload a file containing several forms.</span>"; echo "</div></form></td>\n"; } echo "</tr>\n"; // Ranks if ($Conf->setting("tag_rank") && $Me->is_reviewer()) { $ranktag = $Conf->setting_data("tag_rank"); echo "<tr><td><div class='g'></div></td></tr>\n", "<tr><td><h3>Download ranking file</h3>\n<div>"; echo "<a href=\"", hoturl("search", "get=rank&tag=%7E{$ranktag}&q=&t=r&p=all"), "\">Your reviews</a>"; if ($Me->isPC) { echo "<br />\n<a href=\"", hoturl("search", "get=rank&tag=%7E{$ranktag}&q=&t=s&p=all"), "\">All submitted papers</a>"; } echo "</div></td>\n"; $disabled = $pastDeadline && !$Me->privChair ? " disabled='disabled'" : ""; echo "<td><h3>Upload ranking file</h3>\n", Ht::form_div(hoturl_post("offline", "setrank=1&tag=%7E{$ranktag}")), Ht::hidden("upload", 1), "<input type='file' name='file' accept='text/plain' size='30' {$disabled}/> ", Ht::submit("Go", array("disabled" => !!$disabled)); if ($pastDeadline && $Me->privChair) { echo "<br />", Ht::checkbox("override"), " ", Ht::label("Override deadlines"); } echo "<br /><span class='hint'><strong>Tip:</strong> Use “<a href='", hoturl("search", "q=" . urlencode("editsort:#~{$ranktag}")), "'>editsort:#~{$ranktag}</a>” to drag and drop your ranking.</span>"; echo "<br /><span class='hint'><strong>Tip:</strong> “<a href='", hoturl("search", "q=order:%7E{$ranktag}"), "'>order:~{$ranktag}</a>” searches by your ranking.</span>"; echo "</div></form></td>\n"; echo "</tr>\n"; } echo "</table>\n"; if ($text = $rf->webGuidanceRows($Me->permissive_view_score_bound())) { echo "<div class='g'></div>\n\n<table class='review'>\n<thead><tr class='id'><td></td><td class='entry'><h3>Review form information</h3></td></tr></thead>\n<tbody>", $text, "<tr class='last'>\n <td class='caption'></td>\n <td class='entry'></td>\n</tr></tbody></table>\n"; } $Conf->footer();