• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/ustat/ustat.php
  • Класс: BitrixIntranetUStatUStat
  • Вызов: UStat::getUsersDepartments
static function getUsersDepartments()
{
	$companyStructure = CIntranetUtils::getStructure();

	$users = array();

	foreach ($companyStructure['DATA'] as $departmentData)
	{
		$employees = array_filter(array_unique(array_merge(
			$departmentData['EMPLOYEES'], array($departmentData['UF_HEAD'])
		)));

		foreach ($employees as $employee)
		{
			if (!isset($users[$employee]))
			{
				$users[$employee] = array();
			}

			$users[$employee][] = $departmentData['ID'];
		}
	}

	return $users;
}