CAllCrmActivity::CreateFromCalendarEvent

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmActivity
  4. CreateFromCalendarEvent
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_activity.php
  • Класс: \CAllCrmActivity
  • Вызов: CAllCrmActivity::CreateFromCalendarEvent
static function CreateFromCalendarEvent(
	$eventID,
	&$arEventFields,
	$checkPerms = true,
	$regEvent = true)
{
	$eventID = (int)$eventID;
	if ($eventID <= 0 && isset($arEventFields['ID']))
	{
		$eventID = (int)$arEventFields['ID'];
	}

	if ($eventID <= 0)
	{
		return false;
	}

	$entityCount = self::GetList(array(), array('=CALENDAR_EVENT_ID' => $eventID), array(), false, false);

	if ($entityCount > 0)
	{
		return false;
	}

	$arFields = array();
	self::SetFromCalendarEvent($eventID, $arEventFields, $arFields);
	if(isset($arFields['BINDINGS']) && count($arFields['BINDINGS']) > 0)
	{
		return self::Add($arFields, $checkPerms, $regEvent);
	}
}

Добавить комментарий