예제 #1
1
 function list_actions(Contact $user, $qreq, PaperList $pl, &$actions)
 {
     if (!$user->isPC || Navigation::page() === "reviewprefs") {
         return;
     }
     // tagtype cell
     $tagopt = array("a" => "Add", "d" => "Remove", "s" => "Define", "xxxa" => null, "ao" => "Add to order", "aos" => "Add to gapless order", "so" => "Define order", "sos" => "Define gapless order", "sor" => "Define random order");
     $tagextra = array("id" => "placttagtype");
     if ($user->privChair) {
         $tagopt["xxxb"] = null;
         $tagopt["da"] = "Clear twiddle";
         $tagopt["cr"] = "Calculate rank";
         $tagextra["onchange"] = "plactions_dofold()";
         Ht::stash_script("plactions_dofold()", "plactions_dofold");
     }
     // tag name cell
     $t = "";
     if ($user->privChair) {
         $t .= '<span class="fx99"><a class="q" href="#" onclick="return fold(\'placttags\')">' . expander(null, 0) . "</a></span>";
     }
     $t .= 'tag<span class="fn99">(s)</span> &nbsp;' . Ht::entry("tag", $qreq->tag, ["size" => 15, "onfocus" => "autosub('tag',this)", "class" => "wantcrpfocus"]) . ' &nbsp;' . Ht::submit("fn", "Go", ["value" => "tag", "onclick" => "return plist_submit.call(this)"]);
     if ($user->privChair) {
         $t .= "<div class='fx'><div style='margin:2px 0'>" . Ht::checkbox("tagcr_gapless", 1, $qreq->tagcr_gapless, array("style" => "margin-left:0")) . "&nbsp;" . Ht::label("Gapless order") . "</div>" . "<div style='margin:2px 0'>Using: &nbsp;" . Ht::select("tagcr_method", PaperRank::methods(), $qreq->tagcr_method) . "</div>" . "<div style='margin:2px 0'>Source tag: &nbsp;~" . Ht::entry("tagcr_source", $qreq->tagcr_source, array("size" => 15)) . "</div></div>";
     }
     $actions[] = [500, "tag", "Tag", "<b>:</b> &nbsp;" . Ht::select("tagfn", $tagopt, $qreq->tagfn, $tagextra) . " &nbsp;", ["id" => "foldplacttags", "class" => "foldc fold99c", "content" => $t]];
 }
예제 #2
0
 function list_actions(Contact $user, $qreq, PaperList $pl, &$actions)
 {
     global $Conf;
     Ht::stash_script("plactions_dofold()", "plactions_dofold");
     $Conf->stash_hotcrp_pc($user);
     $actions[] = [700, "assign", "Assign", "<b>:</b> &nbsp;" . Ht::select("assignfn", array("auto" => "Automatic assignments", "zzz1" => null, "conflict" => "Conflict", "unconflict" => "No conflict", "zzz2" => null, "assign" . REVIEW_PRIMARY => "Primary review", "assign" . REVIEW_SECONDARY => "Secondary review", "assign" . REVIEW_PC => "Optional review", "assign0" => "Clear review", "zzz3" => null, "lead" => "Discussion lead", "shepherd" => "Shepherd"), $qreq->assignfn, ["class" => "wantcrpfocus", "onchange" => "plactions_dofold()"]) . '<span class="fx"> &nbsp;<span id="atab_assign_for">for</span> &nbsp;' . Ht::select("markpc", [], 0, ["id" => "markpc", "class" => "need-pcselector", "data-pcselector-selected" => $qreq->markpc]) . "</span> &nbsp;" . Ht::submit("fn", "Go", ["value" => "assign", "onclick" => "return plist_submit.call(this)"])];
 }
 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>";
 }
