예제 #1
0
function _one_quicklink($id, $baseUrl, $urlrest, $listtype, $isprev)
{
    global $Conf;
    if ($listtype == "u") {
        $result = Dbl::ql("select email from ContactInfo where contactId=?", $id);
        $row = edb_row($result);
        Dbl::free($result);
        $paperText = htmlspecialchars($row ? $row[0] : $id);
        $urlrest["u"] = urlencode($id);
    } else {
        $paperText = "#{$id}";
        $urlrest["p"] = $id;
    }
    return "<a id=\"quicklink_" . ($isprev ? "prev" : "next") . "\" class=\"x\" href=\"" . hoturl($baseUrl, $urlrest) . "\" onclick=\"return !Miniajax.isoutstanding('revprevform', make_link_callback(this))\">" . ($isprev ? Ht::img("_.gif", "<-", "prev") : "") . $paperText . ($isprev ? "" : Ht::img("_.gif", "->", "next")) . "</a>";
}
예제 #2
0
 private function _footer($ncol, $extra)
 {
     global $Conf;
     if ($this->count == 0) {
         return "";
     }
     $revpref = $this->table_type == "editReviewPreference";
     $lllgroups = SearchAction::list_all_actions($this->contact, $this->qreq, $this);
     // Upload preferences (review preferences only)
     if ($revpref) {
         $lllgroups[] = [100, "uploadpref", "Upload", "<b>&nbsp;preference file:</b> &nbsp;" . "<input class=\"wantcrpfocus\" type='file' name='uploadedFile' accept='text/plain' size='20' tabindex='6' onfocus='autosub(\"uploadpref\",this)' />&nbsp; " . Ht::submit("fn", "Go", ["value" => "uploadpref", "tabindex" => 6, "onclick" => "return plist_submit.call(this)", "data-plist-submit-all" => 1])];
     }
     // Set preferences (review preferences only)
     if ($revpref) {
         $lllgroups[] = [200, "setpref", "Set preferences", "<b>:</b> &nbsp;" . Ht::entry("pref", "", array("class" => "wantcrpfocus", "size" => 4, "tabindex" => 6, "onfocus" => 'autosub("setpref",this)')) . " &nbsp;" . Ht::submit("fn", "Go", ["value" => "setpref", "tabindex" => 6, "onclick" => "return plist_submit.call(this)"])];
     }
     usort($lllgroups, function ($a, $b) {
         return $a[0] - $b[0];
     });
     $whichlll = 1;
     foreach ($lllgroups as $i => $lllg) {
         if ($this->qreq->fn == $lllg[1] || $this->atab == $lllg[1]) {
             $whichlll = $i + 1;
         }
     }
     // Linelinks container
     $foot = "  <tr class=\"pl_footrow\">";
     if (!$this->viewmap->columns) {
         $foot .= '<td class="pl_footselector">' . Ht::img("_.gif", "^^", "placthook") . "</td>";
         --$ncol;
     }
     $foot .= '<td id="plact" class="pl_footer linelinks' . $whichlll . '" colspan="' . $ncol . '">';
     $foot .= "<table><tbody><tr>\n" . '    <td class="pl_footer_desc"><b>Select papers</b> (or <a href="' . selfHref(["selectall" => 1]) . '#plact" onclick="return papersel(true)">select all ' . $this->count . "</a>), then&nbsp;</td>\n" . "   </tr></tbody></table>";
     foreach ($lllgroups as $i => $lllg) {
         $x = $i + 1;
         $foot .= "<table><tbody><tr>\n" . "    <td class=\"pl_footer_desc lll{$x}\"><a href=\"" . selfHref(["atab" => $lllg[1]]) . "#plact\" onclick=\"return crpfocus('plact',this)\">" . $lllg[2] . "</a></td>\n";
         for ($j = 3; $j < count($lllg); ++$j) {
             $cell = is_array($lllg[$j]) ? $lllg[$j] : ["content" => $lllg[$j]];
             $class = isset($cell["class"]) ? "lld{$x} " . $cell["class"] : "lld{$x}";
             $foot .= "    <td class=\"{$class}\"";
             if (isset($cell["id"])) {
                 $foot .= " id=\"" . $cell["id"] . "\"";
             }
             $foot .= ">" . $cell["content"] . "</td>\n";
         }
         if ($i < count($lllgroups) - 1) {
             $foot .= "    <td>&nbsp;<span class='barsep'>·</span>&nbsp;</td>\n";
         }
         $foot .= "   </tr></tbody></table>";
     }
     $foot .= $extra . "<hr class=\"c\" /></td>\n  </tr>\n";
     return $foot;
 }
