ActivityStatistics::prepareCategories

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. ActivityStatistics
  4. prepareCategories
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/widget/data/company/activitystatistics.php
  • Класс: Bitrix\Crm\Widget\Data\Company\ActivityStatistics
  • Вызов: ActivityStatistics::prepareCategories
static function prepareCategories(array &$categories)
{
	static::includeModuleFile();
	$providers = \CCrmActivity::GetProviders();
	foreach ($providers as $provider)
	{
		$categoryId = 'ACTIVITY_'.$provider::getId();

		if(isset($categories[\CCrmOwnerType::CompanyName.$categoryId]))
		{
			continue;
		}
		
		$types = CommunicationWidgetPanel::getProviderTypes($provider);

		if ($types && $provider::getSupportedCommunicationStatistics())
		{
			$categories[\CCrmOwnerType::CompanyName.$categoryId] = array(
				'entity' => \CCrmOwnerType::CompanyName,
				'title' => Main\Localization\Loc::getMessage('CRM_COMPANY_ACTIVITY_STAT_PROVIDER_CATEGORY',
					array('#PROVIDER_NAME#' => $provider::getName())
				),
				'name' => $categoryId,
				'enableSemantics' => false
			);

			foreach ($types as $type)
			{
				$categoryId .= '_'.$type['PROVIDER_TYPE_ID'];
				$categories[\CCrmOwnerType::CompanyName.$categoryId] = array(
					'entity' => \CCrmOwnerType::CompanyName,
					'title' => $type['NAME'],
					'name' => $categoryId,
					'enableSemantics' => false
				);
			}
		}
	}
}

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