EntityViewSettings::getDefaultPageUrl

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityViewSettings
  4. getDefaultPageUrl
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/settings/entityviewsettings.php
  • Класс: Bitrix\Crm\Settings\EntityViewSettings
  • Вызов: EntityViewSettings::getDefaultPageUrl
static function getDefaultPageUrl()
{
	$settings = \CUserOptions::GetOption('ui', 'crm_control_panel_menu');
	if(is_array($settings) && isset($settings['firstPageLink']) && $settings['firstPageLink'] !== '')
	{
		if(preg_match('/\/crm\/([a-z]+)\//i', $settings['firstPageLink'], $matches) === 1
			&& count($matches) > 1
		)
		{
			$entityTypeName = $matches[1];
			$entityTypeID = \CCrmOwnerType::ResolveID($entityTypeName);
			if($entityTypeID === \CCrmOwnerType::Lead
				|| $entityTypeID === \CCrmOwnerType::Contact
				|| $entityTypeID === \CCrmOwnerType::Company
				|| $entityTypeID === \CCrmOwnerType::Deal
				|| $entityTypeID === \CCrmOwnerType::Quote
				|| $entityTypeID === \CCrmOwnerType::Invoice
			)
			{
				return "/crm/{$entityTypeName}/?redirect_to";
			}
		}

		return $settings['firstPageLink'];
	}

	$entityTypeName = mb_strtolower(Crm\Settings\LeadSettings::isEnabled()? \CCrmOwnerType::LeadName : \CCrmOwnerType::DealName);
	return "/crm/{$entityTypeName}/?redirect_to";
}

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