예제 #3
0
function searchbar()
{
    global $Conf, $Eclass, $page, $start, $count, $nrows, $maxNrows, $nlinks, $offset;
    echo Ht::form_div(hoturl("log"), array("method" => "get")), "<table id='searchform'><tr>\n  <td class='lxcaption", $Eclass['q'], "'>With <b>any</b> of the words</td>\n  <td class='lentry", $Eclass['q'], "'><input type='text' size='40' name='q' value=\"", htmlspecialchars(defval($_REQUEST, "q", "")), "\" /><span class='sep'></span></td>\n  <td rowspan='3'>", Ht::submit("search", "Search"), "</td>\n</tr><tr>\n  <td class='lxcaption", $Eclass['pap'], "'>Concerning paper(s)</td>\n  <td class='lentry", $Eclass['pap'], "'><input type='text' size='40' name='pap' value=\"", htmlspecialchars(defval($_REQUEST, "pap", "")), "\" /></td>\n</tr><tr>\n  <td class='lxcaption", $Eclass['acct'], "'>Concerning account(s)</td>\n  <td class='lentry'><input type='text' size='40' name='acct' value=\"", htmlspecialchars(defval($_REQUEST, "acct", "")), "\" /></td>\n</tr><tr>\n  <td class='lxcaption", $Eclass['n'], "'>Show</td>\n  <td class='lentry", $Eclass['n'], "'><input type='text' size='4' name='n' value=\"", htmlspecialchars($_REQUEST["n"]), "\" /> &nbsp;records at a time</td>\n</tr><tr>\n  <td class='lxcaption", $Eclass['date'], "'>Starting at</td>\n  <td class='lentry", $Eclass['date'], "'><input type='text' size='40' name='date' value=\"", htmlspecialchars($_REQUEST["date"]), "\" /></td>\n</tr></table></div></form>";
    if ($nrows > $count || $page > 1) {
        $urls = array();
        $_REQUEST["offset"] = $offset;
        foreach (array("q", "pap", "acct", "n", "offset") as $x) {
            if ($_REQUEST[$x]) {
                $urls[] = "{$x}=" . urlencode($_REQUEST[$x]);
            }
        }
        $url = hoturl("log", join("&amp;", $urls));
        echo "<table class='lognav'><tr><td id='newest'><div>";
        if ($page > 1) {
            echo "<a href='{$url}&amp;page=1'><strong>Newest</strong></a> &nbsp;|&nbsp;&nbsp;";
        }
        echo "</div></td><td id='newer'><div>";
        if ($page > 1) {
            echo "<a href='{$url}&amp;page=", $page - 1, "'><strong>", Ht::img("_.gif", "<-", array("class" => "prev")), " Newer</strong></a>";
        }
        echo "</div></td><td id='newnum'><div>";
        if ($page - $nlinks > 1) {
            echo "&nbsp;...";
        }
        for ($p = max($page - $nlinks - 1, 0); $p + 1 < $page; $p++) {
            echo "&nbsp;<a href='{$url}&amp;page=", $p + 1, "'>", $p + 1, "</a>";
        }
        echo "</div></td><td id='thisnum'><div><strong class='thispage'>&nbsp;", $page, "&nbsp;</strong></div></td><td id='oldnum'><div>";
        $o = $offset ? $offset - $count : 0;
        for ($p = $page; $p * $count + $o < $start + min($nlinks * $count + 1, $nrows); $p++) {
            echo "<a href='{$url}&amp;page=", $p + 1, "'>", $p + 1, "</a>&nbsp;";
        }
        if ($nrows == $maxNrows) {
            echo "...&nbsp;";
        }
        echo "</div></td><td id='older'><div>";
        if ($nrows > $count) {
            echo "<a href='{$url}&amp;page=", $page + 1, "'><strong>Older ", Ht::img("_.gif", "->", array("class" => "next")), "</strong></a>";
        }
        echo "</div></td><td id='oldest'><div>";
        if ($nrows > $count) {
            echo "&nbsp;&nbsp;|&nbsp; <a href='{$url}&amp;page=earliest'><strong>Oldest</strong></a>";
        }
        echo "</div></td></tr></table>";
    }
    echo "<div class='g'></div>\n";
}
예제 #4
0
 echo '<div class="ctelt"><div class="ctelti' . ($color ? " {$color}" : "") . '">';
 if ($p->conflictType >= CONFLICT_AUTHOR) {
     echo '<div class="pctbass">', review_type_icon(-2), Ht::img("_.gif", ">", array("class" => "next", "style" => "visibility:hidden")), '&nbsp;</div>', '<div id="ass' . $p->contactId . '" class="pctbname pctbname-2 taghl nw">', $Me->name_html_for($pc), '</div>';
 } else {
     if ($p->conflictType > 0) {
         $revtype = -1;
     } else {
         if ($p->reviewType) {
             $revtype = $p->reviewType;
         } else {
             $revtype = $p->refused ? -3 : 0;
         }
     }
     $title = $p->refused ? "Review previously declined" : "Assignment";
     // NB manualassign.php also uses the "pcs$contactId" convention
     echo '<div class="pctbass">' . '<div id="foldass' . $p->contactId . '" class="foldc" style="position:relative">' . '<a id="folderass' . $p->contactId . '" href="#" onclick="return assigntable.open(' . $p->contactId . ')">' . review_type_icon($revtype, false, $title) . Ht::img("_.gif", ">", array("class" => "next")) . '</a>&nbsp;' . Ht::hidden("pcs{$p->contactId}", $p->conflictType == 0 ? $p->reviewType : -1, array("id" => "pcs{$p->contactId}")) . '</div></div>';
     echo '<div id="ass' . $p->contactId . '" class="pctbname pctbname' . $revtype . '">' . '<span class="taghl nw">' . $Me->name_html_for($pc) . '</span>';
     if ($p->conflictType == 0) {
         $p->topicInterestScore = $prow->topic_interest_score($pc);
         if ($p->reviewerPreference || $p->reviewerExpertise || $p->topicInterestScore) {
             echo unparse_preference_span($p);
         }
     }
     echo '</div>';
 }
 // then, number of reviews
 echo '<div class="pctbnrev">';
 $numReviews = strlen($p->allReviews);
 $numPrimary = preg_match_all("|" . REVIEW_PRIMARY . "|", $p->allReviews, $matches);
 if (!$numReviews) {
     echo "0 reviews";
 public static function unparse_flow_entry($crow, $contact, $trclass)
 {
     // See also ReviewForm::reviewFlowEntry
     global $Conf;
     $a = "<a href=\"" . hoturl("paper", "p={$crow->paperId}#" . self::unparse_html_id($crow)) . "\"";
     $t = "<tr class='{$trclass}'><td class='pl_activityicon'>" . $a . ">" . Ht::img("comment24.png", "[Comment]", "dlimg") . '</a></td><td class="pl_activityid pnum">' . $a . ">#{$crow->paperId}</a></td><td class='pl_activitymain'><small>" . $a . " class=\"ptitle\">" . htmlspecialchars($crow->shortTitle);
     if (strlen($crow->shortTitle) != strlen($crow->title)) {
         $t .= "...";
     }
     $t .= "</a>";
     $idable = $contact->can_view_comment_identity($crow, $crow, false);
     if ($idable || $contact->can_view_comment_time($crow, $crow)) {
         $time = $Conf->parseableTime($crow->timeModified, false);
     } else {
         $time = $Conf->unparse_time_obscure($Conf->obscure_time($crow->timeModified));
     }
     $t .= ' <span class="barsep">·</span> ' . $time;
     if ($idable) {
         $t .= ' <span class="barsep">·</span> <span class="hint">comment by</span> ' . Text::user_html(self::_user($crow));
     }
     $t .= '</small><br /><a class="q" ' . substr($a, 3) . ">" . htmlspecialchars($crow->shortComment);
     if (strlen($crow->shortComment) < strlen($crow->comment)) {
         $t .= "...";
     }
     return $t . "</a></td></tr>";
 }
예제 #6
0
        foreach (array("A", "V", "D") as $k) {
            /* ghetto array_intersect_key */
            if (isset(ListSorter::$score_sorts[$k])) {
                $ss[$k] = ListSorter::$score_sorts[$k];
            }
        }
        echo "<tr><td colspan='3'><div class='g'></div><b>Sort scores by:</b> &nbsp;", Ht::select("scoresort", $ss, $Conf->session("scoresort", "A")), "</td></tr>";
    }
    echo "</table></div></form>";
    echo "</div></div></td></tr>\n";
    // Tab selectors
    echo "<tr><td class='tllx'><table><tr>\n  <td><div class='tll1'><a class='tla' onclick='return crpfocus(\"contactsform\", 1)' href=''>User selection</a></div></td>\n  <td><div class='tll2'><a class='tla' onclick='return crpfocus(\"contactsform\", 2)' href=''>Display options</a></div></td>\n</tr></table></td></tr>\n</table>\n\n";
}
if ($Me->privChair && $_REQUEST["t"] == "pc") {
    $Conf->infoMsg("<p><a href='" . hoturl("profile", "u=new&amp;role=pc") . "' class='button'>Add PC member</a></p><p>Select a PC member’s name to edit their profile or remove them from the PC.</p>");
} else {
    if ($Me->privChair && $_REQUEST["t"] == "all") {
        $Conf->infoMsg("<p><a href='" . hoturl("profile", "u=new") . "' class='button'>Create account</a></p><p>Select a user to edit their profile.  Select " . Ht::img("viewas.png", "[Act as]") . " to view the site as that user would see it.</p>");
    }
}
if (isset($pl->any->sel)) {
    echo Ht::form(hoturl_post("users", ["t" => $_REQUEST["t"]])), "<div>";
    if (isset($_REQUEST["sort"])) {
        echo Ht::hidden("sort", $_REQUEST["sort"]);
    }
}
echo $pl_text;
if (isset($pl->any->sel)) {
    echo "</div></form>";
}
$Conf->footer();
예제 #7
0
 function header($title, $id, $actionBar, $title_div = null)
 {
     global $ConfSitePATH, $Me, $Now, $Opt;
     if ($this->headerPrinted) {
         return;
     }
     // <head>
     if ($title === "Home") {
         $title = "";
     }
     $this->header_head($title);
     // <body>
     $body_class = "";
     if ($id === "paper_view" || $id === "paper_edit" || $id === "review" || $id === "assign") {
         $body_class = "paper";
     }
     echo "<body";
     if ($id) {
         echo ' id="', $id, '"';
     }
     if ($body_class) {
         echo ' class="', $body_class, '"';
     }
     echo ">\n";
     // initial load (JS's timezone offsets are negative of PHP's)
     Ht::stash_script("hotcrp_load.time(" . -date("Z", $Now) / 60 . "," . (get($Opt, "time24hour") ? 1 : 0) . ")");
     // deadlines settings
     if ($Me) {
         Ht::stash_script("hotcrp_deadlines.init(" . json_encode($Me->my_deadlines($this->paper)) . ")");
     }
     if (self::$gDefaultFormat) {
         Ht::stash_script("render_text.set_default_format(" . self::$gDefaultFormat . ")");
     }
     // meeting tracker
     $trackerowner = ($trackerstate = $this->setting_json("tracker")) && $trackerstate->trackerid && $trackerstate->sessionid == session_id();
     if ($trackerowner) {
         Ht::stash_script("hotcrp_deadlines.tracker(0)");
     }
     echo '<div id="prebody"><div id="header">';
     // $header_site
     $is_home = $id === "home";
     $site_div = '<div id="header_site" class="header_site_logo ' . ($is_home ? "header_site_home" : "header_site_page") . '"><h1><a class="qq" href="' . hoturl("index") . '">' . htmlspecialchars($Opt["shortName"]);
     if (!$is_home) {
         $site_div .= ' <span style="font-weight:normal">Home</span>';
     }
     $site_div .= '</a></h1></div>';
     // $header_profile
     $profile_html = "";
     if ($Me && !$Me->is_empty()) {
         // profile link
         $xsep = ' <span class="barsep">·</span> ';
         if ($Me->has_email()) {
             $profile_html .= '<a class="q" href="' . hoturl("profile") . '"><strong>' . htmlspecialchars($Me->email) . '</strong></a> &nbsp; <a href="' . hoturl("profile") . '">Profile</a>' . $xsep;
         }
         // "act as" link
         if (($actas = get($_SESSION, "last_actas")) && get($_SESSION, "trueuser") && ($Me->privChair || Contact::$trueuser_privChair === $Me)) {
             // Link becomes true user if not currently chair.
             if (!$Me->privChair || strcasecmp($Me->email, $actas) == 0) {
                 $actas = $_SESSION["trueuser"]->email;
             }
             if (strcasecmp($Me->email, $actas) != 0) {
                 $profile_html .= "<a href=\"" . selfHref(array("actas" => $actas)) . "\">" . ($Me->privChair ? htmlspecialchars($actas) : "Admin") . "&nbsp;" . Ht::img("viewas.png", "Act as " . htmlspecialchars($actas)) . "</a>" . $xsep;
             }
         }
         // help, sign out
         $x = $id == "search" ? "t={$id}" : ($id == "settings" ? "t=chair" : "");
         $profile_html .= '<a href="' . hoturl("help", $x) . '">Help</a>';
         if (!$Me->has_email() && !isset($Opt["httpAuthLogin"])) {
             $profile_html .= $xsep . '<a href="' . hoturl("index", "signin=1") . '">Sign&nbsp;in</a>';
         }
         if (!$Me->is_empty() || isset($Opt["httpAuthLogin"])) {
             $profile_html .= $xsep . '<a href="' . hoturl_post("index", "signout=1") . '">Sign&nbsp;out</a>';
         }
     }
     if (!$title_div && $title) {
         $title_div = '<div id="header_page"><h1>' . $title . '</h1></div>';
     }
     if (!$title_div && $actionBar) {
         $title_div = '<hr class="c" />';
     }
     $renderf = get($Opt, "headerRenderer");
     if (!$renderf) {
         $renderf = "Conf::echo_header";
     }
     if (is_array($renderf)) {
         require_once $renderf[0];
         $renderf = $renderf[1];
     }
     call_user_func($renderf, $this, $is_home, $site_div, $title_div, $profile_html, $actionBar);
     echo "  <hr class=\"c\" /></div>\n";
     echo "<div id=\"initialmsgs\">\n";
     if (get($Opt, "maintenance")) {
         echo "<div class=\"merror\"><strong>The site is down for maintenance.</strong> ", is_string($Opt["maintenance"]) ? $Opt["maintenance"] : "Please check back later.", "</div>";
     }
     $this->save_messages = false;
     if (($msgs = $this->session("msgs")) && count($msgs)) {
         $this->save_session("msgs", null);
         foreach ($msgs as $m) {
             $this->msg($m[0], $m[1]);
         }
     }
     echo "</div>\n";
     $this->headerPrinted = true;
     echo "</div>\n<div id=\"body\" class=\"body\">\n";
     // If browser owns tracker, send it the script immediately
     if ($trackerowner) {
         $this->echoScript();
     }
     // Callback for version warnings
     if ($Me && $Me->privChair && (!isset($_SESSION["updatecheck"]) || $_SESSION["updatecheck"] + 20 <= $Now) && (!isset($Opt["updatesSite"]) || $Opt["updatesSite"])) {
         $m = defval($Opt, "updatesSite", "//hotcrp.lcdf.org/updates");
         $m .= (strpos($m, "?") === false ? "?" : "&") . "addr=" . urlencode($_SERVER["SERVER_ADDR"]) . "&base=" . urlencode(Navigation::siteurl()) . "&version=" . HOTCRP_VERSION;
         $v = HOTCRP_VERSION;
         if (is_dir("{$ConfSitePATH}/.git")) {
             $args = array();
             exec("export GIT_DIR=" . escapeshellarg($ConfSitePATH) . "/.git; git rev-parse HEAD 2>/dev/null; git merge-base origin/master HEAD 2>/dev/null", $args);
             if (count($args) >= 1) {
                 $m .= "&git-head=" . urlencode($args[0]);
                 $v .= " " . $args[0];
             }
             if (count($args) >= 2) {
                 $m .= "&git-upstream=" . urlencode($args[1]);
                 $v .= " " . $args[1];
             }
         }
         Ht::stash_script("check_version(\"{$m}\",\"{$v}\")");
         $_SESSION["updatecheck"] = $Now;
     }
 }
