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';