Exemplo n.º 1
0
 function render($sv)
 {
     global $Conf;
     // Tags
     $tagger = new Tagger();
     echo "<h3 class=\"settings\">Tags</h3>\n";
     echo "<table class=\"secondary-settings\"><tbody>";
     $sv->set_oldv("tag_chair", join(" ", array_keys(TagInfo::chair_tags())));
     $sv->echo_entry_row("tag_chair", "Chair-only tags", "PC members can view these tags, but only administrators can change them.");
     $sv->set_oldv("tag_sitewide", join(" ", array_keys(TagInfo::sitewide_tags())));
     if ($sv->newv("tag_sitewide") || $Conf->has_any_manager()) {
         $sv->echo_entry_row("tag_sitewide", "Site-wide tags", "Chairs and administrators can view and change these tags for every paper.");
     }
     $sv->set_oldv("tag_approval", join(" ", array_keys(TagInfo::approval_tags())));
     $sv->echo_entry_row("tag_approval", "Approval voting tags", "<a href=\"" . hoturl("help", "t=votetags") . "\">What is this?</a>");
     $x = [];
     foreach (TagInfo::vote_tags() as $n => $v) {
         $x[] = "{$n}#{$v}";
     }
     $sv->set_oldv("tag_vote", join(" ", $x));
     $sv->echo_entry_row("tag_vote", "Allotment voting tags", "“vote#10” declares an allotment of 10 votes per PC member. <span class=\"barsep\">·</span> <a href=\"" . hoturl("help", "t=votetags") . "\">What is this?</a>");
     $sv->set_oldv("tag_rank", $Conf->setting_data("tag_rank", ""));
     $sv->echo_entry_row("tag_rank", "Ranking tag", "The <a href='" . hoturl("offline") . "'>offline reviewing page</a> will expose support for uploading rankings by this tag. <span class='barsep'>·</span> <a href='" . hoturl("help", "t=ranking") . "'>What is this?</a>");
     echo "</tbody></table>";
     echo "<div class='g'></div>\n";
     $sv->echo_checkbox('tag_seeall', "PC can see tags for conflicted papers");
     preg_match_all('_(\\S+)=(\\S+)_', $Conf->setting_data("tag_color", ""), $m, PREG_SET_ORDER);
     $tag_colors = array();
     foreach ($m as $x) {
         $tag_colors[TagInfo::canonical_color($x[2])][] = $x[1];
     }
     $tag_colors_rows = array();
     foreach (explode("|", TagInfo::BASIC_COLORS) as $k) {
         if ($sv->use_req()) {
             $v = defval($sv->req, "tag_color_{$k}", "");
         } else {
             if (isset($tag_colors[$k])) {
                 $v = join(" ", $tag_colors[$k]);
             } else {
                 $v = "";
             }
         }
         $tag_colors_rows[] = "<tr class='k0 {$k}tag'><td class='lxcaption'></td><td class='lxcaption taghl'>{$k}</td><td class='lentry' style='font-size: 10.5pt'><input type='text' name='tag_color_{$k}' value=\"" . htmlspecialchars($v) . "\" size='40' /></td></tr>";
         /* MAINSIZE */
     }
     preg_match_all('_(\\S+)=(\\S+)_', $Conf->setting_data("tag_badge", ""), $m, PREG_SET_ORDER);
     $tag_badges = array();
     foreach ($m as $x) {
         $tag_badges[$x[2]][] = $x[1];
     }
     foreach (["black" => "black label", "red" => "red label", "green" => "green label", "blue" => "blue label", "white" => "white label"] as $k => $desc) {
         if ($sv->use_req()) {
             $v = defval($sv->req, "tag_badge_{$k}", "");
         } else {
             if (isset($tag_badges[$k])) {
                 $v = join(" ", $tag_badges[$k]);
             } else {
                 $v = "";
             }
         }
         $tag_colors_rows[] = "<tr class='k0'><td class='lxcaption'></td><td class='lxcaption'><span class='badge {$k}badge' style='margin:0'>{$desc}</span><td class='lentry' style='font-size:10.5pt'><input type='text' name='tag_badge_{$k}' value=\"" . htmlspecialchars($v) . "\" size='40' /></td></tr>";
         /* MAINSIZE */
     }
     echo Ht::hidden("has_tag_color", 1), '<h3 class="settings g">Styles and colors</h3>', "<div class='hint'>Papers and PC members tagged with a style name, or with one of the associated tags, will appear in that style in lists.</div>", "<div class='smg'></div>", "<table id='foldtag_color'><tr><th colspan='2'>Style name</th><th>Tags</th></tr>", join("", $tag_colors_rows), "</table>\n";
     echo '<h3 class="settings g">Tracks</h3>', "\n";
     echo "<div class='hint'>Tracks control the PC members allowed to view or review different sets of papers. <span class='barsep'>·</span> <a href=\"" . hoturl("help", "t=tracks") . "\">What is this?</a></div>", Ht::hidden("has_tracks", 1), "<div class=\"smg\"></div>\n";
     $this->do_track($sv, "", 0);
     $tracknum = 2;
     $trackj = $Conf->setting_json("tracks") ?: (object) array();
     // existing tracks
     foreach ($trackj as $trackname => $x) {
         if ($trackname !== "_") {
             $this->do_track($sv, $trackname, $tracknum);
             ++$tracknum;
         }
     }
     // new tracks (if error prevented saving)
     if ($sv->use_req()) {
         for ($i = 1; isset($sv->req["name_track{$i}"]); ++$i) {
             $trackname = trim($sv->req["name_track{$i}"]);
             if (!isset($trackj->{$trackname})) {
                 $this->do_track($sv, $trackname, $tracknum);
                 ++$tracknum;
             }
         }
     }
     // catchall track
     $this->do_track($sv, "_", 1);
     echo Ht::button("Add track", array("onclick" => "settings_add_track()"));
 }
