• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/usertype/userfieldbase.php
  • Класс: BitrixBizprocUserTypeUserFieldBase
  • Вызов: UserFieldBase::prepareCrmUserTypeValueView
static function prepareCrmUserTypeValueView($value, $defaultTypeName = '')
{
	$typeId = $id = null;
	$parts = explode('_', $value);

	if (count($parts) > 1)
	{
		$typeId = CCrmOwnerTypeAbbr::ResolveTypeID($parts[0]);
		$id = $parts[1];
	}
	elseif ($defaultTypeName !== '')
	{
		$typeId = CCrmOwnerType::resolveID($defaultTypeName);
		$id = $value;
	}

	if (!$typeId || !$id)
	{
		return '';
	}

	$entityName = CCrmOwnerType::getCaption($typeId, $id, false);
	$entityDesc = CCrmOwnerType::GetDescription($typeId);
	$entityUrl = CCrmOwnerType::GetDetailsUrl($typeId, $id, false);

	return sprintf('[b]%s:[/b] [url=%s]%s[/url]', $entityDesc, $entityUrl, $entityName);
}