• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/event_calendar.php
  • Класс: CEventCalendar
  • Вызов: CEventCalendar::GetGuestAccessibility
function GetGuestAccessibility($arParams)
{
	$busy = false;

	if (!$arParams['from'] || !$arParams['to'])
		return $busy;

	$sectionId = $this->GetSectionIDByOwnerId($arParams['userId'], 'USER', $this->userIblockId);
	if ($sectionId)
	{
		$res = $this->GetEvents(array(
			'iblockId' => $this->userIblockId,
			'fromLimit' => $arParams['from'],
			'toLimit' => $arParams['to'],
			'sectionId' => $sectionId,
			'arCalendarIds' => false,
			'ownerType' => 'USER',
			'bNotFree' => true,
			'CREATED_BY' => $arParams['userId']
		));

		for ($i = 0, $l = count($res); $i < $l; $i++)
		{
			//if ($eventId && $res[$i]['HOST'] && $res[$i]['HOST']['parentId'] == $eventId)
			//	continue;
			$a = $res[$i]['ACCESSIBILITY'];
			if ($a == 'busy' || $a == 'absent')
			{
				$busy = $a;
				break;
			}
			$busy = $a;
		}
	}
	return $busy;
}