• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/automation/target/dealtarget.php
  • Класс: Bitrix\Crm\Automation\Target\DealTarget
  • Вызов: DealTarget::getStatusInfos
public function getStatusInfos($categoryId = 0)
{
	$entity = $this->getEntity();
	if ($entity && !empty($entity['CATEGORY_ID']))
	{
		$categoryId = (int)$entity['CATEGORY_ID'];
	}

	$processColor = \CCrmViewHelper::PROCESS_COLOR;
	$successColor = \CCrmViewHelper::SUCCESS_COLOR;
	$failureColor = \CCrmViewHelper::FAILURE_COLOR;

	$statuses = \CCrmViewHelper::GetDealStageInfos($categoryId);

	foreach ($statuses as $id => $stageInfo)
	{
		if (!empty($stageInfo['COLOR']))
			continue;

		$stageSemanticID = \CCrmDeal::GetSemanticID($stageInfo['STATUS_ID'], $categoryId);
		$isSuccess = $stageSemanticID === PhaseSemantics::SUCCESS;
		$isFailure = $stageSemanticID === PhaseSemantics::FAILURE;

		$statuses[$id]['COLOR'] = ($isSuccess ? $successColor : ($isFailure ? $failureColor : $processColor));
	}
	return $statuses;
}