• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/automation/helper.php
  • Класс: Bitrix\Crm\Automation\Helper
  • Вызов: Helper::getNavigationBarItems
static function getNavigationBarItems($entityTypeId, $categoryId = 0)
{
	if (!Factory::isAutomationAvailable($entityTypeId))
	{
		return [];
	}
	if ($entityTypeId === \CCrmOwnerType::Quote && !QuoteSettings::getCurrent()->isFactoryEnabled())
	{
		return [];
	}

	if ($entityTypeId === \CCrmOwnerType::SmartInvoice && !InvoiceSettings::getCurrent()->isSmartInvoiceEnabled())
	{
		return [];
	}

	$categoryId = max(0, $categoryId);
	$url = Container::getInstance()->getRouter()->getAutomationUrl($entityTypeId, $categoryId);

	return [
		[
			'id' => 'automation',
			'name' => Loc::getMessage('CRM_AUTOMATION_HELPER_ROBOT_TITLE'),
			'active' => false,
			'url' => $url
		]
	];
}