Exemplo n.º 2
0
             $conversation = htmlspecialchars((string) $v->conversation[0][2]);
         }
         if ($resolved && $conversation === "") {
             continue;
         }
         $x = $resolved ? "Resolved" : "<strong>Flagged</strong>";
         if ($conversation !== "") {
             $x .= " (" . $conversation . ")";
         }
         if (!$resolved) {
             $x .= '<span style="display:inline-block;margin-left:1em">' . Ht::button("resolveflag", "Resolve", ["onclick" => "flag61(this)", "data-flagid" => $k]) . '</span>';
         }
         $runnerbuttons[] = $x . "<br />";
     }
     if ($all_resolved) {
         $runnerbuttons[] = Ht::button("flag", "Flag this commit", ["style" => "font-weight:bold;font-size:100%;background:#ffeeee", "onclick" => "flag61(this)"]);
     }
 }
 if (!empty($runnerbuttons)) {
     echo Ht::form($Info->hoturl_post("run")), '<div class="f-contain">';
     ContactView::echo_group("", join("", $runnerbuttons));
     echo "</div></form>\n";
     if ($Me->isPC && $Me != $User) {
         echo Ht::form($Info->hoturl_post("pset", array("saverunsettings" => 1, "ajax" => 1))), '<div class="f-contain"><div id="runsettings61"></div></div></form>', "\n";
         // XXX always using grading commit's settings?
         if ($runsettings = $Info->commit_info("runsettings")) {
             echo '<script>runsetting61.load(', json_encode($runsettings), ')</script>';
         }
     }
     Ht::stash_script("jQuery('button.runner61').prop('disabled',false)");
 }
Exemplo n.º 3
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;
 }
