From b8aab91880172cfd92058eb138cf62953bc60ba3 Mon Sep 17 00:00:00 2001 From: Uryvskiy Dima Date: Fri, 31 Mar 2023 11:29:58 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#88500=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1?= =?UTF-8?q?=D0=BE=D0=BA=20=D0=BF=D1=80=D0=B8=20=D1=83=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=BA=D0=B5=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=B8=20=D0=B2=D1=8B=D0=B3=D1=80=D1=83=D0=B7=D0=BA?= =?UTF-8?q?=D0=B5=20=D0=B8=D1=81=D1=82=D0=BE=D1=80=D0=B8=D0=B8=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BA=D0=B0=D0=B7=D0=BE=D0=B2=20=20(#283)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ .../classes/general/history/RetailCrmHistory_v5.php | 2 +- intaro.retailcrm/description.ru | 3 +-- intaro.retailcrm/install/step2.php | 5 ++++- intaro.retailcrm/install/step3.php | 5 ++++- intaro.retailcrm/install/version.php | 4 ++-- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c33916d8..0fed4365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023-03-29 v.6.2.3 +- Исправление ошибок при установке модуля и выгрузке истории заказов для работы с несколькими сайтами + ## 2023-03-27 v.6.2.2 - Добавление значения по умолчанию у элемента выбора контрагента - Добавлена фильтрация полей по активности diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index ddcce3ab..b6ea0cf1 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -1308,7 +1308,7 @@ class RetailCrmHistory if ($optionsSitesList) { $searchResult = array_search($shopCode, $optionsSitesList, true); - return is_string($searchResult) ? $searchResult : null; + return !empty($searchResult) ? (string) $searchResult : null; } $defaultSite = CSite::GetDefSite(); diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index bf92ba01..421b395e 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1,2 +1 @@ -- Добавление значения по умолчанию у элемента выбора контрагента -- Добавлена фильтрация полей по активности +- Исправление ошибок при установке модуля и выгрузке истории заказов для работы с несколькими сайтами \ No newline at end of file diff --git a/intaro.retailcrm/install/step2.php b/intaro.retailcrm/install/step2.php index f3a6b683..f7af073c 100644 --- a/intaro.retailcrm/install/step2.php +++ b/intaro.retailcrm/install/step2.php @@ -23,7 +23,10 @@ $arResult['arSites'] = RCrmActions::getSitesList(); $RETAIL_CRM_API = new ApiClient($api_host, $api_key); COption::SetOptionString($MODULE_ID, $CRM_API_HOST_OPTION, $api_host); COption::SetOptionString($MODULE_ID, $CRM_API_KEY_OPTION, $api_key); -COption::SetOptionString($MODULE_ID, $CRM_SITES_LIST, serialize([])); + +if (count($arResult['arSites']) === 1) { + COption::SetOptionString($MODULE_ID, $CRM_SITES_LIST, serialize([])); +} if (!isset($arResult['PAYMENT'])) { $arResult['PAYMENT'] = unserialize(COption::GetOptionString($MODULE_ID, $CRM_PAYMENT, 0)); diff --git a/intaro.retailcrm/install/step3.php b/intaro.retailcrm/install/step3.php index 439b613f..e03bd660 100644 --- a/intaro.retailcrm/install/step3.php +++ b/intaro.retailcrm/install/step3.php @@ -24,7 +24,10 @@ $arResult['arSites'] = RCrmActions::getSitesList(); $RETAIL_CRM_API = new ApiClient($api_host, $api_key); COption::SetOptionString($MODULE_ID, $CRM_API_HOST_OPTION, $api_host); COption::SetOptionString($MODULE_ID, $CRM_API_KEY_OPTION, $api_key); -COption::SetOptionString($MODULE_ID, $CRM_SITES_LIST, serialize([])); + +if (count($arResult['arSites']) === 1) { + COption::SetOptionString($MODULE_ID, $CRM_SITES_LIST, serialize([])); +} if (!isset($arResult['bitrixOrderTypesList'])) { $arResult['bitrixOrderTypesList'] = RCrmActions::OrderTypesList($arResult['arSites']); diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 6c714202..08163ae1 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.2.2', - 'VERSION_DATE' => '2023-03-27 14:00:00' + 'VERSION' => '6.2.3', + 'VERSION_DATE' => '2023-03-29 18:00:00' ];