• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/export.php
  • Класс: Bitrix\Crm\Controller\Export
  • Вызов: Export::checkCommonErrors
protected function checkCommonErrors($action)
{
	parent::checkCommonErrors($action);

	if ($this->entityType === '')
	{
		$this->addError(new Error('Entity type is not specified.'));
	}
	$entityTypeId = \CCrmOwnerType::ResolveID($this->entityType);
	$allowedTypes = ['PRODUCT', \CCrmOwnerType::CheckCorrectionName];
	if($entityTypeId === \CCrmOwnerType::Undefined && !in_array($this->entityType, $allowedTypes))
	{
		$this->addError(new Error('Undefined entity type is specified.'));
	}

	if ($this->entityType === \CCrmOwnerType::ContactName)
	{
		if (!\CCrmContact::CheckExportPermission())
		{
			$this->addError(new Error('Access denied.'));
		}
	}

	return count($this->getErrors()) === 0;
}