3namespace Bitrix\Calendar\Integration\SocialNetwork;
6use Bitrix\Main\LoaderException;
7use Bitrix\Socialnetwork\Internals\EventService\EventDictionary;
8use Bitrix\Socialnetwork\Internals\EventService\Service;
15 'onAfterCalendarEventDelete',
17 'onCalendarEventCommentAdd',
27 !Loader::includeModule(
'socialnetwork')
34 return \Bitrix\Socialnetwork\Space\Service::isAvailable();
39 if (!static::isAvailable())
44 if (!in_array(
$type, self::SUPPORTED_EVENTS,
true))
50 $data[
'RECEPIENTS'] = $this->getRecipientIds(
$data);
51 Service::addEvent($this->mapTaskToSpaceEvent(
$type),
$data);
54 private function mapTaskToSpaceEvent(
string $type): string
70 if (isset(
$data[
'TO_USER_ID']))
72 return [
$data[
'TO_USER_ID']];
75 if (is_array(
$data[
'ATTENDEE_LIST'] ??
null))
77 return $this->getRecipientFromAttendeeList(
$data[
'ATTENDEE_LIST']);
83 private function getRecipientFromAttendeeList(
array $attendeeList):
array
87 foreach ($attendeeList as $attendee)
89 if (!empty($attendee[
'id']))
91 $recipients[] = (int)$attendee[
'id'];
addEvent(string $type, array $data)
const EVENT_SPACE_CALENDAR_EVENT_DEL
const EVENT_SPACE_CALENDAR_COMMON
const EVENT_SPACE_CALENDAR_EVENT_COMMENT_ADD
const EVENT_SPACE_CALENDAR_INVITE
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)