• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/security/helper.php
  • Класс: BitrixVoximplantSecurityHelper
  • Вызов: Helper::getUserColleagues
static function getUserColleagues($userId)
{
	if(!Loader::includeModule('intranet'))
	{
		return [];
	}

	$colleagues = [];
	$cursor = CIntranetUtils::getDepartmentColleagues($userId, true);
	while ($row = $cursor->Fetch())
	{
		$colleagues[] = (int)$row['ID'];
	}

	$subordinateEmployees = [];
	$cursor =CIntranetUtils::getSubordinateEmployees($userId, true);
	while ($row = $cursor->Fetch())
	{
		$subordinateEmployees[] = (int)$row['ID'];
	}

	$result = array_merge($colleagues, $subordinateEmployees);

	return $result;
}