1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
icalmailmanager.php
См. документацию.
1<?php
2
3
4namespace Bitrix\Mail\Integration\Calendar\ICal;
5
6use Bitrix\Calendar\ICal\IncomingEventManager;
7use Bitrix\Calendar\ICal\MailInvitation\InboxManager;
8use Bitrix\Calendar\ICal\MailInvitation\IncomingInvitationCancelHandler;
9use Bitrix\Calendar\ICal\MailInvitation\IncomingInvitationReplyHandler;
10use Bitrix\Calendar\ICal\MailInvitation\IncomingInvitationRequestHandler;
11use Bitrix\Calendar\ICal\Parser\Calendar;
12use Bitrix\Main\Loader;
13
14Loader::includeModule('calendar');
15
17{
18 public const CONTENT_TYPES = ['application/ics', 'text/calendar'];
19
20 public static function manageRequest($params): void
21 {
22 IncomingEventManager::handleRequest($params);
23 }
24
25 public static function handleReply(Calendar $icalComponent): bool
26 {
28 ->handle()
29 ->isSuccess();
30 }
31
36 public static function parseRequest(string $content): ?Calendar
37 {
39 ->parseContent()
40 ->getComponent();
41 }
42
43 public static function parseFile($fileId)
44 {
46
47 if (!empty($data))
48 {
50 }
51
52 return null;
53 }
54
55 public static function getFileContent($fileId)
56 {
57 $fileArray = \CFile::makeFileArray($fileId);
58 if (!empty($fileArray) && isset($fileArray['tmp_name']))
59 {
60 return \Bitrix\Main\IO\File::getFileContents($fileArray['tmp_name']);
61 }
62
63 return null;
64 }
65
66 public static function hasICalAttachments(array $attachments)
67 {
68 foreach ($attachments as $item)
69 {
70 if (in_array($item['CONTENT-TYPE'], ICalMailManager::CONTENT_TYPES))
71 {
72 return true;
73 }
74 }
75
76 return false;
77 }
78
79 public static function handleRequest(
80 Calendar $icalComponent,
81 int $userId,
82 string $decision,
84 )
85 {
86 $handler = IncomingInvitationRequestHandler::createInstance();
87 $handler->setIcalComponent($icalComponent)
88 ->setUserId($userId)
89 ->setDecision($decision)
90 ->setEmailFrom($message['FIELD_TO'])
91 ->setEmailTo($message['FIELD_FROM'])
92 ->handle()
93 ;
94
95 return $handler->getEventId();
96 }
97
98 public static function handleCancel(Calendar $icalComponent, $userId)
99 {
101 ->handle();
102 }
103}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static createInstance(string $content)
Определения inboxmanager.php:24
static createWithComponent(int $userId, Calendar $icalComponent)
static hasICalAttachments(array $attachments)
Определения icalmailmanager.php:66
static handleRequest(Calendar $icalComponent, int $userId, string $decision, $message)
Определения icalmailmanager.php:79
static parseRequest(string $content)
Определения icalmailmanager.php:36
static handleCancel(Calendar $icalComponent, $userId)
Определения icalmailmanager.php:98
static handleReply(Calendar $icalComponent)
Определения icalmailmanager.php:25
$content
Определения commerceml.php:144
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$message
Определения payment.php:8
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799