• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/component/itemlist.php
  • Класс: Bitrix\Crm\Component\ItemList
  • Вызов: ItemList::getToolbarViews
protected function getToolbarViews(): array
{
	$views = [];

	if ($this->factory->isCountersEnabled())
	{
		$views['COUNTER_PANEL'] = $this->getCounterPanelView();
	}

	if ($this->isIntranetBindingMenuViewAvailable())
	{
		$views[] = $this->getIntranetBindingMenuView();
	}

	if ($this->factory->isStagesEnabled())
	{
		$views[Service\Router::LIST_VIEW_KANBAN] = [
			'title' => Loc::getMessage('CRM_COMMON_KANBAN'),
			'url' => Container::getInstance()->getRouter()->getKanbanUrl($this->entityTypeId, $this->getCategoryId()),
			'isActive' => false,
		];
		$views[Service\Router::LIST_VIEW_LIST] = [
			'title' => Loc::getMessage('CRM_COMMON_LIST'),
			'url' => Container::getInstance()->getRouter()->getItemListUrl($this->entityTypeId, $this->getCategoryId()),
			'isActive' => true,
		];

		if ($this->isDeadlinesModeSupported())
		{
			$views[Service\Router::LIST_VIEW_DEADLINES] = [
				'title' => Loc::getMessage('CRM_COMMON_DEADLINES'),
				'url' => Container::getInstance()->getRouter()->getDeadlinesUrl($this->entityTypeId, $this->getCategoryId()),
				'isActive' => false,
			];
		}

	}

	if (Automation\Factory::isSupported($this->entityTypeId))
	{
		$categoryId = $this->getCategoryId();
		if (is_null($categoryId) && $this->factory->isCategoriesSupported())
		{
			$categoryId = $this->factory->createDefaultCategoryIfNotExist()->getId();
		}
		$url = Container::getInstance()->getRouter()->getAutomationUrl(
			$this->entityTypeId,
			$categoryId
		);
		$robotView = [
			'className' => 'ui-btn ui-btn-light-border ui-btn-no-caps ui-btn-themes ui-btn-round crm-robot-btn',
			'title' => Loc::getMessage('CRM_COMMON_ROBOTS'),
			'url' => $url,
			'isActive' => false,
			'position' => Toolbar\ButtonLocation::RIGHT,
		];
		$dynamicTypesLimit = RestrictionManager::getDynamicTypesLimitRestriction();
		$isTypeSettingsRestricted = $dynamicTypesLimit->isTypeSettingsRestricted($this->entityTypeId);
		if ($isTypeSettingsRestricted)
		{
			$robotView['onclick'] = $dynamicTypesLimit->getShowFeatureJsFunctionString();
			unset($robotView['url']);
		}
		$views[] = $robotView;
	}

	return $views;
}