...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/widget/custom/saletarget.php
- Класс: Bitrix\Crm\Widget\Custom\SaleTarget
- Вызов: SaleTarget::splitUsersByPermission
private function splitUsersByPermission($targetUserId, $userIds, $permission) { $targetUserId = (int)$targetUserId; $resultIds = array(); if ( $permission !== \CCrmPerms::PERM_SELF && $permission !== \CCrmPerms::PERM_DEPARTMENT && $permission !== \CCrmPerms::PERM_SUBDEPARTMENT ) { return $resultIds; } $targetDepartments = $this->getUserDepartments($targetUserId, $permission); foreach ($userIds as $checkUserId) { $checkUserId = (int)$checkUserId; if ($checkUserId === $targetUserId) { $resultIds[] = $checkUserId; continue; } if ($permission !== \CCrmPerms::PERM_SELF) { $checkDepartments = $this->getUserDepartments($checkUserId, \CCrmPerms::PERM_DEPARTMENT); $sect = array_intersect($targetDepartments, $checkDepartments); if ($sect) { $resultIds[] = $checkUserId; } } } return $resultIds; }