Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/calendar/lib/core/managers/ |
Upload File : |
<?php namespace Bitrix\Calendar\Core\Managers; use Bitrix\Calendar\Integration\SocialNetwork\SpaceService; final class Comment { private SpaceService $spaceService; public function __construct() { $this->spaceService = new SpaceService(); } public function onEventCommentAdd(array $data): void { $this->spaceService->addEvent( 'onCalendarEventCommentAdd', $data, ); } public static function onCommentDeleteHandler($event): void { if ($event instanceof \Bitrix\Main\Event) { (new self())->onCommentDelete($event); } } public function onCommentDelete(\Bitrix\Main\Event $calendarEvent): void { // TODO do not use before event getting rework (perms check) return; [$type, $eventId, $messageData] = $calendarEvent->getParameters(); if ($type !== 'EV' || !is_numeric($eventId) || empty($messageData['MESSAGE_ID'])) { return; } $calendarEvent = \CCalendarEvent::GetById($eventId); if (is_array($calendarEvent)) { $this->spaceService->addEvent( 'onCalendarEventCommentDelete', [ 'ID' => (int)$eventId, 'COMMENT_ID' => (int)$messageData['MESSAGE_ID'], 'ATTENDEE_LIST' => $calendarEvent['ATTENDEE_LIST'] ?? null, 'ATTENDEES_CODES' => $calendarEvent['ATTENDEES_CODES'] ?? null, ], ); } } }