예제 #4
0
 function list_actions(Contact $user, $qreq, PaperList $pl, &$actions)
 {
     $xactions = SearchAction::list_subactions("get", $user, $qreq, $pl);
     foreach (PaperOption::option_ids() as $oid) {
         if ($pl->any["opt{$oid}"] && ($o = PaperOption::find($oid)) && $o->is_document()) {
             $xactions[] = GetDocument_SearchAction::make_option_action($o);
         }
     }
     usort($xactions, function ($a, $b) {
         return $a[0] - $b[0];
     });
     $sel_opt = array();
     $last_group = null;
     foreach ($xactions as $xact) {
         if ($xact[2] !== $last_group) {
             $sel_opt[] = ["optgroup", $xact[2]];
             $last_group = $xact[2];
         }
         $sel_opt[] = ["value" => $xact[1], "label" => $xact[3]];
     }
     if (!empty($sel_opt)) {
         $actions[] = [0, "get", "Download", "<b>:</b> &nbsp;" . Ht::select("getfn", $sel_opt, $qreq->getfn, ["tabindex" => 6, "class" => "wantcrpfocus", "style" => "max-width:10em"]) . "&nbsp; " . Ht::submit("fn", "Go", ["value" => "get", "tabindex" => 6, "onclick" => "return plist_submit.call(this)", "data-plist-submit-all" => 1])];
     }
 }
        $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")) . "&nbsp;" . 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")) . "&nbsp;" . 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")) . "&nbsp;" . 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)")) . "&nbsp;" . 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)")) . "&nbsp;" . Ht::label("Topics") . '</span>';
}
if (count($show_data) && $pl->count) {
    echo '<tr><td class="lxcaption"><strong>Show:</strong> &nbsp;', '</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") ? "&amp;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();
예제 #6
0
 private function _footer($ncol, $extra)
 {
     global $Conf;
     if ($this->count == 0) {
         return "";
     }
     $revpref = $this->table_type == "editReviewPreference";
     $lllgroups = SearchAction::list_all_actions($this->contact, $this->qreq, $this);
     // Upload preferences (review preferences only)
     if ($revpref) {
         $lllgroups[] = [100, "uploadpref", "Upload", "<b>&nbsp;preference file:</b> &nbsp;" . "<input class=\"wantcrpfocus\" type='file' name='uploadedFile' accept='text/plain' size='20' tabindex='6' onfocus='autosub(\"uploadpref\",this)' />&nbsp; " . Ht::submit("fn", "Go", ["value" => "uploadpref", "tabindex" => 6, "onclick" => "return plist_submit.call(this)", "data-plist-submit-all" => 1])];
     }
     // Set preferences (review preferences only)
     if ($revpref) {
         $lllgroups[] = [200, "setpref", "Set preferences", "<b>:</b> &nbsp;" . Ht::entry("pref", "", array("class" => "wantcrpfocus", "size" => 4, "tabindex" => 6, "onfocus" => 'autosub("setpref",this)')) . " &nbsp;" . Ht::submit("fn", "Go", ["value" => "setpref", "tabindex" => 6, "onclick" => "return plist_submit.call(this)"])];
     }
     usort($lllgroups, function ($a, $b) {
         return $a[0] - $b[0];
     });
     $whichlll = 1;
     foreach ($lllgroups as $i => $lllg) {
         if ($this->qreq->fn == $lllg[1] || $this->atab == $lllg[1]) {
             $whichlll = $i + 1;
         }
     }
     // Linelinks container
     $foot = "  <tr class=\"pl_footrow\">";
     if (!$this->viewmap->columns) {
         $foot .= '<td class="pl_footselector">' . Ht::img("_.gif", "^^", "placthook") . "</td>";
         --$ncol;
     }
     $foot .= '<td id="plact" class="pl_footer linelinks' . $whichlll . '" colspan="' . $ncol . '">';
     $foot .= "<table><tbody><tr>\n" . '    <td class="pl_footer_desc"><b>Select papers</b> (or <a href="' . selfHref(["selectall" => 1]) . '#plact" onclick="return papersel(true)">select all ' . $this->count . "</a>), then&nbsp;</td>\n" . "   </tr></tbody></table>";
     foreach ($lllgroups as $i => $lllg) {
         $x = $i + 1;
         $foot .= "<table><tbody><tr>\n" . "    <td class=\"pl_footer_desc lll{$x}\"><a href=\"" . selfHref(["atab" => $lllg[1]]) . "#plact\" onclick=\"return crpfocus('plact',this)\">" . $lllg[2] . "</a></td>\n";
         for ($j = 3; $j < count($lllg); ++$j) {
             $cell = is_array($lllg[$j]) ? $lllg[$j] : ["content" => $lllg[$j]];
             $class = isset($cell["class"]) ? "lld{$x} " . $cell["class"] : "lld{$x}";
             $foot .= "    <td class=\"{$class}\"";
             if (isset($cell["id"])) {
                 $foot .= " id=\"" . $cell["id"] . "\"";
             }
             $foot .= ">" . $cell["content"] . "</td>\n";
         }
         if ($i < count($lllgroups) - 1) {
             $foot .= "    <td>&nbsp;<span class='barsep'>·</span>&nbsp;</td>\n";
         }
         $foot .= "   </tr></tbody></table>";
     }
     $foot .= $extra . "<hr class=\"c\" /></td>\n  </tr>\n";
     return $foot;
 }
예제 #7
0
                echo "&nbsp; (<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")), " &nbsp;", 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";
}
echo "<div class='f-i'>\n", Ht::submit("add", "Request review", array("tabindex" => 2)), "</div>\n\n";
if ($Me->can_administer($prow)) {
    echo "<div class='f-i'>\n  ", Ht::checkbox("override"), "&nbsp;", Ht::label("Override deadlines and any previous refusal"), "\n</div>\n";
}
echo "</div></div></form>\n";
$Conf->footer();
예제 #8
0
파일: pset.php 프로젝트: kohler/peteramati
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>';
        }
    }
}
예제 #9
0
function doActionArea($top)
{
    echo "<div class='aa'>", Ht::submit("update", "Save changes", array("class" => "bb")), " &nbsp;", Ht::submit("cancel", "Cancel"), "</div>";
}
예제 #10
0
            echo Ht::checkbox("show{$fold}", 1, $pl->have_folds[$fold], array("onchange" => "fold('ul',!this.checked,'{$fold}')")), "&nbsp;", Ht::label($text), "<br />\n";
        }
    }
    echo "</td>";
    if (isset($pl->scoreMax)) {
        echo "<td class='pad'>";
        $revViewScore = $Me->aggregated_view_score_bound();
        foreach (ReviewForm::all_fields() as $f) {
            if ($f->view_score > $revViewScore && $f->has_options) {
                $checked = strpos(displayOptionsSet("uldisplay"), $f->id) !== false;
                echo Ht::checkbox("show{$f->id}", 1, $checked), "&nbsp;", Ht::label($f->name_html), "<br />";
            }
        }
        echo "</td>";
    }
    echo "<td>", Ht::submit("redisplay", "Redisplay"), "</td></tr>\n";
    if (isset($pl->scoreMax)) {
        $ss = array();
        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> &nbsp;", 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";
}
예제 #11
0
            } 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), "&nbsp;</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()")), "&nbsp;</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();
