• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/integration/ui/entityselector/departmentprovider.php
  • Класс: BitrixIntranetIntegrationUIEntitySelectorDepartmentProvider
  • Вызов: DepartmentProvider::__construct
public function __construct(array $options = [])
{
	parent::__construct();

	if (isset($options['selectMode']) && in_array($options['selectMode'], self::getSelectModes()))
	{
		$this->options['selectMode'] = $options['selectMode'];
	}
	else
	{
		$this->options['selectMode'] = self::MODE_USERS_ONLY;
	}

	$this->options['allowFlatDepartments'] = (
		isset($options['allowFlatDepartments']) && $options['allowFlatDepartments'] === true
	);

	$this->options['allowOnlyUserDepartments'] = (
		isset($options['allowOnlyUserDepartments']) && $options['allowOnlyUserDepartments'] === true
	);

	$this->options['allowSelectRootDepartment'] = $this->getSelectMode() === self::MODE_DEPARTMENTS_ONLY;
	if (isset($options['allowSelectRootDepartment']) && is_bool($options['allowSelectRootDepartment']))
	{
		$this->options['allowSelectRootDepartment'] = $options['allowSelectRootDepartment'];
	}

	if (isset($options['userOptions']) && is_array($options['userOptions']))
	{
		if (Loader::includeModule('socialnetwork'))
		{
			$userProvider = new UserProvider($options['userOptions']); // process options by UserProvider
			$this->options['userOptions'] = $userProvider->getOptions();
		}
	}

	$this->options['hideChatBotDepartment'] = true;
	if (isset($options['hideChatBotDepartment']) && is_bool($options['hideChatBotDepartment']))
	{
		$this->options['hideChatBotDepartment'] = $options['hideChatBotDepartment'];
	}
}