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/sync/office365/ |
Upload File : |
<?php namespace Bitrix\Calendar\Sync\Office365; use Bitrix\Calendar\Core\Base\Date; class Helper { public const TYPE = 'office365'; public const ACCOUNT_TYPE = 'office365'; public const SERVER_PATH_V1 = 'https://graph.microsoft.com/v1.0/'; public const SERVER_PATH = self::SERVER_PATH_V1; public const TIME_FORMAT_LONG = 'Y-m-d\TH:i:s.u'; public const NEED_SCOPE = [ 'User.Read', 'Calendars.ReadWrite', 'offline_access' ]; public const DELTA_INTERVAL = [ 'from' => '-1 month', 'to' => '+20 year', ]; public const EVENT_TYPES = [ 'single' => 'singleInstance', 'series' => 'seriesMaster', 'exception' => 'exception', 'occurrence' => 'occurrence', 'deleted' => 'deleted', ]; public const RECURRENCE_TYPES = [ 'daily' => 'daily', 'weekly' => 'weekly', 'absoluteMonthly' => 'absoluteMonthly', 'relativeMonthly' => 'relativeMonthly', 'absoluteYearly' => 'absoluteYearly', 'relativeYearly' => 'relativeYearly', ]; const PUSH_PATH = '/bitrix/tools/calendar/office365push.php'; private static array $deltaInterval; /** * @return Date[] = [ 'from' => Date, 'to' => Date, ] */ public function getDeltaInterval(): array { if (empty(static::$deltaInterval)) { $from = new Date(); $from->getDate()->add(self::DELTA_INTERVAL['from']); $to = new Date(); $to->getDate()->add(self::DELTA_INTERVAL['to']); static::$deltaInterval = [ 'from' => $from, 'to' =>$to ]; } return static::$deltaInterval; } public function isVendorConnection(string $accountType): bool { return $accountType === self::ACCOUNT_TYPE; } }