From de7a2bc1defa70162b4c538031a457f9c3f0a120 Mon Sep 17 00:00:00 2001 From: Uryvskiy Dima Date: Thu, 1 Jun 2023 13:33:41 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#89446=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=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20ICML=20=D0=BA=D0=B0=D1=82=D0=B0=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=B8=20=D1=83=D1=81=D1=82=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=B5=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8F?= =?UTF-8?q?=20(#294)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 + intaro.retailcrm/description.ru | 3 +- intaro.retailcrm/export/export_setup.php | 18 +++-- intaro.retailcrm/install/index.php | 82 ++++++++-------------- intaro.retailcrm/install/version.php | 4 +- intaro.retailcrm/lang/en/install/step5.php | 5 +- intaro.retailcrm/lang/ru/install/step5.php | 2 +- 7 files changed, 48 insertions(+), 69 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c503100..efd54dff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023-06-01 v.6.3.9 +- Исправление ошибок генерации ICML каталога при установке модуля + ## 2023-06-01 v.6.3.8 - Исправлена ошибка с получением настроек при генерации файла каталога diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index d347472a..490f0d30 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1,2 +1 @@ -- Исправлена ошибка с получением настроек при генерации файла каталога - +- Исправление ошибок генерации ICML каталога при установке модуля \ No newline at end of file diff --git a/intaro.retailcrm/export/export_setup.php b/intaro.retailcrm/export/export_setup.php index 06534af7..51467fc4 100644 --- a/intaro.retailcrm/export/export_setup.php +++ b/intaro.retailcrm/export/export_setup.php @@ -492,20 +492,18 @@ if ($STEP === 1) { $SETUP_FILE_NAME : $settingsService->setupFileName); ?>" size="50">

  > -
+

  > -


+

  -
+

+   +

