• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_sync.php
  • Класс: CCalendarSync
  • Вызов: CCalendarSync::UpdateUserConnections
static function UpdateUserConnections(): bool
{
	$userId = CCalendar::getCurUserId();
	if (Loader::includeModule('dav'))
	{
		CDavGroupdavClientCalendar::DataSync("user", $userId);

		SyncManagersDataSyncManager::createInstance()->dataSync($userId);

		if (CCalendar::isGoogleApiEnabled() || CCalendar::isOffice365ApiEnabled())
		{
			$manager = new SyncManagersDataExchangeManager(
				FactoriesCollection::createByUserId(
					$userId, [
						GoogleFactory::SERVICE_NAME,
						Office365Factory::SERVICE_NAME,
					]
				)
			);
			$manager->import();
		}

		if (CCalendar::IsExchangeEnabled($userId))
		{
			$error = "";
			CDavExchangeCalendar::DoDataSync($userId, $error);
			echo $error;
		}
	}

	return true;
}