Exemplo n.º 1
0
 function run(Contact $user, $qreq, $ssel)
 {
     global $Conf;
     $o = cvtint($qreq->decision);
     $decision_map = $Conf->decision_map();
     if ($o === null || !isset($decision_map[$o])) {
         return Conf::msg_error("Bad decision value.");
     }
     $result = Dbl::qe_raw($Conf->paperQuery($user, array("paperId" => $ssel->selection())));
     $success = $fails = array();
     while ($prow = PaperInfo::fetch($result, $user)) {
         if ($user->can_set_decision($prow, true)) {
             $success[] = $prow->paperId;
         } else {
             $fails[] = "#" . $prow->paperId;
         }
     }
     if (count($fails)) {
         Conf::msg_error("You cannot set paper decisions for " . pluralx($fails, "paper") . " " . commajoin($fails) . ".");
     }
     if (count($success)) {
         Dbl::qe("update Paper set outcome={$o} where paperId ?a", $success);
         $Conf->update_paperacc_setting($o > 0);
         redirectSelf(array("atab" => "decide", "decision" => $o));
     }
 }
Exemplo n.º 2
0
 static function description($type)
 {
     if (is_array($type)) {
         $a = array();
         foreach ($type as $x) {
             if ($x = self::description($x)) {
                 $a[$x] = $x;
             }
         }
         return commajoin($a, "or");
     } else {
         $x = self::lookup($type);
         if ($x && $x->description) {
             return $x->description;
         } else {
             if ($x && $x->extension) {
                 return $x->extension;
             } else {
                 if ($x) {
                     return $x->mimetype;
                 } else {
                     return $type;
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 function render($sv)
 {
     global $Conf, $Opt;
     echo "<h3 class=\"settings\">Abstract and PDF</h3>\n";
     echo Ht::select("sub_noabstract", [0 => "Abstract required", 2 => "Abstract optional", 1 => "No abstract"], opt_yes_no_optional("noAbstract"));
     echo " <span class=\"barsep\">·</span> ", Ht::select("sub_nopapers", array(0 => "PDF upload required", 2 => "PDF upload optional", 1 => "No PDF"), opt_yes_no_optional("noPapers"));
     if (is_executable("src/banal")) {
         echo "<div class='g'></div>", Ht::hidden("has_sub_banal", 1), "<table id='foldbanal' class='", $sv->curv("sub_banal") ? "foldo" : "foldc", "'>";
         $sv->echo_checkbox_row("sub_banal", "PDF format checker<span class='fx'>:</span>", "void fold('banal',!this.checked)");
         echo '<tr class="fx"><td></td><td class="top"><table class="secondary-settings"><tbody>';
         $bsetting = explode(";", preg_replace("/>.*/", "", $Conf->setting_data("sub_banal", "")));
         foreach (["papersize", "pagelimit", "columns", "textblock", "bodyfontsize", "bodyleading"] as $i => $name) {
             $val = get($bsetting, $i, "");
             $sv->set_oldv("sub_banal_{$name}", $val == "" ? "N/A" : $val);
         }
         $sv->echo_entry_row("sub_banal_papersize", "Paper size", "Examples: “letter”, “A4”, “8.5in&nbsp;x&nbsp;14in”,<br />“letter OR A4”");
         $sv->echo_entry_row("sub_banal_pagelimit", "Page limit");
         $sv->echo_entry_row("sub_banal_textblock", "Text block", "Examples: “6.5in&nbsp;x&nbsp;9in”, “1in&nbsp;margins”");
         echo '</tbody></table></td>', '<td><span class="sep"></span></td>', '<td class="top"><table class="secondary-settings"><tbody>';
         $sv->echo_entry_row("sub_banal_bodyfontsize", "Minimum body font size", null, "&nbsp;pt");
         $sv->echo_entry_row("sub_banal_bodyleading", "Minimum leading", null, "&nbsp;pt");
         $sv->echo_entry_row("sub_banal_columns", "Columns");
         echo "</tbody></table></td></tr></table>";
     }
     echo "<h3 class=\"settings\">Conflicts &amp; collaborators</h3>\n", "<table id=\"foldpcconf\" class=\"fold", $sv->curv("sub_pcconf") ? "o" : "c", "\">\n";
     $sv->echo_checkbox_row("sub_pcconf", "Collect authors’ PC conflicts", "void fold('pcconf',!this.checked)");
     echo "<tr class='fx'><td></td><td>";
     $conf = array();
     foreach (Conflict::$type_descriptions as $n => $d) {
         if ($n) {
             $conf[] = "“{$d}”";
         }
     }
     $sv->echo_checkbox("sub_pcconfsel", "Require conflict descriptions (" . commajoin($conf, "or") . ")");
     echo "</td></tr>\n";
     $sv->echo_checkbox_row("sub_collab", "Collect authors’ other collaborators as text");
     echo "</table>\n";
     echo "<h3 class=\"settings\">Submission options</h3>\n";
     echo "Options are selected by authors at submission time.  Examples have included “PC-authored paper,” “Consider this paper for a Best Student Paper award,” and “Allow the shadow PC to see this paper.”  The “option name” should be brief (“PC paper,” “Best Student Paper,” “Shadow PC”).  The optional description can explain further and may use XHTML.  ";
     echo "Add options one at a time.\n";
     echo "<div class='g'></div>\n", Ht::hidden("has_options", 1);
     $sep = "";
     $all_options = array_merge(PaperOption::nonfixed_option_list());
     // get our own iterator
     foreach ($all_options as $o) {
         echo $sep;
         $this->render_option($sv, $o);
         $sep = "\n<div style=\"margin-top:3em\"></div>\n";
     }
     echo $sep;
     $this->render_option($sv, null);
     // Topics
     // load topic interests
     $qinterest = $Conf->query_topic_interest();
     $result = $Conf->q("select topicId, if({$qinterest}>0,1,0), count(*) from TopicInterest where {$qinterest}!=0 group by topicId, {$qinterest}>0");
     $interests = array();
     $ninterests = 0;
     while ($row = edb_row($result)) {
         if (!isset($interests[$row[0]])) {
             $interests[$row[0]] = array();
         }
         $interests[$row[0]][$row[1]] = $row[2];
         $ninterests += $row[2] ? 1 : 0;
     }
     echo "<h3 class=\"settings g\">Topics</h3>\n";
     echo "Enter topics one per line.  Authors select the topics that apply to their papers; PC members use this information to find papers they'll want to review.  To delete a topic, delete its name.\n";
     echo "<div class='g'></div>", Ht::hidden("has_topics", 1), "<table id='newtoptable' class='", $ninterests ? "foldo" : "foldc", "'>";
     echo "<tr><th colspan='2'></th><th class='fx'><small>Low</small></th><th class='fx'><small>High</small></th></tr>";
     $td1 = '<td class="lcaption">Current</td>';
     foreach ($Conf->topic_map() as $tid => $tname) {
         if ($sv->use_req() && isset($sv->req["top{$tid}"])) {
             $tname = $sv->req["top{$tid}"];
         }
         echo '<tr>', $td1, '<td class="lentry">', Ht::entry("top{$tid}", $tname, array("size" => 40, "style" => "width:20em")), '</td>';
         $tinterests = defval($interests, $tid, array());
         echo '<td class="fx rpentry">', get($tinterests, 0) ? '<span class="topic-2">' . $tinterests[0] . "</span>" : "", "</td>", '<td class="fx rpentry">', get($tinterests, 1) ? '<span class="topic2">' . $tinterests[1] . "</span>" : "", "</td>";
         if ($td1 !== "<td></td>") {
             // example search
             echo "<td class='llentry' style='vertical-align:top' rowspan='40'><div class='f-i'>", "<div class='f-c'>Example search</div>";
             $oabbrev = strtolower($tname);
             if (strstr($oabbrev, " ") !== false) {
                 $oabbrev = "\"{$oabbrev}\"";
             }
             echo "“<a href=\"", hoturl("search", "q=topic:" . urlencode($oabbrev)), "\">", "topic:", htmlspecialchars($oabbrev), "</a>”", "<div class='hint'>Topic abbreviations are also allowed.</div>";
             if ($ninterests) {
                 echo "<a class='hint fn' href=\"#\" onclick=\"return fold('newtoptable')\">Show PC interest counts</a>", "<a class='hint fx' href=\"#\" onclick=\"return fold('newtoptable')\">Hide PC interest counts</a>";
             }
             echo "</div></td>";
         }
         echo "</tr>\n";
         $td1 = "<td></td>";
     }
     echo '<tr><td class="lcaption top">New<br><span class="hint">Enter one topic per line.</span></td><td class="lentry top">', Ht::textarea("topnew", $sv->use_req() ? get($sv->req, "topnew") : "", array("cols" => 40, "rows" => 2, "style" => "width:20em")), '</td></tr></table>';
 }
 public function text($pl, $row)
 {
     if (!$pl->contact->can_view_authors($row, true)) {
         return "";
     }
     $out = [];
     if (!$this->aufull) {
         foreach ($row->author_list() as $au) {
             $out[] = $au->abbrevname_text();
         }
         return join(", ", $out);
     } else {
         $affmap = $this->affiliation_map($row);
         $aus = [];
         foreach ($row->author_list() as $i => $au) {
             $aus[] = $au->name();
             if ($affmap[$i] !== null) {
                 $aff = $affmap[$i] !== "" ? " ({$affmap[$i]})" : "";
                 $out[] = commajoin($aus) . $aff;
                 $aus = [];
             }
         }
         return commajoin($out);
     }
 }
Exemplo n.º 5
0
 protected function unexpanded_warning()
 {
     $a = array_keys($this->_unexpanded);
     natcasesort($a);
     for ($i = 0; $i < count($a); ++$i) {
         $a[$i] = "<code>" . htmlspecialchars($a[$i]) . "</code>";
     }
     if (count($a) == 1) {
         return "Keyword-like string " . commajoin($a) . " was not recognized.";
     } else {
         return "Keyword-like strings " . commajoin($a) . " were not recognized.";
     }
 }
 private function check_invariants($pj, $old_pj)
 {
     global $Opt;
     // Errors don't prevent saving
     if (get($pj, "title") === "" || get($pj, "title") === null && (!$old_pj || !$old_pj->title)) {
         $this->set_error_html("title", "Each paper must have a title.");
     }
     if (get($pj, "abstract") === "" || get($pj, "abstract") === null && (!$old_pj || !$old_pj->abstract)) {
         if (!get($Opt, "noAbstract")) {
             $this->set_error_html("abstract", "Each paper must have an abstract.");
         }
     }
     if (is_array(get($pj, "authors")) && empty($pj->authors) || get($pj, "authors") === null && (!$old_pj || empty($old_pj->authors))) {
         $this->set_error_html("author", "Each paper must have at least one author.");
     }
     if (!empty($pj->bad_authors)) {
         $this->set_error_html("author", "Some authors ignored.");
     }
     $ncontacts = 0;
     foreach ($this->conflicts_array($pj, $old_pj) as $c) {
         if ($c >= CONFLICT_CONTACTAUTHOR) {
             ++$ncontacts;
         }
     }
     if (!$ncontacts && $old_pj && self::contacts_array($old_pj)) {
         $this->set_error_html("contacts", "Each paper must have at least one contact.");
     }
     foreach ($pj->bad_contacts as $reg) {
         if (!isset($reg->email)) {
             $this->set_error_html("contacts", "Contact " . Text::user_html($reg) . " has no associated email.");
         } else {
             $this->set_error_html("contacts", "Contact email " . htmlspecialchars($reg->email) . " is invalid.");
         }
     }
     if (!empty($pj->bad_topics)) {
         $this->set_warning_html("topics", "Unknown topics ignored (" . htmlspecialchars(commajoin($pj->bad_topics)) . ").");
     }
     if (!empty($pj->bad_options)) {
         $this->set_warning_html("options", "Unknown options ignored (" . htmlspecialchars(commajoin(array_keys($pj->bad_options))) . ").");
     }
 }
Exemplo n.º 7
0
 function check_invariants($cj)
 {
     global $Now;
     if (isset($cj->bad_follow) && count($cj->bad_follow)) {
         $this->set_warning("follow", "Unknown follow types ignored (" . htmlspecialchars(commajoin($cj->bad_follow)) . ").");
     }
     if (isset($cj->bad_topics) && count($cj->bad_topics)) {
         $this->set_warning("topics", "Unknown topics ignored (" . htmlspecialchars(commajoin($cj->bad_topics)) . ").");
     }
 }
Exemplo n.º 8
0
 static function send_reviewers($template, $row, $rest = array())
 {
     global $Conf, $Me, $Opt;
     $result = $Conf->qe("select ContactInfo.contactId,\n                firstName, lastName, email, preferredEmail, password, roles, disabled,\n                conflictType, reviewType myReviewType\n                from ContactInfo\n                join PaperReview on (PaperReview.contactId=ContactInfo.contactId and PaperReview.paperId={$row->paperId})\n                left join PaperConflict on (PaperConflict.contactId=ContactInfo.contactId and PaperConflict.paperId={$row->paperId})\n                group by ContactInfo.contactId");
     if (!isset($rest["cc"]) && isset($Opt["emailCc"])) {
         $rest["cc"] = $Opt["emailCc"];
     } else {
         if (!isset($rest["cc"])) {
             $rest["cc"] = Text::user_email_to(Contact::site_contact());
         }
     }
     // must set the current conflict type in $row for each contact
     $contact_info_map = $row->replace_contact_info_map(null);
     $contacts = array();
     while ($contact = edb_orow($result)) {
         $row->assign_contact_info($contact, $contact->contactId);
         self::send_to(Contact::make($contact), $template, $row, $rest);
         $contacts[] = Text::user_html($contact);
     }
     $row->replace_contact_info_map($contact_info_map);
     if ($Me->allow_administer($row) && !$row->has_author($Me) && count($contacts)) {
         $endmsg = isset($rest["infoMsg"]) ? ", " . $rest["infoMsg"] : ".";
         $Conf->infoMsg("Sent email to paper #{$row->paperId}’s " . pluralx($contacts, "reviewer") . ", " . commajoin($contacts) . $endmsg);
     }
 }
Exemplo n.º 9
0
function textArrayPapers($pids)
{
    return commajoin(preg_replace('/(\\d+)/', "<a href='" . hoturl("paper", "p=\$1&amp;ls=" . join("+", $pids)) . "'>\$1</a>", $pids));
}
Exemplo n.º 10
0
 private function _search_has($word, &$qt, $quoted)
 {
     global $Conf;
     $lword = strtolower($word);
     $lword = get(self::$_keywords, $lword) ?: $lword;
     if ($lword === "paper" || $lword === "sub" || $lword === "submission") {
         $qt[] = new SearchTerm("pf", 0, array("paperStorageId", "!=0"));
     } else {
         if ($lword === "final" || $lword === "finalcopy") {
             $qt[] = new SearchTerm("pf", 0, array("finalPaperStorageId", "!=0"));
         } else {
             if ($lword === "ab") {
                 $qt[] = new SearchTerm("pf", 0, array("abstract", "!=''"));
             } else {
                 if (preg_match('/\\A(?:(?:draft-?)?\\w*resp(?:onse)?|\\w*resp(?:onse)(?:-?draft)?|cmt|aucmt|anycmt)\\z/', $lword)) {
                     $this->_search_comment(">0", $lword, $qt, $quoted);
                 } else {
                     if ($lword === "manager" || $lword === "admin" || $lword === "administrator") {
                         $qt[] = new SearchTerm("pf", 0, array("managerContactId", "!=0"));
                     } else {
                         if (preg_match('/\\A[cip]?(?:re|pri|sec|ext)\\z/', $lword)) {
                             $this->_search_reviewer(">0", $lword, $qt);
                         } else {
                             if ($lword === "lead") {
                                 $qt[] = new SearchTerm("pf", self::F_XVIEW, array("leadContactId", "!=0"));
                             } else {
                                 if ($lword === "shep" || $lword === "shepherd") {
                                     $qt[] = new SearchTerm("pf", self::F_XVIEW, array("shepherdContactId", "!=0"));
                                 } else {
                                     if ($lword === "dec" || $lword === "decision") {
                                         $this->_search_status("yes", $qt, false, false);
                                     } else {
                                         if (preg_match('/\\A[\\w-]+\\z/', $lword) && $this->_search_options("{$lword}:yes", $qt, false)) {
                                             /* OK */
                                         } else {
                                             $x = array("“paper”", "“final”", "“abstract”", "“comment”", "“aucomment”", "“re”", "“extre”");
                                             foreach ($Conf->resp_round_list() as $i => $rname) {
                                                 if (!in_array("“response”", $x)) {
                                                     array_push($x, "“response”", "“draftresponse”");
                                                 }
                                                 if ($i) {
                                                     $x[] = "“{$rname}response”";
                                                 }
                                             }
                                             foreach (PaperOption::option_json_list() as $o) {
                                                 array_push($x, "“" . htmlspecialchars($o->abbr) . "”");
                                             }
                                             $this->warn("Unknown “has:” search. I understand " . commajoin($x) . ".");
                                             $qt[] = new SearchTerm("f");
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 11
0
 private static function _paperCommaJoin($pl, $a, $single)
 {
     while (preg_match('/\\b(\\w+)\\*/', $pl, $m)) {
         $pl = preg_replace('/\\b' . $m[1] . '\\*/', pluralx(count($a), $m[1]), $pl);
     }
     if ($single) {
         return preg_replace('/\\|.*/', "", $pl);
     }
     $pids = array();
     foreach ($a as &$x) {
         if (preg_match('/\\A(#?)(\\d+)([A-Z]*)\\z/', $x, $m)) {
             $x = "<a href=\"" . hoturl("paper", ["p" => $m[2], "anchor" => $m[3] ? "r{$m['2']}{$m['3']}" : null]) . "\">" . $x . "</a>";
             $pids[] = $m[2];
         }
     }
     $t = str_replace("|", "", $pl) . commajoin($a);
     if (count($pids) > 1) {
         $t = '<span class="has_hotcrp_list" data-hotcrp-list="p/s/' . join("+", $pids) . '">' . $t . '</span>';
     }
     return $t;
 }
Exemplo n.º 12
0
 static function echo_repo_group($info, $include_tarball = false)
 {
     global $Conf, $Me, $Now;
     if ($info->pset->gitless) {
         return;
     }
     list($user, $pset, $partner, $repo) = array($info->user, $info->pset, $info->partner, $info->repo);
     $editable = $info->can_set_repo && !$user->is_anonymous;
     $repo_url = $repo ? $repo->friendly_url() : "";
     $title = "repository";
     if (!RepositorySite::is_primary($repo)) {
         $title = $repo->reposite->friendly_siteclass() . " " . $title;
     }
     if ($repo && $repo->url) {
         $title = $user->link_repo($title, $repo->web_url());
     }
     if ($editable) {
         $value = Ht::entry("repo", $repo_url, array("style" => "width:32em")) . " " . Ht::submit("Save");
     } else {
         if ($user->is_anonymous) {
             $value = $repo_url ? "[anonymous]" : "(none)";
         } else {
             $value = htmlspecialchars($repo_url ? $repo_url : "(none)");
         }
     }
     if ($repo_url) {
         $value .= ' <button class="b repoclip hottooltip" data-pa-repo="' . htmlspecialchars($repo->ssh_url()) . '"';
         if ($user->is_anonymous) {
             $value .= ' data-tooltip="[anonymous]"';
         } else {
             $value .= ' data-tooltip="' . htmlspecialchars($repo->ssh_url()) . '"';
         }
         $value .= ' type="button" onclick="false">Copy URL to clipboard</button>';
         Ht::stash_script('$(".repoclip").each(pa_init_repoclip)', "repoclip");
         if ($include_tarball && $info->commit_hash() && ($tarball_url = $info->tarball_url())) {
             $value .= ' <a class="bsm q" href="' . htmlspecialchars($tarball_url) . '">Download tarball for ' . substr($info->commit_hash(), 0, 7) . '</a>';
         }
     }
     // check repo
     $ms = new MessageSet($user);
     if ($repo) {
         $repo->check_working($ms);
         $repo->check_open($ms);
     }
     if ($partner && $info->partner_same()) {
         $prepo = $partner->repo($pset->id);
         if (!$repo && $prepo || $repo && !$prepo || $repo && $prepo && $repo->repoid != $prepo->repoid) {
             if ($prepo && $repo) {
                 $prepo_url = ", " . htmlspecialchars($prepo->friendly_url_like($repo));
             } else {
                 if ($prepo) {
                     $prepo_url = ", " . htmlspecialchars($prepo->friendly_url());
                 } else {
                     $prepo_url = "";
                 }
             }
             $your_partner = "your partner’s";
             if ($Me->isPC) {
                 $your_partner = '<a href="' . hoturl("pset", array("pset" => $pset->urlkey, "u" => $Me->user_linkpart($partner))) . '">' . $your_partner . '</a>';
             }
             $ms->set_error_html("partner", "This repository differs from {$your_partner}{$prepo_url}.");
         }
     }
     if ($repo) {
         $repo->check_ownership($user, $partner, $ms);
     }
     $prefixes = ["", "WARNING: ", "ERROR: "];
     $notes = array_map(function ($m) use($prefixes) {
         return [$m[2] > 0, $prefixes[$m[2]] . $m[1]];
     }, $ms->messages(true));
     if ($repo && $repo->truncated_psetdir($pset)) {
         $notes[] = array(true, "Please create your repository by cloning our repository. Creating your repository from scratch makes it harder for us to grade and harder for you to get pset updates.");
     }
     if (!$repo) {
         $repoclasses = RepositorySite::site_classes($Conf);
         $x = commajoin(array_map(function ($k) {
             return Ht::link($k::global_friendly_siteclass(), $k::global_friendly_siteurl());
         }, $repoclasses), "or");
         if ($editable) {
             $notes[] = array(false, "Enter your {$x} repository URL here.");
         }
     }
     // edit
     if ($editable) {
         echo Ht::form(self_href(array("post" => post_value(), "set_repo" => 1, "pset" => $pset->urlkey))), '<div class="f-contain">';
     }
     self::echo_group($title, $value, $notes);
     if ($editable) {
         echo "</div></form>\n";
     }
     return $repo;
 }
Exemplo n.º 13
0
function revround()
{
    global $Conf, $Me;
    _subhead("", "\n<p>Many conferences divide their review assignments into multiple <em>rounds</em>.\nEach round is given a name, such as “R1” or “lastround”\n(we suggest very short names like “R1”).\nConfigure rounds on the <a href='" . hoturl("settings", "group=reviews#rounds") . "'>settings page</a>.\nTo search for any paper with a round “R2” review assignment, <a href='" . hoturl("search", "q=re:R2") . "'>search for re:R2”</a>.\nTo list a PC member’s round “R1” review assignments, <a href='" . hoturl("search", "q=re:membername:R1") . "'>search for “re:membername:R1”</a>.</p>\n\n<p>Different rounds usually share the same review form, but you can also\nmark review fields as appearing only in certain rounds. First configure\nrounds, then see\n<a href=\"" . hoturl("settings", "group=reviewform") . "\">Settings &gt; Review form</a>.</p>");
    _subhead("Assigning rounds", "\n<p>New assignments are marked by default with the round defined in\n<a href='" . hoturl("settings", "group=reviews#rounds") . "'>review settings</a>.\nThe automatic and bulk assignment pages also let you set a review round.</p>");
    // get current tag settings
    if ($Me->isPC) {
        $texts = array();
        if ($rr = setting_data("rev_roundtag")) {
            $texts[] = "The current review round is “<a href=\"" . hoturl("search", "q=round%3A" . urlencode($rr)) . "\">" . htmlspecialchars($rr) . "</a>”";
            if ($Me->privChair) {
                $texts[0] .= " (use <a href=\"" . hoturl("settings", "group=reviews#rounds") . "\">Settings &gt; Reviews</a> to change this).";
            } else {
                $texts[0] .= ".";
            }
        }
        $rounds = array();
        if ($Conf->has_rounds()) {
            $result = $Conf->qe("select distinct reviewRound from PaperReview");
            while ($row = edb_row($result)) {
                if ($row[0] && ($rname = $Conf->round_name($row[0], false))) {
                    $rounds[] = "“<a href=\"" . hoturl("search", "q=round%3A" . urlencode($rname)) . "\">" . htmlspecialchars($rname) . "</a>”";
                }
            }
            sort($rounds);
        }
        if (count($rounds)) {
            $texts[] = "Review rounds currently in use: " . commajoin($rounds) . ".";
        } else {
            if (!count($texts)) {
                $texts[] = "So far no review rounds have been defined.";
            }
        }
        _subhead("Round status", join(" ", $texts));
    }
}
Exemplo n.º 14
0
 static function fail_bad_options()
 {
     global $Opt;
     $errors = array();
     if (get($Opt, "multiconference") && $Opt["confid"] === "__nonexistent__") {
         $errors[] = "You haven’t specified a conference and this is a multiconference installation.";
     } else {
         if (get($Opt, "multiconference")) {
             $errors[] = "The “" . $Opt["confid"] . "” conference does not exist. Check your URL to make sure you spelled it correctly.";
         } else {
             if (!get($Opt, "loaded")) {
                 $errors[] = "HotCRP has been installed, but not yet configured. You must run `lib/createdb.sh` to create a database for your conference. See `README.md` for further guidance.";
             } else {
                 $errors[] = "HotCRP was unable to load. A system administrator must fix this problem.";
             }
         }
     }
     if (!get($Opt, "loaded") && defined("HOTCRP_OPTIONS")) {
         $errors[] = "Error: Unable to load options file `" . HOTCRP_OPTIONS . "`";
     } else {
         if (!get($Opt, "loaded")) {
             $errors[] = "Error: Unable to load options file";
         }
     }
     if (get($Opt, "missing")) {
         $errors[] = "Error: Unable to load options from " . commajoin($Opt["missing"]);
     }
     self::fail_message($errors);
 }
Exemplo n.º 15
0
     reviewTokenGroup(false);
     $sep = $xsep;
 }
 if ($myrow && $Conf->setting("rev_ratings") != REV_RATINGS_NONE) {
     $badratings = PaperSearch::unusableRatings($Me->privChair, $Me->contactId);
     $qx = count($badratings) ? " and not (PaperReview.reviewId in (" . join(",", $badratings) . "))" : "";
     $result = Dbl::qe_raw("select rating, count(PaperReview.reviewId) from PaperReview join ReviewRating on (PaperReview.contactId={$Me->contactId} and PaperReview.reviewId=ReviewRating.reviewId{$qx}) group by rating order by rating desc");
     if (edb_nrows($result)) {
         $a = array();
         while ($row = edb_row($result)) {
             if (isset(ReviewForm::$rating_types[$row[0]])) {
                 $a[] = "<a href=\"" . hoturl("search", "q=re:me+rate:%22" . urlencode(ReviewForm::$rating_types[$row[0]]) . "%22") . "\" title='List rated reviews'>{$row['1']} &ldquo;" . htmlspecialchars(ReviewForm::$rating_types[$row[0]]) . "&rdquo; " . pluralx($row[1], "rating") . "</a>";
             }
         }
         if (count($a) > 0) {
             echo "<div class='hint g'>\nYour reviews have received ", commajoin($a);
             if (count($a) > 1) {
                 echo " (these sets might overlap)";
             }
             echo ".<a class='help' href='", hoturl("help", "t=revrate"), "' title='About ratings'>?</a></div>\n";
         }
     }
 }
 if ($Me->has_review()) {
     $plist = new PaperList(new PaperSearch($Me, ["q" => "re:me"]), ["list" => true]);
     $ptext = $plist->table_html("reviewerHome");
     if ($plist->count > 0) {
         echo "<div class='fx'><div class='g'></div>", $ptext, "</div>";
     }
 }
 if ($Me->is_reviewer()) {
Exemplo n.º 16
0
function numrangejoin($range)
{
    $i = 0;
    $a = array();
    while ($i < count($range)) {
        for ($j = $i + 1; $j < count($range) && $range[$j - 1] == $range[$j] - 1; $j++) {
            /* nada */
        }
        if ($j == $i + 1) {
            $a[] = $range[$i];
        } else {
            $a[] = $range[$i] . "&ndash;" . $range[$j - 1];
        }
        $i = $j;
    }
    return commajoin($a);
}
Exemplo n.º 17
0
 static function echo_partner_group($info)
 {
     global $Conf, $Me;
     list($user, $pset, $partner) = array($info->user, $info->pset, $info->partner);
     if (!$pset->partner) {
         return;
     }
     // collect values
     $partner_email = "";
     if ($user->is_anonymous && $partner) {
         $partner_email = $partner->anon_username;
     } else {
         if ($partner) {
             $partner_email = $partner->email;
         }
     }
     $editable = $info->can_set_repo && !$user->is_anonymous;
     $title = "partner";
     if ($Me->isPC && $partner) {
         $title = '<a href="' . hoturl("pset", array("u" => $Me->user_linkpart($partner), "pset" => $pset->id, "commit" => $info->commit_hash())) . '">' . $title . '</a>';
     }
     if ($editable) {
         $value = Ht::entry("partner", $partner_email, array("style" => "width:32em")) . " " . Ht::submit("Save");
     } else {
         $value = htmlspecialchars($partner_email ?: "(none)");
     }
     // check back-partner links
     $notes = array();
     $backpartners = array_unique($user->links(LINK_BACKPARTNER, $pset->id));
     $info->partner_same = false;
     if (count($backpartners) == 0 && $partner) {
         $notes[] = array(true, "ERROR: " . htmlspecialchars($partner_email) . " has not listed you as a partner yet.");
     } else {
         if (count($backpartners) == 1 && $partner && $backpartners[0] == $partner->contactId) {
             $info->partner_same = true;
             if ($partner->dropped) {
                 $notes[] = array(true, "ERROR: We believe your partner has dropped the course.");
             }
         } else {
             if (count($backpartners) == 0 && !$partner) {
                 if ($editable) {
                     $notes[] = array(false, "Enter your partner’s email, username, or HUID here.");
                 }
             } else {
                 $backpartners[] = -1;
                 $result = $Conf->qe("select " . ($user->is_anonymous ? "anon_username" : "email") . " from ContactInfo where contactId in (" . join(",", $backpartners) . ")");
                 $p = array();
                 while ($row = edb_row($result)) {
                     if ($Me->isPC) {
                         $p[] = '<a href="' . hoturl("pset", array("pset" => $pset->urlkey, "u" => $row[0])) . '">' . htmlspecialchars($row[0]) . '</a>';
                     } else {
                         $p[] = htmlspecialchars($row[0]);
                     }
                 }
                 $notes[] = array(true, "ERROR: These users have listed you as a partner for this pset: " . commajoin($p));
             }
         }
     }
     if ($editable) {
         echo Ht::form(self_href(array("post" => post_value(), "set_partner" => 1, "pset" => $pset->urlkey))), "<div class='f-contain'>";
     }
     self::echo_group($title, $value, $notes);
     if ($editable) {
         echo "</div></form>";
     }
     echo "\n";
 }