1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
eventanalytics.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Internals\EventManager\EventSubscriber\Event;
4
5use Bitrix\Calendar\Application\Command\CreateEventCommand;
6use Bitrix\Calendar\Core\Event\Tools\Dictionary;
7use Bitrix\Calendar\Event\Event\AfterCalendarEventCreated;
8use Bitrix\Calendar\Internals\EventManager\EventSubscriber\EventSubscriberInterface;
9use Bitrix\Calendar\Internals\EventManager\EventSubscriber\EventSubscriberResponseTrait;
10use Bitrix\Calendar\Internals\Helper\Analytics;
11use Bitrix\Calendar\Util;
12use Bitrix\Main\Event;
13use Bitrix\Main\EventResult;
14
16{
17 use EventSubscriberResponseTrait;
18 use CalendarEventSubscriberTrait;
19
26 public function __invoke(Event $event): EventResult
27 {
28 $calendarEvent = $this->getCalendarEvent($event);
29 if (!$calendarEvent)
30 {
31 return $this->makeUndefinedResponse();
32 }
33
34 if (
35 !in_array(
36 $calendarEvent->getSpecialLabel(),
37 [
38 Dictionary::EVENT_TYPE['collab'],
39 Dictionary::EVENT_TYPE['shared_collab']
40 ],
41 true
42 )
43 )
44 {
45 return $this->makeSuccessResponse();
46 }
47
49 $command = $event->getParameter('command');
50 $collabId = $calendarEvent->getSection()->getOwner()?->getId();
51 $userType = Analytics::USER_TYPES['intranet'];
52 if (Util::isCollabUser(\CCalendar::getCurUserId()))
53 {
54 $userType = Analytics::USER_TYPES['collaber'];
55 }
56
57 Analytics::getInstance()->onEventCreate(
58 section: Analytics::SECTION['collab'],
59 subSection: $command->getAnalyticsSubSection(),
60 userType: $userType,
61 collabId: $collabId,
62 chatId: $command->getAnalyticsChatId(),
63 );
64
65 return $this->makeSuccessResponse();
66 }
67
68 public function getEventClasses(): array
69 {
70 return [
71 AfterCalendarEventCreated::class,
72 ];
73 }
74}
static isCollabUser(int $userId)
Определения util.php:337
Определения event.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$event
Определения prolog_after.php:141