Esempio n. 1
0
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>';
echo '<div class="fx9 g"></div></div>';
    $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();
Esempio n. 3
0
 }
 $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.";
         }
     } else {
 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";
         }
     }
 }
    $Qreq->q = join(" ", $SSel->selection());
}
echo Ht::entry_h("q", $Qreq->q, array("id" => "autoassignq", "placeholder" => "(All)", "size" => 40, "title" => "Enter paper numbers or search terms", "class" => "hotcrp_searchbox", "onfocus" => 'autosub("requery",this)')), " &nbsp;in &nbsp;";
if (count($tOpt) > 1) {
    echo Ht::select("t", $tOpt, $Qreq->t, array("onchange" => "highlightUpdate(\"requery\")"));
} else {
    echo join("", $tOpt);
}
echo " &nbsp; ", Ht::submit("requery", "List", array("id" => "requery"));
if (isset($Qreq->requery) || isset($Qreq->haspap)) {
    echo "<br /><span class='hint'>Assignments will apply to the selected papers.</span>\n<div class='g'></div>";
    $search = new PaperSearch($Me, array("t" => $Qreq->t, "q" => $Qreq->q, "urlbase" => hoturl_site_relative_raw("autoassign")));
    $plist = new PaperList($search);
    $plist->display .= " reviewers ";
    $plist->papersel = $SSel->selection_map();
    echo $plist->table_html("reviewersSel", ["nofooter" => true]), Ht::hidden("prevt", $Qreq->t), Ht::hidden("prevq", $Qreq->q), Ht::hidden("haspap", 1);
}
echo "</div>\n";
// echo "<tr><td class='caption'></td><td class='entry'><div class='g'></div></td></tr>\n";
// action
echo divClass("ass"), "<h3>Action</h3>";
echo divClass("rev", "hotradiorelation");
doRadio("a", "rev", "Ensure each selected paper has <i>at least</i>");
echo "&nbsp; ", Ht::entry("revct", get($Qreq, "revct", 1), array("size" => 3, "onfocus" => 'autosub(false,this)')), "&nbsp; ";
doSelect("revtype", array(REVIEW_PRIMARY => "primary", REVIEW_SECONDARY => "secondary", REVIEW_PC => "optional"));
echo "&nbsp; review(s)</div>\n";
echo divClass("revadd", "hotradiorelation");
doRadio("a", "revadd", "Assign");
echo "&nbsp; ", Ht::entry("revaddct", get($Qreq, "revaddct", 1), array("size" => 3, "onfocus" => 'autosub(false,this)')), "&nbsp; <i>additional</i>&nbsp; ";
doSelect("revaddtype", array(REVIEW_PRIMARY => "primary", REVIEW_SECONDARY => "secondary", REVIEW_PC => "optional"));
echo "&nbsp; review(s) per selected paper</div>\n";
    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);
    foreach (pcMembers() as $pcm) {