예제 #1
0
파일: home.php 프로젝트: kohler/peteramati
function show_pset_actions($pset)
{
    global $Conf;
    echo Ht::form_div(hoturl_post("index", array("pset" => $pset->urlkey, "reconfig" => 1)), ["divstyle" => "margin-bottom:1em", "class" => "need-pa-pset-actions"]);
    $options = array("disabled" => "Disabled", "invisible" => "Hidden", "visible" => "Visible without grades", "grades_visible" => "Visible with grades");
    if ($pset->disabled) {
        $state = "disabled";
    } else {
        if (!$pset->visible) {
            $state = "invisible";
        } else {
            if (!$pset->grades_visible) {
                $state = "visible";
            } else {
                $state = "grades_visible";
            }
        }
    }
    echo Ht::select("state", $options, $state);
    echo '<span class="pa-if-visible"> &nbsp;<span class="barsep">·</span>&nbsp; ', Ht::select("frozen", array("no" => "Student updates allowed", "yes" => "Submissions frozen"), $pset->frozen ? "yes" : "no"), '</span>';
    echo '<span class="pa-if-enabled"> &nbsp;<span class="barsep">·</span>&nbsp; ', Ht::select("anonymous", array("no" => "Open grading", "yes" => "Anonymous grading"), $pset->anonymous ? "yes" : "no"), '</span>';
    echo ' &nbsp;', Ht::submit("reconfig", "Save");
    if (!$pset->disabled) {
        echo ' &nbsp;<span class="barsep">·</span>&nbsp; ';
        echo Ht::js_button("Grade report", "window.location=\"" . hoturl_post("index", ["pset" => $pset->urlkey, "report" => 1]) . "\"");
    }
    echo "</div></form>";
    echo Ht::unstash_script("\$('.need-pa-pset-actions').each(pa_pset_actions)");
}
예제 #2
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();
예제 #3
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();
예제 #4
0
                $x[] = "contact for " . pluralx($tracks->author, "paper") . " " . textArrayPapers($tracks->author);
                $y[] = "delete " . pluralx($tracks->author, "this") . " " . pluralx($tracks->author, "authorship association");
            }
            if (count($tracks->review)) {
                $x[] = "reviewer for " . pluralx($tracks->review, "paper") . " " . textArrayPapers($tracks->review);
                $y[] = "<strong>permanently delete</strong> " . pluralx($tracks->review, "this") . " " . pluralx($tracks->review, "review");
            }
            if (count($tracks->comment)) {
                $x[] = "commenter for " . pluralx($tracks->comment, "paper") . " " . textArrayPapers($tracks->comment);
                $y[] = "<strong>permanently delete</strong> " . pluralx($tracks->comment, "this") . " " . pluralx($tracks->comment, "comment");
            }
            $dialog = "<p>This user is " . commajoin($x) . ".\n  Deleting the user will also " . commajoin($y) . ".</p>";
        } else {
            $dialog = "";
        }
        $Conf->footerHtml("<div id='popup_d' class='popupc'>\n  <p>Be careful: This will permanently delete all information about this\n  user from the database and <strong>cannot be undone</strong>.</p>\n  {$dialog}\n  <form method='post' action=\"" . hoturl_post("profile", "u=" . urlencode($Acct->email)) . "\" enctype='multipart/form-data' accept-charset='UTF-8'>\n    <div class='popup_actions'>" . Ht::js_button("Cancel", "popup(null,'d',1)") . Ht::submit("delete", "Delete user", array("class" => "bb")) . "</div></form></div>");
    }
}
if (!$newProfile && $Acct->contactId == $Me->contactId) {
    $buttons[] = Ht::submit("merge", "Merge with another account", array("style" => "margin-left:2ex"));
}
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";
}
예제 #5
0
 private function _review_buttons($prow, $rrow, $type, $reviewPostLink)
 {
     global $Conf, $Me;
     $buttons = array();
     // refuse?
     if ($type == "top" && $rrow && !$rrow->reviewModified && $rrow->reviewType < REVIEW_SECONDARY) {
         $buttons[] = Ht::submit("accept", "Accept review", array("class" => "b"));
         $buttons[] = Ht::button("Decline review", array("class" => "b", "onclick" => "popup(this,'ref',0)"));
         // Also see $_REQUEST["refuse"] case in review.php.
         $Conf->footerHtml("<div id='popup_ref' class='popupc'>" . Ht::form_div($reviewPostLink) . Ht::hidden("refuse", "refuse") . "<p style='margin:0 0 0.3em'>Select “Decline review” to decline this review. Thank you for keeping us informed.</p>" . Ht::textarea("reason", null, array("id" => "refusereviewreason", "rows" => 3, "cols" => 40, "placeholder" => "Optional explanation", "spellcheck" => "true")) . '<div class="popup_actions">' . Ht::js_button("Cancel", "popup(null,'ref',1)") . Ht::submit("Decline review", array("class" => "bb")) . "</div></div></form></div>", "declinereviewform");
         $buttons[] = "";
     }
     $submitted = $rrow && $rrow->reviewSubmitted;
     if (!$Conf->time_review($rrow, $Me->act_pc($prow, true), true)) {
         $whyNot = array("deadline" => $rrow && $rrow->reviewType < REVIEW_PC ? "extrev_hard" : "pcrev_hard");
         $override_text = whyNotText($whyNot, "review");
         if (!$submitted) {
             $buttons[] = array(Ht::js_button("Submit review", "override_deadlines(this)", array("class" => "bb", "data-override-text" => $override_text, "data-override-submit" => "submitreview")), "(admin only)");
             $buttons[] = array(Ht::js_button("Save as draft", "override_deadlines(this)", array("data-override-text" => $override_text, "data-override-submit" => "savedraft")), "(admin only)");
         } else {
             $buttons[] = array(Ht::js_button("Save changes", "override_deadlines(this)", array("class" => "bb", "data-override-text" => $override_text, "data-override-submit" => "submitreview")), "(admin only)");
         }
     } else {
         if (!$submitted) {
             $buttons[] = Ht::submit("submitreview", "Submit review", array("class" => "bb"));
             $buttons[] = Ht::submit("savedraft", "Save as draft");
         } else {
             $buttons[] = Ht::submit("submitreview", "Save changes", array("class" => "bb"));
         }
     }
     if ($rrow && $type == "bottom" && $Me->allow_administer($prow)) {
         $buttons[] = "";
         if ($submitted) {
             $buttons[] = array(Ht::submit("unsubmitreview", "Unsubmit review"), "(admin only)");
         }
         $buttons[] = array(Ht::js_button("Delete review", "popup(this,'d',0)"), "(admin only)");
         $Conf->footerHtml("<div id='popup_d' class='popupc'>\n  <p>Be careful: This will permanently delete all information about this\n  review assignment from the database and <strong>cannot be\n  undone</strong>.</p>\n  " . Ht::form_div($reviewPostLink, array("divclass" => "popup_actions")) . Ht::js_button("Cancel", "popup(null,'d',1)") . Ht::submit("deletereview", "Delete review", array("class" => "bb")) . "</div></form></div>");
     }
     return $buttons;
 }
