• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/component/entitydetails/factorybased.php
  • Класс: Bitrix\Crm\Component\EntityDetails\FactoryBased
  • Вызов: FactoryBased::executeBaseLogic
protected function executeBaseLogic(): void
{
	$this->getApplication()->SetTitle(htmlspecialcharsbx($this->getTitle()));

	$this->initializeEditorAdapter();

	$this->arResult['entityDetailsParams'] = $this->getEntityDetailsParams();
	$this->arResult['activityEditorParams'] = $this->getActivityEditorConfig();
	$this->arResult['jsParams'] = $this->getJsParams();

	if ($this->factory->isStagesEnabled())
	{
		$converter = Container::getInstance()->getStageConverter();
		$stages = $this->factory->getStages($this->categoryId);
		$stageId = $this->item->getStageId();
		$currentStage = null;
		foreach($stages as $stage)
		{
			if(!$currentStage)
			{
				$currentStage = $stage;
			}
			if($stage->getStatusId() === $stageId)
			{
				$currentStage = $stage;
			}
			$this->arResult['jsParams']['stages'][] = $converter->toJson($stage);
		}
		$this->arResult['jsParams']['currentStageId'] = $currentStage ? $currentStage->getId() : null;
	}

	$this->arResult['jsParams']['item'] = $this->item->jsonSerialize();

	if (!$this->item->isNew() && \Bitrix\Crm\Settings\HistorySettings::getCurrent()->isViewEventEnabled())
	{
		$trackedObject = $this->factory->getTrackedObject($this->item);
		Container::getInstance()->getEventHistory()->registerView($trackedObject);

		$this->arResult['jsParams']['pullTag'] = Container::getInstance()->getPullManager()->subscribeOnItemUpdate(
			$this->getEntityTypeID(),
			$this->item->getId()
		);
	}
}