• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Item/Activity/Sms/Sms.php
  • Класс: Bitrix\Crm\Service\Timeline\Item\Activity\Sms\Sms
  • Вызов: Sms::buildUserContentBlock
protected function buildUserContentBlock(): ?ContentBlock
{
	$providerParams = $this->getAssociatedEntityModel()->get('PROVIDER_PARAMS') ?? [];
	$recipientUserId = (int)($providerParams['recipient_user_id'] ?? 0);
	if (!$recipientUserId)
	{
		return null;
	}
	$communication = $this->getAssociatedEntityModel()->get('COMMUNICATION') ?? [];
	$phone = $communication['FORMATTED_VALUE'] ?? null;
	if (!$phone)
	{
		return null;
	}
	$userInfo = Container::getInstance()->getUserBroker()->getById($recipientUserId);
	$userName = $userInfo['FORMATTED_NAME'] ?? null;
	$userDetailsUrl = $userInfo['SHOW_URL'] ?? null;
	if (!$userName)
	{
		return null;
	}
	$textOrLink = ContentBlockFactory::createTextOrLink($userName . ' ' . $phone, $userDetailsUrl ? new Redirect($userDetailsUrl) : null);

	return (new LineOfTextBlocks())
		->addContentBlock(
			'title',
			ContentBlockFactory::createTitle(Loc::getMessage('CRM_TIMELINE_ACTIVITY_SMS_RECIPIENT'))
		)
		->addContentBlock('data', $textOrLink->setIsBold(isset($userDetailsUrl))->setColor(Text::COLOR_BASE_90))
	;
}