From 73b22c3c4c9b663085eeb273e81765453b6213bc Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 16 Sep 2026 21:08:39 +0200 Subject: [PATCH] fix: horde/kronolith#78 selected resource calenders were not stored as preference --- lib/CalendarsManager.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/CalendarsManager.php b/lib/CalendarsManager.php index f737c095..393f6c8c 100644 --- a/lib/CalendarsManager.php +++ b/lib/CalendarsManager.php @@ -1,7 +1,7 @@ kronolithConfig = $GLOBALS['injector']->get(KronolithConfig::class); + $emptyUser = false; if (empty($user)) { + // TODO: Use the modern session accessors instead of legacy Horde_Registry $user = $GLOBALS['registry']->getAuth(); $emptyUser = true; } @@ -290,7 +297,7 @@ protected function _checkDisplayCals() 'display_external_cals' => 'displayExternal', 'holiday_drivers' => 'displayHolidaysInternal']; - if (!empty($GLOBALS['conf']['resource']['driver'])) { + if (!empty($this->kronolithConfig->get('resources.enabled'))) { $display_prefs['display_resource_cals'] = 'displayResource'; } @@ -305,7 +312,7 @@ protected function _checkDisplayCals() // Run through getDisplayExternal to trim any that no longer exist. $this->_getDisplayExternal(); - if (empty($conf['holidays']['enable'])) { + if (empty($this->kronolithConfig->get('holidays.enable'))) { $this->_displayHolidays = []; $this->_displayHolidaysInternal = []; } @@ -608,7 +615,7 @@ protected function _getDisplayHolidays() protected function _getAllResource() { $this->_allResource = []; - if (!empty($GLOBALS['conf']['resources']['enabled'])) { + if (!empty($this->kronolithConfig->get('resources.enabled'))) { foreach (Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, ['isgroup' => 0]) as $resource) { $rcal = new Kronolith_Calendar_Resource([ 'resource' => $resource,