CCrmOwnerType::GetAllCategoryCaptions

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmOwnerType
  4. GetAllCategoryCaptions
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_owner_type.php
  • Класс: \CCrmOwnerType
  • Вызов: CCrmOwnerType::GetAllCategoryCaptions
static function GetAllCategoryCaptions(bool $useNames = false): array
{
	if (!isset(self::$ALL_CATEGORY_CAPTION[LANGUAGE_ID]))
	{
		IncludeModuleLangFile(__FILE__);
		self::$ALL_CATEGORY_CAPTION[LANGUAGE_ID] = [
			self::Lead => GetMessage('CRM_OWNER_TYPE_LEAD_CATEGORY'),
			self::Deal => GetMessage('CRM_OWNER_TYPE_DEAL_CATEGORY'),
			self::Contact => GetMessage('CRM_OWNER_TYPE_CONTACT_CATEGORY'),
			self::Company => GetMessage('CRM_OWNER_TYPE_COMPANY_CATEGORY'),
			self::Invoice => Container::getInstance()->getLocalization()->appendOldVersionSuffix(GetMessage('CRM_OWNER_TYPE_INVOICE_CATEGORY')),
			self::SmartInvoice => GetMessage('CRM_OWNER_TYPE_INVOICE_CATEGORY'),
			self::Quote => GetMessage('CRM_OWNER_TYPE_QUOTE_CATEGORY_MSGVER_2'),
			self::Requisite => GetMessage('CRM_OWNER_TYPE_REQUISITE_CATEGORY'),
			self::DealCategory => GetMessage('CRM_OWNER_TYPE_DEAL_CATEGORY_CATEGORY'),
			self::CustomActivityType => GetMessage('CRM_OWNER_TYPE_CUSTOM_ACTIVITY_TYPE_CATEGORY'),
			self::Order => GetMessage('CRM_OWNER_TYPE_ORDER_CATEGORY'),
			self::SmartInvoice => GetMessage('CRM_OWNER_TYPE_INVOICE_CATEGORY'),
			self::SmartDocument => GetMessage('CRM_OWNER_TYPE_DOCUMENT_CATEGORY'),
		];

		$dynamicTypesMap = Container::getInstance()->getDynamicTypesMap();
		$dynamicTypesMap->load([
			'isLoadCategories' => false,
			'isLoadStages' => false,
		]);
		foreach ($dynamicTypesMap->getTypes() as $type)
		{
			self::$ALL_CATEGORY_CAPTION[LANGUAGE_ID][$type->getEntityTypeId()] = $type->getTitle();
		}
	}


	if(!$useNames)
	{
		return self::$ALL_CATEGORY_CAPTION[LANGUAGE_ID];
	}

	$results = array();
	foreach(self::$ALL_CATEGORY_CAPTION[LANGUAGE_ID] as $typeID => $caption)
	{
		$results[self::ResolveName($typeID)] = $caption;
	}
	return $results;
}

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