• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_productprops_helper.php
  • Класс: \CCrmProductPropsHelper
  • Вызов: CCrmProductPropsHelper::AjustExportMode
static function AjustExportMode ($exportType, $propertyInfo)
{
	$result = 'CSV_EXPORT';

	if (!is_string($exportType) || $exportType === '')
	{
		$exportType = 'csv';
	}
	else
	{
		$exportType = mb_strtolower($exportType);
	}

	switch ($exportType)
	{
		case 'csv':
			$result = 'CSV_EXPORT';
			break;
		case 'excel':
			$propertyType = '';
			if (isset($propertyInfo['PROPERTY_TYPE']))
			{
				$propertyType .= $propertyInfo['PROPERTY_TYPE'];
			}
			if ($propertyType != '' && isset($propertyInfo['USER_TYPE']) && $propertyInfo['USER_TYPE'] != '')
			{
				$propertyType .= ':'.$propertyInfo['USER_TYPE'];
			}
			switch ($propertyType)
			{
				case 'S:DateTime':
				case 'S:map_yandex':
					$result = 'CSV_EXPORT';
					break;
				case 'S:HTML':
					$result = null;
					break;
				default:
					$result = 'EXCEL_EXPORT';
			}
			break;
	}

	return $result;
}