1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
scope.php
См. документацию.
1<?php
2
3namespace Bitrix\Ui\EntityForm;
4
5use Bitrix\HumanResources\Enum\DepthLevel;
6use Bitrix\HumanResources\Service\Container;
7use Bitrix\Main\Access\AccessCode;
8use Bitrix\Main\Application;
9use Bitrix\Main\Engine\CurrentUser;
10use Bitrix\Main\Error;
11use Bitrix\Main\Event;
12use Bitrix\Main\Loader;
13use Bitrix\Main\Localization\Loc;
14use Bitrix\Main\ORM\Data\DeleteResult;
15use Bitrix\Main\ORM\Data\UpdateResult;
16use Bitrix\Main\ORM\Query\Query;
17use Bitrix\Main\Result;
18use Bitrix\Main\Text\HtmlFilter;
19use Bitrix\Main\UI\AccessRights\DataProvider;
20use Bitrix\Socialnetwork\UserToGroupTable;
21use Bitrix\UI\Form\EntityEditorConfigScope;
22use CAccess;
23use CUserOptions;
24
29class Scope
30{
31 protected const CODE_USER = 'U';
32 protected const CODE_PROJECT = 'SG';
33 protected const CODE_DEPARTMENT = 'DR';
34
35 protected const TYPE_USER = 'user';
36 protected const TYPE_PROJECT = 'project';
37 protected const TYPE_DEPARTMENT = 'department';
38
39 protected static array $instances = [];
40 private static array $userScopeIdsCache = [];
41
42 public function __construct(
43 private readonly int $userId,
44 )
45 {
46 }
47
48 public static function getInstance(?int $userId = null): static
49 {
50 if ($userId === null || $userId <= 0)
51 {
52 $userId = (int)CurrentUser::get()->getId();
53 }
54
55 if (!isset(static::$instances[$userId]))
56 {
57 Loader::includeModule('ui');
58 static::$instances[$userId] = new static($userId);
59 }
60
61 return static::$instances[$userId];
62 }
63
69 public function getUserScopes(string $entityTypeId, ?string $moduleId = null, bool $loadMetadata = true): array
70 {
71 return $this->getScopes($entityTypeId, $moduleId, $loadMetadata);
72 }
73
74 public function getAllUserScopes(string $entityTypeId, ?string $moduleId = null, bool $loadMetadata = true): array
75 {
76 return $this->getScopes($entityTypeId, $moduleId, false, $loadMetadata);
77 }
78
79 private function getScopes(
80 string $entityTypeId,
81 ?string $moduleId = null,
82 bool $excludeEmptyAccessCode = true,
83 bool $loadMetadata = true,
84 ): array
85 {
86 static $results = [];
87 $key = $entityTypeId . '-' . $moduleId . '-' . ($loadMetadata ? 'Y' : 'N');
88
89 if (!isset($results[$key]))
90 {
91 $result = [];
92 $isAdminForEntity = $moduleId
93 && (
94 ($scopeAccess = ScopeAccess::getInstance($moduleId, $this->userId))
95 && $scopeAccess->isAdminForEntityTypeId($entityTypeId)
96 );
97
98 if (!$isAdminForEntity)
99 {
100 $filter['@ID'] = $this->getScopesIdByUser();
101 }
102
103 $filter['@ENTITY_TYPE_ID'] = ($this->getEntityTypeIdMap()[$entityTypeId] ?? [$entityTypeId]);
104
105 if ($excludeEmptyAccessCode)
106 {
107 $filter['!=ACCESS_CODE'] = '';
108 }
109
110 if ($isAdminForEntity || !empty($filter['@ID']))
111 {
112 $scopes = EntityFormConfigTable::getList([
113 'select' => [
114 'ID',
115 'NAME',
116 'AUTO_APPLY_SCOPE',
117 'ACCESS_CODE' => '\Bitrix\Ui\EntityForm\EntityFormConfigAcTable:CONFIG.ACCESS_CODE',
118 ],
119 'filter' => $filter,
120 ]);
121
122 foreach ($scopes as $scope)
123 {
124 $result[$scope['ID']]['NAME'] = HtmlFilter::encode($scope['NAME']);
125 $result[$scope['ID']]['AUTO_APPLY_SCOPE'] = $scope['AUTO_APPLY_SCOPE'];
126 if (
127 $loadMetadata
128 && !isset($result[$scope['ID']]['ACCESS_CODES'][$scope['ACCESS_CODE']])
129 && isset($scope['ACCESS_CODE'])
130 )
131 {
132 $accessCode = new AccessCode($scope['ACCESS_CODE']);
133 $member = (new DataProvider())->getEntity(
134 $accessCode->getEntityType(),
135 $accessCode->getEntityId()
136 );
137 $result[$scope['ID']]['ACCESS_CODES'][$scope['ACCESS_CODE']] = $scope['ACCESS_CODE'];
138 $result[$scope['ID']]['MEMBERS'][$scope['ACCESS_CODE']] = $member->getMetaData();
139 }
140 }
141 }
142
143 $results[$key] = $result;
144 }
145
146 return $results[$key];
147 }
148
152 protected function getEntityTypeIdMap(): array
153 {
154 return [
155 'lead_details' => ['lead_details', 'returning_lead_details'],
156 'returning_lead_details' => ['lead_details', 'returning_lead_details'],
157 ];
158 }
159
164 public function isHasScope(int $scopeId): bool
165 {
166 return in_array($scopeId, $this->getScopesIdByUser());
167 }
168
169 protected function getUserId(): int
170 {
171 return $this->userId;
172 }
173
174 private function getScopesIdByUser(): array
175 {
176 if (isset(self::$userScopeIdsCache[$this->getUserId()]))
177 {
178 return self::$userScopeIdsCache[$this->getUserId()];
179 }
180
181 $accessCodes = $this->getCurrentUserAccessCodes();
182 $this->prepareAccessCodes($accessCodes);
183
184 $params = [
185 'select' => [
186 'CONFIG_ID',
187 ],
188 'filter' => [
189 '@ACCESS_CODE' => $accessCodes,
190 ],
191 ];
192
193 $scopes = EntityFormConfigAcTable::getList($params)->fetchAll();
194 $scopesIds = array_unique(array_column($scopes, 'CONFIG_ID'));
195
196 self::$userScopeIdsCache[$this->getUserId()] = $scopesIds;
197
198 return self::$userScopeIdsCache[$this->getUserId()];
199 }
200
201 protected function prepareAccessCodes(array &$accessCodes): void
202 {
203 $accessCodes = array_filter($accessCodes, static fn($code) => mb_strpos($code, 'CHAT') !== 0);
204
205 foreach ($accessCodes as &$accessCode)
206 {
207 $accessCode = preg_replace('|^(SG\d*?)(_[K,A,M])$|', '$1', $accessCode);
208 }
209 unset($accessCode);
210 }
211
216 public function getScopeById(int $scopeId): ?array
217 {
218 if ($row = EntityFormConfigTable::getRowById($scopeId))
219 {
220 return (is_array($row['CONFIG']) ? $row['CONFIG'] : null);
221 }
222 return null;
223 }
224
229 public function getById(int $scopeId): ?array
230 {
231 return EntityFormConfigTable::getRowById($scopeId);
232 }
233
238 public function removeByIds(iterable $ids): void
239 {
240 foreach ($ids as $id)
241 {
242 $this->removeById($id);
243 }
244 }
245
250 private function removeById(int $id): DeleteResult
251 {
252 $this->removeScopeMembers($id);
253 return EntityFormConfigTable::delete($id);
254 }
255
263 public function setScope(string $categoryName, string $guid, string $scope, int $userScopeId = 0, ?int $userId = null): void
264 {
265 $this->setScopeToUser($categoryName, $guid, $scope, $userScopeId, $userId);
266 }
267
268 public function setScopeConfig(
269 string $category,
270 string $entityTypeId,
271 string $name,
272 array $accessCodes,
274 array $params = []
275 )
276 {
277 if (empty($name))
278 {
279 $errors['name'] = new Error(Loc::getMessage('FIELD_REQUIRED'));
280 }
281 if (empty($accessCodes))
282 {
283 $errors['accessCodes'] = new Error(Loc::getMessage('FIELD_REQUIRED'));
284 }
285 if (empty($params['categoryName']))
286 {
287 $errors['categoryName'] = new Error(Loc::getMessage('FIELD_REQUIRED'));
288 }
289 if (!empty($errors))
290 {
291 return $errors;
292 }
293
294 $this->formatAccessCodes($accessCodes);
295
296 $result = EntityFormConfigTable::add([
297 'CATEGORY' => $category,
298 'ENTITY_TYPE_ID' => $entityTypeId,
299 'NAME' => $name,
300 'CONFIG' => $config,
301 'COMMON' => ($params['common'] ?? 'Y'),
302 'AUTO_APPLY_SCOPE' => ($params['forceSetToUsers'] ?? 'N'),
303 'OPTION_CATEGORY' => $params['categoryName']
304 ]);
305
306 if ($result->isSuccess())
307 {
308 $configId = $result->getId();
309 foreach ($accessCodes as $ac)
310 {
311 EntityFormConfigAcTable::add([
312 'ACCESS_CODE' => $ac['id'],
313 'CONFIG_ID' => $configId,
314 ]);
315 }
316
317 $forceSetToUsers = ($params['forceSetToUsers'] ?? false);
318 if (mb_strtoupper($forceSetToUsers) === 'FALSE')
319 {
320 $forceSetToUsers = false;
321 }
322
323 Application::getInstance()->addBackgroundJob(
324 static fn() => Scope::getInstance()->forceSetScopeToUsers($accessCodes, [
325 'forceSetToUsers' => $forceSetToUsers,
326 'categoryName' => ($params['categoryName'] ?? ''),
327 'entityTypeId' => $entityTypeId,
328 'configId' => $configId,
329 ])
330 );
331
332 return $configId;
333 }
334
335 return $result->getErrors();
336 }
337
341 protected function formatAccessCodes(array &$accessCodes): void
342 {
343 foreach ($accessCodes as $key => $item)
344 {
345 if ($item['entityId'] === self::TYPE_USER)
346 {
347 $accessCodes[$key]['id'] = self::CODE_USER . (int)$accessCodes[$key]['id'];
348 }
349 elseif ($item['entityId'] === self::TYPE_DEPARTMENT)
350 {
351 $accessCodes[$key]['id'] = self::CODE_DEPARTMENT . (int)$accessCodes[$key]['id'];
352 }
353 elseif ($item['entityId'] === self::TYPE_PROJECT)
354 {
355 $accessCodes[$key]['id'] = self::CODE_PROJECT . (int)$accessCodes[$key]['id'];
356 }
357 else{
358 unset($accessCodes[$key]);
359 }
360 }
361 }
362
367 protected function forceSetScopeToUsers(array $accessCodes = [], array $params = []): void
368 {
369 if ($params['forceSetToUsers'] && $params['categoryName'])
370 {
371 $codes = [];
372 foreach ($accessCodes as $ac)
373 {
374 $codes[] = $ac['id'];
375 }
376 $this->setScopeByAccessCodes(
377 $params['categoryName'],
378 $params['entityTypeId'],
380 (int)$params['configId'],
381 $codes
382 );
383 }
384 }
385
393 protected function setScopeToUser(
394 string $categoryName,
395 string $guid,
396 string $scope,
397 int $userScopeId,
398 ?int $userId = null
399 ): void
400 {
401 $scope = (isset($scope) ? strtoupper($scope) : EntityEditorConfigScope::UNDEFINED);
402
404 {
405 if ($scope === EntityEditorConfigScope::CUSTOM && $userScopeId)
406 {
407 $value = [
408 'scope' => $scope,
409 'userScopeId' => $userScopeId,
410 ];
411 }
412 else
413 {
414 $value = $scope;
415 }
416
417 $userId = ($userId ?? false);
418 CUserOptions::SetOption($categoryName, "{$guid}_scope", $value, false, $userId);
419 }
420 }
421
422 public function updateScopeConfig(int $id, array $config)
423 {
424 return EntityFormConfigTable::update($id, [
425 'CONFIG' => $config,
426 ]);
427 }
428
429 public function updateScopeName(int $id, string $name): UpdateResult
430 {
431 return EntityFormConfigTable::update($id, [
432 'NAME' => $name,
433 ]);
434 }
435
441 public function updateScopeAccessCodes(int $configId, array $accessCodes = []): array
442 {
443 $this->removeScopeMembers($configId);
444 $this->addAccessCodes($configId, $accessCodes);
445
446 return $this->getScopeMembers($configId);
447 }
448
449 public function addAccessCodes(int $configId, array $accessCodes): Result
450 {
451 $accessCodeCollection = EntityFormConfigAcTable::createCollection();
452 foreach ($accessCodes as $accessCode => $type)
453 {
454 $accessCodeItem = EntityFormConfigAcTable::createObject()
455 ->setAccessCode($accessCode)
456 ->setConfigId($configId);
457
458 $accessCodeCollection->add($accessCodeItem);
459 }
460
461 return $accessCodeCollection->save(true);
462 }
463
468 public function getScopeMembers(int $configId): array
469 {
470 $accessCodes = EntityFormConfigAcTable::getList([
471 'select' => ['ACCESS_CODE'],
472 'filter' => ['=CONFIG_ID' => $configId],
473 ])->fetchAll();
474 $result = [];
475 if (count($accessCodes))
476 {
477 foreach ($accessCodes as $accessCodeEntity)
478 {
479 $accessCode = new AccessCode($accessCodeEntity['ACCESS_CODE']);
480 $member = (new DataProvider())->getEntity($accessCode->getEntityType(), $accessCode->getEntityId());
481 $result[$accessCodeEntity['ACCESS_CODE']] = $member->getMetaData();
482 }
483 }
484 return $result;
485 }
486
490 private function removeScopeMembers(int $configId): void
491 {
492 $entity = EntityFormConfigAcTable::getEntity();
493 $connection = $entity->getConnection();
494
495 $filter = ['CONFIG_ID' => $configId];
496
497 $connection->query(sprintf(
498 'DELETE FROM %s WHERE %s',
499 $connection->getSqlHelper()->quote($entity->getDBTableName()),
500 Query::buildFilterSql($entity, $filter)
501 ));
502 }
503
504 public function updateScopeAutoApplyScope(int $id, bool $autoApplyScope): UpdateResult
505 {
506 return EntityFormConfigTable::update($id, [
507 'AUTO_APPLY_SCOPE' => $autoApplyScope ? 'Y' : 'N',
508 ]);
509 }
510
511 private function setScopeToDepartment(
512 string $categoryName,
513 string $guid,
514 string $scope,
515 int $userScopeId,
516 int $departmentId
517 ): void
518 {
519 $userIds = $this->getUserIdsByDepartment($departmentId);
520 foreach ($userIds as $userId)
521 {
522 $this->setScopeToUser($categoryName, $guid, $scope, $userScopeId, $userId);
523 }
524 }
525
526 private function setScopeToSocialGroup(
527 string $categoryName,
528 string $guid,
529 string $scope,
530 int $userScopeId,
531 int $socialGroupId
532 ): void
533 {
534 $userIds = $this->getUserIdsBySocialGroup($socialGroupId);
535 foreach ($userIds as $userId)
536 {
537 $this->setScopeToUser($categoryName, $guid, $scope, $userScopeId, $userId);
538 }
539 }
540
541 public static function handleMemberAddedToDepartment(Event $event): void
542 {
543 Application::getInstance()->addBackgroundJob(static function() use ($event)
544 {
545 $member = $event->getParameter('member');
546
547 $memberId = $member->entityId;
548 $departmentId = $member->nodeId;
550 $scopes = Scope::getInstance()->getScopesByDepartment($departmentId, true);
551
552 $appliedEntities = [];
553 foreach ($scopes as $scope)
554 {
555 if (!in_array($scope->getEntityTypeId(), $appliedEntities))
556 {
557 $appliedEntities[] = $scope->getEntityTypeId();
558 Scope::getInstance()->setScopeToUser(
559 $scope->getOptionCategory(),
560 $scope->getEntityTypeId(),
561 $scopeType,
562 $scope->getId(),
563 $memberId
564 );
565 }
566 }
567 });
568 }
569
570 public static function handleMemberAddedToSocialGroup(int $id, array $fields): void
571 {
572 Application::getInstance()->addBackgroundJob(static function() use ($id, $fields)
573 {
574 if (!\Bitrix\Main\Loader::includeModule('socialnetwork'))
575 {
576 return;
577 }
578
579 if (empty($fields['ROLE']) && $fields['ROLE'] !== UserToGroupTable::ROLE_USER)
580 {
581 return;
582 }
583
584 if (empty($fields['USER_ID']) || empty($fields['GROUP_ID']))
585 {
586 $userToGroup = UserToGroupTable::getById($id)->fetchObject();
587
588 if (!$userToGroup)
589 {
590 return;
591 }
592
593 $memberId = $userToGroup->getUserId();
594 $socialGroupId = $userToGroup->getGroupId();
595 }
596 else
597 {
598 $memberId = $fields['USER_ID'];
599 $socialGroupId = $fields['GROUP_ID'];
600 }
601
603 $scopes = Scope::getInstance()->getScopesBySocialGroupId($socialGroupId, true);
604
605 $appliedEntities = [];
606 foreach ($scopes as $scope)
607 {
608 if (!in_array($scope->getEntityTypeId(), $appliedEntities))
609 {
610 $appliedEntities[] = $scope->getEntityTypeId();
611 Scope::getInstance()->setScopeToUser(
612 $scope->getOptionCategory(),
613 $scope->getEntityTypeId(),
614 $scopeType,
615 $scope->getId(),
616 $memberId
617 );
618 }
619 }
620 });
621 }
622
623 private function getScopesByDepartment(int $departmentId, bool $onlyAutoApplyView = false): array
624 {
625 $accessCodes = [];
626 $nodeRepository = Container::getNodeRepository();
627 $node = $nodeRepository->getById($departmentId);
628 if (!$node)
629 {
630 return $accessCodes;
631 }
632
633 $parentNodes = $nodeRepository->getParentOf($node, DepthLevel::FULL);
634 foreach ($parentNodes as $node)
635 {
636 $accessCode = str_replace('D', 'DR', $node->accessCode);
637 $accessCodes = array_merge($accessCodes, $this->getScopesByAccessCode($accessCode, $onlyAutoApplyView));
638 }
639
640 return $accessCodes;
641 }
642
643 private function getScopesBySocialGroupId(int $socialGroupId, bool $onlyAutoApplyView = false): array
644 {
645 $accessCode = 'SG' . $socialGroupId;
646
647 return $this->getScopesByAccessCode($accessCode, $onlyAutoApplyView);
648 }
649
650 private function getScopesByAccessCode(string $accessCode, bool $onlyAutoApplyView = false)
651 {
652 $filter = ['=ACCESS_CODE' => $accessCode];
653 if ($onlyAutoApplyView)
654 {
655 $filter['=CONFIG.AUTO_APPLY_SCOPE'] = 'Y';
656 }
657
658 $scopes = EntityFormConfigAcTable::query()
659 ->setSelect(['ACCESS_CODE', 'CONFIG'])
660 ->setFilter($filter)
661 ->setOrder(['CONFIG.ID' => 'DESC'])
662 ->fetchCollection();
663
664 return $scopes->getConfigList();
665 }
666
667 public function setScopeForEligibleUsers(int $scopeId): void
668 {
669 $scope = EntityFormConfigTable::getById($scopeId)->fetchObject();
670
671 if (!$scope)
672 {
673 return;
674 }
675
676 $accessCodes = $this->getScopeAccessCodesByScopeId($scopeId);
677
678 $this->setScopeByAccessCodes(
679 $scope->getOptionCategory(),
680 $scope->getEntityTypeId(),
682 $scopeId,
683 $accessCodes
684 );
685 }
686
687 public function getScopeAccessCodesByScopeId(int $scopeId): array
688 {
689 $accessCodes = EntityFormConfigAcTable::query()
690 ->setSelect(['ACCESS_CODE'])
691 ->setFilter(['=CONFIG_ID' => $scopeId])
692 ->fetchCollection();
693 $result = [];
694 foreach ($accessCodes as $code)
695 {
696 $result[] = $code->getAccessCode();
697 }
698
699 return $result;
700 }
701
702 private function setScopeByAccessCodes(
703 string $categoryName,
704 string $entityTypeId,
705 string $scope,
706 int $scopeId,
707 array $accessCodes
708 ): void
709 {
710 $userIdPattern = '/^U(\d+)$/';
711 $departmentIdPattern = '/^DR(\d+)$/';
712 $socialGroupIdPattern = '/^SG(\d+)$/';
713 foreach ($accessCodes as $accessCode)
714 {
715 $matches = [];
716 if (preg_match($userIdPattern, $accessCode, $matches))
717 {
718 $this->setScopeToUser(
719 $categoryName,
720 $entityTypeId,
721 $scope,
722 $scopeId,
723 $matches[1]
724 );
725 }
726 elseif (preg_match($departmentIdPattern, $accessCode, $matches))
727 {
728 $this->setScopeToDepartment(
729 $categoryName,
730 $entityTypeId,
731 $scope,
732 $scopeId,
733 $matches[1]
734 );
735 }
736 elseif (preg_match($socialGroupIdPattern, $accessCode, $matches))
737 {
738 $this->setScopeToSocialGroup(
739 $categoryName,
740 $entityTypeId,
741 $scope,
742 $scopeId,
743 $matches[1]
744 );
745 }
746 }
747 }
748
749 private function getUserIdsBySocialGroup(int $socialGroupId): array
750 {
751 if (!\Bitrix\Main\Loader::includeModule('socialnetwork'))
752 {
753 return [];
754 }
755
756
757 $userCollection = UserToGroupTable::query()
758 ->setSelect(['USER_ID'])
759 ->setFilter([
760 '=GROUP_ID' => $socialGroupId,
761 '@ROLE' => [
762 UserToGroupTable::ROLE_MODERATOR,
763 UserToGroupTable::ROLE_USER,
764 UserToGroupTable::ROLE_OWNER,
765 ]
766 ])
767 ->fetchCollection();
768
769 $userIds = [];
770 foreach ($userCollection as $user)
771 {
772 $userIds[] = $user->getUserId();
773 }
774
775 return $userIds;
776 }
777
778 private function getUserIdsByDepartment(int $departmentId): array
779 {
780 $userIds = [];
781 if (!\Bitrix\Main\Loader::includeModule('humanresources'))
782 {
783 return $userIds;
784 }
785
786 $hrServiceLocator = Container::instance();
787 $accessCode = 'DR' . $departmentId;
788 $node = $hrServiceLocator::getNodeRepository()->getByAccessCode($accessCode);
789 if (!$node)
790 {
791 return $userIds;
792 }
793
794 $allEmp = $hrServiceLocator::getNodeMemberService()->getAllEmployees($node->id, true);
795 foreach ($allEmp->getIterator() as $emp)
796 {
797 $userIds[] = $emp->entityId;
798 }
799
800 return $userIds;
801 }
802
803 private function getCurrentUserAccessCodes(): array
804 {
805 return CAccess::GetUserCodesArray($this->userId);
806 }
807}
$connection
Определения actionsdefinitions.php:38
$type
Определения options.php:106
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
Определения error.php:15
Определения event.php:5
static isDefined(string $scope)
Определения entityeditorconfigscope.php:16
static getInstance(string $moduleId, int $userId=null)
Определения scopeaccess.php:42
setScopeForEligibleUsers(int $scopeId)
Определения scope.php:667
getEntityTypeIdMap()
Определения scope.php:152
getUserId()
Определения scope.php:169
const CODE_DEPARTMENT
Определения scope.php:33
static handleMemberAddedToDepartment(Event $event)
Определения scope.php:541
getUserScopes(string $entityTypeId, ?string $moduleId=null, bool $loadMetadata=true)
Определения scope.php:69
static getInstance(?int $userId=null)
Определения scope.php:48
getScopeMembers(int $configId)
Определения scope.php:468
static handleMemberAddedToSocialGroup(int $id, array $fields)
Определения scope.php:570
getById(int $scopeId)
Определения scope.php:229
formatAccessCodes(array &$accessCodes)
Определения scope.php:341
updateScopeAccessCodes(int $configId, array $accessCodes=[])
Определения scope.php:441
const CODE_PROJECT
Определения scope.php:32
__construct(private readonly int $userId,)
Определения scope.php:42
prepareAccessCodes(array &$accessCodes)
Определения scope.php:201
updateScopeName(int $id, string $name)
Определения scope.php:429
const TYPE_USER
Определения scope.php:35
isHasScope(int $scopeId)
Определения scope.php:164
addAccessCodes(int $configId, array $accessCodes)
Определения scope.php:449
static array $instances
Определения scope.php:39
setScopeConfig(string $category, string $entityTypeId, string $name, array $accessCodes, array $config, array $params=[])
Определения scope.php:268
const TYPE_DEPARTMENT
Определения scope.php:37
getAllUserScopes(string $entityTypeId, ?string $moduleId=null, bool $loadMetadata=true)
Определения scope.php:74
updateScopeAutoApplyScope(int $id, bool $autoApplyScope)
Определения scope.php:504
const CODE_USER
Определения scope.php:31
const TYPE_PROJECT
Определения scope.php:36
getScopeAccessCodesByScopeId(int $scopeId)
Определения scope.php:687
setScope(string $categoryName, string $guid, string $scope, int $userScopeId=0, ?int $userId=null)
Определения scope.php:263
getScopeById(int $scopeId)
Определения scope.php:216
forceSetScopeToUsers(array $accessCodes=[], array $params=[])
Определения scope.php:367
setScopeToUser(string $categoryName, string $guid, string $scope, int $userScopeId, ?int $userId=null)
Определения scope.php:393
removeByIds(iterable $ids)
Определения scope.php:238
updateScopeConfig(int $id, array $config)
Определения scope.php:422
static GetUserCodesArray($USER_ID, $arFilter=[])
Определения access.php:369
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$entity
$moduleId
$errors
Определения iblock_catalog_edit.php:74
$filter
Определения iblock_catalog_list.php:54
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$name
Определения menu_edit.php:35
$user
Определения mysql_to_pgsql.php:33
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$config
Определения quickway.php:69
if(empty($signedUserToken)) $key
Определения quickway.php:257
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$matches
Определения index.php:22
$fields
Определения yandex_run.php:501