CCrmComponentHelper::prepareClientEditorDuplicateControlParams

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmComponentHelper
  4. prepareClientEditorDuplicateControlParams
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_component_helper.php
  • Класс: \CCrmComponentHelper
  • Вызов: CCrmComponentHelper::prepareClientEditorDuplicateControlParams
static function prepareClientEditorDuplicateControlParams(array $params = []): array
{
	$result = [];

	$entityTypes =
		(isset($params['entityTypes']) && is_array($params['entityTypes']))
			? $params['entityTypes']
			: []
	;

	foreach ($entityTypes as $entityTypeId)
	{
		$entityTypeId = (int)$entityTypeId;
		if (
			CCrmOwnerType::IsDefined($entityTypeId)
			&& DuplicateControl::isControlEnabledFor($entityTypeId)
		)
		{
			$entityTypeName = CCrmOwnerType::ResolveName($entityTypeId);
			$entityTypeNameLower = mb_strtolower($entityTypeName);
			$result[$entityTypeId] = [
				'enabled' => true,
				'serviceUrl' =>
					'/bitrix/components/bitrix/crm.'
					. $entityTypeNameLower
					. '.edit/ajax.php?'
					. bitrix_sessid_get(),
				'entityTypeName' => $entityTypeName,
				'groups' => [
					'title' => [
						'parameterName' => 'TITLE',
						'groupType' => 'single',
						'groupSummaryTitle' => Loc::getMessage('CRM_COMPONENT_HELPER_DUP_CTRL_TTL_SUMMARY_TITLE')
					],
					'email' => [
						'groupType' => 'communication',
						'communicationType' => 'EMAIL',
						'groupSummaryTitle' => Loc::getMessage('CRM_COMPONENT_HELPER_DUP_CTRL_EMAIL_SUMMARY_TITLE')
					],
					'phone' => [
						'groupType' => 'communication',
						'communicationType' => 'PHONE',
						'groupSummaryTitle' => Loc::getMessage('CRM_COMPONENT_HELPER_DUP_CTRL_PHONE_SUMMARY_TITLE')
					],
				],
			];
		}
	}

	return $result;
}

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