4namespace Bitrix\Calendar\ICal\MailInvitation;
7use Bitrix\Calendar\ICal\Parser\Calendar;
8use Bitrix\Calendar\ICal\Parser\Dictionary;
9use Bitrix\Main\ArgumentException;
11use Bitrix\Main\IO\File;
12use Bitrix\Main\IO\FileNotFoundException;
13use Bitrix\Main\LoaderException;
14use Bitrix\Main\ObjectPropertyException;
15use Bitrix\Main\SystemException;
28 private $handleStatus =
false;
36 $handler =
new self();
37 $handler->component = $component;
65 $localEvent = Helper::getEventByUId($this->component->getEvent()->getUid());
66 if (!is_null($localEvent))
68 $user = Helper::getUserById((
int)$localEvent[
'OWNER_ID']);
72 && !is_null($attendeeStatus = $this->getAttendeeStatus(
$user[
'EMAIL']))
76 $this->handleStatus =
true;
87 private function getAttendeeStatus(
string $userEmail): ?string
89 $attendees = $this->component->getEvent()->getAttendees();
90 if (is_iterable($attendees))
92 foreach ($attendees as $attendee)
94 if ($attendee->getParameterValueByName(
'email') === $userEmail
95 || $this->getMailTo($attendee->getValue()) === $userEmail)
97 $attendeeStatus = $attendee->getParameterValueByName(
'partstat');
98 if(array_key_exists($attendeeStatus,Dictionary::ATTENDEES_STATUS))
100 return Dictionary::ATTENDEES_STATUS[$attendeeStatus];
115 CCalendarEvent::SetMeetingStatusEx([
116 'attendeeId' =>
$event[
'OWNER_ID'],
117 'eventId' =>
$event[
'ID'],
118 'status' => $attendeeStatus,
119 'personalNotification' =>
$event[
'MEETING_HOST'],
120 'doSendMail' =>
false,
129 return $this->handleStatus;
142 $attachments =
$event->getParameter(
'attachments');
143 if (is_array($attachments))
145 foreach($attachments as $file)
147 if (in_array($file[
'type'], self::CONTENT_TYPES,
true))
151 $fileObject =
new File($file[
'tmp_name'],
$event->getParameter(
'site_id'));
163 if ($icalComponent?->getMethod() === Dictionary::METHOD[
'reply'])
static createInstance(string $content)
static handleFromRequest(Event $event)
sendNotificationGuestReaction(array $event, string $attendeeStatus)
static fromComponent(Calendar $component)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)