Skip to content

Commit

Permalink
Improve punctuation of override-deadline messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Jan 4, 2024
1 parent abeb36a commit 65a4636
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/papertable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2080,9 +2080,8 @@ private function _collect_actions() {
if (!$whyNot) {
$buttons[] = [Ht::submit("update", $save_name, ["class" => "btn-primary btn-savepaper uic js-mark-submit"]), ""];
} else if ($this->admin) {
$revWhyNot = $whyNot->filter(["deadline", "frozen"]);
$x = $revWhyNot->unparse_html() . " Are you sure you want to override the deadline?";
$buttons[] = [Ht::button($save_name, ["class" => "btn-primary btn-savepaper ui js-override-deadlines", "data-override-text" => $x, "data-override-submit" => "update"]), "(admin only)"];
$revWhyNot = $whyNot->filter(["deadline", "frozen"])->set("confirmOverride", true);
$buttons[] = [Ht::button($save_name, ["class" => "btn-primary btn-savepaper ui js-override-deadlines", "data-override-text" => $revWhyNot->unparse_html(), "data-override-submit" => "update"]), "(admin only)"];
} else if (isset($whyNot["frozen"])
&& $auuser->can_finalize_paper($this->prow)) {
$buttons[] = Ht::submit("update", $save_name, ["class" => "btn-savepaper uic js-mark-submit"]);
Expand Down
4 changes: 4 additions & 0 deletions src/permissionproblem.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ function unparse($format = 0) {
&& $format === 5) {
$ms[] = $this->conf->_("<5><a href=\"{searchurl}\">List the {submissions} you can view</a>", new FmtArg("searchurl", $this->conf->hoturl_raw("search", "q="), 0));
}
if (!empty($ms)
&& ($this->_a["confirmOverride"] ?? false)) {
$ms[] = $this->conf->_("<0>Are you sure you want to override the deadline?");
}
$tt = "";
foreach ($ms as $m) {
$t = Ftext::as($format, $m);
Expand Down
4 changes: 2 additions & 2 deletions src/reviewform.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ private function _print_review_actions($prow, $rrow, $user) {
$my_review = !$rrow || $user->is_my_review($rrow);
$pc_deadline = $user->act_pc($prow) || $user->allow_administer($prow);
if (!$this->conf->time_review($rrow ? $rrow->reviewRound : null, $rrow ? $rrow->reviewType : $pc_deadline, true)) {
$whyNot = new PermissionProblem($this->conf, ["deadline" => ($rrow && $rrow->reviewType < REVIEW_PC ? "extrev_hard" : "pcrev_hard")]);
$override_text = $whyNot->unparse_html() . " Are you sure you want to override the deadline?";
$whyNot = new PermissionProblem($this->conf, ["deadline" => ($rrow && $rrow->reviewType < REVIEW_PC ? "extrev_hard" : "pcrev_hard"), "confirmOverride" => true]);
$override_text = $whyNot->unparse_html();
if (!$submitted) {
$buttons[] = [Ht::button("Submit review", ["class" => "btn-primary btn-savereview ui js-override-deadlines", "data-override-text" => $override_text, "data-override-submit" => "submitreview"]), "(admin only)"];
$buttons[] = [Ht::button("Save draft", ["class" => "btn-savereview ui js-override-deadlines", "data-override-text" => $override_text, "data-override-submit" => "savedraft"]), "(admin only)"];
Expand Down

0 comments on commit 65a4636

Please sign in to comment.