예제 #6
0
 function render($sv)
 {
     global $Conf;
     $sv->echo_checkbox("rev_open", "<b>Open site for reviewing</b>");
     $sv->echo_checkbox("cmt_always", "Allow comments even if reviewing is closed");
     echo "<div class='g'></div>\n";
     $sv->echo_checkbox('pcrev_any', "PC members can review <strong>any</strong> submitted paper");
     echo "<div class='g'></div>\n";
     echo "<strong>Review anonymity:</strong> Are reviewer names hidden from authors?<br />\n";
     $sv->echo_radio_table("rev_blind", array(Conf::BLIND_ALWAYS => "Yes—reviews are anonymous", Conf::BLIND_NEVER => "No—reviewer names are visible to authors", Conf::BLIND_OPTIONAL => "Depends—reviewers decide whether to expose their names"));
     echo "<div class='g'></div>\n";
     $sv->echo_checkbox('rev_notifychair', 'Notify PC chairs of newly submitted reviews by email');
     // Deadlines
     echo "<h3 id=\"rounds\" class=\"settings g\">Deadlines &amp; rounds</h3>\n";
     echo '<p class="hint">Reviews are due by the deadline, but <em>cannot be modified</em> after the hard deadline. Most conferences don’t use hard deadlines for reviews.<br />', $sv->type_hint("date") ?: "", '</p>';
     $rounds = $Conf->round_list();
     if ($sv->use_req()) {
         for ($i = 1; isset($sv->req["roundname_{$i}"]); ++$i) {
             $rounds[$i] = get($sv->req, "deleteround_{$i}") ? ";" : trim(get_s($sv->req, "roundname_{$i}"));
         }
     }
     // prepare round selector
     $round_value = trim($sv->curv("rev_roundtag"));
     $current_round_value = $Conf->setting_data("rev_roundtag", "");
     if (preg_match('/\\A(?:|\\(none\\)|\\(no name\\)|default|unnamed|#0)\\z/i', $round_value)) {
         $round_value = "#0";
     } else {
         if (($round_number = $Conf->round_number($round_value, false)) || ($round_number = $Conf->round_number($current_round_value, false))) {
             $round_value = "#" . $round_number;
         } else {
             $round_value = $selector[$current_round_value] = $current_round_value;
         }
     }
     $round_map = edb_map(Dbl::ql("select reviewRound, count(*) from PaperReview group by reviewRound"));
     $print_round0 = true;
     if ($round_value !== "#0" && $round_value !== "" && $current_round_value !== "" && (!$sv->use_req() || isset($sv->req["roundname_0"])) && !$Conf->round0_defined()) {
         $print_round0 = false;
     }
     $selector = array();
     if ($print_round0) {
         $selector["#0"] = "unnamed";
     }
     for ($i = 1; $i < count($rounds); ++$i) {
         if ($rounds[$i] !== ";") {
             $selector["#{$i}"] = (object) array("label" => $rounds[$i], "id" => "rev_roundtag_{$i}");
         }
     }
     echo '<div id="round_container"', count($selector) == 1 ? ' style="display:none"' : '', '>', '<table id="rev_roundtag_table"><tr><td class="lxcaption">', $sv->label("rev_roundtag", "Current round"), '</td><td>', Ht::select("rev_roundtag", $selector, $round_value, $sv->sjs("rev_roundtag")), '</td></tr></table>', '<div class="hint">This round is used for new assignments.</div><div class="g"></div></div>';
     echo '<div id="roundtable">';
     $num_printed = 0;
     for ($i = 0; $i < count($rounds); ++$i) {
         if ($i ? $rounds[$i] !== ";" : $print_round0) {
             $this->echo_round($sv, $i, $i ? $rounds[$i] : "", +get($round_map, $i), count($selector) !== 1);
             ++$num_printed;
         }
     }
     echo '</div><div id="newround" style="display:none">';
     $this->echo_round($sv, '$', "", "", true);
     echo '</div><div class="g"></div>';
     echo Ht::js_button("Add round", "review_round_settings.add();hiliter(this)"), ' &nbsp; <span class="hint"><a href="', hoturl("help", "t=revround"), '">What is this?</a></span>', Ht::hidden("oldroundcount", count($Conf->round_list())), Ht::hidden("has_rev_roundtag", 1);
     for ($i = 1; $i < count($rounds); ++$i) {
         if ($rounds[$i] === ";") {
             echo Ht::hidden("roundname_{$i}", "", array("id" => "roundname_{$i}")), Ht::hidden("deleteround_{$i}", 1);
         }
     }
     Ht::stash_script("review_round_settings.init()");
     // External reviews
     echo "<h3 class=\"settings g\">External reviews</h3>\n";
     echo "<div class='g'></div>";
     $sv->echo_checkbox("extrev_chairreq", "PC chair must approve proposed external reviewers");
     $sv->echo_checkbox("pcrev_editdelegate", "PC members can edit external reviews they requested");
     echo "<div class='g'></div>\n";
     $t = expandMailTemplate("requestreview", false);
     echo "<table id='foldmailbody_requestreview' class='", $t == expandMailTemplate("requestreview", true) ? "foldc" : "foldo", "'><tr><td>", foldbutton("mailbody_requestreview"), "</td>", "<td><a href='#' onclick='return fold(\"mailbody_requestreview\")' class='q'><strong>Mail template for external review requests</strong></a>", " <span class='fx'>(<a href='", hoturl("mail"), "'>keywords</a> allowed; set to empty for default)<br /></span>\n<textarea class='tt fx' name='mailbody_requestreview' cols='80' rows='20'>", htmlspecialchars($t["body"]), "</textarea>", "</td></tr></table>\n";
     // Review visibility
     echo "<h3 class=\"settings g\">Visibility</h3>\n";
     echo "Can PC members <strong>see all reviews</strong> except for conflicts?<br />\n";
     $sv->echo_radio_table("pc_seeallrev", array(Conf::PCSEEREV_YES => "Yes", Conf::PCSEEREV_UNLESSINCOMPLETE => "Yes, unless they haven’t completed an assigned review for the same paper", Conf::PCSEEREV_UNLESSANYINCOMPLETE => "Yes, after completing all their assigned reviews", Conf::PCSEEREV_IFCOMPLETE => "Only after completing a review for the same paper"));
     echo "<div class='g'></div>\n";
     echo "Can PC members see <strong>reviewer names</strong> except for conflicts?<br />\n";
     $sv->echo_radio_table("pc_seeblindrev", array(0 => "Yes", 1 => "Only after completing a review for the same paper<br /><span class='hint'>This setting also hides reviewer-only comments from PC members who have not completed a review for the same paper.</span>"));
     echo "<div class='g'></div>";
     echo "Can external reviewers see the other reviews for their assigned papers, once they’ve submitted their own?<br />\n";
     $sv->echo_radio_table("extrev_view", array(2 => "Yes", 1 => "Yes, but they can’t see who wrote blind reviews", 0 => "No"));
     // Review ratings
     echo "<h3 class=\"settings g\">Review ratings</h3>\n";
     echo "Should HotCRP collect ratings of reviews? &nbsp; <a class='hint' href='", hoturl("help", "t=revrate"), "'>(Learn more)</a><br />\n";
     $sv->echo_radio_table("rev_ratings", array(REV_RATINGS_PC => "Yes, PC members can rate reviews", REV_RATINGS_PC_EXTERNAL => "Yes, PC members and external reviewers can rate reviews", REV_RATINGS_NONE => "No"));
 }