Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sharingajaxhelper.php
1<?php
2
4
8
10{
11 public static function getDeletedSharedEvent(int $entryId): ?array
12 {
13 $result = EventTable::query()
14 ->setSelect(['*'])
15 ->where('DELETED', 'Y')
16 ->where(Query::filter()
17 ->logic('or')
18 ->where([
19 ['ID', $entryId],
20 ['PARENT_ID', $entryId],
21 ])
22 )
23 ->where('OWNER_ID', \CCalendar::GetCurUserId())
24 ->where('EVENT_TYPE', '#shared#')
25 ->exec()
26 ;
27 $event = $result->fetch() ?: null;
28
29 if ($event)
30 {
31 $host = Sharing\Helper::getOwnerInfo((int)$event["MEETING_HOST"]);
32 $event['HOST_NAME'] = $host['name'];
33
34 $event['timestampFromUTC'] = Sharing\Helper::getEventTimestampUTC($event['DATE_FROM'], $event['TZ_FROM']);
35 $event['timestampToUTC'] = Sharing\Helper::getEventTimestampUTC($event['DATE_TO'], $event['TZ_TO']);
36 }
37
38 return $event;
39 }
40
41 public static function getUserTimezoneName(): string
42 {
43 $userId = \CCalendar::GetCurUserId();
44 return \CCalendar::getUserTimezoneName($userId);
45 }
46}