CCrmComponentHelper::getEventTabParams

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmComponentHelper
  4. getEventTabParams
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_component_helper.php
  • Класс: \CCrmComponentHelper
  • Вызов: CCrmComponentHelper::getEventTabParams
static function getEventTabParams(
	int $entityId,
	string $tabName,
	string $entityTypeName,
	array $result
): array
{
	$tabParams = [
		'id' => 'tab_event',
		'name' => $tabName,
	];

	if ($entityId > 0)
	{
		if (!RestrictionManager::isHistoryViewPermitted())
		{
			$tabParams['tariffLock'] = RestrictionManager::getHistoryViewRestriction()->prepareInfoHelperScript();
		}
		else
		{
			$tabParams['loader'] = [
				'serviceUrl' =>
					'/bitrix/components/bitrix/crm.event.view/lazyload.ajax.php?&site='
					. SITE_ID . '&' . bitrix_sessid_get()
				,
				'componentData' => [
					'template' => '',
					'contextId' => "{$entityTypeName}_{$entityId}_EVENT",
					'signedParameters' => \CCrmInstantEditorHelper::signComponentParams([
						'AJAX_OPTION_ADDITIONAL' => "{$entityTypeName}_{$entityId}_EVENT",
						'ENTITY_TYPE' => $entityTypeName,
						'ENTITY_ID' => $entityId,
						'PATH_TO_USER_PROFILE' => $result['PATH_TO_USER_PROFILE'],
						'TAB_ID' => 'tab_event',
						'INTERNAL' => 'Y',
						'SHOW_INTERNAL_FILTER' => 'Y',
						'PRESERVE_HISTORY' => true,
						'NAME_TEMPLATE' => $result['NAME_TEMPLATE']
					], 'crm.event.view')
				]
			];
		}
	}
	else
	{
		$tabParams['enabled'] = false;
	}

	return $tabParams;
}

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