From c070b18b1be656894762fb8fad3da34310b0eab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 12 Jan 2022 13:43:50 +0100 Subject: [PATCH] Add app config to toggle the default calendar setting as an admin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/ConfigService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index d7bae6390..2250dbf92 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -102,7 +102,8 @@ public function isCalendarEnabled(int $boardId = null): bool { return false; } - $defaultState = (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'calendar', true); + $appConfigState = $this->config->getAppValue(Application::APP_ID, 'calendar', 'yes') === 'yes'; + $defaultState = (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'calendar', $appConfigState); if ($boardId === null) { return $defaultState; }