• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/integration/crm/connectors/personalize/contact.php
  • Класс: Bitrix\Sender\Integration\Crm\Connectors\Personalize\Contact
  • Вызов: Contact::getEntityFields
static function getEntityFields($entityType)
{
	\Bitrix\Main\Localization\Loc::loadMessages(
		$_SERVER['DOCUMENT_ROOT'].BX_ROOT.'/components/bitrix/crm.'.strtolower($entityType).'.edit/component.php'
	);

	$addressLabels = Bitrix\Crm\EntityAddress::getShortLabels();

	$arResult = array(
		'ID' => array(
			'Name' => GetMessage('CRM_FIELD_ID'),
			'Type' => 'int',
			'Filterable' => true,
			'Editable' => false,
			'Required' => false,
			// 'personalizeCode' => 'ID'
		),
		'NAME' => array(
			'Name' => GetMessage('CRM_FIELD_FIRST_NAME'),
			'Type' => 'string',
			'Filterable' => true,
			'Editable' => true,
			'Required' => true,
			// 'personalizeCode' => 'NAME'
		),
		'LAST_NAME' => array(
			'Name' => GetMessage('CRM_FIELD_LAST_NAME'),
			'Type' => 'string',
			'Filterable' => true,
			'Editable' => true,
			'Required' => true,
		),
		'SECOND_NAME' => array(
			'Name' => GetMessage('CRM_FIELD_SECOND_NAME'),
			'Type' => 'string',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'HONORIFIC' => array(
			'Name' => GetMessage('CRM_FIELD_HONORIFIC'),
			'Type' => 'select',
			'Options' => CCrmStatus::GetStatusListEx('HONORIFIC'),
			'Editable' => true,
			'Required' => false,
		),
		'BIRTHDATE' => array(
			'Name' => GetMessage('CRM_FIELD_BIRTHDATE'),
			'Type' => 'datetime',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'EMAIL' => array(
			'Name' => GetMessage('CRM_FIELD_EMAIL'),
			'Type' => 'email',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
			// 'personalizeCode' => 'EMAIL'
		),
		'PHONE' => array(
			'Name' => GetMessage('CRM_FIELD_PHONE'),
			'Type' => 'phone',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
			// 'personalizeCode' => 'PHONE'
		),
		'WEB' => array(
			'Name' => GetMessage('CRM_FIELD_WEB'),
			'Type' => 'web',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'IM' => array(
			'Name' => GetMessage('CRM_FIELD_MESSENGER'),
			'Type' => 'im',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'POST' => array(
			'Name' => GetMessage('CRM_FIELD_POST'),
			'Type' => 'string',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'FULL_ADDRESS' => array(
			'Name' => GetMessage('CRM_FIELD_ADDRESS'),
			'Type' => 'text',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'ADDRESS' => array(
			'Name' => $addressLabels['ADDRESS'],
			'Type' => 'text',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'ADDRESS_2' => array(
			'Name' => $addressLabels['ADDRESS_2'],
			'Type' => 'text',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'ADDRESS_CITY' => array(
			'Name' => $addressLabels['CITY'],
			'Type' => 'text',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'ADDRESS_POSTAL_CODE' => array(
			'Name' => $addressLabels['POSTAL_CODE'],
			'Type' => 'text',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'ADDRESS_REGION' => array(
			'Name' => $addressLabels['REGION'],
			'Type' => 'text',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'ADDRESS_COUNTRY' => array(
			'Name' => $addressLabels['COUNTRY'],
			'Type' => 'text',
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'COMMENTS' => array(
			'Name' => GetMessage('CRM_FIELD_COMMENTS'),
			'Type' => 'text',
			'Filterable' => false,
			'Editable' => true,
			'Required' => false,
		),
		'TYPE_ID' => array(
			'Name' => GetMessage('CRM_FIELD_TYPE_ID'),
			'Type' => 'select',
			'Options' => CCrmStatus::GetStatusListEx('CONTACT_TYPE'),
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
	);

	$arResult += array(
		'CREATED_BY_ID' => array(
			'Name' => GetMessage('CRM_DOCUMENT_FIELD_CREATED_BY_ID_CONTACT'),
			'Type' => 'user',
		),
		'MODIFY_BY_ID' => array(
			'Name' => GetMessage('CRM_DOCUMENT_FIELD_MODIFY_BY_ID'),
			'Type' => 'user',
		),
		'SOURCE_ID' => array(
			'Name' => GetMessage('CRM_FIELD_SOURCE_ID'),
			'Type' => 'select',
			'Options' => CCrmStatus::GetStatusListEx('SOURCE'),
			'Filterable' => true,
			'Editable' => true,
			'Required' => false,
		),
		'SOURCE_DESCRIPTION' => array(
			'Name' => GetMessage('CRM_FIELD_SOURCE_DESCRIPTION'),
			'Type' => 'text',
			'Filterable' => false,
			'Editable' => true,
			'Required' => false,
		),
		"OPENED" => array(
			"Name" => GetMessage("CRM_FIELD_OPENED"),
			"Type" => "bool",
			"Filterable" => true,
			"Editable" => true,
			"Required" => false,
		),
		"EXPORT" => array(
			"Name" => GetMessage("CRM_FIELD_EXPORT"),
			"Type" => "bool",
			"Filterable" => true,
			"Editable" => true,
			"Required" => false,
		),
//			"ORIGINATOR_ID" => array(
//				"Name" => GetMessage("CRM_FIELD_ORIGINATOR_ID"),
//				"Type" => "string",
//				"Filterable" => true,
//				"Editable" => true,
//				"Required" => false,
//			),
		"COMPANY_ID" => array(
			"Name" => GetMessage("CRM_FIELD_COMPANY_ID"),
			"Type" => "string",
			"Filterable" => true,
			"Editable" => true,
			"Required" => false,
		),
		"COMPANY_IDS" => array(
			"Name" => GetMessage("CRM_FIELD_COMPANY_IDS"),
			"Type" => "string",
			"Filterable" => true,
			"Editable" => true,
			"Required" => false,
			"Multiple" => true
		),
		"DATE_CREATE" => array(
			"Name" => GetMessage("CRM_CONTACT_EDIT_FIELD_DATE_CREATE"),
			"Type" => "datetime",
			"Filterable" => true,
			"Editable" => false,
			"Required" => false,
		),
		"DATE_MODIFY" => array(
			"Name" => GetMessage("CRM_CONTACT_EDIT_FIELD_DATE_MODIFY"),
			"Type" => "datetime",
			"Filterable" => true,
			"Editable" => false,
			"Required" => false,
		)
	);

	$arResult += parent::getEntityFields($entityType);

	return $arResult;
}