BaseMessage::getTypes

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. BaseMessage
  4. getTypes
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/activity/provider/basemessage.php
  • Класс: Bitrix\Crm\Activity\Provider\BaseMessage
  • Вызов: BaseMessage::getTypes
static function getTypes()
{
	$result = [];

	$result[] = [
		'NAME' => Loc::getMessage(
			sprintf(
				'CRM_ACTIVITY_PROVIDER_%s_NAME',
				static::getLangProviderId()
			)
		),
		'PROVIDER_ID' => static::getId(),
		'PROVIDER_TYPE_ID' => static::getDefaultTypeId(),
		'DIRECTIONS' => [
			\CCrmActivityDirection::Incoming => Loc::getMessage(
				sprintf(
					'CRM_ACTIVITY_PROVIDER_%s_INCOMING',
					static::getLangProviderId()
				)
			),
			\CCrmActivityDirection::Outgoing => Loc::getMessage(
				sprintf(
					'CRM_ACTIVITY_PROVIDER_%s_OUTGOING',
					static::getLangProviderId()
				)
			),
		],
	];

	$availableProviderTypeIds = [
		static::PROVIDER_TYPE_SALESCENTER_PAYMENT_SENT,
		static::PROVIDER_TYPE_SALESCENTER_TERMINAL_PAYMENT_PAID,
		static::PROVIDER_TYPE_SALESCENTER_DELIVERY,
		static::PROVIDER_TYPE_CRM_ORDER_COMPLETED,
		static::PROVIDER_TYPE_CRM_ORDER_PAID,
	];
	foreach ($availableProviderTypeIds as $providerTypeId)
	{
		$providerTypeName = Loc::getMessage(
			sprintf(
				'CRM_ACTIVITY_PROVIDER_%s_%s_NAME',
				static::getLangProviderId(),
				$providerTypeId
			)
		);
		if (!$providerTypeName)
		{
			$providerTypeName = Loc::getMessage(
				sprintf(
					'CRM_ACTIVITY_PROVIDER_%s_%s_NAME_MSGVER_1',
					static::getLangProviderId(),
					$providerTypeId
				)
			);
		}

		$result[] = [
			'NAME' => $providerTypeName,
			'PROVIDER_ID' => static::getId(),
			'PROVIDER_TYPE_ID' => $providerTypeId,
			'DIRECTIONS' => [
				\CCrmActivityDirection::Incoming => Loc::getMessage(
					sprintf(
						'CRM_ACTIVITY_PROVIDER_%s_INCOMING',
						static::getLangProviderId()
					)
				),
				\CCrmActivityDirection::Outgoing => Loc::getMessage(
					sprintf(
						'CRM_ACTIVITY_PROVIDER_%s_OUTGOING',
						static::getLangProviderId()
					)
				),
			],
		];
	}

	return $result;
}

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