From ff71691c5e8bc7410b37d66ce7720ad0e3a93973 Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Mon, 28 Aug 2023 12:58:19 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#91590=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B5=20=D0=BC?= =?UTF-8?q?=D0=BE=D0=B4=D1=83=D0=BB=D1=8F=20=D0=98=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=82=D0=B5=D0=BA=D1=81=D1=82=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- intaro.retailcrm/install/index.php | 18 ++++++++++++++---- intaro.retailcrm/lang/ru/install/step1.php | 2 +- intaro.retailcrm/lang/ru/options.php | 2 +- intaro.retailcrm/options.php | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/intaro.retailcrm/install/index.php b/intaro.retailcrm/install/index.php index 7a999bd2..efb794a6 100644 --- a/intaro.retailcrm/install/index.php +++ b/intaro.retailcrm/install/index.php @@ -369,11 +369,8 @@ class intaro_retailcrm extends CModule } $arResult['arSites'] = RCrmActions::getSitesList(); - $arResult['arCurrencySites'] = RCrmActions::getCurrencySites(); - $bitrixBaseCurrency = CCurrency::GetBaseCurrency(); if (count($arResult['arSites']) > 1) { - $api_host = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_HOST_OPTION, 0); $api_key = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_KEY_OPTION, 0); @@ -385,6 +382,16 @@ class intaro_retailcrm extends CModule } } + $arResult['arCurrencySites'] = RCrmActions::getCurrencySites(); + $bitrixBaseCurrency = CCurrency::GetBaseCurrency(); + $result = $this->getReferenceShops($api_host, $api_key); + + if (isset($result['errCode'])) { + $arResult['errCode'] = $result['errCode']; + } else { + $arResult['sitesList'] = $result['sitesList']; + } + foreach ($arResult['arSites'] as $bitrixSite) { $currentCurrency = $bitrixBaseCurrency; $LID = $bitrixSite['LID']; @@ -403,8 +410,11 @@ class intaro_retailcrm extends CModule if (count($arResult['arSites']) != count($siteCode)) { $arResult['errCode'] = 'ERR_FIELDS_API_HOST'; + } + + if (isset($arResult['errCode'])) { $APPLICATION->IncludeAdminFile( - GetMessage('MODULE_INSTALL_TITLE'), $this->INSTALL_PATH . '/step11.php' + GetMessage('MODULE_INSTALL_TITLE'), $this->INSTALL_PATH . '/step1.php' ); return false; diff --git a/intaro.retailcrm/lang/ru/install/step1.php b/intaro.retailcrm/lang/ru/install/step1.php index c9d3a767..d115e151 100644 --- a/intaro.retailcrm/lang/ru/install/step1.php +++ b/intaro.retailcrm/lang/ru/install/step1.php @@ -12,7 +12,7 @@ $MESS ['ERR_0'] = 'Превышено время ожидания ответа $MESS ['ERR_FIELDS_API_HOST'] = 'Неверно заполнены поля.'; $MESS ['ERR_METHOD_NOT_FOUND'] = 'Проверьте доступность методов API по текущему ключу.'; $MESS ['ERR_COUNT_SITES'] = 'По введенному ключу апи доступно больше одного магазина!'; -$MESS ['ERR_CURRENCY_SITES'] = 'Базовая валюта отличается от валюты магазина в CRM'; +$MESS ['ERR_CURRENCY_SITES'] = 'Валюта сайта отличается от валюты магазина в CRM!'; //$MESS ['URL_NOT_FOUND'] = 'В настройках одного или нескольких сайтов не заполнено поле "URL сервера".'; $MESS ['INFO_1'] = 'Введите адрес экземпляра RetailCRM (например, https://demo.retailcrm.ru) и API-ключ.'; $MESS ['INFO_2'] = 'API-ключ можно сгенерировать при регистрации магазина в RetailCRM (Администрирование > Интеграция).'; diff --git a/intaro.retailcrm/lang/ru/options.php b/intaro.retailcrm/lang/ru/options.php index cec67572..81da3d5c 100644 --- a/intaro.retailcrm/lang/ru/options.php +++ b/intaro.retailcrm/lang/ru/options.php @@ -27,7 +27,7 @@ $MESS ['ORDER_UPLOAD_INFO'] = 'Для загрузки всех заказов $MESS ['INTEGRATION_PAYMENT_LIST'] = 'Для интеграционных оплат статус не передаётся'; $MESS ['INTEGRATIONS'] = ' (интеграционная)'; -$MESS ['ERR_CURRENCY_SITES'] = 'Базовая валюта отличается от валюты магазина в CRM!'; +$MESS ['ERR_CURRENCY_SITES'] = 'Валюта сайта отличается от валюты магазина в CRM!'; $MESS ['ERR_COUNT_SITES'] = 'По введенному ключу апи доступно больше одного магазина!'; $MESS ['ICRM_OPTIONS_SUBMIT_TITLE'] = 'Сохранить настройки'; diff --git a/intaro.retailcrm/options.php b/intaro.retailcrm/options.php index af9d6ac6..50f4215b 100644 --- a/intaro.retailcrm/options.php +++ b/intaro.retailcrm/options.php @@ -1077,7 +1077,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { } if ($currentCurrency !== $arResult['sitesList'][$crmCode]['currency']) { - $errorsText[] = GetMessage('ERR_CURRENCY_SITES') . '(' . $arResult['sitesList'][$crmCode]['name'] . ')'; + $errorsText[] = GetMessage('ERR_CURRENCY_SITES') . ' (' . $arResult['sitesList'][$crmCode]['name'] . ')'; } } } else {