ActivityMarkStatistics::getPresets

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. ActivityMarkStatistics
  4. getPresets
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/widget/data/company/activitymarkstatistics.php
  • Класс: Bitrix\Crm\Widget\Data\Company\ActivityMarkStatistics
  • Вызов: ActivityMarkStatistics::getPresets
static function getPresets()
{
	static::includeModuleFile();
	$result = array();
	$categories = static::getProviderCategories(CommunicationStatistics::STATISTICS_MARKS);

	foreach ($categories as $categoryId => $presetPrefix)
	{
		$result[] =	array(
			'entity' => \CCrmOwnerType::CompanyName,
			'title' => GetMessage('CRM_COMPANY_ACTIVITY_MARK_STAT_TOTAL'),
			'name' => self::TYPE_NAME.'::'.$presetPrefix.':TOTAL',
			'source' => self::TYPE_NAME,
			'select' => array(
				'name' => 'TOTAL',
				'aggregate' => 'SUM'
			),
			'context' => DataContext::ENTITY,
			'category' => $categoryId,
			'grouping' => array('extras' => array(self::GROUP_BY_SOURCE, self::GROUP_BY_MARK))
		);
		$result[] =	array(
			'entity' => \CCrmOwnerType::CompanyName,
			'title' => GetMessage('CRM_COMPANY_ACTIVITY_MARK_STAT_NONE_QTY'),
			'name' => self::TYPE_NAME.'::'.$presetPrefix.':NONE_QTY',
			'source' => self::TYPE_NAME,
			'select' => array(
				'name' => 'NONE_QTY',
				'aggregate' => 'SUM'
			),
			'context' => DataContext::ENTITY,
			'category' => $categoryId,
			'grouping' => array('extras' => array(self::GROUP_BY_SOURCE, self::GROUP_BY_MARK))
		);
		$result[] =	array(
			'entity' => \CCrmOwnerType::CompanyName,
			'title' => GetMessage('CRM_COMPANY_ACTIVITY_MARK_STAT_NEGATIVE_QTY'),
			'name' => self::TYPE_NAME.'::'.$presetPrefix.':NEGATIVE_QTY',
			'source' => self::TYPE_NAME,
			'select' => array(
				'name' => 'NEGATIVE_QTY',
				'aggregate' => 'SUM'
			),
			'context' => DataContext::ENTITY,
			'category' => $categoryId,
			'grouping' => array('extras' => array(self::GROUP_BY_SOURCE, self::GROUP_BY_MARK))
		);
		$result[] =	array(
			'entity' => \CCrmOwnerType::CompanyName,
			'title' => GetMessage('CRM_COMPANY_ACTIVITY_MARK_STAT_POSITIVE_QTY'),
			'name' => self::TYPE_NAME.'::'.$presetPrefix.':POSITIVE_QTY',
			'source' => self::TYPE_NAME,
			'select' => array(
				'name' => 'POSITIVE_QTY',
				'aggregate' => 'SUM'
			),
			'context' => DataContext::ENTITY,
			'category' => $categoryId,
			'grouping' => array('extras' => array(self::GROUP_BY_SOURCE, self::GROUP_BY_MARK))
		);
	}

	return $result;
}

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