CCrmStatusRestProxy::prepareExtra

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmStatusRestProxy
  4. prepareExtra
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmStatusRestProxy
  • Вызов: CCrmStatusRestProxy::prepareExtra
static function prepareExtra(array &$fields)
{
	$statusID = $fields['STATUS_ID'] ?? '';
	if($statusID === '')
	{
		return null;
	}

	$result = null;
	$entityID = $fields['ENTITY_ID'] ?? '';
	if($entityID === 'STATUS')
	{
		$result = array('SEMANTICS' => CCrmLead::GetStatusSemantics($statusID));
	}
	elseif($entityID === 'QUOTE_STATUS')
	{
		$result = array('SEMANTICS' => CCrmQuote::GetStatusSemantics($statusID));
	}
	elseif($entityID === 'DEAL_STAGE')
	{
		$result = array('SEMANTICS' => CCrmDeal::GetStageSemantics($statusID, 0));
	}
	elseif(DealCategory::hasStatusEntity($entityID))
	{
		$categoryID = DealCategory::convertFromStatusEntityID($entityID);
		$result = array('SEMANTICS' => CCrmDeal::GetStageSemantics($statusID, $categoryID));
	}

	if(is_array($result))
	{
		$result['COLOR'] = $fields['COLOR'] ?? '';
		$fields['EXTRA'] = $result;
	}
}

Добавить комментарий