3namespace Bitrix\Calendar\Sync\Office365;
5use Bitrix\Calendar\Core\Base\BaseException;
6use Bitrix\Calendar\Sync\Exceptions\ApiException;
7use Bitrix\Calendar\Sync\Exceptions\AuthException;
8use Bitrix\Calendar\Sync\Exceptions\ConflictException;
9use Bitrix\Calendar\Sync\Exceptions\GoneException;
10use Bitrix\Calendar\Sync\Exceptions\NotFoundException;
11use Bitrix\Calendar\Sync\Exceptions\RemoteAccountException;
12use Bitrix\Calendar\Sync\Internals\HasContextTrait;
13use Bitrix\Calendar\Sync\Office365\Dto\DateTimeDto;
14use Bitrix\Calendar\Sync\Office365\Dto\EventDto;
15use Bitrix\Calendar\Sync\Office365\Dto\SectionDto;
16use Bitrix\Calendar\Sync\Connection\SectionConnection;
17use Bitrix\Main\ArgumentException;
18use Bitrix\Main\ArgumentNullException;
19use Bitrix\Main\LoaderException;
42 $this->apiService =
$context->getApiService();
60 return array_map(
function ($row){
81 return array_map(
function ($row){
102 return array_map(
function ($row){
121 $newSection = $this->apiService->createSection($sectionDto);
140 $newSection = $this->apiService->updateSection($sectionDto);
160 if ($newEvent = $this->apiService->createEvent($dto, $sectionId))
182 foreach ($this->apiService->getCalendarDelta($sectionLink) as $batch)
185 foreach ($batch as $item) {
186 if (!empty($item[
'@removed']))
188 $events[$item[
'id']][Helper::EVENT_TYPES[
'deleted']] =
new EventDto($item);
190 elseif ($item[
'type'] === Helper::EVENT_TYPES[
'single'])
192 $events[$item[
'id']][$item[
'type']] =
new EventDto($item);
194 elseif ($item[
'type'] === Helper::EVENT_TYPES[
'series'])
196 $events[$item[
'id']][$item[
'type']] =
new EventDto($item);
198 elseif ($item[
'type'] === Helper::EVENT_TYPES[
'exception'])
200 $events[$item[
'seriesMasterId']][Helper::EVENT_TYPES[
'exception']][$item[
'id']] =
new EventDto($item);
201 $events[$item[
'seriesMasterId']][Helper::EVENT_TYPES[
'occurrence']][] =
new DateTimeDto($item[
'start']);
203 elseif ($item[
'type'] === Helper::EVENT_TYPES[
'occurrence'])
205 $events[$item[
'seriesMasterId']][Helper::EVENT_TYPES[
'occurrence']][] =
new DateTimeDto($item[
'start']);
208 foreach ($events as $id => $eventDelta)
210 yield $id => $eventDelta;
230 if (
$event = $this->apiService->updateEvent($eventDto, $vendorEventId))
256 return array_map(
function ($row){
278 $this->apiService->deleteEvent($vendorEventId);
295 $this->apiService->deleteSection($dto->id);
313 $result = $this->apiService->addSectionSubscription(
340 return $this->apiService->renewSectionSubscription($subscribeId);
356 return $this->apiService->deleteSectionSubscription($subscribeId);
365 return 'BX_OFFICE_SC_' . $link->
getConnection()->getOwner()->getId() .
'_' . md5($link->
getId() . time());
if(empty( $fields)) foreach($fields as $field) $channelId
updateEvent(string $vendorEventId, EventDto $eventDto)
getCalendarDelta(SectionConnection $sectionLink)
getSections(array $params=[])
createSection(SectionDto $sectionDto)
deleteEvent(string $vendorEventId)
updateSection(SectionDto $sectionDto)
__construct(Office365Context $context)
createEvent(EventDto $dto, string $sectionId)
subscribeSection(SectionConnection $link)
resubscribe(string $subscribeId)
unsubscribe(string $subscribeId)
deleteSection(SectionDto $dto)
getEventInstances(array $params)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']