function reviewLinks($prow, $rrows, $crows, $rrow, $mode, &$allreviewslink)
{
    global $Conf, $Me;
    $conflictType = $Me->view_conflict_type($prow);
    $allow_admin = $Me->allow_administer($prow);
    $any_comments = false;
    $admin = $Me->can_administer($prow);
    $xsep = ' <span class="barsep">·</span> ';
    $nvisible = 0;
    $myrr = null;
    if ($rrows) {
        foreach ($rrows as $rr) {
            if ($Me->can_view_review($prow, $rr, null)) {
                $nvisible++;
            }
            if ($rr->contactId == $Me->contactId || !$myrr && $Me->is_my_review($rr)) {
                $myrr = $rr;
            }
        }
    }
    // comments
    $pret = "";
    if ($crows && count($crows) > 0 && !$rrow && $mode !== "edit") {
        $cids = array();
        $cnames = array();
        $tagger = new Tagger($Me);
        foreach ($crows as $cr) {
            if ($Me->can_view_comment($prow, $cr, null)) {
                if ($Me->can_view_comment_identity($prow, $cr, null)) {
                    $n = Text::abbrevname_html($cr->user());
                } else {
                    $n = "anonymous";
                }
                if ($cr->commentType & COMMENTTYPE_RESPONSE) {
                    $rname = $Conf->resp_round_name($cr->commentRound);
                    $n = $n === "anonymous" ? "" : " ({$n})";
                    if ($cr->commentType & COMMENTTYPE_DRAFT && $rname != "1") {
                        $n = "<i>Draft {$rname} Response</i>{$n}";
                    } else {
                        if ($cr->commentType & COMMENTTYPE_DRAFT) {
                            $n = "<i>Draft Response</i>{$n}";
                        } else {
                            if ($rname != "1") {
                                $n = "<i>{$rname} Response</i>{$n}";
                            } else {
                                $n = "<i>Response</i>{$n}";
                            }
                        }
                    }
                }
                $cids[] = $cid = CommentInfo::unparse_html_id($cr);
                $tclass = "cmtlink";
                if ($cr->commentTags && ($tags = Tagger::strip_nonviewable($cr->commentTags, $Me)) && $Me->can_view_comment_tags($prow, $cr, null) && ($color = TagInfo::color_classes($tags))) {
                    if (TagInfo::classes_have_colors($color)) {
                        $tclass .= " tagcolorspan";
                    }
                    $tclass .= " {$color} taghl";
                }
                $cnames[] = '<a class="' . $tclass . '" href="#' . $cid . '">' . $n . '</a>';
            }
        }
        if (count($cids) > 0) {
            $pret = '<div class="revnotes"><a href="#' . $cids[0] . '"><strong>' . plural(count($cids), "Comment") . '</strong></a>: <span class="nb">' . join(',</span> <span class="nb">', $cnames) . "</span></div>";
            $any_comments = true;
        }
    }
    $t = "";
    // see all reviews
    $allreviewslink = false;
    if (($nvisible > 1 || $nvisible > 0 && !$myrr) && ($mode !== "p" || $rrow)) {
        $allreviewslink = true;
        $x = '<a href="' . hoturl("paper", "p={$prow->paperId}") . '" class="xx">' . Ht::img("view24.png", "[All reviews]", "dlimg") . "&nbsp;<u>All reviews</u></a>";
        $t .= ($t === "" ? "" : $xsep) . $x;
    }
    // edit paper
    if ($mode !== "edit" && $prow->conflictType >= CONFLICT_AUTHOR && !$Me->can_administer($prow)) {
        $x = '<a href="' . hoturl("paper", "p={$prow->paperId}&amp;m=edit") . '" class="xx">' . Ht::img("edit24.png", "[Edit paper]", "dlimg") . "&nbsp;<u><strong>Edit paper</strong></u></a>";
        $t .= ($t === "" ? "" : $xsep) . $x;
    }
    // edit review
    if ($mode === "re" || $mode === "assign" && $t !== "" || !$prow) {
        /* no link */
    } else {
        if ($myrr && $rrow != $myrr) {
            $myrlink = unparseReviewOrdinal($myrr);
            $a = '<a href="' . hoturl("review", "p={$prow->paperId}&r={$myrlink}") . '" class="xx">';
            if ($Me->can_review($prow, $myrr)) {
                $x = $a . Ht::img("review24.png", "[Edit review]", "dlimg") . "&nbsp;<u><b>Edit your review</b></u></a>";
            } else {
                $x = $a . Ht::img("review24.png", "[Your review]", "dlimg") . "&nbsp;<u><b>Your review</b></u></a>";
            }
            $t .= ($t === "" ? "" : $xsep) . $x;
        } else {
            if (!$myrr && !$rrow && $Me->can_review($prow, null)) {
                $x = '<a href="' . hoturl("review", "p={$prow->paperId}&amp;m=re") . '" class="xx">' . Ht::img("review24.png", "[Write review]", "dlimg") . "&nbsp;<u><b>Write review</b></u></a>";
                $t .= ($t === "" ? "" : $xsep) . $x;
            }
        }
    }
    // review assignments
    if ($mode !== "assign" && $mode !== "edit" && $Me->can_request_review($prow, true)) {
        $x = '<a href="' . hoturl("assign", "p={$prow->paperId}") . '" class="xx">' . Ht::img("assign24.png", "[Assign]", "dlimg") . "&nbsp;<u>" . ($admin ? "Assign reviews" : "External reviews") . "</u></a>";
        $t .= ($t === "" ? "" : $xsep) . $x;
    }
    // new comment
    $nocmt = preg_match('/\\A(?:assign|contact|edit|re)\\z/', $mode);
    if (!$allreviewslink && !$nocmt && $Me->can_comment($prow, null)) {
        $x = '<a href="#cnew" onclick="return papercomment.edit_new()" class="xx">' . Ht::img("comment24.png", "[Add comment]", "dlimg") . "&nbsp;<u>Add comment</u></a>";
        $t .= ($t === "" ? "" : $xsep) . $x;
        $any_comments = true;
    }
    // new response
    if (!$nocmt && ($prow->conflictType >= CONFLICT_AUTHOR || $allow_admin) && ($rrounds = $Conf->time_author_respond())) {
        foreach ($rrounds as $i => $rname) {
            $cid = ($i ? $rname : "") . "response";
            $what = "Add";
            if ($crows) {
                foreach ($crows as $cr) {
                    if ($cr->commentType & COMMENTTYPE_RESPONSE && $cr->commentRound == $i) {
                        $what = "Edit";
                        if ($cr->commentType & COMMENTTYPE_DRAFT) {
                            $what = "Edit draft";
                        }
                    }
                }
            }
            $x = '<a href="#' . $cid . '" onclick=\'return papercomment.edit_response(' . json_encode($rname) . ')\' class="xx">' . Ht::img("comment24.png", "[{$what} response]", "dlimg") . "&nbsp;" . ($conflictType >= CONFLICT_AUTHOR ? '<u style="font-weight:bold">' : '<u>') . $what . ($i ? " {$rname}" : "") . ' response</u></a>';
            $t .= ($t === "" ? "" : $xsep) . $x;
            $any_comments = true;
        }
    }
    // override conflict
    if ($allow_admin && !$admin) {
        $x = '<a href="' . selfHref(array("forceShow" => 1)) . '" class="xx">' . Ht::img("override24.png", "[Override]", "dlimg") . "&nbsp;<u>Override conflict</u></a> to show reviewers and allow editing";
        $t .= ($t === "" ? "" : $xsep) . $x;
    } else {
        if ($Me->privChair && !$allow_admin) {
            $x = "You can’t override your conflict because this paper has an administrator.";
            $t .= ($t === "" ? "" : $xsep) . $x;
        }
    }
    if ($any_comments) {
        CommentInfo::echo_script($prow);
    }
    if (($list = SessionList::active()) && ($pret || $t)) {
        return '<div class="has_hotcrp_list" data-hotcrp-list="' . $list->listno . '">' . $pret . $t . '</div>';
    } else {
        return $pret . $t;
    }
}
예제 #9
0
 function reviewFlowEntry($contact, $rrow, $trclass)
 {
     // See also CommentInfo::unparse_flow_entry
     global $Conf;
     $barsep = " <span class='barsep'>·</span> ";
     $a = "<a href='" . hoturl("paper", "p={$rrow->paperId}#r" . unparseReviewOrdinal($rrow)) . "'";
     $t = "<tr class='{$trclass}'><td class='pl_activityicon'>" . $a . ">" . Ht::img("review24.png", "[Review]", "dlimg") . "</a></td><td class='pl_activityid pnum'>" . $a . ">#{$rrow->paperId}</a></td><td class='pl_activitymain'><small>" . $a . " class=\"ptitle\">" . htmlspecialchars($rrow->shortTitle);
     if (strlen($rrow->shortTitle) != strlen($rrow->title)) {
         $t .= "...";
     }
     $t .= "</a>";
     if ($contact->can_view_review_time($rrow, $rrow)) {
         $time = $Conf->parseableTime($rrow->reviewModified, false);
     } else {
         $time = $Conf->unparse_time_obscure($Conf->obscure_time($rrow->reviewModified));
     }
     $t .= $barsep . $time;
     if ($contact->can_view_review_identity($rrow, $rrow, false)) {
         $t .= $barsep . "<span class='hint'>review by</span> " . Text::user_html($rrow->reviewFirstName, $rrow->reviewLastName, $rrow->reviewEmail);
     }
     $t .= "</small><br /><a class='q'" . substr($a, 3) . ">";
     $revViewScore = $contact->view_score_bound($rrow, $rrow);
     if ($rrow->reviewSubmitted) {
         $t .= "Review #" . unparseReviewOrdinal($rrow) . " submitted";
         $xbarsep = $barsep;
     } else {
         $xbarsep = "";
     }
     foreach ($this->forder as $field => $f) {
         if ($f->view_score > $revViewScore && $f->has_options && $rrow->{$field}) {
             $t .= $xbarsep . $f->name_html . "&nbsp;" . $f->unparse_value($rrow->{$field}, ReviewField::VALUE_SC);
             $xbarsep = $barsep;
         }
     }
     return $t . "</a></td></tr>";
 }