-
-   - -
- +
@@ -586,9 +584,9 @@ if ($STEP === 1) { function checkLoadStatus(object) { if (object.checked) { - $('#loadMessage').show(); + $('#loadMessageNow').show(); } else { - $('#loadMessage').hide(); + $('#loadMessageNow').hide(); } } diff --git a/intaro.retailcrm/install/index.php b/intaro.retailcrm/install/index.php index 54ed143e..16c0d213 100644 --- a/intaro.retailcrm/install/index.php +++ b/intaro.retailcrm/install/index.php @@ -938,14 +938,8 @@ class intaro_retailcrm extends CModule ); } - if (!isset($_POST['iblockExport'])) { - $arResult['errCode'] = 'ERR_FIELDS_IBLOCK'; - } else { - $iblocks = $_POST['iblockExport']; - } - $hlblockModule = false; - //highloadblock + if (CModule::IncludeModule('highloadblock')) { $hlblockModule = true; $hlblockList = []; @@ -1017,29 +1011,22 @@ class intaro_retailcrm extends CModule } } - if (!isset($_POST['SETUP_FILE_NAME'])) { - $arResult['errCode'] = 'ERR_FIELDS_FILE'; - } else { - $filename = $_POST['SETUP_FILE_NAME']; + $iblocks = $_POST['iblockExport'] ?? null; + $filename = $_POST['SETUP_FILE_NAME'] ?? null; + $maxOffers = $_POST['maxOffersValue'] ?? null; + $profileName = $_POST['SETUP_PROFILE_NAME'] ?? null; + $loadPurchasePrice = $_POST['loadPurchasePrice'] ?? null; + $loadInactiveProduct = $_POST['loadNonActivity'] ?? null; + + if ($iblocks === null) { + $arResult['errCode'] = 'ERR_FIELDS_IBLOCK'; } - if (!isset($_POST['maxOffersValue'])) { - $maxOffers = null; - } else { - $maxOffers = (int) $_POST['maxOffersValue']; - } - - if (!isset($_POST['SETUP_PROFILE_NAME'])) { - $profileName = ''; - } else { - $profileName = $_POST['SETUP_PROFILE_NAME']; - } - - if ($profileName == '') { + if ($profileName === null) { $arResult['errCode'] = 'ERR_FIELDS_PROFILE'; } - if ($filename === '') { + if ($filename === null) { $arResult['errCode'] = 'ERR_FIELDS_FILE'; } @@ -1053,6 +1040,8 @@ class intaro_retailcrm extends CModule 'SETUP_FILE_NAME' => $filename, 'SETUP_PROFILE_NAME' => $profileName, 'maxOffersValue' => $maxOffers, + 'loadPurchasePrice' => $loadPurchasePrice, + 'loadNonActivity' => $loadInactiveProduct, ]; global $oldValues; @@ -1121,8 +1110,11 @@ class intaro_retailcrm extends CModule $propertiesHbSKU, $propertiesHbProduct, $filename, - $maxOffers + $maxOffers, + $loadPurchasePrice, + $loadInactiveProduct ); + $profileId = CCatalogExport::Add([ 'LAST_USE' => false, 'FILE_NAME' => $this->RETAIL_CRM_EXPORT, @@ -1150,18 +1142,10 @@ class intaro_retailcrm extends CModule $agentId = null; if (isset($_POST['NEED_CATALOG_AGENT'])) { - $dateAgent = new DateTime(); - $intAgent = new DateInterval('PT60S'); // PT60S - 60 sec; - $dateAgent->add($intAgent); $agentId = CAgent::AddAgent( 'CCatalogExport::PreGenerateExport(' . $profileId . ');', 'catalog', 'N', - 86400, - $dateAgent->format('d.m.Y H:i:s'), - 'Y', - $dateAgent->format('d.m.Y H:i:s'), - 30 ); CCatalogExport::Update($profileId, [ @@ -1169,19 +1153,8 @@ class intaro_retailcrm extends CModule ]); } - if ( - isset($_POST['LOAD_NOW']) - && $agentId === null - ) { - CAgent::AddAgent( - '\Intaro\RetailCrm\Component\Agent::preGenerateExport(' . $profileId . ');', - $this->MODULE_ID, - 'N', - 86400, - $dateAgent->format('d.m.Y H:i:s'), - 'Y', - $dateAgent->format('d.m.Y H:i:s') - ); + if (isset($_POST['LOAD_NOW']) && $agentId === null) { + CCatalogExport::PreGenerateExport($profileId); } $api_host = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_HOST_OPTION, 0); @@ -1330,7 +1303,9 @@ class intaro_retailcrm extends CModule $propertiesHbSKU, $propertiesHbProduct, $filename, - $maxOffers + $maxOffers, + $loadPurchasePrice, + $loadInactiveProduct ): string { $strVars = ''; @@ -1354,10 +1329,15 @@ class intaro_retailcrm extends CModule } } - $strVars .= 'SETUP_FILE_NAME=' . urlencode($filename); - $strVars .= '&maxOffersValue=' . urlencode($maxOffers); + $additionalProperties = sprintf( + 'SETUP_FILE_NAME=%s&maxOffersValue=%s&loadPurchasePrice=%s&loadNonActivity=%s', + $filename, + $maxOffers, + $loadPurchasePrice, + $loadInactiveProduct + ); - return $strVars; + return $strVars . $additionalProperties; } /** diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 512b1700..d688f421 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.3.8', - 'VERSION_DATE' => '2023-06-01 12:00:00' + 'VERSION' => '6.3.9', + 'VERSION_DATE' => '2023-06-01 14:00:00' ]; diff --git a/intaro.retailcrm/lang/en/install/step5.php b/intaro.retailcrm/lang/en/install/step5.php index 0d1dc1c6..afbc7bf8 100644 --- a/intaro.retailcrm/lang/en/install/step5.php +++ b/intaro.retailcrm/lang/en/install/step5.php @@ -13,9 +13,8 @@ $MESS ['PAYMENT_N'] = 'Not paid'; $MESS ['CANCELED'] = 'Is «Cancelled»'; $MESS ['INFO_1'] = ' Set the correspondence between 1C-Bitrix data books and RetailCRM data books.'; $MESS ['AGENT_LOADING'] = 'Export catalog periodically (By Agent every 24 hours)'; -$MESS ['LOAD_NOW'] = 'Export now'; -$MESS ['LOAD_NOW_MSG'] = 'The generation will start after you click "Finish installation". -This may take some time'; +$MESS ['LOAD_NOW'] = 'Generate ICML catalog now'; +$MESS ['LOAD_NOW_MSG'] = 'The generation will start after you click "Finish installation". This may take some time'; $MESS ['PROFILE_NAME'] = 'Profile name:'; $MESS ['PROFILE_NAME_EXAMPLE'] = 'RetailCRM catalog export'; $MESS ['ERR_FIELDS_PROFILE'] = 'Invalid profile name field'; diff --git a/intaro.retailcrm/lang/ru/install/step5.php b/intaro.retailcrm/lang/ru/install/step5.php index dbe277e0..5831a35b 100644 --- a/intaro.retailcrm/lang/ru/install/step5.php +++ b/intaro.retailcrm/lang/ru/install/step5.php @@ -13,7 +13,7 @@ $MESS ['PAYMENT_N'] = 'Не оплачен'; $MESS ['CANCELED'] = 'Флаг «Отменен»'; $MESS ['INFO_1'] = ' Задайте соответствие между справочниками 1C-Битрикс и справочниками RetailCRM.'; $MESS ['AGENT_LOADING'] = 'Выгружать каталог периодически (Агентом каждые 24 часа)'; -$MESS ['LOAD_NOW'] = 'Выгрузить сейчас'; +$MESS ['LOAD_NOW'] = 'Сгенерировать ICML каталог сейчас'; $MESS ['LOAD_NOW_MSG'] = 'Генерация начнется после нажатия "Завершить установку". Это может занять некоторое время'; $MESS ['PROFILE_NAME'] = 'Имя профиля:'; $MESS ['PROFILE_NAME_EXAMPLE'] = 'Выгрузка каталога RetailCRM';