• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Item/LogMessage/OpenLineIncoming.php
  • Класс: Bitrix\Crm\Service\Timeline\Item\LogMessage\OpenLineIncoming
  • Вызов: OpenLineIncoming::getContentBlocks
public function getContentBlocks(): ?array
{
	$userCode = $this->getAssociatedEntityModel()->get('PROVIDER_PARAMS')['USER_CODE'] ?? null;
	$connectorType = OpenLineManager::getLineConnectorType($userCode);

	$sourceList = [];
	$providerId = $this->getAssociatedEntityModel()->get('PROVIDER_ID');
	if ($providerId && $provider = CCrmActivity::GetProviderById($providerId))
	{
		$sourceList = $provider::getResultSources();
	}

	$channelName = empty($sourceList)
		? (string)$this->getAssociatedEntityModel()->get('TITLE')
		: $sourceList[$connectorType] ?? $sourceList['livechat'];

	return [
		'content' =>
			(new LineOfTextBlocks())
				->addContentBlock(
					'title',
					ContentBlockFactory::createTitle(Loc::getMessage('CRM_TIMELINE_LOG_OL_INCOMING_CHANNEL'))
				)
				->addContentBlock('data', (new Text())->setValue($channelName)->setColor(Text::COLOR_BASE_90))
	];
}