diff --git a/CHANGELOG.md b/CHANGELOG.md index d4a260df9b..3d0c275d1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. ### Added - Show locale date as tooltip for relative date time information - Add popover to counter to show voters by answer + - Add forced display mode to poll configuration ## [8.5.0] - 2025-10-03 ### Fixed diff --git a/lib/Db/Poll.php b/lib/Db/Poll.php index da7df0ae2a..13137f6f32 100644 --- a/lib/Db/Poll.php +++ b/lib/Db/Poll.php @@ -243,6 +243,7 @@ public function getStatusArray(): array { 'countParticipants' => $this->getIsAllowed(self::PERMISSION_POLL_RESULTS_VIEW) ? $this->getParticipantsCount() : 0, 'maxVotes' => $this->getVoteLimit(), 'maxOptionVotes' => $this->getOptionLimit(), + 'forcedViewMode' => $this->getForcedDisplayMode() === 'user-pref' ? null : $this->getForcedDisplayMode(), ]; } public function getConfigurationArray(): array { @@ -257,6 +258,7 @@ public function getConfigurationArray(): array { 'description' => $this->getDescription(), 'expire' => $this->getExpire(), 'forceConfidentialComments' => $this->getForceConfidentialComments(), + 'forcedDisplayMode' => $this->getForcedDisplayMode(), 'hideBookedUp' => boolval($this->getHideBookedUp()), 'maxVotesPerOption' => $this->getOptionLimit(), 'maxVotesPerUser' => $this->getVoteLimit(), @@ -328,6 +330,7 @@ public function deserializeArray(array $pollConfiguration): self { $this->setHideBookedUp($pollConfiguration['hideBookedUp'] ?? $this->getHideBookedUp()); $this->setProposalsExpire($pollConfiguration['proposalsExpire'] ?? $this->getProposalsExpire()); $this->setShowResults($pollConfiguration['showResults'] ?? $this->getShowResults()); + $this->setForcedDisplayMode($pollConfiguration['forcedDisplayMode'] ?? $this->getForcedDisplayMode()); $this->setUseNo($pollConfiguration['useNo'] ?? $this->getUseNo()); $this->setOptionLimit($pollConfiguration['maxVotesPerOption'] ?? $this->getOptionLimit()); $this->setVoteLimit($pollConfiguration['maxVotesPerUser'] ?? $this->getVoteLimit()); @@ -421,6 +424,14 @@ public function getForceConfidentialComments(): bool { return $this->getMiscSettingsArray()['forceConfidentialComments'] ?? false; } + private function setForcedDisplayMode(string $value): void { + $this->setMiscSettingsByKey('forcedDisplayMode', $value); + } + + public function getForcedDisplayMode(): string { + return $this->getMiscSettingsArray()['forcedDisplayMode'] ?? 'user-pref'; + } + private function setCollapseDescription(bool|int $value): void { $this->setMiscSettingsByKey('collapseDescription', (bool)$value); } diff --git a/src/components/Configuration/ConfigForceViewMode.vue b/src/components/Configuration/ConfigForceViewMode.vue new file mode 100644 index 0000000000..b378cb4b5d --- /dev/null +++ b/src/components/Configuration/ConfigForceViewMode.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/src/components/SideBar/SideBarTabConfiguration.vue b/src/components/SideBar/SideBarTabConfiguration.vue index 5fa005110f..fefa4d4cc7 100644 --- a/src/components/SideBar/SideBarTabConfiguration.vue +++ b/src/components/SideBar/SideBarTabConfiguration.vue @@ -14,7 +14,10 @@ import LockedIcon from 'vue-material-design-icons/LockOutline.vue' import UnlockedIcon from 'vue-material-design-icons/LockOpenVariantOutline.vue' import ShowResultsIcon from 'vue-material-design-icons/Monitor.vue' import HideResultsUntilClosedIcon from 'vue-material-design-icons/MonitorLock.vue' +import UserPreferenceIcon from 'vue-material-design-icons/AccountCogOutline.vue' import ShowResultsNeverIcon from 'vue-material-design-icons/MonitorOff.vue' +import ListViewIcon from 'vue-material-design-icons/ViewListOutline.vue' +import TableViewIcon from 'vue-material-design-icons/Table.vue' import CardDiv from '../Base/modules/CardDiv.vue' import ConfigBox from '../Base/modules/ConfigBox.vue' @@ -32,6 +35,7 @@ import ConfigVoteLimit from '../Configuration/ConfigVoteLimit.vue' import { usePollStore } from '../../stores/poll' import { useVotesStore } from '../../stores/votes' import ConfigDangerArea from '../Configuration/ConfigDangerArea.vue' +import ConfigForceViewMode from '../Configuration/ConfigForceViewMode.vue' const pollStore = usePollStore() const votesStore = useVotesStore() @@ -95,6 +99,18 @@ const votesStore = useVotesStore() + + + + +