• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/component/entitydetails/factorybased.php
  • Класс: Bitrix\Crm\Component\EntityDetails\FactoryBased
  • Вызов: FactoryBased::getEditorAttributeConfig
protected function getEditorAttributeConfig(): ?array
{
	if(!$this->factory->isStagesEnabled())
	{
		return null;
	}

	$entityPhases = [];
	$stages = $this->factory->getStages($this->categoryId);
	foreach($stages as $stage)
	{
		$semantics = 'process';
		if ($stage->getSemantics() === PhaseSemantics::SUCCESS)
		{
			$semantics = 'success';
		}
		elseif ($stage->getSemantics() === PhaseSemantics::FAILURE)
		{
			$semantics = 'failure';
		}
		$entityPhases[] = [
			'id' => $stage->getStatusId(),
			'name' => $stage->getName(),
			'sort' => $stage->getSort(),
			'color' => $stage->getColor(),
			'semantics' => $semantics,
		];
	}

	return [
		'ENTITY_SCOPE' => FieldAttributeManager::getItemConfigScope($this->item),
		'CAPTIONS' => FieldAttributeManager::getCaptionsForEntityWithStages($this->entityTypeId),
		'ENTITY_PHASES' => $entityPhases,
	];
}