2namespace Bitrix\Calendar\Controller;
4use Bitrix\Calendar\Core\Event\Event;
5use Bitrix\Calendar\ICal\IcsManager;
6use Bitrix\Calendar\ICal\MailInvitation\AttachmentEditManager;
7use Bitrix\Calendar\ICal\MailInvitation\Helper;
8use Bitrix\Calendar\Public;
9use Bitrix\Calendar\Core\Mappers;
11use Bitrix\Main\Localization\Loc;
12use Bitrix\Main\Engine\ActionFilter;
14Loc::loadMessages(__FILE__);
25 ActionFilter\Authentication::class,
26 ActionFilter\Csrf::class
32 'getIcsFileContent' => [
34 ActionFilter\Authentication::class,
35 ActionFilter\Csrf::class
48 if ($this->event ===
null || !
Public\PublicEvent::isHashValid($this->event,
$hash))
55 $status = $decision ===
'Y' ?
'Y' :
'N';
56 if ($this->event->getMeetingStatus() === $decision)
61 \CCalendarEvent::SetMeetingStatus(
63 'userId' => $this->event->getOwner()->getId(),
64 'eventId' => $this->event->getId(),
66 'personalNotification' =>
true,
76 if (!$this->event || !
Public\PublicEvent::isHashValid($this->event,
$hash))
84 if ($detailLink ===
null)
86 $this->
addError(
new Error(
'Event doesnt have owner or date'));
91 if ($this->event->getMeetingDescription()?->getHideGuests())
93 $this->
event->setAttendeesCollection(
null);
96 $descriptionParams = [
97 'eventUrl' => $detailLink,
101 if (!$attachmentManager->getUid())
103 return IcsManager::getInstance()->getIcsFileContent($this->event, $descriptionParams);
106 return $attachmentManager->getContent();
109 private function getEventArrayForIcs(
array $descriptionParams):
array
111 $parentId = $this->
event->getParentId();
112 $eventArray = (
new Mappers\Event())->convertToArray($this->event);
113 $description = IcsManager::getInstance()->prepareEventDescription($this->event, $descriptionParams);
114 $eventArray[
'DESCRIPTION'] = str_replace(
"\\n",
"\n",
$description);
115 $eventArray[
'ICAL_ORGANIZER'] = Helper::getAttendee($eventArray[
'MEETING_HOST'], $parentId,
false);
116 if (!$this->event->getMeetingDescription()?->getHideGuests())
118 $eventArray[
'ICAL_ATTENDEES'] = Helper::getAttendeesByEventParentId($parentId);
121 $eventArray[
'ICAL_ATTACHES'] = Helper::getMailAttaches(
null, $eventArray[
'MEETING_HOST'], $parentId);
getIcsFileContentAction(int $eventId, string $hash)
handleDecisionAction(int $eventId, string $hash, string $decision)
static getDetailLinkFromEvent(Event $event)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description