echo '<table class="fx9"><tr>';
if ($Me->privChair) {
    echo '<td class="nw">', Ht::checkbox("plimit", 1, isset($_REQUEST["plimit"]), ["id" => "plimit", "onchange" => "fold('psel', !this.checked, 8)"]), "&nbsp;</td><td>", Ht::label("Choose papers", "plimit"), "<span class='fx8'>:&nbsp; ";
} else {
    echo '<td class="nw">Papers: &nbsp;</td><td>', Ht::hidden("plimit", 1), '<span>';
}
echo Ht::entry("q", @$_REQUEST["q"], array("id" => "q", "placeholder" => "(All)", "class" => "hotcrp_searchbox", "size" => 36)), " &nbsp;in&nbsp;";
if (count($tOpt) == 1) {
    echo htmlspecialchars($tOpt[$_REQUEST["t"]]);
} else {
    echo " ", Ht::select("t", $tOpt, $_REQUEST["t"], array("id" => "t"));
}
echo " &nbsp;", Ht::submit("psearch", "Search");
echo "</span>";
if (isset($_REQUEST["plimit"]) && !isset($_REQUEST["monreq"]) && (isset($_REQUEST["loadtmpl"]) || isset($_REQUEST["psearch"]))) {
    $plist = new PaperList(new PaperSearch($Me, ["t" => $_REQUEST["t"], "q" => $_REQUEST["q"]]));
    $ptext = $plist->table_html("reviewers", ["noheader" => true, "nofooter" => true]);
    echo "<div class='fx8'>";
    if ($plist->count == 0) {
        echo "No papers match that search.";
    } else {
        echo '<div class="g"></div>', $ptext;
    }
    echo '</div>', Ht::hidden("prevt", $_REQUEST["t"]), Ht::hidden("prevq", $_REQUEST["q"]);
}
echo "</td></tr></table>\n";
echo '<div class="fx10" style="margin-top:0.35em">';
if (!@$_REQUEST["newrev_since"] && ($t = $Conf->setting("pcrev_informtime"))) {
    $_REQUEST["newrev_since"] = $Conf->parseableTime($t, true);
}
echo 'Assignments since:&nbsp; ', Ht::entry("newrev_since", @$_REQUEST["newrev_since"], array("placeholder" => "(all)", "size" => 30)), '</div>';
 private static function try_list($opt, $listtype, $sort = null)
 {
     global $Conf, $Me;
     if ($listtype == "u" && $Me->privChair) {
         $searchtype = defval($opt, "t") === "all" ? "all" : "pc";
         $q = "select contactId from ContactInfo";
         if ($searchtype == "pc") {
             $q .= " where (roles&" . Contact::ROLE_PC . ")!=0";
         }
         $result = Dbl::ql("{$q} order by lastName, firstName, email");
         $a = array();
         while ($row = edb_row($result)) {
             $a[] = (int) $row[0];
         }
         Dbl::free($result);
         return self::create("u/" . $searchtype, $a, $searchtype == "pc" ? "Program committee" : "Users", hoturl_site_relative_raw("users", "t={$searchtype}"));
     } else {
         $search = new PaperSearch($Me, $opt);
         $x = $search->session_list_object($sort);
         if ($sort || $search->has_sort()) {
             $pl = new PaperList($search, array("sort" => $sort));
             $x->ids = $pl->id_array();
         }
         return $x;
     }
 }