예제 #10
0
function showvotetags()
{
    global $Conf, $Me;
    _subhead("", "\n<p>Some conferences have PC members vote for papers.\nEach PC member is assigned a vote allotment, and can distribute that allotment\narbitrarily among unconflicted papers.\nAlternately, each PC member can vote, once, for as many papers as they like (“approval voting”).\nThe PC’s aggregated vote totals might help determine\nwhich papers to discuss.</p>\n\n<p>HotCRP supports voting through the <a href='" . hoturl("help", "t=tags") . "'>tags system</a>.\nThe chair can <a href='" . hoturl("settings", "group=tags") . "'>define a set of voting tags</a> and allotments" . _currentVoteTags() . ".\nPC members vote by assigning the corresponding twiddle tags;\nthe aggregated PC vote is visible in the public tag.</p>\n\n<p>For example, assume that an administrator defines a voting tag\n “" . _singleVoteTag() . "” with an allotment of 10.\nTo use two votes for a paper, a PC member tags the paper as\n“~" . _singleVoteTag() . "#2”. The system\nautomatically adds the tag “" . _singleVoteTag() . "#2” to that\npaper (note the\nlack of the “~”), indicating that the paper has two total votes.\nAs other PC members add their votes with their own “~” tags, the system\nupdates the main tag to reflect the total.\n(The system ensures no PC member exceeds their allotment.) </p>\n\n<p>\nTo see the current voting status, search by\n<a href=\"" . hoturl("search", "q=rorder:" . _singleVoteTag() . "") . "\">\nrorder:" . _singleVoteTag() . "</a>. Use the display options to show tags\nin the search results (or set up a\n<a href='" . hoturl("help", "t=formulas") . "'>formula</a>).\n</p>\n\n<p>\nHover to learn how the PC voted:</p>\n\n<p>" . Ht::img("extagvotehover.png", "[Hovering over a voting tag]", ["width" => 390, "height" => 46]) . "</p>");
}
예제 #11
0
 function footer($ncol, $hascolors)
 {
     global $Conf;
     if ($this->count == 0) {
         return "";
     }
     $t = "  <tfoot class=\"pltable" . ($hascolors ? " pltable_colored" : "") . "\"><tr class=\"pl_footrow\">\n    <td class=\"pl_footselector\">" . Ht::img("_.gif", "^^", "placthook") . "</td>\n  <td class=\"pl_footer\" colspan=\"" . ($ncol - 1) . '">' . '<div id="plact" class="linelinks1">' . '<a name="plact"><b>Select people</b></a> (or <a href="#" onclick="return papersel(true)">select all ' . $this->count . "</a>), then ";
     // Begin linelinks
     $types = array("nameemail" => "Names and emails");
     if ($this->contact->privChair) {
         $types["pcinfo"] = "PC info";
     }
     $nlll = 1;
     $t .= "<span class=\"lll{$nlll}\"><a href=\"#\" onclick=\"return crpfocus('plact',{$nlll})\">Download</a></span><span class=\"lld{$nlll}\"><b>:</b> &nbsp;" . Ht::select("getaction", $types, null, array("id" => "plact{$nlll}_d")) . "&nbsp; " . Ht::submit("getgo", "Go", array("class" => "bsm")) . "</span>";
     $barsep = " <span class='barsep'>·</span> ";
     if ($this->contact->privChair) {
         ++$nlll;
         $t .= $barsep;
         $t .= "<span class=\"lll{$nlll}\"><a href=\"#\" onclick=\"return crpfocus('plact',{$nlll})\">Tag</a></span><span class=\"lld{$nlll}\"><b>:</b> &nbsp;";
         $t .= Ht::select("tagtype", array("a" => "Add", "d" => "Remove", "s" => "Define"), @$_REQUEST["tagtype"]) . ' &nbsp;tag(s) &nbsp;' . Ht::entry("tag", @$_REQUEST["tag"], array("id" => "plact{$nlll}_d", "size" => 15, "onfocus" => "autosub('tagact',this)")) . ' &nbsp;' . Ht::submit("tagact", "Go") . '</span>';
         ++$nlll;
         $t .= $barsep;
         $t .= "<span class=\"lll{$nlll}\"><a href=\"#\" onclick=\"return crpfocus('plact',{$nlll})\">Modify</a></span><span class=\"lld{$nlll}\"><b>:</b> &nbsp;";
         $t .= Ht::select("modifytype", array("disableaccount" => "Disable", "enableaccount" => "Enable", "resetpassword" => "Reset password", "sendaccount" => "Send account information"), null, array("id" => "plact{$nlll}_d")) . "&nbsp; " . Ht::submit("modifygo", "Go", array("class" => "bsm")) . "</span>";
     }
     return $t . "</div></td></tr></tfoot>\n";
 }
