• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/classes/general/timeman.php
  • Класс: _CTimeManCalendarOld
  • Вызов: _CTimeManCalendarOld::Get
public function Get($arParams)
{
	$ID = intval($arParams['ID']);
	$site_id = $arParams['site_id'];

	$calIblock = COption::GetOptionInt('intranet', 'iblock_calendar', null, $site_id);

	$dbRes = CIBlockElement::GetByID($ID);
	if ($arRes = $dbRes->Fetch())
	{
		$calIblockSection = $arRes['IBLOCK_SECTION_ID'];
	}
	else
	{
		return false;
	}

	CModule::IncludeModule('socialnetwork');

	$obCalendar = new CEventCalendar();
	$obCalendar->Init([
		'ownerType' => 'USER',
		'ownerId' => $arRes['CREATED_BY'],
		'bOwner' => true,
		'iblockId' => $calIblock,
		'userIblockId' => $calIblock,
	]);

	$arPermissions = $obCalendar->GetPermissions(
		[
			'setProperties' => true,
		]
	);

	$arEvents = $obCalendar->GetEvents([
		'iblockId' => $calIblock,
		'sectionId' => $calIblockSection,
		'eventId' => $ID,
		'bLoadAll' => true,
		'ownerType' => 'USER',
	]);

	return $arEvents[0];
}