public static function make($qreq, Contact $user = null, $key = null)
 {
     $ps = null;
     if ($key !== null && isset($qreq[$key])) {
         $ps = $qreq[$key];
     } else {
         if ($key === null && isset($qreq["p"])) {
             $ps = $qreq["p"];
         } else {
             if ($key === null && isset($qreq["pap"])) {
                 $ps = $qreq["pap"];
             }
         }
     }
     if ($user && $ps === "all") {
         $s = new PaperSearch($user, $qreq);
         $ps = $s->paperList();
     } else {
         if ($ps === "all") {
             $ps = null;
         }
     }
     if (is_string($ps)) {
         $ps = preg_split('/\\s+/', $ps);
     }
     return new SearchSelection($ps);
 }
Example #2
0
}
$papersel = null;
if (isset($_REQUEST["p"]) && is_array($_REQUEST["p"]) && !isset($_REQUEST["psearch"])) {
    $papersel = array();
    foreach ($_REQUEST["p"] as $p) {
        if (($p = cvtint($p)) > 0) {
            $papersel[] = $p;
        }
    }
    sort($papersel);
    $_REQUEST["q"] = join(" ", $papersel);
    $_REQUEST["plimit"] = 1;
} else {
    if (isset($_REQUEST["plimit"])) {
        $search = new PaperSearch($Me, array("t" => $_REQUEST["t"], "q" => $_REQUEST["q"]));
        $papersel = $search->paperList();
        sort($papersel);
    } else {
        $_REQUEST["q"] = "";
    }
}
// Load template if requested
if (isset($_REQUEST["loadtmpl"])) {
    $t = defval($_REQUEST, "template", "genericmailtool");
    if (!isset($mailTemplates[$t]) || !isset($mailTemplates[$t]["mailtool_name"])) {
        $t = "genericmailtool";
    }
    $template = $mailTemplates[$t];
    $_REQUEST["recipients"] = defval($template, "mailtool_recipients", "s");
    if (isset($template["mailtool_search_type"])) {
        $_REQUEST["t"] = $template["mailtool_search_type"];
    $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) ? "&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();
Example #4
0
}
$nlinks = 4;
$Conf->header("Log", "actionlog", actionBar());
$wheres = array();
$Eclass["q"] = $Eclass["pap"] = $Eclass["acct"] = $Eclass["n"] = $Eclass["date"] = "";
$_REQUEST["q"] = trim(defval($_REQUEST, "q", ""));
$_REQUEST["pap"] = trim(defval($_REQUEST, "pap", ""));
$_REQUEST["acct"] = trim(defval($_REQUEST, "acct", ""));
$_REQUEST["n"] = trim(defval($_REQUEST, "n", "{$DEFAULT_COUNT}"));
$_REQUEST["date"] = trim(defval($_REQUEST, "date", "now"));
if ($_REQUEST["pap"]) {
    $Search = new PaperSearch($Me, array("t" => "all", "q" => $_REQUEST["pap"], "allow_deleted" => true));
    if (count($Search->warnings)) {
        $Conf->warnMsg(join("<br />\n", $Search->warnings));
    }
    $pl = $Search->paperList();
    if (count($pl)) {
        $where = array();
        foreach ($pl as $p) {
            $where[] = "paperId={$p}";
            $where[] = "action like '%(papers% {$p},%'";
            $where[] = "action like '%(papers% {$p})%'";
        }
        $wheres[] = "(" . join(" or ", $where) . ")";
    } else {
        if (!count($Search->warnings)) {
            $Conf->warnMsg("No papers match that search.");
        }
        $wheres[] = "false";
    }
}
 private function collect_papers($req, &$pids, $report_error)
 {
     $pfield = trim(get_s($req, "paper"));
     if ($pfield !== "" && ctype_digit($pfield)) {
         $pids[intval($pfield)] = 2;
     } else {
         if ($pfield !== "") {
             if (!isset($this->searches[$pfield])) {
                 $search = new PaperSearch($this->contact, $pfield);
                 $this->searches[$pfield] = $search->paperList();
                 if ($report_error) {
                     foreach ($search->warnings as $w) {
                         $this->error($w);
                     }
                 }
             }
             foreach ($this->searches[$pfield] as $pid) {
                 $pids[$pid] = 1;
             }
             if (!count($this->searches[$pfield]) && $report_error) {
                 $this->error("No papers match “" . htmlspecialchars($pfield) . "”");
             }
         } else {
             if ($report_error) {
                 $this->error("Bad paper column");
             }
         }
     }
 }
    if (isset($Qreq->assign)) {
        $Conf->warnMsg("You changed the paper search. Please review the paper list.");
    }
    unset($Qreq->assign);
    $Qreq->requery = 1;
}
if (isset($Qreq->saveassignment)) {
    $SSel = SearchSelection::make($Qreq, $Me, $Qreq->submit ? "pap" : "p");
} else {
    $SSel = new SearchSelection();
    if (!$Qreq->requery) {
        $SSel = SearchSelection::make($Qreq, $Me);
    }
    if ($SSel->is_empty()) {
        $search = new PaperSearch($Me, array("t" => $Qreq->t, "q" => $Qreq->q));
        $SSel = new SearchSelection($search->paperList());
    }
}
$SSel->sort_selection();
// rev_roundtag
if (($x = $Conf->sanitize_round_name($Qreq->rev_roundtag)) !== false) {
    $Qreq->rev_roundtag = $x;
}
// score selector
$scoreselector = array("+overAllMerit" => "", "-overAllMerit" => "");
foreach (ReviewForm::all_fields() as $f) {
    if ($f->has_options) {
        $scoreselector["+" . $f->id] = "high {$f->name_html} scores";
        $scoreselector["-" . $f->id] = "low {$f->name_html} scores";
    }
}
 public function add_query($q, $style, $fieldname = false)
 {
     global $Me;
     $qn = count($this->queries);
     $this->queries[] = $q;
     if ($style === "by-tag" || $style === "default") {
         $style = "";
     }
     $this->query_styles[] = $style;
     $psearch = new PaperSearch($Me, array("q" => $q));
     foreach ($psearch->paperList() as $pid) {
         $this->papermap[$pid][] = $qn;
     }
     if (count($psearch->warnings)) {
         $this->error_html = array_merge($this->error_html, $psearch->warnings);
         if ($fieldname) {
             $this->errf[$fieldname] = true;
         }
     }
 }