예제 #12
0
파일: diff.php 프로젝트: benesch/peteramati
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) . '">&larr; Prev</a>';
                list($nfile, $nlineid) = $lnorder->get_next($file, $lineid);
                if ($nfile) {
                    $links[] = '<a href="#L' . $nlineid . '_' . html_id_encode($nfile) . '">Next &gt;</a>';
                } else {
                    $links[] = '<a href="#">Top</a>';
                }
                if (count($links)) {
                    echo '<div class="difflnoteptr61">', join("&nbsp;&nbsp;&nbsp;", $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>";
}
예제 #13
0
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("&amp;", $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> &nbsp;', '<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>';
}
if ($newProfile) {
    $Conf->footerScript('if(/bulk/.test(location.hash))fold("bulk",false,9)');
}
$Conf->footerScript('hiliter_children("#accountform");$("textarea").autogrow()');
$Conf->footerScript('crpfocus("account")');
$Conf->footer();
예제 #14
0
 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&nbsp;", Ht::submit("download", "Download assignment file"), "\n&nbsp;", 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();
 }
예제 #15
0
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 .= "&nbsp;#" . $prow->paperId . unparseReviewOrdinal($rr->reviewOrdinal);
        } else {
            if ($rr->reviewType == REVIEW_SECONDARY && $rr->reviewNeedsSubmit <= 0) {
                $id .= "&nbsp;(delegated)";
            } else {
                if ($rr->reviewModified > 0) {
                    $id .= "&nbsp;(in&nbsp;progress)";
                } else {
                    $id .= "&nbsp;(not&nbsp;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 .= '&nbsp;<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;
    }
}
    $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) ? "&amp;sort=" . urlencode($qreq->sort) : "";
    echo "<div class='aahc'><form class='assignpc' method='post' action=\"", hoturl_post("manualassign", "reviewer={$reviewer}&amp;kind={$qreq->kind}{$a}"), "\" enctype='multipart/form-data' accept-charset='UTF-8'><div>\n", Ht::hidden("t", $qreq->t), Ht::hidden("q", $qreq->q), Ht::hidden("papx", join(" ", $search->paperList())), "<div class=\"aa\">", Ht::submit("update", "Save assignments", array("class" => "bb"));
    if ($qreq->kind != "c") {
        $rev_rounds = $Conf->round_selector_options();
        if (count($rev_rounds) > 1) {
            echo '<span style="padding-left:2em">Review round: &nbsp;', Ht::select("rev_roundtag", $rev_rounds, $qreq->rev_roundtag ?: "unnamed", array("id" => "assrevroundtag")), '</span>';
        } else {
            if (!@$rev_rounds["unnamed"]) {
                echo '<span style="padding-left:2em">Review round: ', $Conf->current_round_name(), '</span>';
            }
        }
    }
    echo "<span style='padding-left:2em'>", Ht::checkbox(false, false, true, array("id" => "assrevimmediate")), "&nbsp;", Ht::label("Automatically save assignments", "assrevimmediate"), "</span></div>\n", $paperList->table_html($qreq->kind == "c" ? "conflict" : "reviewAssignment", array("class" => "pltable_full", "table_id" => "foldpl", "header_links" => true, "nofooter" => true, "fold" => array("allrevtopicpref" => true))), "<div class='aa'>", Ht::submit("update", "Save assignments", array("class" => "bb")), "</div></div></form></div>\n";
}
echo '<hr class="c" />';
$Conf->footer();
예제 #17
0
 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), '&nbsp;', Ht::label("Show immediately");
     }
     echo '</div></div></div></form></div></td></tr>';
 }
