• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entitymanagefacility.php
  • Класс: Bitrix\Crm\EntityManageFacility
  • Вызов: EntityManageFacility::canAddReturnCustomerLead
protected function canAddReturnCustomerLead()
{
	// return false if can't add
	if (!$this->canAdd())
	{
		return false;
	}

	//  return false if rc lead gen disabled and leads enabled
	if (!$this->isAutoGenRcEnabled && $this->isLeadEnabled)
	{
		return false;
	}

	// return false if it has entities like company or contact
	if (!$this->selector->hasEntities())
	{
		return false;
	}

	//  return true if register mode is "add always"
	if ($this->registerMode === self::REGISTER_MODE_ALWAYS_ADD)
	{
		return true;
	}

	return $this->selector->canCreateReturnCustomerLead();
}