1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
util.php
См. документацию.
1<?php
2namespace Bitrix\Calendar;
3
4use Bitrix\Calendar\Core\Event\Tools\Dictionary;
5use Bitrix\Calendar\Integration\Pull\PushCommand;
6use Bitrix\Calendar\Integration\Pull\PushService;
7use Bitrix\Calendar\Sync\Util\MsTimezoneConverter;
8use Bitrix\Extranet\Service\ServiceContainer;
9use Bitrix\Main;
10use Bitrix\Main\Application;
11use Bitrix\Main\Loader;
12use Bitrix\Main\LoaderException;
13use Bitrix\Main\Localization\LanguageTable;
14use Bitrix\Main\Localization\Loc;
15use Bitrix\Main\Text\Emoji;
16use Bitrix\Main\Type\Date;
17use Bitrix\Main\Type\DateTime;
18use COption;
19
20class Util
21{
22 public const USER_SELECTOR_CONTEXT = "CALENDAR";
23 public const USER_FIELD_ENTITY_ID = 'CALENDAR_EVENT';
25 public const DATETIME_PHP_FORMAT = 'Y-m-d H:i:sP';
26 public const VERSION_DIFFERENCE = 1;
27 public const DEFAULT_TIMEZONE = "UTC";
28
29 private static $requestUid = '';
30 private static $userAccessCodes = [];
31 private static $pathCache = [];
32 private static $isRussian = null;
33
39 public static function isManagerForUser($managerId, $userId): bool
40 {
41 return in_array('IU'.$userId, self::getUserAccessCodes($managerId));
42 }
43
49 public static function isSectionStructureConverted(): bool
50 {
51 return \Bitrix\Main\Config\Option::get('calendar', 'sectionStructureConverted', 'N') === 'Y';
52 }
53
60 public static function getTimestamp($date, $round = true, $getTime = true)
61 {
62 $timestamp = MakeTimeStamp($date, \CSite::getDateFormat($getTime ? "FULL" : "SHORT"));
63
64 return $round ? (round($timestamp / 60) * 60) : $timestamp;
65 }
66
71 public static function isTimezoneValid(?string $timeZone): bool
72 {
73 return (!is_null($timeZone) && $timeZone !== 'false' && in_array($timeZone, timezone_identifiers_list(), true));
74 }
75
80 public static function prepareTimezone(?string $tz = null): \DateTimeZone
81 {
82 if (!$tz)
83 {
84 return new \DateTimeZone(self::DEFAULT_TIMEZONE);
85 }
86
87 if (self::isTimezoneValid($tz))
88 {
89 return new \DateTimeZone($tz);
90 }
91
93 {
94 return new \DateTimeZone($timezones[0]);
95 }
96
97 return new \DateTimeZone(self::getServerTimezoneName());
98 }
99
107 public static function getDateObject(string $date = null, ?bool $fullDay = true, ?string $tz = 'UTC'): Date
108 {
109 $preparedDate = $date;
110 if ($date)
111 {
112 $timestamp = \CCalendar::Timestamp($date, false, !$fullDay);
113 $preparedDate = \CCalendar::Date($timestamp, !$fullDay);
114 }
115
116 return $fullDay
117 ? new Date($preparedDate, Date::convertFormatToPhp(FORMAT_DATE))
118 : new DateTime($preparedDate, Date::convertFormatToPhp(FORMAT_DATETIME), Util::prepareTimezone($tz));
119 }
120
124 public static function getUserSelectorContext(): string
125 {
126 return self::USER_SELECTOR_CONTEXT;
127 }
128
129 public static function checkRuZone(): bool
130 {
131 if (!is_null(self::$isRussian))
132 {
133 return self::$isRussian;
134 }
135
137 {
138 self::$isRussian = (\CBitrix24::getPortalZone() === 'ru');
139 }
140 else
141 {
142 $iterator = LanguageTable::getList([
143 'select' => ['ID'],
144 'filter' => ['=ID' => 'ru', '=ACTIVE' => 'Y']
145 ]);
146
147 $row = $iterator->fetch();
148 if (empty($row))
149 {
150 self::$isRussian = false;
151 }
152 else
153 {
154 $iterator = LanguageTable::getList([
155 'select' => ['ID'],
156 'filter' => ['@ID' => ['ua', 'by', 'kz'], '=ACTIVE' => 'Y'],
157 'limit' => 1
158 ]);
159 $row = $iterator->fetch();
160 self::$isRussian = empty($row);
161 }
162 }
163
164 return self::$isRussian;
165 }
166
167 public static function convertEntitiesToCodes($entityList = [])
168 {
169 $codeList = [];
170 if (is_array($entityList))
171 {
172 foreach($entityList as $entity)
173 {
174 if ($entity['entityId'] === 'meta-user' && $entity['id'] === 'all-users')
175 {
176 $codeList[] = 'UA';
177 }
178 elseif ($entity['entityId'] === 'user')
179 {
180 $codeList[] = 'U'.$entity['id'];
181 }
182 elseif ($entity['entityId'] === 'project' || $entity['entityId'] === 'project-roles')
183 {
184 $codeList[] = 'SG'.$entity['id'];
185 }
186 elseif ($entity['entityId'] === 'department')
187 {
188 $codeList[] = 'DR'.$entity['id'];
189 }
190 }
191 }
192 return $codeList;
193 }
194
195 public static function convertCodesToEntities($codeList = [])
196 {
197 $entityList = [];
198 if (is_array($codeList))
199 {
200 foreach($codeList as $code)
201 {
202 if ($code === 'UA')
203 {
204 $entityList[] = [
205 'entityId' => 'meta-user',
206 'id' => 'all-users'
207 ];
208 }
209 elseif (mb_substr($code, 0, 1) == 'U')
210 {
211 $entityList[] = [
212 'entityId' => 'user',
213 'id' => intval(mb_substr($code, 1))
214 ];
215 }
216 if (mb_substr($code, 0, 2) == 'DR')
217 {
218 $entityList[] = [
219 'entityId' => 'department',
220 'id' => intval(mb_substr($code, 2))
221 ];
222 }
223 elseif (preg_match('/^SG([0-9]+)_?([AEKMO])?$/', $code, $match) && isset($match[2]))
224 {
225 // todo May need to be removed/rewrite after creating new roles in projects.
226 $entityList[] = [
227 'entityId' => 'project-roles',
228 'id' => mb_substr($code, 2)
229 ];
230 }
231 elseif (mb_substr($code, 0, 2) == 'SG')
232 {
233 $entityList[] = [
234 'entityId' => 'project',
235 'id' => intval(mb_substr($code, 2))
236 ];
237 }
238 }
239 }
240
241 return $entityList;
242 }
243
244 public static function getUsersByEntityList($entityList, $fetchUsers = false)
245 {
246 return \CCalendar::GetDestinationUsers(self::convertEntitiesToCodes($entityList), $fetchUsers);
247 }
248
249
250 public static function getDefaultEntityList($userId, $type, $ownerId)
251 {
252 $entityList = [['entityId' => 'user', 'id' => $userId]];
253 if ($type === 'user' && $ownerId !== $userId)
254 {
255 $entityList[] = ['entityId' => 'user', 'id' => $ownerId];
256 }
257 else if($type === 'group')
258 {
259 $entityList[] = ['entityId' => 'project', 'id' => $ownerId];
260 }
261 return $entityList;
262 }
263
272 public static function getAttendees(array $codeAttendees = null, string $stringWrapper = ''): array
273 {
274 if (empty($codeAttendees))
275 {
276 return [];
277 }
278
279 $userIdList = [];
280 $userList = [];
281
282 foreach ($codeAttendees as $codeAttend)
283 {
284 if (mb_strpos($codeAttend, 'U') === 0)
285 {
286 $userId = (int)(mb_substr($codeAttend, 1));
287 $userIdList[] = $userId;
288 }
289 }
290
291 if (!empty($userIdList))
292 {
294 'filter' => [
295 '=ID' => $userIdList,
296 ],
297 'select' => ['NAME', 'LAST_NAME'],
298 ));
299
300 while ($user = $res->fetch())
301 {
302 $userList[] = addcslashes($stringWrapper . $user['NAME'].' '.$user['LAST_NAME'] . $stringWrapper, "()");
303 }
304 }
305
306 return $userList;
307 }
308
317 public static function isExtranetUser(int $userId): bool
318 {
319 if (Loader::includeModule('intranet'))
320 {
321 $userDb = \Bitrix\Intranet\UserTable::getList([
322 'filter' => [
323 'ID' => $userId,
324 ],
325 'select' => [
326 'USER_TYPE',
327 ]
328 ]);
329
330 $user = $userDb->fetch();
331 return $user['USER_TYPE'] === 'extranet';
332 }
333
334 return false;
335 }
336
337 public static function isCollabUser(int $userId): bool
338 {
339 return Loader::includeModule('extranet')
340 && ServiceContainer::getInstance()->getCollaberService()->isCollaberById($userId);
341 }
342
350 public static function getEventById(int $eventId): ?array
351 {
352 $eventDb = Internals\EventTable::getList([
353 'filter' => [
354 '=ID' => $eventId,
355 ],
356 ]);
357
358 if ($event = $eventDb->fetch())
359 {
360 if (!empty($event['NAME']))
361 {
362 $event['NAME'] = Emoji::decode($event['NAME']);
363 }
364 if (!empty($event['DESCRIPTION']))
365 {
366 $event['DESCRIPTION'] = Emoji::decode($event['DESCRIPTION']);
367 }
368 if (!empty($event['LOCATION']))
369 {
370 $event['LOCATION'] = Emoji::decode($event['LOCATION']);
371 }
372 return $event;
373 }
374
375 return null;
376 }
377
385 public static function addPullEvent(PushCommand $command, int $userId, array $params = []): void
386 {
387 if (!Loader::includeModule("pull"))
388 {
389 return;
390 }
391
392 if (
393 in_array($command->value, [
394 PushCommand::EditEvent->value,
395 PushCommand::DeleteEvent->value,
396 PushCommand::SetMeetingStatus->value,
397 ], true)
398 )
399 {
400 PushService::addEventByTag('calendar-planner-'.$userId, [
401 'module_id' => PushService::MODULE_ID,
402 'command' => $command->value,
403 'params' => $params
404 ]);
405
406 if (isset($params['fields']['CAL_TYPE']) && $params['fields']['CAL_TYPE'] === 'location')
407 {
408 PushService::addEventByTag('calendar-location', [
409 'module_id' => PushService::MODULE_ID,
410 'command' => "{$command->value}_location",
411 'params' => [
412 'fields' => [
413 'DATE_FROM' => $params['fields']['DATE_FROM'],
414 'DATE_TO' => $params['fields']['DATE_TO'],
415 'EXDATE' => $params['fields']['EXDATE'],
416 ],
417 ],
418 ]);
419 }
420 }
421
422 if (
423 isset($params['fields']['SECTION_OWNER_ID'])
424 && (int)$params['fields']['SECTION_OWNER_ID'] !== $userId
425 && in_array($command->value, [
426 PushCommand::EditEvent->value,
427 PushCommand::DeleteEvent->value,
428 PushCommand::SetMeetingStatus->value,
429 ], true)
430 )
431 {
432 PushService::addEvent((int)$params['fields']['SECTION_OWNER_ID'], [
433 'module_id' => PushService::MODULE_ID,
434 'command' => $command->value,
435 'params' => $params,
436 ]);
437 }
438
439 PushService::addEvent($userId, [
440 'module_id' => PushService::MODULE_ID,
441 'command' => $command->value,
442 'params' => $params,
443 ]);
444 }
445
452 public static function initPlannerPullWatches(int $currentUserId, array $userIdList = []): void
453 {
454 if (Loader::includeModule("pull"))
455 {
456 foreach($userIdList as $userId)
457 {
458 if ((int)$userId !== $currentUserId)
459 {
460 \CPullWatch::Add($currentUserId, 'calendar-planner-'.$userId);
461 }
462 }
463 }
464 }
465
466 public static function getUserFieldsByEventId(int $eventId): array
467 {
468 global $DB;
469 $result = [];
470 $strSql = "SELECT * from b_uts_calendar_event WHERE VALUE_ID=" . $eventId;
471 $ufDb = $DB->query($strSql);
472
473 while ($uf = $ufDb->fetch())
474 {
475 $result[] = [
476 'crm' => unserialize($uf['UF_CRM_CAL_EVENT'], ['allowed_classes' => false]),
477 'webdav' => unserialize($uf['UF_WEBDAV_CAL_EVENT'], ['allowed_classes' => false]),
478 ];
479 }
480
481 return $result;
482 }
483
487 public static function getServerTimezoneName(): string
488 {
489 return (new \DateTime())->getTimezone()->getName();
490 }
491
495 public static function getServerOffsetUTC(): int
496 {
497 return (new \DateTime())->getOffset();
498 }
499
506 public static function getTimezoneOffsetFromServer(?string $tz = 'UTC', $date = null): int
507 {
508 if ($date instanceof Date)
509 {
510 $timestamp = $date->format(self::DATETIME_PHP_FORMAT);
511 }
512 elseif ($date === null)
513 {
514 $timestamp = 'now';
515 }
516 else
517 {
518 $timestamp = "@".(int)$date;
519 }
520
521 $date = new \DateTime($timestamp, self::prepareTimezone($tz));
522
523 return $date->getOffset() - self::getServerOffsetUTC();
524 }
525
529 public static function setRequestUid(string $requestUid = ''): void
530 {
531 self::$requestUid = $requestUid;
532 }
533
537 public static function getRequestUid(): string
538 {
539 return self::$requestUid;
540 }
541
546 public static function getUserAccessCodes(int $userId): array
547 {
548 global $USER;
549 $userId = (int)$userId;
550 if (!$userId)
551 {
552 $userId = \CCalendar::GetCurUserId();
553 }
554
555 if (!isset(self::$userAccessCodes[$userId]))
556 {
557 $codes = [];
558 $r = \CAccess::GetUserCodes($userId);
559 while($code = $r->Fetch())
560 {
561 $codes[] = $code['ACCESS_CODE'];
562 }
563
564 if (!in_array('G2', $codes))
565 {
566 $codes[] = 'G2';
567 }
568
569 if (!in_array('AU', $codes) && $USER && (int)$USER->GetId() === $userId)
570 {
571 $codes[] = 'AU';
572 }
573
574 if(!in_array('UA', $codes) && $USER && (int)$USER->GetId() == $userId)
575 {
576 $codes[] = 'UA';
577 }
578
579 self::$userAccessCodes[$userId] = $codes;
580 }
581
582 return self::$userAccessCodes[$userId];
583 }
584
591 public static function getPathToCalendar(?int $ownerId, ?string $type): string
592 {
593 $key = $type . $ownerId;
594 if (!isset(self::$pathCache[$key]) || !is_string(self::$pathCache[$key]))
595 {
596 if ($type === Dictionary::CALENDAR_TYPE['user'] || $type === Dictionary::CALENDAR_TYPE['open_event'])
597 {
598 $path = \COption::GetOptionString(
599 'calendar',
600 'path_to_user_calendar',
601 \COption::getOptionString('socialnetwork', 'user_page', "/company/personal/")
602 . "user/#user_id#/calendar/"
603 );
604 }
605 else if ($type === Dictionary::CALENDAR_TYPE['group'])
606 {
607 $path = \COption::GetOptionString(
608 'calendar',
609 'path_to_group_calendar',
610 \COption::getOptionString('socialnetwork', 'workgroups_page', "/workgroups/")
611 . "group/#group_id#/calendar/"
612 );
613 }
614 else if (in_array($type, ['company', 'company_calendar', 'calendar_company'], true))
615 {
616 $path = '/calendar/';
617 }
618 else
619 {
620 $settings = \CCalendar::GetSettings();
621 $path = $settings['path_to_type_' . $type] ?? null;
622 }
623
624 if (!\COption::GetOptionString('calendar', 'pathes_for_sites', true))
625 {
626 $siteId = \CCalendar::GetSiteId();
627 $pathList = \CCalendar::GetPathes();
628 if (isset($pathList[$siteId]))
629 {
630 if ($type === Dictionary::CALENDAR_TYPE['user'] && !empty($pathList[$siteId]['path_to_user_calendar']))
631 {
632 $path = $pathList[$siteId]['path_to_user_calendar'];
633 }
634 else if ($type === Dictionary::CALENDAR_TYPE['group'] && !empty($pathList[$siteId]['path_to_group_calendar']))
635 {
636 $path = $pathList[$siteId]['path_to_group_calendar'];
637 }
638 else if (!empty($pathList[$siteId]['path_to_type_company_calendar']) && in_array($type, ['company', 'company_calendar', 'calendar_company'], true))
639 {
640 $path = $pathList[$siteId]['path_to_type_company_calendar'];
641 }
642 else if (!empty($pathList[$siteId]['path_to_type_' . $type]))
643 {
644 $path = $pathList[$siteId]['path_to_type_' . $type];
645 }
646 }
647 }
648
649 if (!is_string($path))
650 {
651 $path = '';
652 }
653
654 // substitute user=0 for links to open events
655 if (!empty($path))
656 {
657 if ($ownerId > 0)
658 {
659 if ($type === Dictionary::CALENDAR_TYPE['user'])
660 {
661 $path = str_replace(['#user_id#', '#USER_ID#'], $ownerId, $path);
662 }
663 elseif ($type === Dictionary::CALENDAR_TYPE['group'])
664 {
665 $path = str_replace(['#group_id#', '#GROUP_ID#'], $ownerId, $path);
666 }
667 }
668 elseif ($type === Dictionary::CALENDAR_TYPE['open_event'])
669 {
670 $path = str_replace(['#user_id#', '#USER_ID#'], $ownerId, $path);
671 }
672 }
673
674 self::$pathCache[$key] = $path;
675 }
676
677 return self::$pathCache[$key];
678 }
679
683 public static function getServerName(): string
684 {
685 return COption::getOptionString('main', 'server_name', Application::getInstance()->getContext()->getServer()->getServerName());
686 }
687
693 public static function secondsToDayHoursMinutes(int $second): array
694 {
695 $day = $second / 24 / 3600;
696 $hours = $second / 3600 - (int)$day * 24;
697 $min = $second / 60 - (int)$day * 24 * 60 - (int)$hours * 60;
698
699 return [
700 'days' => (int)$day,
701 'hours' => (int)$hours,
702 'minutes' => (int)$min
703 ];
704 }
705
711 public static function minutesToDayHoursMinutes(int $minutes): array
712 {
713 $day = $minutes / 24 / 60;
714 $hours = $minutes / 60 - (int)$day * 24;
715 $min = $minutes - (int)$day * 24 * 60 - (int)$hours * 60;
716
717 return [
718 'days' => (int)$day,
719 'hours' => (int)$hours,
720 'minutes' => (int)$min
721 ];
722 }
723
724 public static function getDateTimestamp(?string $dateFrom, ?string $timezone): ?int
725 {
726 if (!$dateFrom || !$timezone)
727 {
728 return null;
729 }
730
731 $date = new \Bitrix\Calendar\Core\Base\Date(
733 $dateFrom,
734 false,
735 $timezone
736 )
737 );
738
739 return $date->getTimestamp();
740 }
741
742 public static function formatDateTimeTimestamp(int $timestamp, string $timezoneName): string
743 {
744 $timezone = new \DateTimeZone($timezoneName);
745 $dateTimeFormat = Date::convertFormatToPhp(FORMAT_DATETIME);
746
747 return (new \DateTime('now', $timezone))
748 ->setTimestamp($timestamp)
749 ->format($dateTimeFormat)
750 ;
751 }
752
753 public static function formatDateTimeTimestampUTC(int $timestamp): string
754 {
755 $dateTimeFormat = Date::convertFormatToPhp(FORMAT_DATETIME);
756
757 return gmdate($dateTimeFormat, $timestamp);
758 }
759
760 public static function formatDateTimestampUTC(int $timestamp): string
761 {
762 $dateFormat = Date::convertFormatToPhp(FORMAT_DATE);
763
764 return gmdate($dateFormat, $timestamp);
765 }
766
767 public static function getTimezoneOffsetUTC(string $timezoneName): int
768 {
769 $utc = new \DateTimeZone('UTC');
770
771 return (new \DateTimeZone($timezoneName))->getOffset(new \DateTime('now', $utc));
772 }
773
774 public static function getDateTimestampUtc(DateTime $date, ?string $eventTimezone = null): int
775 {
776 $dateTimezone = $date->getTimeZone()->getName();
777 $dateTimestampUTC = $date->getTimestamp() + \CCalendar::GetTimezoneOffset($dateTimezone);
778 $eventOffsetUTC = \CCalendar::GetTimezoneOffset($eventTimezone);
779
780 return $dateTimestampUTC - $eventOffsetUTC;
781 }
782
783 public static function formatEventDateTime(DateTime $dateTime): string
784 {
785 $culture = Main\Application::getInstance()->getContext()->getCulture();
786 $dayMonthFormat = Main\Type\Date::convertFormatToPhp($culture->getDateFormat());
787 $timeFormat = $culture->get('SHORT_TIME_FORMAT');
788
789 $eventDate = FormatDate($dayMonthFormat, $dateTime->getTimestamp());
790 $eventTime = FormatDate($timeFormat, $dateTime->getTimestamp());
791
792 return "$eventDate $eventTime";
793 }
794
795 public static function getTimezoneHint(int $userId, array $event): string
796 {
797 $skipTime = $event['DT_SKIP_TIME'] === "Y";
798 $timezoneHint = '';
799 if (
800 !$skipTime
801 && (
802 (int)$event['~USER_OFFSET_FROM'] !== 0
803 || (int)$event['~USER_OFFSET_TO'] !== 0
804 || $event['TZ_FROM'] !== $event['TZ_TO']
805 || $event['TZ_FROM'] !== \CCalendar::GetUserTimezoneName($userId)
806 )
807 )
808 {
809 if ($event['TZ_FROM'] === $event['TZ_TO'])
810 {
811 $timezoneHint = \CCalendar::GetFromToHtml(
812 \CCalendar::Timestamp($event['DATE_FROM']),
813 \CCalendar::Timestamp($event['DATE_TO']),
814 false,
815 $event['DT_LENGTH']
816 );
817 if ($event['TZ_FROM'])
818 {
819 $timezoneHint .= ' (' . $event['TZ_FROM'] . ')';
820 }
821 }
822 else
823 {
824 $timezoneHint = Loc::getMessage('EC_VIEW_DATE_FROM_TO', array('#DATE_FROM#' => $event['DATE_FROM'].' ('.$event['TZ_FROM'].')', '#DATE_TO#' => $event['DATE_TO'].' ('.$event['TZ_TO'].')'));
825 }
826 }
827
828 return $timezoneHint;
829 }
830
831 public static function formatEventDate(DateTime $dateTime): string
832 {
833 $culture = Main\Application::getInstance()->getContext()->getCulture();
834 $dayMonthFormat = Main\Type\Date::convertFormatToPhp($culture->getDateFormat());
835
836 return FormatDate($dayMonthFormat, $dateTime->getTimestamp());
837 }
838
839 public static function doIntervalsIntersect($from1, $to1, $from2, $to2): bool
840 {
841 return self::oneIntervalIntersectsAnother($from1, $to1, $from2, $to2)
842 || self::oneIntervalIntersectsAnother($from2, $to2, $from1, $to1);
843 }
844
845 public static function oneIntervalIntersectsAnother($from1, $to1, $from2, $to2): bool
846 {
847 $startsInside = $from2 <= $from1 && $from1 < $to2;
848 $endsInside = $from2 < $to1 && $to1 <= $to2;
849 $startsBeforeEndsAfter = $from1 <= $from2 && $to1 >= $to2;
850
851 return $startsInside || $endsInside || $startsBeforeEndsAfter;
852 }
853}
$path
Определения access_edit.php:21
$type
Определения options.php:106
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static getValidateTimezones(string $msTimezone)
Определения mstimezoneconverter.php:1987
Определения util.php:21
const VERSION_DIFFERENCE
Определения util.php:26
static isExtranetUser(int $userId)
Определения util.php:317
static oneIntervalIntersectsAnother($from1, $to1, $from2, $to2)
Определения util.php:845
static isSectionStructureConverted()
Определения util.php:49
static getDefaultEntityList($userId, $type, $ownerId)
Определения util.php:250
static minutesToDayHoursMinutes(int $minutes)
Определения util.php:711
static getTimezoneOffsetFromServer(?string $tz='UTC', $date=null)
Определения util.php:506
static getTimezoneHint(int $userId, array $event)
Определения util.php:795
const DEFAULT_TIMEZONE
Определения util.php:27
static formatEventDateTime(DateTime $dateTime)
Определения util.php:783
static getTimezoneOffsetUTC(string $timezoneName)
Определения util.php:767
static getUserSelectorContext()
Определения util.php:124
const USER_SELECTOR_CONTEXT
Определения util.php:22
static getAttendees(array $codeAttendees=null, string $stringWrapper='')
Определения util.php:272
static addPullEvent(PushCommand $command, int $userId, array $params=[])
Определения util.php:385
static prepareTimezone(?string $tz=null)
Определения util.php:80
static getEventById(int $eventId)
Определения util.php:350
const DATETIME_PHP_FORMAT
Определения util.php:25
static getServerTimezoneName()
Определения util.php:487
static checkRuZone()
Определения util.php:129
static doIntervalsIntersect($from1, $to1, $from2, $to2)
Определения util.php:839
static isTimezoneValid(?string $timeZone)
Определения util.php:71
static getUsersByEntityList($entityList, $fetchUsers=false)
Определения util.php:244
static getPathToCalendar(?int $ownerId, ?string $type)
Определения util.php:591
static formatDateTimestampUTC(int $timestamp)
Определения util.php:760
static getUserAccessCodes(int $userId)
Определения util.php:546
static getUserFieldsByEventId(int $eventId)
Определения util.php:466
static formatEventDate(DateTime $dateTime)
Определения util.php:831
static getDateObject(string $date=null, ?bool $fullDay=true, ?string $tz='UTC')
Определения util.php:107
static getRequestUid()
Определения util.php:537
static convertEntitiesToCodes($entityList=[])
Определения util.php:167
static secondsToDayHoursMinutes(int $second)
Определения util.php:693
static formatDateTimeTimestampUTC(int $timestamp)
Определения util.php:753
static convertCodesToEntities($codeList=[])
Определения util.php:195
static getDateTimestamp(?string $dateFrom, ?string $timezone)
Определения util.php:724
static isCollabUser(int $userId)
Определения util.php:337
static getServerName()
Определения util.php:683
static initPlannerPullWatches(int $currentUserId, array $userIdList=[])
Определения util.php:452
static isManagerForUser($managerId, $userId)
Определения util.php:39
const USER_FIELD_ENTITY_ID
Определения util.php:23
static setRequestUid(string $requestUid='')
Определения util.php:529
static formatDateTimeTimestamp(int $timestamp, string $timezoneName)
Определения util.php:742
static getServerOffsetUTC()
Определения util.php:495
static getTimestamp($date, $round=true, $getTime=true)
Определения util.php:60
const LIMIT_NUMBER_BANNER_IMPRESSIONS
Определения util.php:24
static getDateTimestampUtc(DateTime $date, ?string $eventTimezone=null)
Определения util.php:774
static getInstance()
Определения application.php:98
static isModuleInstalled($moduleName)
Определения modulemanager.php:125
static getList(array $parameters=array())
Определения datamanager.php:431
Определения date.php:9
getTimestamp()
Определения date.php:218
static convertFormatToPhp($format)
Определения date.php:309
getTimeZone()
Определения datetime.php:106
$hours
Определения cron_html_pages.php:15
$userList
Определения discount_coupon_list.php:276
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$result
Определения get_property_values.php:14
$entity
global $DB
Определения cron_frame.php:29
global $USER
Определения csv_new_run.php:40
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
const FORMAT_DATETIME
Определения include.php:64
const FORMAT_DATE
Определения include.php:63
$culture
Определения include.php:61
$siteId
Определения ajax.php:8
FormatDate($format="", $timestamp=false, $now=false, ?string $languageId=null)
Определения tools.php:871
MakeTimeStamp($datetime, $format=false)
Определения tools.php:538
$user
Определения mysql_to_pgsql.php:33
$settings
Определения product_settings.php:43
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($signedUserToken)) $key
Определения quickway.php:257
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$iterator
Определения yandex_run.php:610