예제 #18
0
파일: home.php 프로젝트: benesch/peteramati
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";
}
예제 #19
0
 <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">&nbsp;Mute</span>';
//echo '<span class="hidden fhx_ib">&nbsp;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()")), "&nbsp;", 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();
예제 #20
0
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> &nbsp;', '<input type="file" name="bulk" accept="text/plain,text/csv" size="30" /></div>';
echo '<div id="foldoptions" class="lg foldc fold2o">', 'By default, assign&nbsp; ', 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">&nbsp; in round &nbsp;', Ht::select("rev_roundtag", $rev_rounds, $_REQUEST["rev_roundtag"] ?: "unnamed"), '</span>';
} else {
    if (!get($rev_rounds, "unnamed")) {
        echo '<span class="fx2">&nbsp; 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"]);
if (isset($_REQUEST["requestreview_body"])) {
    $t = $_REQUEST["requestreview_body"];
} else {
    $t = $requestreview_template["body"];
}
echo "<table class='fx'><tr><td>", Ht::checkbox("requestreview_notify", 1, true), "&nbsp;</td><td>", Ht::label("Send email to external reviewers:"), "</td></tr>\n<tr><td></td><td>", Ht::textarea("requestreview_body", $t, array("class" => "tt", "cols" => 80, "rows" => 20, "spellcheck" => "true")), "</td></tr></table>\n";
echo '<div class="g"></div><div class="aa">', Ht::submit("Prepare assignments"), " &nbsp; <span class='hint'>You’ll be able to check the assignment before it is saved.</span></div>\n";
echo '<div style="margin-top:1.5em"><a href="', hoturl_post("search", "t=manager&q=&get=pcassignments&p=all"), '">Download current PC assignments</a></div>';
echo "</div></form>\n\n<hr style='margin-top:1em' />\n\n<div class='helppagetext'>\n<h3>Instructions</h3>\n\n<p>Upload a comma-separated value file to prepare an assignment of reviews,\nconflicts, leads, shepherds, and tags. HotCRP calculates the minimal changes\nbetween the current state and the requested assignment; you’ll confirm those\nchanges before they are committed.</p>\n\n<p>A simple example:</p>\n\n<pre class='entryexample'>paper,assignment,email\n1,primary,man@alice.org\n2,secondary,slugger@manny.com\n1,primary,slugger@manny.com</pre>\n\n<p>This assigns PC members man@alice.org and slugger@manny.com as primary\nreviewers for paper #1, and slugger@manny.com as a secondary\nreviewer for paper #2. Errors will be reported if those users aren’t PC\nmembers, or if they have conflicts with their assigned papers.</p>\n\n<p>A more complex example:</p>\n\n<pre class='entryexample'>paper,assignment,email,round\nall,clearreview,all,R2\n1,primary,man@alice.org,R2\n10,primary,slugger@manny.com,R2\n#manny OR #ramirez,primary,slugger@manny.com,R2</pre>\n\n<p>The first assignment line clears all review assignments in\nround R2. (Review assignments in other rounds are left alone.) The next\nlines assign man@alice.org as a primary reviewer for paper #1, and slugger@manny.com\nas a primary reviewer for paper #10. The last line assigns slugger@manny.com\nas a primary reviewer for all papers tagged #manny or #ramirez.</p>\n\n<p>Assignment types are:</p>\n\n<dl class=\"spaced\">\n<dt><code>review</code></dt>\n\n<dd>Assign a review. The <code>email</code> and/or <code>name</code> columns\nlocate the user. (<code>first</code> and <code>last</code> columns may be used\nin place of <code>name</code>.) The <code>reviewtype</code> column sets the\nreview type; it can be <code>primary</code>, <code>secondary</code>,\n<code>pcreview</code> (optional PC review), or <code>external</code>, or\n<code>clear</code> to unassign the review. The optional\n<code>round</code> column sets the review round.\n\n<p>Only PC members can be assigned primary, secondary, and optional PC\nreviews. Accounts will be created for new external reviewers as necessary. The\n<code>clear</code> action doesn’t delete reviews that have already been\nentered.</p>\n\n<p>Assignments can create new reviews or change existing reviews. Use\n“<code>any</code>” or “old:new” syntax in the <code>round</code> and/or\n<code>reviewtype</code> columns to restrict assignments to existing reviews.\nFor example, to create a new assignment or modify an existing review:</p>\n\n<pre class=\"entryexample\">paper,assignment,email,reviewtype,round\n1,review,drew@harvard.edu,primary,R2</pre>\n\n<p>To modify an existing review’s round (“<code>any</code>” restricts the\nassignment to existing reviews):</p>\n\n<pre class=\"entryexample\">paper,assignment,email,reviewtype,round\n1,review,drew@harvard.edu,any,R2</pre>\n\n<p>To change an existing review from round R1 to round R2:</p>\n\n<pre class=\"entryexample\">paper,assignment,email,reviewtype,round\n1,review,drew@harvard.edu,any,R1:R2</pre>\n\n<p>To change all round-R1 primary reviews to round R2:</p>\n\n<pre class=\"entryexample\">paper,assignment,email,reviewtype,round\nall,review,all,primary,R1:R2</pre>\n\n</dd>\n\n<dt><code>primary</code>, <code>secondary</code>, <code>pcreview</code>,\n<code>external</code>, <code>clearreview</code></dt>\n<dd>Like <code>review</code>, assign a primary, secondary, optional PC, or\nexternal review, or clear existing reviews.</dd>\n\n<dt><code>unsubmitreview</code></dt>\n<dd>Unsubmit a submitted review. The <code>email</code>, <code>name</code>,\n<code>reviewtype</code>, and <code>round</code> columns locate the review.</dd>\n\n<dt><code>lead</code></dt>\n<dd>Set the discussion lead. The <code>email</code>, <code>name</code>,\nand/or <code>user</code> columns locate the PC user. To clear the discussion lead,\nuse email <code>none</code> or assignment type <code>clearlead</code>.</dd>\n\n<dt><code>shepherd</code></dt>\n<dd>Set the shepherd. The <code>email</code>, <code>name</code>,\nand/or <code>user</code> columns locate the PC user. To clear the shepherd,\nuse email <code>none</code> or assignment type <code>clearshepherd</code>.</dd>\n\n<dt><code>conflict</code></dt>\n<dd>Mark a PC conflict. The <code>email</code>, <code>name</code>,\nand/or <code>user</code> columns locate the PC user. To clear a conflict,\nuse assignment type <code>clearconflict</code>.</dd>\n\n<dt><code>tag</code></dt>\n<dd>Add a tag. The <code>tag</code> column names the tag and the optional\n<code>value</code> column sets the tag value.\nTo clear a tag, use assignment type <code>cleartag</code> or value <code>none</code>.</dd>\n\n<dt><code>preference</code></dt>\n<dd>Set reviewer preference and expertise. The <code>preference</code> column\ngives the preference value.</dd>\n</dl>\n\n</div>\n";
$Conf->footerScript('$("#tsel").trigger("change");$("textarea").autogrow()');
$Conf->footer();
예제 #21
0
파일: home.php 프로젝트: kohler/peteramati
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";
}
예제 #22
0
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: &nbsp;</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: &nbsp;';
    }
    echo Ht::form_div(hoturl_post("index")), Ht::entry("token", join(" ", $tokens), array("size" => max(15, count($tokens) * 8))), " &nbsp;", 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;
}
예제 #23
0
 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:&nbsp;", $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:&nbsp;", 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;
 }
