• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/ParentFieldManager.php
  • Класс: Bitrix\Crm\Service\ParentFieldManager
  • Вызов: ParentFieldManager::prepareParentFieldDataForFilterProvider
public function prepareParentFieldDataForFilterProvider(int $entityTypeId, string $fieldId): array
{
	$result = [
		'params' => [
			'apiVersion' => 3,
			'context' => EntitySelector::CONTEXT,
			'multiple' => 'N',
			'contextCode' => 'CRM',
			'useClientDatabase' => 'N',
			'enableAll' => 'N',
			'enableUsers' => 'N',
			'enableSonetgroups' => 'N',
			'enableDepartments' => 'N',
			'allowEmailInvitation' => 'N',
			'allowSearchEmailUsers' => 'N',
			'departmentSelectDisable' => 'Y',
			'isNumeric' => 'Y',
			'enableCrm' => 'Y',
		]
	];

	$parentId = static::getEntityTypeIdFromFieldName($fieldId);

	if (\CCrmOwnerType::isPossibleDynamicTypeId($parentId))
	{
		$key = UISelector\Handler::ENTITY_TYPE_CRMDYNAMICS . '_'. $parentId;
		$crmDynamicTitles = [
			$key => HtmlFilter::encode(\CCrmOwnerType::GetDescription($parentId)),
		];
	}

	$result['params'] = array_merge_recursive(
		$result['params'],
		ElementType::getEnableEntityTypesForSelectorOptions(
			[\CCrmOwnerType::ResolveName($parentId)],
			$crmDynamicTitles ?? []
		)
	);

	return $result;
}