Skip to content

Commit

Permalink
Improve display of disabled PC conflicts settings field.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Jan 24, 2024
1 parent c9d0240 commit 3392f28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/options/o_pcconflicts.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ function render(FieldRender $fr, PaperValue $ov) {
function export_setting() {
$sfs = parent::export_setting();
$sfs->exists_if = $this->visible_if ?? "all";
$sfs->exists_disabled = $sfs->exists_disabled
|| strcasecmp($this->visible_if, "NONE") === 0;
return $sfs;
}
}
9 changes: 7 additions & 2 deletions src/settings/s_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,20 @@ private function print_one_option_view(PaperOption $io, SettingValues $sv, $ctr)
echo '<div id="sf/', $ctr, '/view" class="settings-xf-viewbox fn2 ui js-foldup">',
'<div class="settings-xf-viewport"><div class="settings-xf-view">';
if ($disabled) {
$this->pt->msg_at($io->formid, "<0>This field is currently disabled", MessageSet::URGENT_NOTE);
if ($io->id === PaperOption::PCCONFID) {
$this->pt->msg_at($io->formid, "<0>Field disabled for submitters (but accessible to administrators)", MessageSet::URGENT_NOTE);
} else {
$this->pt->msg_at($io->formid, "<0>Field disabled", MessageSet::URGENT_NOTE);
}
} else if (strcasecmp($this->sfs->exists_if, "all") !== 0
&& strcasecmp($this->sfs->exists_if, "phase:final") !== 0) {
$this->pt->msg_at($io->formid, "<0>Present on submissions matching ‘" . $this->sfs->exists_if . "", MessageSet::WARNING_NOTE);
}
if ($io->is_final()) {
$this->pt->msg_at($io->formid, "<0>Present in the final-version phase", MessageSet::WARNING_NOTE);
}
if (strcasecmp($this->sfs->editable_if, "all") === 0) {
if ($disabled
|| strcasecmp($this->sfs->editable_if, "all") === 0) {
// no editable comment
} else if (strcasecmp($this->sfs->editable_if, "none") === 0) {
$this->pt->msg_at($io->formid, "<0>Frozen on all submissions (not editable)", MessageSet::WARNING_NOTE);
Expand Down

0 comments on commit 3392f28

Please sign in to comment.