CAllCrmContact::GetFieldCaption

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmContact
  4. GetFieldCaption
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_contact.php
  • Класс: \CAllCrmContact
  • Вызов: CAllCrmContact::GetFieldCaption
static function GetFieldCaption($fieldName)
{
	if(\CCrmFieldMulti::IsSupportedType($fieldName))
	{
		return \CCrmFieldMulti::GetEntityTypeCaption($fieldName);
	}

	$result = GetMessage("CRM_CONTACT_FIELD_{$fieldName}_NEW");
	if (!(is_string($result) && $result !== ''))
	{
		$result = GetMessage("CRM_CONTACT_FIELD_{$fieldName}");
	}

	if (!(is_string($result) && $result !== '')
		&& Crm\Tracking\UI\Details::isTrackingField($fieldName))
	{
		$result = Crm\Tracking\UI\Details::getFieldCaption($fieldName);
	}

	if (Crm\Service\ParentFieldManager::isParentFieldName($fieldName))
	{
		$entityTypeId = Crm\Service\ParentFieldManager::getEntityTypeIdFromFieldName($fieldName);
		$result = \CCrmOwnerType::GetDescription($entityTypeId);
	}
	// get caption from tablet
	if (!(is_string($result) && $result !== ''))
	{
		if (Crm\ContactTable::getEntity()->hasField($fieldName))
		{
			$result = Crm\ContactTable::getEntity()->getField($fieldName)->getTitle();
			if($result === $fieldName) // to avoid $result = 'UF_CRM_xxx' for user fields
			{
				$result = '';
			}
		}
	}

	return is_string($result) ? $result : '';
}

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