Exemple #3
0
    $_REQUEST["replyto"] = defval($Opt, "emailReplyTo", "");
}
// Check or send
if (defval($_REQUEST, "loadtmpl") || defval($_REQUEST, "cancel")) {
    /* do nothing */
} else {
    if (defval($_REQUEST, "send") && !$recip->error && check_post()) {
        MailSender::send($recip);
    } else {
        if ((@$_REQUEST["check"] || @$_REQUEST["group"] || @$_REQUEST["ungroup"]) && !$recip->error && check_post()) {
            MailSender::check($recip);
        }
    }
}
if (isset($_REQUEST["monreq"])) {
    $plist = new PaperList(new PaperSearch($Me, array("t" => "req", "q" => "")), array("list" => true));
    $ptext = $plist->text("reqrevs", array("header_links" => true));
    if ($plist->count == 0) {
        $Conf->infoMsg("You have not requested any external reviews.  <a href='", hoturl("index"), "'>Return home</a>");
    } else {
        echo "<h2>Requested reviews</h2>\n\n", $ptext, "<div class='info'>";
        if ($plist->any->need_review) {
            echo "Some of your requested external reviewers have not completed their reviews.  To send them an email reminder, check the text below and then select &ldquo;Prepare mail.&rdquo;  You’ll get a chance to review the emails and select specific reviewers to remind.";
        } else {
            echo "All of your requested external reviewers have completed their reviews.  <a href='", hoturl("index"), "'>Return home</a>";
        }
        echo "</div>\n";
    }
    if (!$plist->any->need_review) {
        $Conf->footer();
        exit;
xassert(!$user_mgbaker->can_administer($paper1));
xassert(!$user_mgbaker->can_administer($paper18));
// author derivation works
xassert($user_mgbaker->act_author_view($paper18));
// simple search
$pl = new PaperList(new PaperSearch($user_shenker, "au:berkeley"));
$j = $pl->text_json("id title");
xassert_eqq(join(";", array_keys($j)), "1;6;13;15;24");
// sorting works
assert_search_papers($user_shenker, "au:berkeley sort:title", "24 15 13 1 6");
// correct conflict information returned
$pl = new PaperList(new PaperSearch($user_shenker, "1 2 3 4 5 15-18"), ["reviewer" => $user_mgbaker]);
$j = $pl->text_json("id selconf");
xassert_eqq(join(";", array_keys($j)), "1;2;3;4;5;15;16;17;18");
xassert(!@$j[1]->selconf && !@$j[2]->selconf && @$j[3]->selconf && !@$j[4]->selconf && !@$j[5]->selconf && !@$j[15]->selconf && !@$j[16]->selconf && !@$j[17]->selconf && @$j[18]->selconf);
$pl = new PaperList(new PaperSearch($user_shenker, "1 2 3 4 5 15-18"), ["reviewer" => $user_jon]);
$j = $pl->text_json("id selconf");
xassert_eqq(join(";", array_keys($j)), "1;2;3;4;5;15;16;17;18");
xassert(!@$j[1]->selconf && !@$j[2]->selconf && !@$j[3]->selconf && !@$j[4]->selconf && !@$j[5]->selconf && !@$j[15]->selconf && !@$j[16]->selconf && @$j[17]->selconf && !@$j[18]->selconf);
assert_search_papers($user_shenker, "re:estrin", "4 8 18");
// normals don't see conflicted reviews
assert_search_papers($user_mgbaker, "re:estrin", "4 8");
// make reviewer identity anonymous until review completion
$Conf->save_setting("rev_open", 1);
$Conf->save_setting("pc_seeblindrev", 1);
assert_search_papers($user_mgbaker, "re:varghese", "");
$revreq = array("overAllMerit" => 5, "reviewerQualification" => 4, "ready" => true);
save_review(1, $user_mgbaker, $revreq);
assert_search_papers($user_mgbaker, "re:varghese", "1");
// check comment identity
xassert($Conf->setting("au_seerev") == Conf::AUSEEREV_NO);
     foreach ($col as $thecol) {
         if (count($thecol)) {
             echo "<td class='top'><table>";
             foreach ($thecol as $td) {
                 echo "<tr><td style='padding:0 2em 1ex 0'>", $td, "</td></tr>";
             }
             echo "</table></td>\n";
         }
     }
     echo "</tr></table>\n";
 }
 // ajax assignment form
 echo Ht::form(hoturl_post("assign", "update=1"), array("id" => "assrevform")), "<div class='clear'>", Ht::hidden("kind", $qreq->kind), Ht::hidden("p", ""), Ht::hidden("pcs{$reviewer}", ""), Ht::hidden("reviewer", $reviewer), Ht::hidden("rev_roundtag", $qreq->rev_roundtag), "</div></form>\n\n";
 // main assignment form
 $search = new PaperSearch($Me, array("t" => $qreq->t, "q" => $qreq->q, "urlbase" => hoturl_site_relative_raw("manualassign", "reviewer={$reviewer}")));
 $paperList = new PaperList($search, ["sort" => true, "list" => true, "reviewer" => $pcm[$reviewer]], make_qreq());
 $paperList->display .= " topics ";
 if ($qreq->kind != "c") {
     $paperList->display .= "reviewers ";
 }
 if (isset($showau)) {
     $search->overrideMatchPreg = true;
     $search->matchPreg = array();
     if ($showau) {
         $search->matchPreg["authorInformation"] = make_match_preg($showau);
     }
     if ($showco) {
         $search->matchPreg["collaborators"] = make_match_preg($showco);
     }
 }
 $a = isset($qreq->sort) ? "&amp;sort=" . urlencode($qreq->sort) : "";
 public function prepare(PaperList $pl, $visible)
 {
     if (!$pl->contact->can_view_tags(null)) {
         return false;
     }
     if ($visible) {
         $pl->qopts["tags"] = 1;
     }
     if ($visible && $this->editable && ($tid = $pl->table_id())) {
         $pl->add_header_script("plinfo_tags(" . json_encode("#{$tid}") . ")", "plinfo_tags");
     }
     return true;
 }
function search_text_col($user, $text, $col = "id")
{
    $pl = new PaperList(new PaperSearch($user, $text));
    $x = array();
    foreach ($pl->text_json($col) as $pid => $p) {
        $x[] = $pid . " " . $p->{$col} . "\n";
    }
    return join("", $x);
}
     echo "<h4>Submissions: &nbsp;</h4> ";
 }
 $startable = $Conf->timeStartPaper();
 if ($startable && !$Me->has_email()) {
     echo "<span class='deadline'>", $Conf->printableDeadlineSetting("sub_reg", "span"), "</span><br />\n<small>You must sign in to register papers.</small>";
 } else {
     if ($startable || $Me->privChair) {
         echo "<strong><a href='", hoturl("paper", "p=new"), "'>Start new paper</a></strong> <span class='deadline'>(", $Conf->printableDeadlineSetting("sub_reg", "span"), ")</span>";
         if ($Me->privChair) {
             echo "<br />\n<span class='hint'>As an administrator, you can start a paper regardless of deadlines and on behalf of others.</span>";
         }
     }
 }
 $plist = null;
 if ($Me->is_author()) {
     $plist = new PaperList(new PaperSearch($Me, ["t" => "a"]), ["list" => true]);
     $ptext = $plist->table_html("authorHome", array("noheader" => true));
     if ($plist->count > 0) {
         echo "<div class='g'></div>\n", $ptext;
     }
 }
 $deadlines = array();
 if ($plist && $plist->any->need_submit) {
     if (!$Conf->timeFinalizePaper()) {
         // Be careful not to refer to a future deadline; perhaps an admin
         // just turned off submissions.
         if ($Conf->deadlinesBetween("", "sub_sub", "sub_grace")) {
             $deadlines[] = "The site is not open for submissions at the moment.";
         } else {
             $deadlines[] = "The <a href='" . hoturl("deadlines") . "'>deadline</a> for submitting papers has passed.";
         }
 function echo_unparse_display()
 {
     $this->set_my_conflicts();
     $bypaper = array();
     foreach ($this->assigners as $assigner) {
         if ($text = $assigner->unparse_display($this)) {
             $c = $assigner->contact;
             if ($c && !isset($c->sorter)) {
                 Contact::set_sorter($c);
             }
             arrayappend($bypaper[$assigner->pid], (object) array("text" => $text, "sorter" => $c ? $c->sorter : $text));
         }
     }
     AutoassignmentPaperColumn::$header = "Assignment";
     $assinfo = array();
     PaperColumn::register(new AutoassignmentPaperColumn());
     foreach ($bypaper as $pid => $list) {
         uasort($list, "Contact::compare");
         $t = "";
         foreach ($list as $x) {
             $t .= ($t ? ", " : "") . '<span class="nw">' . $x->text . '</span>';
         }
         if (isset($this->my_conflicts[$pid])) {
             if ($this->my_conflicts[$pid] !== true) {
                 $t = '<em>Hidden for conflict</em>';
             } else {
                 $t = PaperList::wrapChairConflict($t);
             }
         }
         $assinfo[$pid] = $t;
     }
     ksort($assinfo);
     AutoassignmentPaperColumn::$info = $assinfo;
     if ($this->unparse_search) {
         $query_order = "(" . $this->unparse_search . ") THEN HEADING:none " . join(" ", array_keys($assinfo));
     } else {
         $query_order = count($assinfo) ? join(" ", array_keys($assinfo)) : "NONE";
     }
     foreach ($this->unparse_columns as $k => $v) {
         $query_order .= " show:{$k}";
     }
     $query_order .= " show:autoassignment";
     $search = new PaperSearch($this->contact, array("t" => defval($_REQUEST, "t", "s"), "q" => $query_order));
     $plist = new PaperList($search);
     echo $plist->table_html("reviewers", ["nofooter" => 1]);
     $deltarev = new AssignmentCountSet();
     foreach ($this->assigners as $assigner) {
         $assigner->account($deltarev);
     }
     if (count(array_intersect_key($deltarev->bypc, pcMembers()))) {
         $summary = [];
         $tagger = new Tagger($this->contact);
         $nrev = new AssignmentCountSet();
         $deltarev->rev && $nrev->load_rev();
         $deltarev->lead && $nrev->load_lead();
         $deltarev->shepherd && $nrev->load_shepherd();
         foreach (pcMembers() as $p) {
             if ($deltarev->get($p->contactId)->ass) {
                 $t = '<div class="ctelt"><div class="ctelti';
                 if ($k = $p->viewable_color_classes($this->contact)) {
                     $t .= ' ' . $k;
                 }
                 $t .= '"><span class="taghl">' . $this->contact->name_html_for($p) . "</span>: " . plural($deltarev->get($p->contactId)->ass, "assignment") . self::review_count_report($nrev, $deltarev, $p, "After assignment:&nbsp;") . "<hr class=\"c\" /></div></div>";
                 $summary[] = $t;
             }
         }
         if (count($summary)) {
             echo "<div class=\"g\"></div>\n", "<h3>Summary</h3>\n", '<div class="pc_ctable">', join("", $summary), "</div>\n";
         }
     }
 }
 public function run()
 {
     global $Conf, $Me, $Qreq, $SSel, $pcsel, $badpairs, $scoreselector;
     assert($this->ok);
     session_write_close();
     // this might take a long time
     set_time_limit(240);
     // prepare autoassigner
     if ($Qreq->seed && is_numeric($Qreq->seed)) {
         srand((int) $Qreq->seed);
     }
     $this->autoassigner = $autoassigner = new Autoassigner($SSel->selection());
     if ($Qreq->pctyp === "sel") {
         $n = $autoassigner->select_pc(array_keys($pcsel));
         if ($n == 0) {
             Conf::msg_error("Select one or more PC members to assign.");
             return null;
         }
     }
     if ($Qreq->balance === "all") {
         $autoassigner->set_balance(Autoassigner::BALANCE_ALL);
     }
     foreach ($badpairs as $cid1 => $bp) {
         foreach ($bp as $cid2 => $x) {
             $autoassigner->avoid_pair_assignment($cid1, $cid2);
         }
     }
     if ($Qreq->method === "random") {
         $autoassigner->set_method(Autoassigner::METHOD_RANDOM);
     } else {
         $autoassigner->set_method(Autoassigner::METHOD_MCMF);
     }
     $autoassigner->add_progressf(array($this, "progress"));
     $this->live = true;
     echo '<div id="propass" class="propass">';
     $this->start_at = microtime(true);
     if ($this->atype === "prefconflict") {
         $autoassigner->run_prefconflict($Qreq->t);
     } else {
         if ($this->atype === "clear") {
             $autoassigner->run_clear($this->reviewtype);
         } else {
             if ($this->atype === "lead" || $this->atype === "shepherd") {
                 $autoassigner->run_paperpc($this->atype, $Qreq["{$this->atype}score"]);
             } else {
                 if ($this->atype === "revpc") {
                     $autoassigner->run_reviews_per_pc($this->reviewtype, $Qreq->rev_roundtag, cvtint($Qreq->revpcct));
                 } else {
                     if ($this->atype === "revadd") {
                         $autoassigner->run_more_reviews($this->reviewtype, $Qreq->rev_roundtag, cvtint($Qreq->revaddct));
                     } else {
                         if ($this->atype === "rev") {
                             $autoassigner->run_ensure_reviews($this->reviewtype, $Qreq->rev_roundtag, cvtint($Qreq->revct));
                         } else {
                             if ($this->atype === "discorder") {
                                 $autoassigner->run_discussion_order($this->discordertag);
                             }
                         }
                     }
                 }
             }
         }
     }
     if ($this->live) {
         echo $this->result_html(), "</div>\n";
     } else {
         PaperList::$include_stash = false;
         $result_html = $this->result_html();
         echo Ht::take_stash(), '<script>$$("propass").innerHTML=', json_encode($result_html), ";</script>\n";
     }
     if ($this->autoassigner->assignments()) {
         $Conf->footer();
         exit;
     }
 }
    $pfd = " ";
    foreach ($_REQUEST as $k => $v) {
        if (substr($k, 0, 4) == "show" && $v) {
            $pfd .= substr($k, 4) . " ";
        }
    }
    $Conf->save_session("pfdisplay", $pfd);
    redirectSelf();
}
$pldisplay = displayOptionsSet("pfdisplay");
// Header and body
$Conf->header("Review preferences", "revpref", actionBar());
$Conf->infoMsg($Conf->message_html("revprefdescription"));
// search
$search = new PaperSearch($Me, array("t" => "rable", "urlbase" => hoturl_site_relative_raw("reviewprefs", "reviewer={$reviewer}"), "q" => defval($_REQUEST, "q", "")), $reviewer);
$pl = new PaperList($search, ["sort" => true, "list" => true, "row_id_pattern" => "p#", "foldtype" => "pf", "reviewer" => $reviewer_contact], make_qreq());
$pl_text = $pl->table_html("editReviewPreference", array("class" => "pltable_full", "table_id" => "foldpl", "attributes" => array("data-fold-session" => "pfdisplay.\$"), "footer_extra" => "<div id='plactr'>" . Ht::submit("update", "Save changes", array("class" => "hb")) . "</div>", "list_properties" => ["revprefs" => true]));
// DISPLAY OPTIONS
echo "<table id='searchform' class='tablinks1'>\n<tr><td>";
// <div class='tlx'><div class='tld1'>";
$showing_au = !$Conf->subBlindAlways() && strpos($pldisplay, " au ") !== false;
$showing_anonau = (!$Conf->subBlindNever() || $Me->privChair) && strpos($pldisplay, " anonau ") !== false;
echo Ht::form_div(hoturl("reviewprefs"), array("method" => "get", "id" => "redisplayform", "class" => $showing_au || $showing_anonau && $Conf->subBlindAlways() ? "fold10o" : "fold10c")), "<table>";
if ($Me->privChair) {
    echo "<tr><td class='lxcaption'><strong>Preferences:</strong> &nbsp;</td><td class='lentry'>";
    $prefcount = array();
    $result = $Conf->qe("select contactId, count(preference) from PaperReviewPreference where preference!=0 group by contactId");
    while ($row = edb_row($result)) {
        $prefcount[$row[0]] = $row[1];
    }
    $revopt = pc_members_selector_options(false);