• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/event_calendar.php
  • Класс: CEventCalendar
  • Вызов: CEventCalendar::DeleteCalendar
function DeleteCalendar($ID, $arEvIds = false)
{
	global $DB;
	if (!$this->CheckPermissionForEvent(array(), true))
		return CEventCalendar::ThrowError('EC_ACCESS_DENIED');
	@set_time_limit(0);

	// Exchange
	if (CEventCalendar::IsExchangeEnabled() && $this->ownerType == 'USER')
	{
		$calendarXmlId = CECCalendar::GetExchangeXmlId($this->iblockId, $ID);
		if ($calendarXmlId <> '' && $calendarXmlId !== 0)
		{
			$exchRes = CDavExchangeCalendar::DoDeleteCalendar($this->ownerId, $calendarXmlId);
			if ($exchRes !== true)
				return CEventCalendar::CollectExchangeErros($exchRes);
		}
	}

	$DB->StartTransaction();
	if(!CIBlockSection::Delete($ID))
	{
		$DB->Rollback();
		return false;
	}
	$DB->Commit();
	return true;
}