CCrmSipHelper::setFieldsEntities

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmSipHelper
  4. setFieldsEntities
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/sip_helper.php
  • Класс: \CCrmSipHelper
  • Вызов: CCrmSipHelper::setFieldsEntities
static function setFieldsEntities(array &$fields,int  $entityTypeID,int  $entityID,int $userID,bool $isAdmin): void
{
	$fields['DEALS'] = static::getDeals($entityTypeID, $entityID, $userID);

	if ($fields['DEALS'] === [])
	{
		$lead = static::getLead($entityTypeID, $entityID, $isAdmin);
		if ($lead)
		{
			$fields['LEAD'] = $lead;
			$isReturnCustomer = $fields['LEAD']['IS_RETURN_CUSTOMER'];
			$fields['STATUS_TEXT'] = static::getStatusText(\CCrmOwnerType::Lead, $isReturnCustomer, false);
			$fields['STATUS_COLOR'] = static::getStatusColor(\CCrmOwnerType::Lead);
		}
	}
	else
	{
		$isReturnCustomer = $fields['DEALS'][0]['IS_RETURN_CUSTOMER'];
		$isRepeatedApproach = $fields['DEALS'][0]['IS_REPEATED_APPROACH'];
		$fields['STATUS_TEXT'] = static::getStatusText(\CCrmOwnerType::Deal, $isReturnCustomer, $isRepeatedApproach);
		$fields['STATUS_COLOR'] = static::getStatusColor(\CCrmOwnerType::Deal);
	}

	$fields['INVOICES'] = static::getInvoices($entityID, $isAdmin);
}

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