예제 #12
0
 function header($title, $id = "", $actionBar = null, $showTitle = true)
 {
     global $ConfSitePATH, $Me, $Now;
     if ($this->headerPrinted) {
         return;
     }
     // <head>
     if ($title === "Home") {
         $title = "";
     }
     $this->header_head($title);
     // <body>
     echo "<body", $id ? " id=\"{$id}\"" : "", " onload=\"hotcrp_load()\">\n";
     // initial load (JS's timezone offsets are negative of PHP's)
     Ht::stash_script("hotcrp_load.time(" . -date("Z", $Now) / 60 . "," . ($this->opt("time24hour") ? 1 : 0) . ")");
     echo "<div id='prebody'>\n";
     echo "<div id='header'>\n<div id='header_left_conf'><h1>";
     if ($title && $showTitle && ($title == "Home" || $title == "Sign in")) {
         echo "<a name='' class='qq' href='", hoturl("index"), "' title='Home'>", htmlspecialchars($this->short_name), "</a>";
     } else {
         echo "<a name='' class='uu' href='", hoturl("index"), "' title='Home'>", htmlspecialchars($this->short_name), "</a></h1></div><div id='header_left_page'><h1>", $title;
     }
     echo "</h1></div><div id='header_right'>";
     if ($Me && !$Me->is_empty()) {
         // profile link
         $profile_parts = [];
         if ($Me->has_email() && !$Me->disabled) {
             $profile_parts[] = '<strong>' . htmlspecialchars($Me->email) . '</strong>';
             /*echo '<a class="q" href="', hoturl("profile"), '"><strong>',
               htmlspecialchars($Me->email),
               '</strong></a> &nbsp; <a href="', hoturl("profile"), '">Profile</a>',
               $xsep;*/
         }
         // "act as" link
         if (($actas = get($_SESSION, "last_actas")) && get($_SESSION, "trueuser") && ($Me->privChair || Contact::$trueuser_privChair === $Me)) {
             // Link becomes true user if not currently chair.
             if (!$Me->privChair || strcasecmp($Me->email, $actas) == 0) {
                 $actas = $_SESSION["trueuser"]->email;
             }
             if (strcasecmp($Me->email, $actas) != 0) {
                 $profile_parts[] = "<a href=\"" . self_href(["actas" => $actas]) . "\">" . ($Me->privChair ? htmlspecialchars($actas) : "Admin") . "&nbsp;" . Ht::img("viewas.png", "Act as " . htmlspecialchars($actas)) . "</a>";
             }
         }
         // help, sign out
         $x = $id == "search" ? "t={$id}" : ($id == "settings" ? "t=chair" : "");
         if (!$Me->has_email() && !isset($this->opt["httpAuthLogin"])) {
             $profile_parts[] = '<a href="' . hoturl("index", "signin=1") . '">Sign&nbsp;in</a>';
         }
         if (!$Me->is_empty() || isset($this->opt["httpAuthLogin"])) {
             $profile_parts[] = '<a href="' . hoturl_post("index", "signout=1") . '">Sign&nbsp;out</a>';
         }
         if (!empty($profile_parts)) {
             echo join(' <span class="barsep">·</span> ', $profile_parts);
         }
     }
     echo '<div id="maindeadline" style="display:none"></div></div>', "\n";
     echo "  <hr class=\"c\" />\n";
     echo $actionBar;
     echo "</div>\n<div id=\"initialmsgs\">\n";
     if ($x = $this->opt("maintenance")) {
         echo "<div class=\"merror\"><strong>The site is down for maintenance.</strong> ", is_string($x) ? $x : "Please check back later.", "</div>";
     }
     $this->save_messages = false;
     if (($msgs = $this->session("msgs")) && count($msgs)) {
         $this->save_session("msgs", null);
         foreach ($msgs as $m) {
             $this->msg($m[0], $m[1]);
         }
         echo "<div id=\"initialmsgspacer\"></div>";
     }
     echo "</div>\n";
     $this->headerPrinted = true;
     echo "</div>\n<div class='body'>\n";
 }
