From 3162031b65ada8d536abbfc6efd0e090700aec70 Mon Sep 17 00:00:00 2001 From: Kocmonavtik <61938582+Kocmonavtik@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:33:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8=D1=87?= =?UTF-8?q?=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B2=D0=BE=D0=B9=D1=81?= =?UTF-8?q?=D1=82=D0=B2=20=D0=B2=20ICML=20(#375)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 + intaro.retailcrm/description.ru | 2 +- intaro.retailcrm/export/export_run.php | 5 +- intaro.retailcrm/export/export_setup.php | 246 +++++++++++++++-- intaro.retailcrm/include.php | 4 + .../js/intaro/export/custom-props-export.js | 228 ++++++++++++++++ intaro.retailcrm/install/version.php | 4 +- .../lang/en/icml_export_setup.php | 2 + .../lang/ru/icml_export_setup.php | 2 + .../lib/component/advanced/installertrait.php | 20 +- .../lib/controller/customexportprops.php | 95 +++++++ intaro.retailcrm/lib/icml/settingsservice.php | 256 +++++++++++++++--- intaro.retailcrm/lib/icml/xmlofferbuilder.php | 10 +- intaro.retailcrm/updater.php | 39 +-- tests/lib/icml/SettingServiceTest.php | 19 -- 15 files changed, 817 insertions(+), 118 deletions(-) create mode 100644 intaro.retailcrm/install/export/bitrix/js/intaro/export/custom-props-export.js create mode 100644 intaro.retailcrm/lib/controller/customexportprops.php diff --git a/CHANGELOG.md b/CHANGELOG.md index c32d325b..eccd6942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2024-12-09 v6.6.0 +- Добавлено динамическое изменение свойств товаров при настройке экспорта + ## 2024-12-08 v6.5.39 - Исправлена поломка заказов с промокодом Maxma при включенной передаче корзины в CRM diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index 6bbd2283..18aaf57b 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Исправлена поломка заказов с промокодом Maxma при включенной передаче корзины в CRM +- Добавлено динамическое изменение свойств товаров при настройке экспорта diff --git a/intaro.retailcrm/export/export_run.php b/intaro.retailcrm/export/export_run.php index 22c74766..dee1703d 100644 --- a/intaro.retailcrm/export/export_run.php +++ b/intaro.retailcrm/export/export_run.php @@ -38,7 +38,8 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/retailcrm/exp } } - $settingService = SettingsService::getInstance([], ''); + global $PROFILE_ID; + $settingService = SettingsService::getInstance([], '', $PROFILE_ID); $iblockPropertySku = []; $iblockPropertySkuHl = []; $iblockPropertyUnitSku = []; @@ -46,7 +47,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/retailcrm/exp $iblockPropertyProductHl = []; $iblockPropertyUnitProduct = []; - foreach (array_keys($settingService->actrualPropList) as $prop) { + foreach (array_keys($settingService->actualPropList) as $prop) { $skuUnitProps = ('iblockPropertyUnitSku_' . $prop); $skuUnitProps = $$skuUnitProps; diff --git a/intaro.retailcrm/export/export_setup.php b/intaro.retailcrm/export/export_setup.php index d9d0f91e..2b8a3f1c 100644 --- a/intaro.retailcrm/export/export_setup.php +++ b/intaro.retailcrm/export/export_setup.php @@ -26,7 +26,8 @@ CModule::IncludeModule('intaro.retailcrm'); //TODO заменить вызов на сервис-локатор, когда он приедет $settingsService = SettingsService::getInstance( $arOldSetupVars ?? [], - $ACTION + $ACTION, + $PROFILE_ID ); $isSetupModulePage = $settingsService->isSetupModulePage(); @@ -110,7 +111,7 @@ if ($STEP === 1) { } -
+ @@ -190,8 +191,7 @@ if ($STEP === 1) { actrualPropList as $propertyKey => $property) { - $productSelected = false; ?> + foreach ($settingsService->defaultPropList as $propertyKey => $property) { ?> @@ -215,14 +215,14 @@ if ($STEP === 1) { if ($keyField === $propertyKey) { ?> @@ -241,7 +241,7 @@ if ($STEP === 1) { getOptionClass($prop, true); - $productSelected = $settingsService->isOptionSelected( + $isSelected = $settingsService->isOptionSelected( $prop, $arIBlock['OLD_PROPERTY_PRODUCT_SELECT'], $propertyKey @@ -251,7 +251,7 @@ if ($STEP === 1) { = $settingsService->getHlTableName($prop) ?? $productHlTableName; - echo $productSelected ? ' selected' : ''; + echo $isSelected ? ' selected' : ''; ?> > @@ -376,19 +376,18 @@ if ($STEP === 1) {