• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/update/welcomeform.php
  • Класс: BitrixImopenlinesUpdateWelcomeForm
  • Вызов: WelcomeForm::setFormIdForExistingConfigs
static function setFormIdForExistingConfigs(): string
{
	if (!Loader::includeModule('crm'))
	{
		$sql = "UPDATE b_imopenlines_config SET USE_WELCOME_FORM = 'N'";
		HttpApplication::getConnection()->query($sql);

		return "";
	}

	$defaultWelcomeFormId = (new Preset)->getInstalledId('imol_reg');
	if ($defaultWelcomeFormId && (new Form($defaultWelcomeFormId))->isActive())
	{
		$sql = "UPDATE b_imopenlines_config SET WELCOME_FORM_ID = '" . $defaultWelcomeFormId . "' WHERE WELCOME_FORM_ID IS NULL";
		HttpApplication::getConnection()->query($sql);
	}

	return "";
}