From ec7cdc55d0b33283d6df3d8dd060a90024044fe5 Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Thu, 24 Aug 2023 18:06:44 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#91590=20=D0=BF=D0=B5=D1=80=D0=B5=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=BD=D0=B0=20=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- intaro.retailcrm/lang/ru/options.php | 2 +- intaro.retailcrm/options.php | 38 +++++++++++----------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/intaro.retailcrm/lang/ru/options.php b/intaro.retailcrm/lang/ru/options.php index 946f2eb7..cec67572 100644 --- a/intaro.retailcrm/lang/ru/options.php +++ b/intaro.retailcrm/lang/ru/options.php @@ -28,7 +28,7 @@ $MESS ['INTEGRATION_PAYMENT_LIST'] = 'Для интеграционных опл $MESS ['INTEGRATIONS'] = ' (интеграционная)'; $MESS ['ERR_CURRENCY_SITES'] = 'Базовая валюта отличается от валюты магазина в CRM!'; -$MESS ['ERR_COUNT_SITES'] = 'По введенному ключу апи доступно больше магазинов, чем существует в CMS!'; +$MESS ['ERR_COUNT_SITES'] = 'По введенному ключу апи доступно больше одного магазина!'; $MESS ['ICRM_OPTIONS_SUBMIT_TITLE'] = 'Сохранить настройки'; $MESS ['ICRM_OPTIONS_SUBMIT_VALUE'] = 'Сохранить'; diff --git a/intaro.retailcrm/options.php b/intaro.retailcrm/options.php index ec00e29b..364714df 100644 --- a/intaro.retailcrm/options.php +++ b/intaro.retailcrm/options.php @@ -1061,21 +1061,21 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { $currencyOption = COption::GetOptionString($mid, $CRM_CURRENCY, 0) ?: $baseCurrency; $currencyList = \Bitrix\Currency\CurrencyManager::getCurrencyList(); - $errorText = []; + $errorsText = []; foreach ($arResult['sitesList'] as $site) { if ($site['currency'] !== $baseCurrency) { - $errorText[] = GetMessage('ERR_CURRENCY_SITES') . '(' . $site['name'] . ')'; + $errorsText[] = GetMessage('ERR_CURRENCY_SITES') . '(' . $site['name'] . ')'; } } - $errCountSites = null; - - if (count($arResult['arSites']) < count($arResult['sitesList'])) { - $errorText[] = GetMessage('ERR_COUNT_SITES'); + if (count($arResult['arSites']) === 1 && count($arResult['sitesList']) > 1) { + $errorsText[] = GetMessage('ERR_COUNT_SITES'); } - + if (preg_match('/&errc=ERR_(.*)/is', $uri, $matches)){ + $errorsText[] = $matches[1]; + } $customFields = [['code' => '__default_empty_value__', 'name' => GetMessage('SELECT_VALUE')]]; $crmCouponFieldOption = COption::GetOptionString($mid, $CRM_COUPON_FIELD, 0) ?: null; @@ -1488,23 +1488,15 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { - + - - - - - - - - - - - - - - - + + + + + + +