Exemplo n.º 4
0
         if ($Me->can_run($Pset, $r, $User)) {
             $b = Ht::button("run", htmlspecialchars($r->title), array("value" => $r->name, "class" => "runner61", "style" => "font-weight:bold", "onclick" => "run61(this)", "loadgrade61" => isset($r->eval) ? "true" : null));
             $runnerbuttons[] = ($last_run ? " &nbsp;" : "") . $b;
             $last_run = true;
         } else {
             $runnerbuttons[] = Ht::hidden("run", $r->name, array("class" => "runner61"));
         }
     }
 }
 if (count($runnerbuttons) && $Me->isPC && $Me != $User && $last_run) {
     $runnerbuttons[] = " &nbsp;" . Ht::button("define", "+", array("class" => "runner61", "style" => "font-weight:bold", "onclick" => "runsetting61.add()"));
 }
 if ($Me->isPC && $Me != $User || $Info->grading_hash() && !$Info->is_grading_commit() || !$Info->grading_hash() && $Pset->grades_visible) {
     ContactView::add_regrades($Info);
     $already_requested = isset($Info->regrades[$Info->commit_hash()]);
     $runnerbuttons[] = ($last_run ? ' <span style="padding:0 1em"></span>' : "") . Ht::button("reqgrade", $already_requested ? "Regrade Requested" : "Request Regrade", array("style" => "font-weight:bold" . ($already_requested ? ";font-style:italic" : ""), "onclick" => "reqregrade61(this)"));
 }
 if (count($runnerbuttons)) {
     echo Ht::form($Info->hoturl_post("run")), '<div class="f-contain">';
     ContactView::echo_group("", join("", $runnerbuttons));
     echo "</div></form>\n";
     if ($Me->isPC && $Me != $User) {
         echo Ht::form($Info->hoturl_post("pset", array("saverunsettings" => 1, "ajax" => 1))), '<div class="f-contain"><div id="runsettings61"></div></div></form>', "\n";
         // XXX always using grading commit's settings?
         if ($runsettings = $Info->commit_info("runsettings")) {
             echo '<script>runsetting61.load(', json_encode($runsettings), ')</script>';
         }
     }
     $Conf->footerScript("jQuery('button.runner61').prop('disabled',false)");
 }
 // print current grader
    function render($sv)
    {
        global $Conf, $ConfSitePATH;
        $rf = ReviewForm::get();
        $fmap = array();
        foreach ($rf->fmap as $fid => $f) {
            $fmap[$fid] = $f->has_options;
        }
        $samples = json_decode(file_get_contents("{$ConfSitePATH}/src/reviewformlibrary.json"));
        $req = array();
        if ($sv->use_req()) {
            foreach ($rf->fmap as $fid => $f) {
                foreach (ReviewForm_SettingParser::$setting_prefixes as $fx) {
                    if (isset($sv->req["{$fx}{$fid}"])) {
                        $req["{$fx}{$fid}"] = $sv->req["{$fx}{$fid}"];
                    }
                }
            }
        }
        $Conf->footerHtml('<div id="review_form_caption_description" style="display:none">' . '<p>Enter an HTML description for the review form.
Include any guidance you’d like to provide for reviewers.
Note that complex HTML will not appear on offline review forms.</p></div>' . '<div id="review_form_caption_options" style="display:none">' . '<p>Enter one option per line, numbered starting from 1 (higher numbers
are better). For example:</p>
<pre class="entryexample dark">1. Reject
2. Weak reject
3. Weak accept
4. Accept</pre>
<p>Or use consecutive capital letters (lower letters are better).</p>
<p>Normally scores are mandatory: a review with a missing score cannot be
submitted. Add a line “<code>No entry</code>” to make the score optional.</p></div>');
        $Conf->footerScript("review_form_settings(" . json_encode($fmap) . "," . json_encode($rf->unparse_full_json()) . "," . json_encode($samples) . "," . json_encode($sv->error_fields()) . "," . json_encode($req) . ")");
        echo Ht::hidden("has_review_form", 1), "<div id=\"reviewform_removedcontainer\"></div>", "<div id=\"reviewform_container\"></div>", Ht::button("Add score field", array("onclick" => "review_form_settings.add(1)")), "<span class='sep'></span>", Ht::button("Add text field", array("onclick" => "review_form_settings.add(0)"));
    }