3namespace Bitrix\Calendar\Sync\Managers;
5use Bitrix\Main\LoaderException;
6use Bitrix\Main\Localization\Loc;
12use
function ConvertTimeStamp;
16 private const FINISHED_SYNC_NOTIFICATION_DELAY = 60;
30 && !empty($vendorName)
31 &&
Main\Loader::includeModule(
"im")
34 $notificationCallback = fn (?
string $languageId =
null) => Loc::getMessage(
35 'FINISHED_SYNC_NOTIFICATION_' . mb_strtoupper($vendorName),
44 'NOTIFY_MODULE' =>
'calendar',
45 'NOTIFY_TAG' =>
'CALENDAR|SYNC_FINISH|'.
$userId,
46 'NOTIFY_SUB_TAG' =>
'CALENDAR|SYNC_FINISH|'.
$userId,
47 'NOTIFY_MESSAGE' => $notificationCallback
64 && !empty($vendorName)
65 &&
Main\Loader::includeModule(
"im")
68 $notificationCallback = fn (?
string $languageId =
null) => Loc::getMessage(
69 'ROLLBACK_SYNC_NOTIFICATION_' . mb_strtoupper($vendorName),
78 'NOTIFY_MODULE' =>
'calendar',
79 'NOTIFY_TAG' =>
'CALENDAR|SYNC_ROLLBACK|'.
$userId,
80 'NOTIFY_SUB_TAG' =>
'CALENDAR|SYNC_ROLLBACK|'.
$userId,
81 'NOTIFY_MESSAGE' => $notificationCallback
95 '\\Bitrix\\Calendar\\Sync\\Managers\\NotificationManager::sendFinishedSyncNotification('
97 .
"'" . $vendorName .
"'" .
');',
111 '\\Bitrix\\Calendar\\Sync\\Managers\\NotificationManager::sendFinishedSyncNotification('
113 .
"'" . $vendorName .
"'" .
');',
119 ConvertTimeStamp(time() + CTimeZone::GetOffset() + self::FINISHED_SYNC_NOTIFICATION_DELAY,
'FULL')
135 && !empty(Loc::getMessage($messageCode))
136 &&
Main\Loader::includeModule(
"im")
139 $notificationCallback = fn (?
string $languageId =
null) => Loc::getMessage($messageCode, $vars, $languageId);
145 'NOTIFY_MODULE' =>
'calendar',
146 'NOTIFY_TAG' =>
'CALENDAR|SYNC_ROLLBACK|' .
$userId .
'|' . ($vars[
'EVENT_ID'] ?? random_int(1,100)),
147 'NOTIFY_SUB_TAG' =>
'CALENDAR|SYNC_ROLLBACK|'.
$userId,
148 'NOTIFY_MESSAGE' => $notificationCallback
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static addFinishedSyncNotificationAgent(int $userId, string $vendorName)
static sendRollbackSyncNotification(int $userId, string $vendorName)
static clearFinishedSyncNotificationAgent(int $userId, string $vendorName)
static sendFinishedSyncNotification(int $userId, string $vendorName)
static sendBlockChangeNotification(int $userId, $messageCode, $vars)