if (isset($_REQUEST["email"])) {
    echo "value=\"", htmlspecialchars($_REQUEST["email"]), "\" ";
}
?>
  /></td>
</tr>

<tr>
  <td class='caption'>Password</td>
  <td class='entry'><input type='password' name='password' size='50' /></td>
</tr>

<tr>
  <td class='caption'></td>
  <td class='entry'><?php 
echo Ht::radio("prefer", 0, true), "&nbsp;", Ht::label("Keep my current account (" . htmlspecialchars($Me->email) . ")"), "<br />\n", Ht::radio("prefer", 1), "&nbsp;", Ht::label("Keep the account named above and delete my current account");
?>
</td>
</tr>

<tr><td class='caption'></td><td class='entry'><?php 
echo Ht::submit("merge", "Merge accounts");
?>
</td></tr>
<tr class='last'><td class='caption'></td></tr>
</table>
</form>


<?php 
$Conf->footer();
예제 #25
0
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 .= "&nbsp; " . Ht::submit("Search") . "</div></form>";
    return $x;
}
예제 #26
0
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"]), "\" /> &nbsp;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("&amp;", $urls));
        echo "<table class='lognav'><tr><td id='newest'><div>";
        if ($page > 1) {
            echo "<a href='{$url}&amp;page=1'><strong>Newest</strong></a> &nbsp;|&nbsp;&nbsp;";
        }
        echo "</div></td><td id='newer'><div>";
        if ($page > 1) {
            echo "<a href='{$url}&amp;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 "&nbsp;...";
        }
        for ($p = max($page - $nlinks - 1, 0); $p + 1 < $page; $p++) {
            echo "&nbsp;<a href='{$url}&amp;page=", $p + 1, "'>", $p + 1, "</a>";
        }
        echo "</div></td><td id='thisnum'><div><strong class='thispage'>&nbsp;", $page, "&nbsp;</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}&amp;page=", $p + 1, "'>", $p + 1, "</a>&nbsp;";
        }
        if ($nrows == $maxNrows) {
            echo "...&nbsp;";
        }
        echo "</div></td><td id='older'><div>";
        if ($nrows > $count) {
            echo "<a href='{$url}&amp;page=", $page + 1, "'><strong>Older ", Ht::img("_.gif", "->", array("class" => "next")), "</strong></a>";
        }
        echo "</div></td><td id='oldest'><div>";
        if ($nrows > $count) {
            echo "&nbsp;&nbsp;|&nbsp; <a href='{$url}&amp;page=earliest'><strong>Oldest</strong></a>";
        }
        echo "</div></td></tr></table>";
    }
    echo "<div class='g'></div>\n";
}
예제 #27
0
$xsep = " <span class='barsep'>&nbsp;|&nbsp;</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 "&nbsp;", 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), "&nbsp;", Ht::label("Course instructor"), "<br>";
echo Ht::radio("pctype", "pc", $User->roles & Contact::ROLE_PC && !($User->roles & Contact::ROLE_CHAIR)), "&nbsp;", Ht::label("Course staff"), "<br>";
echo Ht::radio("pctype", "no", !($User->roles & (Contact::ROLE_PC | Contact::ROLE_CHAIR))), "&nbsp;", 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";
echo "<div class='clear'></div>\n";
$Conf->footer();
예제 #28
0
 function list_actions(Contact $user, $qreq, PaperList $plist, &$actions)
 {
     $actions[] = [1000, "mail", "Mail", "<b>:</b> &nbsp;" . Ht::select("recipients", array("au" => "Contact authors", "rev" => "Reviewers"), $qreq->recipients, ["class" => "wantcrpfocus"]) . " &nbsp;" . Ht::submit("fn", "Go", ["value" => "mail", "onclick" => "return plist_submit.call(this)", "data-plist-submit-all" => 1])];
 }
예제 #29
0
                $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();
예제 #30
0
        }
        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");
    echo '</div></form>';
}
echo '<div style="margin:2em 0"><strong>More graphs:</strong>&nbsp; ';
$ghtml = array();
foreach ($Graphs as $g => $gname) {
    $ghtml[] = '<a' . ($g == $Graph ? ' class="q"' : '') . ' href="' . hoturl("graph", "g={$g}") . '">' . htmlspecialchars($gname) . '</a>';
}
echo join(' <span class="barsep">·</span> ', $ghtml), '</div>';
echo "<hr class=\"c\" />\n";
$Conf->footer();