diff --git a/controllers/GlobalController.php b/controllers/GlobalController.php index eea0c4e8..02fc1848 100644 --- a/controllers/GlobalController.php +++ b/controllers/GlobalController.php @@ -88,13 +88,53 @@ public function actionIndex() ]); } + /** + * @return array|mixed calendar selector settings + * @throws \Throwable + */ + private function getSelectorSettings() + { + if (Yii::$app->user->isGuest) { + return []; + } + + return $this->getUserSettings()->getSerialized('lastSelectors', []); + } + + /** + * @return \humhub\modules\content\components\ContentContainerSettingsManager + */ + public function getUserSettings() + { + if (Yii::$app->user->isGuest) { + return null; + } + + /* @var $module \humhub\modules\calendar\Module */ + $module = Yii::$app->getModule('calendar'); + return $module->settings->user(); + } + + /** + * @return array|mixed calendar filter settings + * @throws \Throwable + */ + private function getFilterSettings() + { + if (Yii::$app->user->isGuest) { + return []; + } + + return $this->getUserSettings()->getSerialized('lastFilters', []); + } + public function actionSelect($start = null, $end = null) { /* @var $user User */ $contentContainerSelection = []; $user = Yii::$app->user->getIdentity(); - if ($user->moduleManager->canEnable('calendar')) { + if ($user->moduleManager->isEnabled('calendar') || $user->moduleManager->canEnable('calendar')) { $contentContainerSelection[$user->contentcontainer_id] = Yii::t('CalendarModule.base', 'Profile Calendar'); } @@ -161,46 +201,6 @@ public function actionSelectSubmit($start = null, $end = null) return Yii::$app->runAction('/calendar/entry/edit', $params); } - /** - * @return array|mixed calendar selector settings - * @throws \Throwable - */ - private function getSelectorSettings() - { - if (Yii::$app->user->isGuest) { - return []; - } - - return $this->getUserSettings()->getSerialized('lastSelectors', []); - } - - /** - * @return array|mixed calendar filter settings - * @throws \Throwable - */ - private function getFilterSettings() - { - if (Yii::$app->user->isGuest) { - return []; - } - - return $this->getUserSettings()->getSerialized('lastFilters', []); - } - - /** - * @return \humhub\modules\content\components\ContentContainerSettingsManager - */ - public function getUserSettings() - { - if (Yii::$app->user->isGuest) { - return null; - } - - /* @var $module \humhub\modules\calendar\Module */ - $module = Yii::$app->getModule('calendar'); - return $module->settings->user(); - } - /** * Loads entries within search interval, the given string contains timezone offset. * diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1529cd44..640db8ae 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,6 +6,7 @@ Changelog - Fix #443: Fix email subject on invite/add users - Fix #447: Global calendar header redesign - Enh #440: Extend list of fields for updating of sequence +- Fix #453: Profile Calendar not available when adding an event from the global Calendar when the module is enabled in the profile 1.5.8 (January 19, 2024) ------------------------