static function echo_username_form(Contact $user, $first) { global $Me; if (!$first && !$user->seascode_username) { return; } echo Ht::form(hoturl_post("index", array("set_username" => 1, "u" => $Me->user_linkpart($user), "reposite" => "harvardseas"))), '<div class="f-contain">'; $notes = array(); if (!$user->seascode_username) { $notes[] = array(true, "Please enter your " . self::home_link("code.seas.harvard.edu") . " username and click “Save.”"); } ContactView::echo_group(self::home_link("code.seas") . " username", Ht::entry("username", $user->seascode_username) . " " . Ht::submit("Save"), $notes); echo "</div></form>"; }
} function trackertable_showpapers() { var e = jQuery("#buzzer_showpapers"); if (e && !!showpapers != !!e.is(":checked")) { showpapers = !showpapers; trackertable(); } } jQuery(window).on("hotcrp_deadlines", function (evt, dl) { evt.preventDefault(); jQuery(trackertable); })'); $Conf->header("Discussion status", "buzzer", false); echo '<div id="trackertable" style="margin-top:1em"></div>'; echo "<audio id=\"buzzersound\"><source src=\"", Ht::$img_base, "buzzer.mp3\"></audio>"; echo Ht::form(hoturl_post("buzzer")); echo '<table style="margin-top:3em"><tr>'; // mute button echo '<td><button type="button" class="foldc" style="padding-bottom:5px" onclick="trackertable_mute(this)"> <svg id="soundicon" class="fn" 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.128,49.03 C 50.057,45.934 51.19,42.291 51.19,38.377 C 51.19,34.399 50.026,30.703 48.043,27.577" style="fill:none;stroke:#111111;stroke-width:5;stroke-linecap:round"/> <path d="M 55.082,20.537 C 58.777,25.523 60.966,31.694 60.966,38.377 C 60.966,44.998 58.815,51.115 55.178,56.076" style="fill:none;stroke:#111111;stroke-width:5;stroke-linecap:round"/> <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>';
} if (isset($_REQUEST["update"]) && check_post()) { do_setting_update($Sv); } if (isset($_REQUEST["cancel"]) && check_post()) { redirectSelf(); } if (!$Sv->warnings_reported) { SettingGroup::crosscheck($Sv, $Group); $Sv->report(); } $Conf->header("Settings ∕ <strong>" . SettingGroup::$all[$Group]->description . "</strong>", "settings", actionBar()); $Conf->echoScript(""); // clear out other script references echo $Conf->make_script_file("scripts/settings.js"), "\n"; echo Ht::form(hoturl_post("settings", "group={$Group}"), array("id" => "settingsform")); echo '<div class="leftmenu_menucontainer"><div class="leftmenu_list">'; foreach (SettingGroup::all() as $g) { if ($g->name === $Group) { echo '<div class="leftmenu_item_on">', $g->description, '</div>'; } else { echo '<div class="leftmenu_item">', '<a href="', hoturl("settings", "group={$g->name}"), '">', $g->description, '</a></div>'; } } echo "</div></div>\n", '<div class="leftmenu_content_container"><div class="leftmenu_content">', '<div class="leftmenu_body">'; Ht::stash_script("jQuery(\".leftmenu_item\").click(divclick)"); function doActionArea($top) { echo "<div class='aa'>", Ht::submit("update", "Save changes", array("class" => "bb")), " ", Ht::submit("cancel", "Cancel"), "</div>"; } echo "<div class='aahc'>";
if (!$Me->can_view_run($Pset, $Runner, $RunMany ? null : $User)) { if (!$Me->isPC && !$Runner->visible) { quit("Command reserved for TFs"); } else { if ($Runner->disabled) { quit("Command disabled"); } else { quit("Can’t run command right now"); } } } } // magic multi-runner if ($Me->isPC && @$_GET["runmany"] && check_post()) { $Conf->header(htmlspecialchars($Pset->title . " " . $Runner->title), "home"); echo '<h2 id="runmany61_who"></h2>', Ht::form(hoturl_post("run")), '<div class="f-contain">', Ht::hidden("u", ""), Ht::hidden("pset", $Pset->urlkey), Ht::hidden("run", $Runner->name, array("id" => "runmany61")), '</div></form>'; echo '<div id="run61out_' . $Runner->name . '">', '<div class="run61" id="run61_' . $Runner->name . '">', '<div class="run61in"><pre class="run61pre"></pre></div>', '</div>', '</div>'; echo '<div id="runmany61_users">', htmlspecialchars($_GET["runmany"]), '</div>'; $Conf->footerScript('runmany61()'); echo '<div class="clear"></div>', "\n"; $Conf->footer(); exit; } // repo $Info = user_pset_info(); $Repo = $Info->repo; $RecentCommits = $Info->recent_commits(); // can we run this? if (!$Repo) { quit("No repository to run"); } else {
if (!$Me->can_view_run($Pset, $Runner, $RunMany ? null : $User)) { if (!$Me->isPC && !$Runner->visible) { quit("Command reserved for TFs"); } else { if ($Runner->disabled) { quit("Command disabled"); } else { quit("Can’t run command right now"); } } } } // magic multi-runner if ($Me->isPC && get($_GET, "runmany") && check_post()) { $Conf->header(htmlspecialchars($Pset->title . " " . $Runner->title), "home"); echo '<h2 id="runmany61_who"></h2>', Ht::form(hoturl_post("run")), '<div class="f-contain">', Ht::hidden("u", ""), Ht::hidden("pset", $Pset->urlkey), Ht::hidden("run", $Runner->name, ["id" => "runmany61", "data-pa-runclass" => $Runner->runclass_argument()]), '</div></form>'; echo '<div id="run61out_' . $Runner->runclass . '">', '<div class="run61" id="run61_' . $Runner->runclass . '">', '<div class="run61in"><pre class="run61pre"></pre></div>', '</div>', '</div>'; echo '<div id="runmany61_users">', htmlspecialchars($_GET["runmany"]), '</div>'; Ht::stash_script('runmany61()'); echo '<div class="clear"></div>', "\n"; $Conf->footer(); exit; } // repo $Info = user_pset_info(); $Repo = $Info->repo; $RecentCommits = $Info->recent_commits(); // can we run this? if (!$Repo) { quit("No repository to run"); } else {
static function echo_repo_group($info, $include_tarball = false) { global $Conf, $Me, $Now; if ($info->pset->gitless) { return; } list($user, $pset, $partner, $repo) = array($info->user, $info->pset, $info->partner, $info->repo); $editable = $info->can_set_repo && !$user->is_anonymous; $repo_url = $repo ? $repo->friendly_url() : ""; $title = "repository"; if (!RepositorySite::is_primary($repo)) { $title = $repo->reposite->friendly_siteclass() . " " . $title; } if ($repo && $repo->url) { $title = $user->link_repo($title, $repo->web_url()); } if ($editable) { $value = Ht::entry("repo", $repo_url, array("style" => "width:32em")) . " " . Ht::submit("Save"); } else { if ($user->is_anonymous) { $value = $repo_url ? "[anonymous]" : "(none)"; } else { $value = htmlspecialchars($repo_url ? $repo_url : "(none)"); } } if ($repo_url) { $value .= ' <button class="b repoclip hottooltip" data-pa-repo="' . htmlspecialchars($repo->ssh_url()) . '"'; if ($user->is_anonymous) { $value .= ' data-tooltip="[anonymous]"'; } else { $value .= ' data-tooltip="' . htmlspecialchars($repo->ssh_url()) . '"'; } $value .= ' type="button" onclick="false">Copy URL to clipboard</button>'; Ht::stash_script('$(".repoclip").each(pa_init_repoclip)', "repoclip"); if ($include_tarball && $info->commit_hash() && ($tarball_url = $info->tarball_url())) { $value .= ' <a class="bsm q" href="' . htmlspecialchars($tarball_url) . '">Download tarball for ' . substr($info->commit_hash(), 0, 7) . '</a>'; } } // check repo $ms = new MessageSet($user); if ($repo) { $repo->check_working($ms); $repo->check_open($ms); } if ($partner && $info->partner_same()) { $prepo = $partner->repo($pset->id); if (!$repo && $prepo || $repo && !$prepo || $repo && $prepo && $repo->repoid != $prepo->repoid) { if ($prepo && $repo) { $prepo_url = ", " . htmlspecialchars($prepo->friendly_url_like($repo)); } else { if ($prepo) { $prepo_url = ", " . htmlspecialchars($prepo->friendly_url()); } else { $prepo_url = ""; } } $your_partner = "your partner’s"; if ($Me->isPC) { $your_partner = '<a href="' . hoturl("pset", array("pset" => $pset->urlkey, "u" => $Me->user_linkpart($partner))) . '">' . $your_partner . '</a>'; } $ms->set_error_html("partner", "This repository differs from {$your_partner}{$prepo_url}."); } } if ($repo) { $repo->check_ownership($user, $partner, $ms); } $prefixes = ["", "WARNING: ", "ERROR: "]; $notes = array_map(function ($m) use($prefixes) { return [$m[2] > 0, $prefixes[$m[2]] . $m[1]]; }, $ms->messages(true)); if ($repo && $repo->truncated_psetdir($pset)) { $notes[] = array(true, "Please create your repository by cloning our repository. Creating your repository from scratch makes it harder for us to grade and harder for you to get pset updates."); } if (!$repo) { $repoclasses = RepositorySite::site_classes($Conf); $x = commajoin(array_map(function ($k) { return Ht::link($k::global_friendly_siteclass(), $k::global_friendly_siteurl()); }, $repoclasses), "or"); if ($editable) { $notes[] = array(false, "Enter your {$x} repository URL here."); } } // edit if ($editable) { echo Ht::form(self_href(array("post" => post_value(), "set_repo" => 1, "pset" => $pset->urlkey))), '<div class="f-contain">'; } self::echo_group($title, $value, $notes); if ($editable) { echo "</div></form>\n"; } return $repo; }
} $Conf->header("Profile", "profile"); $xsep = " <span class='barsep'> | </span> "; echo "<div id='homeinfo'>"; echo "<h2 class='homeemail'>", Text::user_html($User), "</h2>"; if ($User->seascode_username || $User->huid) { echo '<h3><a href="', hoturl("index", array("u" => $Me->user_linkpart($User))), '">', htmlspecialchars($User->seascode_username ?: $User->huid), '</a>'; if ($Me->privChair) { echo " ", become_user_link($User); } echo "</h3>"; } if ($User->dropped) { ContactView::echo_group("", '<strong class="err">You have dropped the course.</strong> If this is incorrect, contact us.'); } echo Ht::form(hoturl_post("profile", array("u" => $User->email))), "<div>"; if ($User->disabled || $User->password == "") { echo Ht::submit("enable", "Enable user", array("value" => 1)); } else { echo Ht::submit("disable", "Disable user", array("value" => 1)); } echo '<hr>'; echo '<table class="pltable" style="margin-top:1em"><tbody class="pltable pltable_alternate">'; echo '<tr><td class="pl pls">Roles</td><td class="pl">'; echo Ht::radio("pctype", "chair", $User->roles & Contact::ROLE_CHAIR), " ", Ht::label("Course instructor"), "<br>"; echo Ht::radio("pctype", "pc", $User->roles & Contact::ROLE_PC && !($User->roles & Contact::ROLE_CHAIR)), " ", Ht::label("Course staff"), "<br>"; echo Ht::radio("pctype", "no", !($User->roles & (Contact::ROLE_PC | Contact::ROLE_CHAIR))), " ", Ht::label("Not on course staff"), "<br>"; echo "</td></tr>\n"; echo '</tbody></table>'; echo Ht::submit("update", "Save changes", array("value" => 1)); echo "</div></form>\n";
} else { $Acct->change_password($_REQUEST["upassword"], true); $Acct->log_activity("Reset password"); $Conf->confirmMsg("Your password has been changed. You may now sign in to the conference site."); $capmgr->delete($capdata); $Conf->save_session("password_reset", (object) array("time" => $Now, "email" => $Acct->email, "password" => $_REQUEST["upassword"])); go(hoturl("index")); } } } $password_class = " error"; } $Conf->header("Reset Password", "resetpassword", null); if (!isset($_REQUEST["autopassword"]) || trim($_REQUEST["autopassword"]) != $_REQUEST["autopassword"] || strlen($_REQUEST["autopassword"]) < 16 || !preg_match("/\\A[-0-9A-Za-z@_+=]*\\z/", $_REQUEST["autopassword"])) { $_REQUEST["autopassword"] = Contact::random_password(); } if (!isset($_REQUEST["useauto"]) || $_REQUEST["useauto"] != "n") { $_REQUEST["useauto"] = "y"; } $confname = $Opt["longName"]; if ($Opt["shortName"] && $Opt["shortName"] != $Opt["longName"]) { $confname .= " (" . $Opt["shortName"] . ")"; } echo "<div class='homegrp'>\nWelcome to the ", htmlspecialchars($confname), " submissions site."; if (isset($Opt["conferenceSite"])) { echo " For general information about ", htmlspecialchars($Opt["shortName"]), ", see <a href=\"", htmlspecialchars($Opt["conferenceSite"]), "\">the conference site</a>."; } echo "</div>\n<hr class='home' />\n<div class='homegrp' id='homereset'>\n", Ht::form(hoturl_post("resetpassword")), '<div class="f-contain">', Ht::hidden("resetcap", $_REQUEST["resetcap"]), Ht::hidden("autopassword", $_REQUEST["autopassword"]), "<p>This form will reset the password for <b>", htmlspecialchars($Acct->email), "</b>. Use our suggested replacement password, or choose your own.</p>\n<table>\n <tr><td>", Ht::radio("useauto", "y", null), " </td><td>", Ht::label("Use password <tt>" . htmlspecialchars($_REQUEST["autopassword"]) . "</tt>"), "</td></tr>\n <tr><td>", Ht::radio("useauto", "n", null, array("id" => "usemy", "onclick" => "x=\$\$(\"login_d\");if(document.activeElement!=x)x.focus()")), " </td><td style='padding-top:1em'>", Ht::label("Use this password:"******"</td></tr>\n <tr><td></td><td><div class='f-i'>\n <div class='f-c", $password_class, "'>Password</div>\n <div class='f-e'><input id='login_d' type='password' name='upassword' size='36' tabindex='1' value='' onkeypress='if(!((x=\$\$(\"usemy\")).checked)) x.click()' /></div>\n</div>\n<div class='f-i'>\n <div class='f-c", $password_class, "'>Password (again)</div>\n <div class='f-e'><input id='login_d' type='password' name='upassword2' size='36' tabindex='1' value='' /></div>\n</div></td></tr>\n<tr><td colspan='2' style='padding-top:1em'>\n<div class='f-i'>", Ht::submit("go", "Reset password", array("tabindex" => 1)), "</div></td>\n</tr></table>\n</div></form>\n<hr class='home' /></div>\n"; $Conf->footerScript("crpfocus(\"login\", null, 2)"); echo '<hr class="c" />', "\n"; $Conf->footer();
foreach (array("A", "V", "D") as $k) { /* ghetto array_intersect_key */ if (isset(ListSorter::$score_sorts[$k])) { $ss[$k] = ListSorter::$score_sorts[$k]; } } echo "<tr><td colspan='3'><div class='g'></div><b>Sort scores by:</b> ", Ht::select("scoresort", $ss, $Conf->session("scoresort", "A")), "</td></tr>"; } echo "</table></div></form>"; echo "</div></div></td></tr>\n"; // Tab selectors echo "<tr><td class='tllx'><table><tr>\n <td><div class='tll1'><a class='tla' onclick='return crpfocus(\"contactsform\", 1)' href=''>User selection</a></div></td>\n <td><div class='tll2'><a class='tla' onclick='return crpfocus(\"contactsform\", 2)' href=''>Display options</a></div></td>\n</tr></table></td></tr>\n</table>\n\n"; } if ($Me->privChair && $_REQUEST["t"] == "pc") { $Conf->infoMsg("<p><a href='" . hoturl("profile", "u=new&role=pc") . "' class='button'>Add PC member</a></p><p>Select a PC member’s name to edit their profile or remove them from the PC.</p>"); } else { if ($Me->privChair && $_REQUEST["t"] == "all") { $Conf->infoMsg("<p><a href='" . hoturl("profile", "u=new") . "' class='button'>Create account</a></p><p>Select a user to edit their profile. Select " . Ht::img("viewas.png", "[Act as]") . " to view the site as that user would see it.</p>"); } } if (isset($pl->any->sel)) { echo Ht::form(hoturl_post("users", ["t" => $_REQUEST["t"]])), "<div>"; if (isset($_REQUEST["sort"])) { echo Ht::hidden("sort", $_REQUEST["sort"]); } } echo $pl_text; if (isset($pl->any->sel)) { echo "</div></form>"; } $Conf->footer();
} echo " <tr>\n"; foreach ($buttons as $b) { $x = is_array($b) ? $b[0] : $b; echo " <td class='ptb_button'>", $x, "</td>\n"; } echo " </tr>\n <tr>\n"; foreach ($buttons as $b) { $x = is_array($b) ? $b[1] : ""; echo " <td class='ptb_explain'>", $x, "</td>\n"; } echo " </tr>\n </table></div>\n"; echo "</div>\n", "</div>\n", "</form>\n"; if ($newProfile) { echo '</div><div class="fx9">'; echo Ht::form(hoturl_post("profile", join("&", $form_params)), array("id" => "accountform", "autocomplete" => "off")), "<div class='profiletext aahc", $UserStatus->nerrors ? " alert" : "", "'>\n", Ht::password("chromefooler", "", array("style" => "display:none")); create_modes(true); $bulkentry = @$_REQUEST["bulkentry"]; if ($bulkentry === null && ($session_bulkentry = $Conf->session("profile_bulkentry")) && is_array($session_bulkentry) && $session_bulkentry[0] > $Now - 5) { $bulkentry = $session_bulkentry[1]; $Conf->save_session("profile_bulkentry", null); } echo '<div class="f-contain"><div class="f-i"><div class="f-e">', Ht::textarea("bulkentry", $bulkentry, ["rows" => 1, "cols" => 80, "placeholder" => "Enter users one per line"]), '</div></div></div>'; echo '<div class="g"><strong>OR</strong> ', '<input type="file" name="bulk" size="30" /></div>'; echo '<div>', Ht::submit("bulkregister", "Save accounts"), '</div>'; echo "<p>Enter or upload CSV user data, including a header to explain your format. For example:</p>\n", '<pre class="entryexample"> name,email,affiliation,roles John Adams,john@earbox.org,UC Berkeley,pc "Adams, John Quincy",quincy@whitehouse.gov </pre>', "\n", '<p>Or just enter an email address per line.</p>', '<p>Supported CSV fields include:</p><table>', '<tr><td class="lmcaption"><code>name</code></td>', '<td>User name</td></tr>', '<tr><td class="lmcaption"><code>first</code></td>', '<td>First name</td></tr>', '<tr><td class="lmcaption"><code>last</code></td>', '<td>Last name</td></tr>', '<tr><td class="lmcaption"><code>affiliation</code></td>', '<td>Affiliation</td></tr>', '<tr><td class="lmcaption"><code>roles</code></td>', '<td>User roles: blank, “<code>pc</code>”, “<code>chair</code>”, or “<code>sysadmin</code>”</td></tr>', '<tr><td class="lmcaption"><code>tags</code></td>', '<td>PC tags (space-separated)</td></tr>', '<tr><td class="lmcaption"><code>add_tags</code>, <code>remove_tags</code></td>', '<td>PC tags to add or remove</td></tr>', '<tr><td class="lmcaption"><code>collaborators</code></td>', '<td>Collaborators</td></tr>', '<tr><td class="lmcaption"><code>follow</code></td>', '<td>Email notification: blank, “<code>reviews</code>”, “<code>allreviews</code>”</td></tr>', "</table>\n"; echo '</div></form></div></div>';
function echo_linenote_entry_row($file, $lineid, $note, $displayed, $lnorder) { global $Pset, $Me, $User, $Info; if (!is_array($note)) { $note = array(false, $note); } if (!$Me->isPC || $Me == $User || $displayed) { if ($Info->can_see_grades || $note[0]) { echo '<tr class="diffl61 gw">', '<td colspan="2" class="difflnoteborder61"></td>', '<td class="difflnote61">'; if ($lnorder) { $links = array(); //list($pfile, $plineid) = $lnorder->get_prev($file, $lineid); //if ($pfile) // $links[] = '<a href="#L' . $plineid . '_' // . html_id_encode($pfile) . '">← Prev</a>'; list($nfile, $nlineid) = $lnorder->get_next($file, $lineid); if ($nfile) { $links[] = '<a href="#L' . $nlineid . '_' . html_id_encode($nfile) . '">Next ></a>'; } else { $links[] = '<a href="#">Top</a>'; } if (count($links)) { echo '<div class="difflnoteptr61">', join(" ", $links), '</div>'; } } echo '<div class="note61', $note[0] ? ' commentnote' : ' gradenote', '">', htmlspecialchars($note[1]), '</div>', '<div class="clear"></div></td></tr>'; } return; } echo '<tr class="diffl61 gw', $note[0] ? ' isgrade61' : ' iscomment61', '" savednote61="', htmlspecialchars($note[1]), '">', '<td colspan="2" class="difflnoteborder61"></td>', '<td class="difflnote61">', '<div class="diffnoteholder61"', $displayed ? "" : " style=\"display:none\"", ">", Ht::form($Info->hoturl_post("pset", array("savelinenote" => 1)), array("onsubmit" => "return savelinenote61(this)")), "<div class=\"f-contain\">", Ht::hidden("file", $file), Ht::hidden("line", $lineid), Ht::hidden("iscomment", "", array("class" => "iscomment")), "<textarea class=\"diffnoteentry61\" name=\"note\">", htmlspecialchars($note[1]), "</textarea><br />"; echo Ht::submit("Comment", array("onclick" => "return setiscomment61(this,1)")), ' ', Ht::submit("Grade", array("onclick" => "return setiscomment61(this,'')")), '<span class="ajaxsave61"></span>', "</div></form></div></td></tr>"; }
} echo Ht::select($name, $opts, $Qreq[$name], $extra); } function divClass($name, $classes = null) { global $Error; if (isset($Error[$name])) { $classes = ($classes ? $classes . " " : "") . "error"; } if ($classes) { return '<div class="' . $classes . '">'; } else { return '<div>'; } } echo Ht::form(hoturl_post("autoassign", array("profile" => $Qreq->profile, "seed" => $Qreq->seed, "XDEBUG_PROFILE" => $Qreq->XDEBUG_PROFILE))), '<div class="aahc">', "<div class='helpside'><div class='helpinside'>\nAssignment methods:\n<ul><li><a href='", hoturl("autoassign"), "' class='q'><strong>Automatic</strong></a></li>\n <li><a href='", hoturl("manualassign"), "'>Manual by PC member</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' />\nTypes 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</div></div>\n"; // paper selection echo divClass("pap"), "<h3>Paper selection</h3>"; if (!isset($Qreq->q)) { // XXX redundant $Qreq->q = join(" ", $SSel->selection()); } echo Ht::entry_h("q", $Qreq->q, array("id" => "autoassignq", "placeholder" => "(All)", "size" => 40, "title" => "Enter paper numbers or search terms", "class" => "hotcrp_searchbox", "onfocus" => 'autosub("requery",this)')), " in "; if (count($tOpt) > 1) { echo Ht::select("t", $tOpt, $Qreq->t, array("onchange" => "highlightUpdate(\"requery\")")); } else { echo join("", $tOpt); } echo " ", Ht::submit("requery", "List", array("id" => "requery")); if (isset($Qreq->requery) || isset($Qreq->haspap)) { echo "<br /><span class='hint'>Assignments will apply to the selected papers.</span>\n<div class='g'></div>";
function reviewTable($prow, $rrows, $crows, $rrow, $mode, $proposals = null) { global $Conf, $Me; $subrev = array(); $nonsubrev = array(); $foundRrow = $foundMyReview = $notShown = 0; $conflictType = $Me->view_conflict_type($prow); $allow_admin = $Me->allow_administer($prow); $admin = $Me->can_administer($prow); $hideUnviewable = $conflictType > 0 && !$admin || !$Me->act_pc($prow) && !$Conf->setting("extrev_view"); $show_colors = $Me->can_view_reviewer_tags($prow); $tagger = $show_colors ? new Tagger($Me) : null; $xsep = ' <span class="barsep">·</span> '; $want_scores = $mode !== "assign" && $mode !== "edit" && $mode !== "re"; $want_requested_by = false; $want_retract = false; $pcm = pcMembers(); $score_header = array(); // actual rows foreach ($rrows as $rr) { $highlight = $rrow && $rr->reviewId == $rrow->reviewId; $foundRrow += $highlight; if ($Me->is_my_review($rr)) { $foundMyReview++; } $canView = $Me->can_view_review($prow, $rr, null); // skip unsubmitted reviews if (!$canView && $hideUnviewable) { if ($rr->reviewNeedsSubmit == 1 && $rr->reviewModified) { $notShown++; } continue; } $t = ""; $tclass = $rrow && $highlight ? "hilite" : ""; // review ID $id = "Review"; if ($rr->reviewSubmitted) { $id .= " #" . $prow->paperId . unparseReviewOrdinal($rr->reviewOrdinal); } else { if ($rr->reviewType == REVIEW_SECONDARY && $rr->reviewNeedsSubmit <= 0) { $id .= " (delegated)"; } else { if ($rr->reviewModified > 0) { $id .= " (in progress)"; } else { $id .= " (not started)"; } } } $rlink = unparseReviewOrdinal($rr); if ($rrow && $rrow->reviewId == $rr->reviewId) { if ($Me->contactId == $rr->contactId && !$rr->reviewSubmitted) { $id = "Your {$id}"; } $t .= '<td><a href="' . hoturl("review", "p={$prow->paperId}&r={$rlink}") . '" class="q"><b>' . $id . '</b></a></td>'; } else { if (!$canView) { $t .= "<td>{$id}</td>"; } else { if ($rrow || $rr->reviewModified <= 0 || ($mode === "re" || $mode === "assign") && $Me->can_review($prow, $rr)) { $t .= '<td><a href="' . hoturl("review", "p={$prow->paperId}&r={$rlink}") . '">' . $id . '</a></td>'; } else { if (Navigation::page() !== "paper") { $t .= '<td><a href="' . hoturl("paper", "p={$prow->paperId}#r{$rlink}") . '">' . $id . '</a></td>'; } else { $t .= '<td><a href="#r' . $rlink . '">' . $id . '</a></td>'; } } } } // primary/secondary glyph if ($conflictType > 0 && !$admin) { $rtype = ""; } else { if ($rr->reviewType > 0) { $rtype = review_type_icon($rr->reviewType); if ($admin && $mode === "assign") { $rtype .= _review_table_round_selector($prow, $rr); } else { if ($rr->reviewRound > 0 && $Me->can_view_review_round($prow, $rr)) { $rtype .= ' <span class="revround" title="Review round">' . htmlspecialchars($Conf->round_name($rr->reviewRound, true)) . "</span>"; } } } else { $rtype = ""; } } // reviewer identity $showtoken = $rr->reviewToken && $Me->can_review($prow, $rr); if (!$Me->can_view_review_identity($prow, $rr, null)) { $t .= $rtype ? "<td>{$rtype}</td>" : '<td class="empty"></td>'; } else { if (!$showtoken || !Contact::is_anonymous_email($rr->email)) { $n = $Me->name_html_for($rr); } else { $n = "[Token " . encode_token((int) $rr->reviewToken) . "]"; } if ($allow_admin) { $n .= _review_table_actas($rr); } $t .= '<td class="rl"><span class="taghl">' . $n . '</span>' . ($rtype ? " {$rtype}" : "") . "</td>"; if ($show_colors && (get($rr, "contactRoles") || get($rr, "contactTags"))) { $tags = Contact::roles_all_contact_tags(get($rr, "contactRoles"), get($rr, "contactTags")); $tags = Tagger::strip_nonviewable($tags, $Me); if ($tags && ($color = TagInfo::color_classes($tags))) { $tclass = $color; } } } // requester if ($mode === "assign") { if (($conflictType <= 0 || $admin) && $rr->reviewType == REVIEW_EXTERNAL && !$showtoken) { $t .= '<td style="font-size:smaller">'; if ($rr->requestedBy == $Me->contactId) { $t .= "you"; } else { if ($u = get($pcm, $rr->requestedBy)) { $t .= $Me->reviewer_html_for($rr->requestedBy); } else { $t .= Text::user_html([$rr->reqFirstName, $rr->reqLastName, $rr->reqEmail]); } } $t .= '</td>'; $want_requested_by = true; } else { $t .= '<td class="empty"></td>'; } } // actions if ($mode === "assign" && ($conflictType <= 0 || $admin) && $rr->reviewType == REVIEW_EXTERNAL && $rr->reviewModified <= 0 && ($rr->requestedBy == $Me->contactId || $admin)) { $t .= '<td>' . _retract_review_request_form($prow, $rr) . '</td>'; } // scores $scores = array(); if ($want_scores && $canView) { $view_score = $Me->view_score_bound($prow, $rr); $rf = ReviewForm::get(); foreach ($rf->forder as $fid => $f) { if (!$f->has_options || $f->view_score <= $view_score || $f->round_mask && !$f->is_round_visible($rr)) { /* do nothing */ } else { if ($rr->{$fid}) { if (!get($score_header, $fid)) { $score_header[$fid] = "<th>" . $f->web_abbreviation() . "</th>"; } $scores[$fid] = '<td class="revscore" data-rf="' . $f->uid . '">' . $f->unparse_value($rr->{$fid}, ReviewField::VALUE_SC) . '</td>'; } else { if (get($score_header, $fid) === null) { $score_header[$fid] = ""; } } } } } // affix if (!$rr->reviewSubmitted) { $nonsubrev[] = array($tclass, $t, $scores); } else { $subrev[] = array($tclass, $t, $scores); } } // proposed review rows if ($proposals) { foreach ($proposals as $rr) { $t = ""; // review ID $t = "<td>Proposed review</td>"; // reviewer identity $t .= "<td>" . Text::user_html($rr); if ($allow_admin) { $t .= _review_table_actas($rr); } $t .= "</td>"; // requester if ($conflictType <= 0 || $admin) { $t .= '<td style="font-size:smaller">'; if ($rr->requestedBy == $Me->contactId) { $t .= "you"; } else { if ($u = get($pcm, $rr->requestedBy)) { $t .= $Me->reviewer_html_for($rr->requestedBy); } else { $t .= Text::user_html([$rr->reqFirstName, $rr->reqLastName, $rr->reqEmail]); } } $t .= '</td>'; $want_requested_by = true; } $t .= '<td>'; if ($admin) { $t .= '<small>' . Ht::form(hoturl_post("assign", "p={$prow->paperId}")) . '<div class="inline">' . Ht::hidden("name", $rr->name) . Ht::hidden("email", $rr->email) . Ht::hidden("reason", $rr->reason); if ($rr->reviewRound !== null) { if ($rr->reviewRound == 0) { $rname = "unnamed"; } else { $rname = $Conf->round_name($rr->reviewRound); } if ($rname) { $t .= Ht::hidden("round", $rname); } } $t .= Ht::submit("add", "Approve review", array("style" => "font-size:smaller")) . ' ' . Ht::submit("deny", "Deny request", array("style" => "font-size:smaller")) . '</div></form>'; } else { if ($rr->reqEmail === $Me->email) { $t .= _retract_review_request_form($prow, $rr); } } $t .= '</td>'; // affix $nonsubrev[] = array("", $t); } } // unfinished review notification $notetxt = ""; if ($conflictType >= CONFLICT_AUTHOR && !$admin && $notShown && $Me->can_view_review($prow, null, null)) { if ($notShown == 1) { $t = "1 review remains outstanding."; } else { $t = "{$notShown} reviews remain outstanding."; } $t .= '<br /><span class="hint">You will be emailed if new reviews are submitted or existing reviews are changed.</span>'; $notetxt = '<div class="revnotes">' . $t . "</div>"; } // completion if (count($nonsubrev) + count($subrev)) { if ($want_requested_by) { array_unshift($score_header, '<th class="revsl">Requester</th>'); } $score_header_text = join("", $score_header); $t = "<table class=\"reviewers"; if ($score_header_text) { $t .= " reviewers_scores"; } if ($list = SessionList::active()) { $t .= " has_hotcrp_list\" data-hotcrp-list=\"" . $list->listno; } $t .= "\">\n"; if ($score_header_text) { $t .= '<tr><td class="empty" colspan="2"></td>' . $score_header_text . "</tr>\n"; } foreach (array_merge($subrev, $nonsubrev) as $r) { $t .= '<tr class="rl' . ($r[0] ? " {$r['0']}" : "") . '">' . $r[1]; if (get($r, 2)) { foreach ($score_header as $fid => $header_needed) { if ($header_needed) { $x = get($r[2], $fid); $t .= $x ?: "<td class=\"revscore rs_{$fid}\"></td>"; } } } else { if (count($score_header)) { $t .= '<td colspan="' . count($score_header) . '"></td>'; } } $t .= "</tr>\n"; } if ($score_header_text) { $Conf->footerScript("review_form.score_tooltips(\$(\"table.reviewers_scores\"))", "score_tooltips"); } return $t . "</table>\n" . $notetxt; } else { return $notetxt; } }
function show($prow, $rrows, $rrow, &$options) { global $Conf, $Opt, $Me, $useRequest; if (!$options) { $options = array(); } $editmode = defval($options, "edit", false); $reviewOrdinal = unparseReviewOrdinal($rrow); self::check_review_author_seen($prow, $rrow, $Me); if (!$editmode) { $rj = $this->unparse_review_json($prow, $rrow, $Me); if (get($options, "editmessage")) { $rj->message_html = $options["editmessage"]; } $Conf->echoScript("review_form.add_review(" . json_encode($rj) . ");\n"); return; } // From here on, edit mode. $forceShow = $Me->is_admin_force() ? "&forceShow=1" : ""; $reviewLinkArgs = "p={$prow->paperId}" . ($rrow ? "&r={$reviewOrdinal}" : "") . "&m=re" . $forceShow; $reviewPostLink = hoturl_post("review", $reviewLinkArgs); $reviewDownloadLink = hoturl("review", $reviewLinkArgs . "&downloadForm=1" . $forceShow); echo Ht::form($reviewPostLink, array("class" => "revcard")), '<div class="aahc">', Ht::hidden_default_submit("default", ""); if ($rrow) { echo Ht::hidden("version", defval($rrow, "reviewEditVersion", 0) + 1); } echo '<div class="revcard" id="r', $reviewOrdinal, '"><div class="revcard_head">'; // Links if ($rrow) { echo '<div class="floatright"><a href="' . hoturl("review", "r={$reviewOrdinal}&text=1" . $forceShow) . '" class="xx">', Ht::img("txt.png", "[Text]", "b"), " <u>Plain text</u></a>", "</div>"; } echo "<h3>"; if ($rrow) { echo '<a href="', hoturl("review", "r={$reviewOrdinal}" . $forceShow), '" class="q">Edit Review'; if ($rrow->reviewSubmitted) { echo " #", $reviewOrdinal; } echo "</a>"; } else { echo "Write Review"; } echo "</h3>\n"; $open = $sep = " <span class='revinfo'>"; $xsep = " <span class='barsep'>·</span> "; $showtoken = $rrow && $Me->review_token_cid($prow, $rrow); $type = ""; if ($rrow && $Me->can_view_review_round($prow, $rrow, null)) { $type = review_type_icon($rrow->reviewType); if ($rrow->reviewRound > 0 && $Me->can_view_review_round($prow, $rrow, null)) { $type .= " <span class=\"revround\" title=\"Review round\">" . htmlspecialchars($Conf->round_name($rrow->reviewRound, true)) . "</span>"; } } if ($rrow && $Me->can_view_review_identity($prow, $rrow, null) && (!$showtoken || !Contact::is_anonymous_email($rrow->email))) { echo $sep, $rrow->reviewBlind ? "[" : "", Text::user_html($rrow), $rrow->reviewBlind ? "]" : "", " ", $type; $sep = $xsep; } else { if ($type) { echo $sep, $type; $sep = $xsep; } } if ($showtoken) { echo $sep, "Review token ", encode_token((int) $rrow->reviewToken); $sep = $xsep; } if ($rrow && $rrow->reviewModified > 0 && $Me->can_view_review_time($prow, $rrow)) { echo $sep, "Updated ", $Conf->printableTime($rrow->reviewModified); $sep = $xsep; } if ($sep != $open) { echo "</span>\n"; } if (defval($options, "editmessage")) { echo "<div class='hint'>", defval($options, "editmessage"), "</div>\n"; } // download? echo '<hr class="c" />'; echo "<table class='revoff'><tr>\n <td><strong>Offline reviewing</strong> </td>\n <td>Upload form: <input type='file' name='uploadedFile' accept='text/plain' size='30' />\n ", Ht::submit("uploadForm", "Go"), "</td>\n </tr><tr>\n <td></td>\n <td><a href='{$reviewDownloadLink}'>Download form</a>\n <span class='barsep'>·</span>\n <span class='hint'><strong>Tip:</strong> Use <a href='", hoturl("search"), "'>Search</a> or <a href='", hoturl("offline"), "'>Offline reviewing</a> to download or upload many forms at once.</span></td>\n </tr></table></div>\n"; // ready? $ready = $useRequest ? defval($_REQUEST, "ready") : !($rrow && $rrow->reviewModified && !$rrow->reviewSubmitted); // review card echo '<div class="revcard_body">'; // administrator? $admin = $Me->allow_administer($prow); if ($rrow && !$Me->is_my_review($rrow) && $admin) { echo Ht::xmsg("info", "This isn’t your review, but as an administrator you can still make changes."); } // delegate? if ($rrow && !$rrow->reviewSubmitted && $rrow->contactId == $Me->contactId && $rrow->reviewType == REVIEW_SECONDARY) { $ndelegated = 0; foreach ($rrows as $rr) { if ($rr->reviewType == REVIEW_EXTERNAL && $rr->requestedBy == $rrow->contactId) { $ndelegated++; } } if ($ndelegated == 0) { $t = "As a secondary reviewer, you can <a href=\"" . hoturl("assign", "p={$rrow->paperId}") . "\">delegate this review to an external reviewer</a>, but if your external reviewer declines to review the paper, you should complete this review yourself."; } else { if ($rrow->reviewNeedsSubmit == 0) { $t = "A delegated external reviewer has submitted their review, but you can still complete your own if you’d like."; } else { $t = "Your delegated external reviewer has not yet submitted a review. If they do not, you should complete this review yourself."; } } echo Ht::xmsg("info", $t); } // top save changes if ($Me->timeReview($prow, $rrow) || $admin) { $buttons = $this->_review_buttons($prow, $rrow, "top", $reviewPostLink); echo Ht::actions($buttons, array("class" => "aab", "style" => "margin-top:0")); } // blind? if ($Conf->review_blindness() == Conf::BLIND_OPTIONAL) { echo '<div class="revet"><span class="revfn">', Ht::checkbox_h("blind", 1, $useRequest ? defval($_REQUEST, 'blind') : !$rrow || $rrow->reviewBlind), " ", Ht::label("Anonymous review"), "</span><hr class=\"c\" /></div>\n", '<div class="revhint">', htmlspecialchars(Conf::$gShortName), " allows either anonymous or open review. Check this box to submit your review anonymously (the authors won’t know who wrote the review).</div>\n", '<div class="g"></div>', "\n"; } // form body $this->webFormRows($Me, $prow, $rrow, $useRequest); // review actions if ($Me->timeReview($prow, $rrow) || $admin) { $buttons = $this->_review_buttons($prow, $rrow, "bottom", $reviewPostLink); echo Ht::actions($buttons, array("class" => "aab", "style" => "margin-bottom:0")); if ($rrow && $rrow->reviewSubmitted && !$admin) { echo '<div class="hint">Only administrators can remove or unsubmit the review at this point.</div>'; } } echo "</div></div></div></form>\n\n"; Ht::stash_script('hiliter_children("form.revcard")', "form_revcard"); }
function echo_all_grades() { global $Me, $User, $Pset, $Info; if ($Info->is_handout_commit()) { return; } $gj = ContactView::grade_json($Info); if (get($gj, "grades") || $Info->can_see_grades && $Me != $User) { echo_grade_total($gj); foreach ($Pset->grades as $ge) { echo_grade_entry($ge); } } $lhg = $Info->late_hours(); if ($lhg && $User == $Me && $Info->can_see_grades) { if ($lhg->hours || get($gj, "grades")) { echo '<div style="margin-top:1.5em">'; ContactView::echo_group("late hours", '<span class="grader61" data-pa-grade="late_hours">' . htmlspecialchars($lhg->hours) . '</span>', array(), array("nowrap" => true)); echo '</div>'; } } else { if ($User != $Me) { $lhag = $Info->late_hours(true); $value = '<span class="gradeholder61">' . Ht::entry("late_hours", $lhg ? $lhg->hours : "", array("onchange" => "jQuery(this).closest('form').submit()", "class" => "grader61")) . '</span>'; $value .= " " . Ht::submit("Save", array("tabindex" => 1)); $value .= ' <span class="ajaxsave61"></span>'; if ($lhag && $lhag->hours !== $lhg->hours) { $value .= ' <span class="autograde61">auto-late hours is ' . htmlspecialchars($lhag->hours) . '</span>'; } echo Ht::form($Info->hoturl_post("pset", array("setlatehours" => 1)), array("onsubmit" => "return gradesubmit61(this)")), '<div class="f-contain" style="margin-top:1.5em">'; ContactView::echo_group("late hours", $value, array(), array("nowrap" => true)); echo '</div></form>'; } } }
$confname = Conf::$gLongName; if (Conf::$gShortName && Conf::$gShortName != Conf::$gLongName) { $confname .= " (" . Conf::$gShortName . ")"; } echo '<div class="homegrp"> Welcome to the ', htmlspecialchars($confname), " site."; if (isset($Opt["conferenceSite"])) { echo " For general conference information, see <a href=\"", htmlspecialchars($Opt["conferenceSite"]), "\">", htmlspecialchars($Opt["conferenceSite"]), "</a>."; } echo '</div>'; } if (!$Me->has_email() || isset($_REQUEST["signin"])) { echo "<div class=\"homegrp\">Sign in using your <strong>COE credentials</strong> (same as for ECE/COE email). Only ECE faculty has access. Please contact COE Computer Help for password problems.</div>"; $passwordFocus = $email_class == "" && $password_class != ""; echo '<hr class="home" /> <div class="homegrp foldo" id="homeacct">', Ht::form(hoturl_post("index")), '<div class="f-contain">'; if ($Me->is_empty() || isset($_REQUEST["signin"])) { echo Ht::hidden("testsession", 1); } if (get($Opt, "contactdb_dsn") && get($Opt, "contactdb_loginFormHeading")) { echo $Opt["contactdb_loginFormHeading"]; } $password_reset = $Conf->session("password_reset"); if ($password_reset && $password_reset->time < $Now - 900) { $password_reset = null; $Conf->save_session("password_reset", null); } echo '<div class="f-ii"> <div class="f-c', $email_class, '">', isset($Opt["ldapLogin"]) ? "Username" : "Email", '</div> <div class="f-e', $email_class, '">', Ht::entry("email", isset($_REQUEST["email"]) ? $_REQUEST["email"] : ($password_reset ? $password_reset->email : ""), ["size" => 36, "tabindex" => 1, "id" => "signin_email"]), '</div> </div>
ContactView::echo_repo_regrades_group($info); } else { ContactView::echo_repo_last_commit_group($info, true); } } if (!$Me->is_empty() && $User->is_student()) { Ht::stash_script("peteramati_uservalue=" . json_encode($Me->user_linkpart($User))); foreach (ContactView::pset_list(false, true) as $pset) { show_pset($pset, $User); } if ($Me->isPC) { echo "<div style='margin-top:5em'></div>\n"; if ($User->dropped) { echo Ht::form(hoturl_post("index", array("set_undrop" => 1, "u" => $Me->user_linkpart($User)))), "<div>", Ht::submit("Undrop"), "</div></form>"; } else { echo Ht::form(hoturl_post("index", array("set_drop" => 1, "u" => $Me->user_linkpart($User)))), "<div>", Ht::submit("Drop"), "</div></form>"; } } } function render_pset_row(Pset $pset, $students, Contact $s, $row, $pcmembers, $anonymous) { global $Conf, $Me, $Now, $Profile; $row->sortprefix = ""; $ncol = 0; $t0 = $Profile ? microtime(true) : 0; $j = []; $j["username"] = $s->github_username ?: $s->seascode_username ?: ($s->email ?: $s->huid); if ($anonymous) { $j["anon_username"] = $s->anon_username; } $j["sorter"] = $s->sorter;
// Table if (count($col[0]) || count($col[1]) || count($col[2])) { echo "<table><tr>\n"; 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);
$numPrimary = preg_match_all("|" . REVIEW_PRIMARY . "|", $p->allReviews, $matches); if (!$numReviews) { echo "0 reviews"; } else { echo "<a class='q' href=\"" . hoturl("search", "q=re:" . urlencode($pc->email)) . "\">" . plural($numReviews, "review") . "</a>"; if ($numPrimary && $numPrimary < $numReviews) { echo " (<a class='q' href=\"" . hoturl("search", "q=pri:" . urlencode($pc->email)) . "\">{$numPrimary} primary</a>)"; } } echo "</div><hr class=\"c\" /></div></div>\n"; } echo "</div>\n", "<div class='aa' style='margin-bottom:0'>", Ht::submit("update", "Save assignments", array("class" => "bb")), " ", Ht::submit("cancel", "Cancel"), " <span id='assresult' style='padding-left:1em'></span></div>\n\n", '</div></form>'; } echo "</div></div>\n"; // add external reviewers echo Ht::form($loginUrl), '<div class="aahc revcard"><div class="revcard_head">', "<h3>Request an external review</h3>\n", "<div class='hint'>External reviewers get access to their assigned papers, including "; if (setting("extrev_view") >= 2) { echo "the other reviewers' identities and "; } echo "any eventual decision. Before requesting an external review,\n you should generally check personally whether they are interested."; if ($Me->allow_administer($prow)) { echo "\nTo create a review with no associated reviewer, leave Name and Email blank."; } echo '</div></div><div class="revcard_body">'; echo "<div class='f-i'><div class='f-ix'>\n <div class='f-c'>Name</div>\n <div class='f-e'><input type='text' name='name' value=\"", htmlspecialchars(defval($_REQUEST, "name", "")), "\" size='32' tabindex='1' /></div>\n</div><div class='f-ix'>\n <div class='f-c", isset($Error["email"]) ? " error" : "", "'>Email</div>\n <div class='f-e'><input type='text' name='email' value=\"", htmlspecialchars(defval($_REQUEST, "email", "")), "\" size='28' tabindex='1' /></div>\n</div><hr class=\"c\" /></div>\n\n"; // reason area $null_mailer = new HotCRPMailer(); $reqbody = $null_mailer->expand_template("requestreview", false); if (strpos($reqbody["body"], "%REASON%") !== false) { echo "<div class='f-i'>\n <div class='f-c'>Note to reviewer <span class='f-cx'>(optional)</span></div>\n <div class='f-e'>", Ht::textarea("reason", @$_REQUEST["reason"], array("class" => "papertext", "rows" => 2, "cols" => 60, "tabindex" => 1, "spellcheck" => "true")), "</div><hr class=\"c\" /></div>\n\n"; }
function echo_linenote_entry_prototype() { echo '<tr class="diffl61 gw iscomment61"', ' data-pa-savednote="">', '<td colspan="2" class="difflnoteborder61"></td>', '<td class="difflnote61"><div class="diffnoteholder61" style="display:none">', Ht::form($this->hoturl_post("pset", array("savelinenote" => 1)), array("onsubmit" => "return savelinenote61(this)")), '<div class="f-contain">', Ht::hidden("file", ""), Ht::hidden("line", ""), Ht::hidden("iscomment", "", array("class" => "iscomment")), '<textarea class="diffnoteentry61" name="note"></textarea>', '<div class="aab aabr difflnoteaa61">', '<div class="aabut">', Ht::submit("Save comment"), '</div><div class="aabut">'; if ($this->user_can_see_grades) { echo Ht::hidden("iscomment", 1); } else { echo Ht::checkbox("iscomment", 1), ' ', Ht::label("Show immediately"); } echo '</div></div></div></form></div></td></tr>'; }
$capmgr->delete($capdata); $Conf->save_session("password_reset", (object) array("time" => $Now, "email" => $Acct->email, "password" => $_POST["password"])); go(hoturl("index")); } } } $password_class = " error"; } $Conf->header("Reset password", "resetpassword", null); if (!isset($_POST["autopassword"]) || trim($_POST["autopassword"]) != $_POST["autopassword"] || strlen($_POST["autopassword"]) < 16 || !preg_match("/\\A[-0-9A-Za-z@_+=]*\\z/", $_POST["autopassword"])) { $_POST["autopassword"] = Contact::random_password(); } echo "<div class='homegrp'>\nWelcome to the ", htmlspecialchars($Conf->full_name()), " submissions site."; if (opt("conferenceSite")) { echo " For general information about ", htmlspecialchars($Conf->short_name), ", see <a href=\"", htmlspecialchars(opt("conferenceSite")), "\">the conference site</a>."; } echo "</div>\n<hr class='home' />\n<div class='homegrp' id='homereset'>\n", Ht::form(hoturl_post("resetpassword")), '<div class="f-contain">', Ht::hidden("resetcap", $resetcap), Ht::hidden("autopassword", $_POST["autopassword"]), "<p>Use this form to reset your password. You may want to use the random password we’ve chosen.</p>"; echo '<table style="margin-bottom:2em">', '<tr><td class="lcaption">Your email</td><td>', htmlspecialchars($Acct->email), '</td></tr> <tr><td class="lcaption">Suggested password</td><td>', htmlspecialchars($_POST["autopassword"]), '</td></tr></table>'; echo '<div class="f-i"> <div class="f-c', $password_class, '">New password</div> <div class="f-e">', Ht::password("password", "", array("id" => "login_d", "tabindex" => 1, "size" => 36)), '</div> </div> <div class="f-i"> <div class="f-c', $password_class, '">New password (again)</div> <div class="f-e">', Ht::password("password2", "", array("tabindex" => 1, "size" => 36)), '</div> </div> <div class="f-i" style="margin-top:2em">', Ht::submit("go", "Reset password", array("tabindex" => 1)), "</div>\n</div></form>\n<hr class='home' /></div>\n"; Ht::stash_script("crpfocus(\"login\", null, 2)"); echo '<hr class="c" />', "\n"; $Conf->footer();
static function echo_repo_group($info, $include_tarball = false) { global $Conf, $Me, $Now; if ($info->pset->gitless) { return; } list($user, $pset, $partner, $repo) = array($info->user, $info->pset, $info->partner, $info->repo); $editable = $info->can_set_repo && !$user->is_anonymous; $repo_url = $user->seascode_repo_base($repo ? $repo->url : ""); $title = "repository"; if ($repo_url && strpos($repo_url, ":") === false) { $title = $user->repo_link($repo_url, $title); } if ($editable) { $value = Ht::entry("repo", $repo_url, array("style" => "width:32em")) . " " . Ht::submit("Save"); } else { if ($user->is_anonymous) { $value = $repo_url ? "[anonymous]" : "(none)"; } else { $value = htmlspecialchars($repo_url ? $repo_url : "(none)"); } } if ($repo_url) { $value .= ' <button class="b repoclip hottooltip" data-pa-repo="' . htmlspecialchars($repo->url) . '"'; if ($user->is_anonymous) { $value .= ' data-tooltip="[anonymous]"'; } else { $value .= ' data-tooltip="' . htmlspecialchars($repo->url) . '"'; } $value .= ' type="button" onclick="false">Copy URL to clipboard</button>'; $Conf->footerScript('$(".repoclip").each(pa_init_repoclip)', "repoclip"); if ($include_tarball && $info->commit_hash() && ($tarball_url = $info->tarball_url())) { $value .= ' <a class="bsm q" href="' . htmlspecialchars($tarball_url) . '">Download tarball for ' . substr($info->commit_hash(), 0, 7) . '</a>'; } } // check repo $notes = array(); if ($repo && !$repo->working) { if ($user->check_seascode_repo($pset, $repo, false)) { $Now = time(); $Conf->qe("update Repository set `working`={$Now} where repoid={$repo->repoid}"); } else { $notes[] = array(true, "ERROR: " . Messages::$main->expand_html("repo_unreadable", $user->repo_messagedefs($repo))); } } if (($open = $info->check_repo_open()) > 0) { $notes[] = array(true, "ERROR: " . Messages::$main->expand_html("repo_toopublic", $user->repo_messagedefs($repo))); } else { if ($open < 0 && $Me->isPC) { $notes[] = array(true, "WARNING: " . Messages::$main->expand_html("repo_toopublic_timeout", $user->repo_messagedefs($repo))); } } if ($partner && $info->partner_same) { $prepo = $partner->repo($pset->id); if (!$repo && $prepo || $repo && !$prepo || $repo && $prepo && $repo->repoid != $prepo->repoid) { if ($prepo) { $prepo_url = ", " . htmlspecialchars($user->seascode_repo_base($prepo->url)); } else { $prepo_url = ""; } $your_partner = "your partner’s"; if ($Me->isPC) { $your_partner = '<a href="' . hoturl("pset", array("pset" => $pset->urlkey, "u" => $Me->user_linkpart($partner))) . '">' . $your_partner . '</a>'; } $notes[] = array(true, "ERROR: This repository differs from {$your_partner}{$prepo_url}."); } } if ($repo && $repo_url[0] == "~" && $user->seascode_username && !preg_match("_\\A~(?:" . preg_quote($user->seascode_username) . ($partner ? "|" . preg_quote($partner->seascode_username) : "") . ")/_i", $repo_url)) { if ($partner) { $notes[] = array(true, "ERROR: This repository belongs to neither you nor your partner."); } else { $notes[] = array(true, "ERROR: This repository does not belong to you."); } } if ($repo && isset($repo->truncated_psetdir) && defval($repo->truncated_psetdir, $pset->id)) { $notes[] = array(true, "Please create your repository by cloning our repository. Creating your repository from scratch makes it harder for us to grade and harder for you to get pset updates."); } if (!$repo) { $notes[] = array(false, "Enter your " . Contact::seascode_home("code.seas") . " repository URL here."); } // edit if ($editable) { echo Ht::form(self_href(array("post" => post_value(), "set_seascode_repo" => 1, "pset" => $pset->urlkey))), '<div class="f-contain">'; } self::echo_group($title, $value, $notes); if ($editable) { echo "</div></form>\n"; } return $repo; }