• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Router.php
  • Класс: Bitrix\Crm\Service\Router
  • Вызов: Router::getConsistentUrlFromPartlyDefined
public function getConsistentUrlFromPartlyDefined(string $currentUrl): ?Uri
{
	if (!$this->isSefMode())
	{
		return null;
	}

	$url = new Uri($currentUrl);
	$path = $url->getPath();
	if (preg_match('#type/(\d+)/(list|kanban)?#', $path, $matches))
	{
		$entityTypeId = (int)$matches[1];
		if (isset($matches[2]))
		{
			$viewType = mb_strtoupper($matches[2]);
		}
		else
		{
			$viewType = $this->getCurrentListView($entityTypeId);
		}

		if ($viewType === static::LIST_VIEW_LIST)
		{
			return $this->getItemListUrl($entityTypeId);
		}

		return $this->getKanbanUrl($entityTypeId);
	}

	return null;
}