예제 #13
0
 function header($title, $id = "", $actionBar = null, $showTitle = true)
 {
     global $ConfSiteBase, $ConfSiteSuffix, $ConfSitePATH, $Me, $Now, $Opt;
     if ($this->headerPrinted) {
         return;
     }
     // <head>
     $this->header_head($title);
     // <body>
     echo "<body", $id ? " id='{$id}'" : "", " onload='hotcrp_load()'>\n";
     // on load of script.js
     $this->scriptStuff .= "<script>";
     // initial load (JS's timezone offsets are negative of PHP's)
     $this->scriptStuff .= "hotcrp_load.time(" . -date("Z", $Now) / 60 . "," . (@$Opt["time24hour"] ? 1 : 0) . ")";
     $this->scriptStuff .= "</script>";
     echo "<div id='prebody'>\n";
     echo "<div id='header'>\n<div id='header_left_conf'><h1>";
     if ($title && $showTitle && ($title == "Home" || $title == "Sign in")) {
         echo "<a name='' class='qq' href='", hoturl("index"), "' title='Home'>", htmlspecialchars($Opt["shortName"]), "</a>";
     } else {
         echo "<a name='' class='uu' href='", hoturl("index"), "' title='Home'>", htmlspecialchars($Opt["shortName"]), "</a></h1></div><div id='header_left_page'><h1>", $title;
     }
     echo "</h1></div><div id='header_right'>";
     if ($Me && !$Me->is_empty()) {
         // profile link
         $xsep = ' <span class="barsep">&nbsp;|&nbsp;</span> ';
         if ($Me->has_email() && false) {
             echo '<a class="q" href="', hoturl("profile"), '"><strong>', htmlspecialchars($Me->email), '</strong></a> &nbsp; <a href="', hoturl("profile"), '">Profile</a>', $xsep;
         } else {
             if ($Me->has_email()) {
                 echo '<strong>', htmlspecialchars($Me->email), '</strong>', $xsep;
             }
         }
         // "act as" link
         if (($actas = @$_SESSION["last_actas"]) && @$_SESSION["trueuser"]) {
             // Become true user if not currently chair.
             if (!$Me->privChair || strcasecmp($Me->email, $actas) == 0) {
                 $actas = $_SESSION["trueuser"]->email;
             }
             if (strcasecmp($Me->email, $actas) != 0) {
                 echo "<a href=\"", self_href(array("actas" => $actas)), "\">", $Me->privChair ? htmlspecialchars($actas) : "Admin", "&nbsp;", Ht::img("viewas.png", "Act as " . htmlspecialchars($actas)), "</a>", $xsep;
             }
         }
         // help, sign out
         $x = $id == "search" ? "t={$id}" : ($id == "settings" ? "t=chair" : "");
         if (!$Me->has_email() && !isset($Opt["httpAuthLogin"])) {
             echo '<a href="', hoturl("index", "signin=1"), '">Sign&nbsp;in</a>';
         }
         if (!$Me->is_empty() || isset($Opt["httpAuthLogin"])) {
             echo '<a href="', hoturl_post("index", "signout=1"), '">Sign&nbsp;out</a>';
         }
     }
     echo '<div id="maindeadline" style="display:none"></div></div>', "\n";
     echo "  <hr class=\"c\" />\n";
     echo $actionBar;
     echo "</div>\n<div id=\"initialmsgs\">\n";
     if (@$Opt["maintenance"]) {
         echo "<div class=\"merror\"><strong>The site is down for maintenance.</strong> ", is_string($Opt["maintenance"]) ? $Opt["maintenance"] : "Please check back later.", "</div>";
     }
     if (($msgs = $this->session("msgs")) && count($msgs)) {
         foreach ($msgs as $m) {
             echo $m;
         }
         $this->save_session("msgs", null);
         echo "<div id=\"initialmsgspacer\"></div>";
     }
     $this->save_messages = false;
     echo "</div>\n";
     $this->headerPrinted = true;
     echo "</div>\n<div class='body'>\n";
 }