• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/rest/externalchannelimport.php
  • Класс: Bitrix\Crm\Rest\CCrmExternalChannelImport
  • Вызов: CCrmExternalChannelImport::checkLicense
public function checkLicense($type='')
{
	$result = true;

	$fields = $this->getRawData();

	if(($activityInfo = $fields[self::ACTIVITY]) && count($activityInfo)>0)
	{
		$result = false;

		$typeId = self::resolveTypeIdActivityByFields($activityInfo);

		if($typeId>0)
		{
			switch ($typeId)
			{
				case CCrmExternalChannelActivityType::ActivityFaceCard:

					switch ($type)
					{
						case 'tariff':
							$result = $this->licenceIsRestricted()? false:true;
							break;
						case 'accepted':
							$result = $this->agreementIsAccepted();
							break;
					}

					break;
				case CCrmExternalChannelActivityType::Activity:
					$result = true;
					break;
			}
		}
	}

	return $result;
}