• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/catalog/contractor/provider.php
  • Класс: Bitrix\Crm\Integration\Catalog\Contractor\Provider
  • Вызов: Provider::getDocumentsGridFilters
static function getDocumentsGridFilters(): array
{
	$companyCategoryId = CategoryRepository::getIdByEntityTypeId(CCrmOwnerType::Company);
	$contactCategoryId = CategoryRepository::getIdByEntityTypeId(CCrmOwnerType::Contact);

	return [
		self::FILTER_CODE_CONTRACTOR_CRM_COMPANY_ID => [
			'ENTITY_TYPE_ID' => CCrmOwnerType::Company,
			'FIELD_PARAMS' => [
				'partial' => true,
				'type' => 'entity_selector',
				'default' => true,
			],
			'FIELD_DATA' => [
				'params' => [
					'multiple' => 'Y',
					'dialogOptions' => [
						'height' => 200,
						'context' => '1contractor_filter',
						'entities' => [
							[
								'id' => 'company',
								'options' => [
									'categoryId' => $companyCategoryId ?: -1,
								],
								'dynamicLoad' => true,
								'dynamicSearch' => true,
							]
						],
						'dropdownMode' => false,
					],
				],
			],
		],
		self::FILTER_CODE_CONTRACTOR_CRM_CONTACT_ID => [
			'ENTITY_TYPE_ID' => CCrmOwnerType::Contact,
			'FIELD_PARAMS' => [
				'partial' => true,
				'type' => 'entity_selector',
				'default' => true,
			],
			'FIELD_DATA' => [
				'params' => [
					'multiple' => 'Y',
					'dialogOptions' => [
						'height' => 200,
						'context' => '2contractor_filter',
						'entities' => [
							[
								'id' => 'contact',
								'options' => [
									'categoryId' => $contactCategoryId ?: -1,
								],
								'dynamicLoad' => true,
								'dynamicSearch' => true,
							]
						],
						'dropdownMode' => false,
					],
				],
			],
		],
	];
}