function my_deadlines($prows = null) { // Return cleaned deadline-relevant settings that this user can see. global $Conf, $Opt, $Now; $dl = (object) array("now" => $Now, "sub" => (object) array(), "rev" => (object) array()); if ($this->privChair) { $dl->is_admin = true; } if ($this->is_author()) { $dl->is_author = true; } $graces = []; // submissions $sub_reg = setting("sub_reg"); $sub_update = setting("sub_update"); $sub_sub = setting("sub_sub"); $dl->sub->open = +setting("sub_open") > 0; $dl->sub->sub = +$sub_sub; if ($dl->sub->open) { $graces[] = [$dl->sub, "sub_grace"]; } if ($sub_reg && $sub_reg != $sub_update) { $dl->sub->reg = $sub_reg; } if ($sub_update && $sub_update != $sub_sub) { $dl->sub->update = $sub_update; } $sb = $Conf->submission_blindness(); if ($sb === Conf::BLIND_ALWAYS) { $dl->sub->blind = true; } else { if ($sb === Conf::BLIND_OPTIONAL) { $dl->sub->blind = "optional"; } else { if ($sb === Conf::BLIND_UNTILREVIEW) { $dl->sub->blind = "until-review"; } } } // responses if (+setting("resp_active") > 0) { $dlresps = []; foreach ($Conf->resp_round_list() as $i => $rname) { $isuf = $i ? "_{$i}" : ""; $dlresps[$rname] = $dlresp = (object) ["open" => +setting("resp_open{$isuf}"), "done" => +setting("resp_done{$isuf}")]; if ($dlresp->open) { $graces[] = [$dlresp, "resp_grace{$isuf}"]; } } if (count($dlresps)) { $dl->resps = $dlresps; } } // final copy deadlines if (+setting("final_open") > 0) { $dl->final = (object) array("open" => true); $final_soft = +setting("final_soft"); if ($final_soft > $Now) { $dl->final->done = $final_soft; } else { $dl->final->done = +setting("final_done"); $dl->final->ishard = true; } $graces[] = [$dl->final, "final_grace"]; } // reviewer deadlines $revtypes = array(); if ($this->is_reviewer() && ($rev_open = +setting("rev_open")) > 0 && $rev_open <= $Now) { $dl->rev->open = true; } if (get($dl->rev, "open")) { $dl->revs = []; $k = $this->isPC ? "pcrev" : "extrev"; foreach ($Conf->defined_round_list() as $i => $round_name) { $isuf = $i ? "_{$i}" : ""; $s = +setting("{$k}_soft{$isuf}"); $h = +setting("{$k}_hard{$isuf}"); $dl->revs[$round_name] = $dlround = (object) ["open" => true]; if ($h && ($h < $Now || $s < $Now)) { $dlround->done = $h; $dlround->ishard = true; } else { if ($s) { $dlround->done = $s; } } } // blindness $rb = $Conf->review_blindness(); if ($rb === Conf::BLIND_ALWAYS) { $dl->rev->blind = true; } else { if ($rb === Conf::BLIND_OPTIONAL) { $dl->rev->blind = "optional"; } } } // grace periods: give a minute's notice of an impending grace // period foreach ($graces as $g) { if ($grace = setting($g[1])) { foreach (array("reg", "update", "sub", "done") as $k) { if (get($g[0], $k) && $g[0]->{$k} + 60 < $Now && $g[0]->{$k} + $grace >= $Now) { $kgrace = "{$k}_ingrace"; $g[0]->{$kgrace} = true; } } } } // add meeting tracker if (($this->isPC || $this->tracker_kiosk_state) && $this->can_view_tracker()) { $tracker = MeetingTracker::lookup(); if ($tracker->trackerid && ($tinfo = MeetingTracker::info_for($this))) { $dl->tracker = $tinfo; $dl->tracker_status = MeetingTracker::tracker_status($tracker); if (get($Opt, "trackerHidden")) { $dl->tracker_hidden = true; } $dl->now = microtime(true); } if ($tracker->position_at) { $dl->tracker_status_at = $tracker->position_at; } if (get($Opt, "trackerCometSite")) { $dl->tracker_site = $Opt["trackerCometSite"]; } } // permissions if ($prows) { if (is_object($prows)) { $prows = array($prows); } $dl->perm = array(); foreach ($prows as $prow) { if (!$this->can_view_paper($prow)) { continue; } $perm = $dl->perm[$prow->paperId] = (object) array(); $rights = $this->rights($prow); $admin = $rights->allow_administer; if ($admin) { $perm->allow_administer = true; } if ($rights->act_author) { $perm->act_author = true; } if ($rights->act_author_view) { $perm->act_author_view = true; } if ($this->can_review($prow, null, false)) { $perm->can_review = true; } if ($this->can_comment($prow, null, true)) { $perm->can_comment = true; } else { if ($admin && $this->can_comment($prow, null, false)) { $perm->can_comment = "override"; } } if (get($dl, "resps")) { foreach ($Conf->resp_round_list() as $i => $rname) { $crow = (object) array("commentType" => COMMENTTYPE_RESPONSE, "commentRound" => $i); $v = false; if ($this->can_respond($prow, $crow, true)) { $v = true; } else { if ($admin && $this->can_respond($prow, $crow, false)) { $v = "override"; } } if ($v && !isset($perm->can_respond)) { $perm->can_responds = []; } if ($v) { $perm->can_responds[$rname] = $v; } } } if (self::can_some_author_view_submitted_review($prow)) { $perm->some_author_can_view_review = true; } } } return $dl; }