Provider::getEditorFieldData

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Provider
  4. getEditorFieldData
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/catalog/contractor/provider.php
  • Класс: Bitrix\Crm\Integration\Catalog\Contractor\Provider
  • Вызов: Provider::getEditorFieldData
static function getEditorFieldData(): array
{
	$categoryParams = [
		CCrmOwnerType::Company => [
			'categoryId' => CategoryRepository::getIdByEntityTypeId(CCrmOwnerType::Company) ?? 0,
		],
		CCrmOwnerType::Contact => [
			'categoryId' => CategoryRepository::getIdByEntityTypeId(CCrmOwnerType::Contact) ?? 0,
		],
	];

	return [
		'compound' => [
			[
				'name' => 'COMPANY_ID',
				'type' => 'company',
				'entityTypeName' => CCrmOwnerType::CompanyName,
				'tagName' => CCrmOwnerType::CompanyName,
			],
			[
				'name' => 'CONTACT_IDS',
				'type' => 'multiple_contact',
				'entityTypeName' => CCrmOwnerType::ContactName,
				'tagName' => CCrmOwnerType::ContactName,
			]
		],
		'categoryParams' => $categoryParams,
		'requiredFieldErrorMessage' => Loc::getMessage('CONTRACTORS_PROVIDER_CONTRACTOR_FIELD_REQUIRED'),
		'map' => ['data' => 'CLIENT_DATA'],
		'info' => 'CLIENT_INFO',
		'lastCompanyInfos' => 'LAST_COMPANY_INFOS',
		'lastContactInfos' => 'LAST_CONTACT_INFOS',
		'loaders' => [
			'primary' => [
				CCrmOwnerType::CompanyName => [
					'action' => 'GET_CLIENT_INFO',
					'url' => '/bitrix/components/bitrix/crm.company.show/ajax.php?' . bitrix_sessid_get(),
				],
				CCrmOwnerType::ContactName => [
					'action' => 'GET_CLIENT_INFO',
					'url' => '/bitrix/components/bitrix/crm.contact.show/ajax.php?' . bitrix_sessid_get(),
				]
			],
			'secondary' => [
				CCrmOwnerType::CompanyName => [
					'action' => self::DETAIL_CARD_ACTION_GET_SECONDARY_ENTITY_INFOS,
					'url' => '/bitrix/components/bitrix/' . static::getComponentName() . '/ajax.php?' . bitrix_sessid_get(),
				]
			]
		],
		'clientEditorFieldsParams' =>
			\CCrmComponentHelper::prepareClientEditorFieldsParams(['categoryParams' => $categoryParams])
		,
		'useExternalRequisiteBinding' => true,
	];
}

Добавить комментарий