From 612efc9c251eca3b84f4f360c20cad92a70f6560 Mon Sep 17 00:00:00 2001 From: ellynoize Date: Tue, 14 Jan 2025 11:31:39 +0300 Subject: [PATCH 1/4] add deps in file --- intaro.retailcrm/install/index.php | 83 ++++------------------- intaro.retailcrm/install/install_deps.php | 70 +++++++++++++++++++ 2 files changed, 84 insertions(+), 69 deletions(-) create mode 100644 intaro.retailcrm/install/install_deps.php diff --git a/intaro.retailcrm/install/index.php b/intaro.retailcrm/install/index.php index a4c4cb9c..48a45638 100644 --- a/intaro.retailcrm/install/index.php +++ b/intaro.retailcrm/install/index.php @@ -31,7 +31,7 @@ return false; } -include (__DIR__ . '/../lib/component/advanced/installertrait.php'); +require_once(__DIR__ . '/../lib/component/advanced/installertrait.php'); class intaro_retailcrm extends CModule { @@ -57,7 +57,8 @@ public function __construct() $path = substr($path, 0, strlen($path) - strlen('/index.php')); $this->INSTALL_PATH = $path; - include($path . '/version.php'); + require_once($path . '/version.php'); + $this->MODULE_VERSION = $arModuleVersion['VERSION']; $this->MODULE_VERSION_DATE = $arModuleVersion['VERSION_DATE']; $this->MODULE_NAME = GetMessage('RETAIL_MODULE_NAME'); @@ -87,6 +88,17 @@ public function loadDeps() */ function DoInstall() { + try { + require_once('install_deps.php'); + } catch (Error $ex) { + RCrmActions::eventLog( + 'RetailCRM module install error', 'intaro.retailcrm', + $ex->getCode() . ': ' . $ex->getMessage() + ); + + return false; + } + global $APPLICATION, $step, $arResult; if (!in_array('curl', get_loaded_extensions(), true)) { @@ -112,57 +124,6 @@ function DoInstall() return false; } - include($this->INSTALL_PATH . '/../lib/component/apiclient/traits/baseclienttrait.php'); - include($this->INSTALL_PATH . '/../lib/component/apiclient/traits/customerstrait.php'); - include($this->INSTALL_PATH . '/../lib/component/apiclient/traits/customerscorporatetrait.php'); - include($this->INSTALL_PATH . '/../lib/component/apiclient/traits/loyaltytrait.php'); - include($this->INSTALL_PATH . '/../lib/component/apiclient/traits/ordertrait.php'); - include($this->INSTALL_PATH . '/../lib/component/apiclient/traits/carttrait.php'); - include($this->INSTALL_PATH . '/../classes/general/Http/Client.php'); - include($this->INSTALL_PATH . '/../classes/general/Response/ApiResponse.php'); - include($this->INSTALL_PATH . '/../classes/general/RCrmActions.php'); - include($this->INSTALL_PATH . '/../classes/general/user/RetailCrmUser.php'); - include($this->INSTALL_PATH . '/../classes/general/events/RetailCrmEvent.php'); - require_once $this->INSTALL_PATH . '/../classes/general/RetailcrmConfigProvider.php'; - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/offerparam.php'); - include($this->INSTALL_PATH . '/../lib/icml/settingsservice.php'); - include($this->INSTALL_PATH . '/../lib/component/agent.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/selectparams.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/unit.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmlcategory.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmldata.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmloffer.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmlsetup.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmlsetupprops.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmlsetuppropscategories.php'); - include($this->INSTALL_PATH . '/../lib/icml/icmldirector.php'); - include($this->INSTALL_PATH . '/../lib/icml/icmlwriter.php'); - include($this->INSTALL_PATH . '/../lib/icml/queryparamsmolder.php'); - include($this->INSTALL_PATH . '/../lib/icml/xmlcategorydirector.php'); - include($this->INSTALL_PATH . '/../lib/icml/xmlcategoryfactory.php'); - include($this->INSTALL_PATH . '/../lib/icml/xmlofferdirector.php'); - include($this->INSTALL_PATH . '/../lib/icml/xmlofferbuilder.php'); - include($this->INSTALL_PATH . '/../lib/icml/utils/icmlutils.php'); - include($this->INSTALL_PATH . '/../lib/repository/catalogrepository.php'); - include($this->INSTALL_PATH . '/../lib/repository/filerepository.php'); - include($this->INSTALL_PATH . '/../lib/repository/hlrepository.php'); - include($this->INSTALL_PATH . '/../lib/repository/measurerepository.php'); - include($this->INSTALL_PATH . '/../lib/repository/siterepository.php'); - include($this->INSTALL_PATH . '/../lib/service/hl.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/orm/catalogiblockinfo.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/orm/iblockcatalog.php'); - include($this->INSTALL_PATH . '/../classes/general/Exception/InvalidJsonException.php'); - include($this->INSTALL_PATH . '/../classes/general/Exception/CurlException.php'); - include($this->INSTALL_PATH . '/../classes/general/RestNormalizer.php'); - include($this->INSTALL_PATH . '/../classes/general/Logger.php'); - include($this->INSTALL_PATH . '/../classes/general/services/RetailCrmService.php'); - include($this->INSTALL_PATH . '/../lib/component/constants.php'); - $version = COption::GetOptionString($this->MODULE_ID, Constants::CRM_API_VERSION, 0); - include($this->INSTALL_PATH . '/../classes/general/ApiClient_v5.php'); - include($this->INSTALL_PATH . '/../classes/general/order/RetailCrmOrder_v5.php'); - include($this->INSTALL_PATH . '/../classes/general/history/RetailCrmHistory_v5.php'); - include($this->INSTALL_PATH . '/../classes/general/cart/RetailCrmCart_v5.php'); - $step = (int) $_REQUEST['step']; if (file_exists($this->INSTALL_PATH . '/../classes/general/config/options.xml')) { @@ -191,22 +152,6 @@ function DoInstall() } } - include($this->INSTALL_PATH . '/../lib/model/bitrix/abstractmodelproxy.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/orderprops.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/tomodule.php'); - include($this->INSTALL_PATH . '/../lib/repository/abstractrepository.php'); - include($this->INSTALL_PATH . '/../lib/repository/orderpropsrepository.php'); - include($this->INSTALL_PATH . '/../lib/repository/persontyperepository.php'); - include($this->INSTALL_PATH . '/../lib/repository/tomodulerepository.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/orm/tomodule.php'); - include($this->INSTALL_PATH . '/../lib/model/bitrix/agreement.php'); - include($this->INSTALL_PATH . '/../lib/repository/agreementrepository.php'); - include($this->INSTALL_PATH . '/../lib/service/orderloyaltydataservice.php'); - include($this->INSTALL_PATH . '/../lib/service/currencyservice.php'); - include($this->INSTALL_PATH . '/../lib/component/factory/clientfactory.php'); - include($this->INSTALL_PATH . '/../lib/component/apiclient/clientadapter.php'); - include($this->INSTALL_PATH . '/../lib/component/advanced/loyaltyinstaller.php'); - $this->installExport(); $this->subscriptionSetup(); diff --git a/intaro.retailcrm/install/install_deps.php b/intaro.retailcrm/install/install_deps.php new file mode 100644 index 00000000..77b08d6c --- /dev/null +++ b/intaro.retailcrm/install/install_deps.php @@ -0,0 +1,70 @@ +INSTALL_PATH . '/../lib/component/apiclient/traits/baseclienttrait.php'); +require_once($this->INSTALL_PATH . '/../lib/component/apiclient/traits/customerstrait.php'); +require_once($this->INSTALL_PATH . '/../lib/component/apiclient/traits/customerscorporatetrait.php'); +require_once($this->INSTALL_PATH . '/../lib/component/apiclient/traits/loyaltytrait.php'); +require_once($this->INSTALL_PATH . '/../lib/component/apiclient/traits/ordertrait.php'); +require_once($this->INSTALL_PATH . '/../lib/component/apiclient/traits/carttrait.php'); +require_once($this->INSTALL_PATH . '/../classes/general/Http/Client.php'); +require_once($this->INSTALL_PATH . '/../classes/general/Response/ApiResponse.php'); +require_once($this->INSTALL_PATH . '/../classes/general/RCrmActions.php'); +require_once($this->INSTALL_PATH . '/../classes/general/user/RetailCrmUser.php'); +require_once($this->INSTALL_PATH . '/../classes/general/events/RetailCrmEvent.php'); +require_once $this->INSTALL_PATH . '/../classes/general/RetailcrmConfigProvider.php'; +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/offerparam.php'); +require_once($this->INSTALL_PATH . '/../lib/icml/settingsservice.php'); +require_once($this->INSTALL_PATH . '/../lib/component/agent.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/selectparams.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/unit.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmlcategory.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmldata.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmloffer.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmlsetup.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmlsetupprops.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/xml/xmlsetuppropscategories.php'); +require_once($this->INSTALL_PATH . '/../lib/icml/icmldirector.php'); +require_once($this->INSTALL_PATH . '/../lib/icml/icmlwriter.php'); +require_once($this->INSTALL_PATH . '/../lib/icml/queryparamsmolder.php'); +require_once($this->INSTALL_PATH . '/../lib/icml/xmlcategorydirector.php'); +require_once($this->INSTALL_PATH . '/../lib/icml/xmlcategoryfactory.php'); +require_once($this->INSTALL_PATH . '/../lib/icml/xmlofferdirector.php'); +require_once($this->INSTALL_PATH . '/../lib/icml/xmlofferbuilder.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/catalogrepository.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/filerepository.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/hlrepository.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/measurerepository.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/siterepository.php'); +require_once($this->INSTALL_PATH . '/../lib/service/hl.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/orm/catalogiblockinfo.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/orm/iblockcatalog.php'); +require_once($this->INSTALL_PATH . '/../classes/general/Exception/InvalidJsonException.php'); +require_once($this->INSTALL_PATH . '/../classes/general/Exception/CurlException.php'); +require_once($this->INSTALL_PATH . '/../classes/general/RestNormalizer.php'); +require_once($this->INSTALL_PATH . '/../classes/general/Logger.php'); +require_once($this->INSTALL_PATH . '/../classes/general/services/RetailCrmService.php'); +require_once($this->INSTALL_PATH . '/../lib/component/constants.php'); +require_once($this->INSTALL_PATH . '/../classes/general/ApiClient_v5.php'); +require_once($this->INSTALL_PATH . '/../classes/general/order/RetailCrmOrder_v5.php'); +require_once($this->INSTALL_PATH . '/../classes/general/history/RetailCrmHistory_v5.php'); +require_once($this->INSTALL_PATH . '/../classes/general/cart/RetailCrmCart_v5.php'); +require_once($this->INSTALL_PATH . '/../lib/service/managerservice.php'); +require_once($this->INSTALL_PATH . '/../lib/service/loyaltyservice.php'); +require_once($this->INSTALL_PATH . '/../lib/service/loyaltyaccountservice.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/managerrepository.php'); +require_once($this->INSTALL_PATH . '/../classes/general/services/BitrixOrderService.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/abstractmodelproxy.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/orderprops.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/tomodule.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/abstractrepository.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/orderpropsrepository.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/persontyperepository.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/tomodulerepository.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/orm/tomodule.php'); +require_once($this->INSTALL_PATH . '/../lib/model/bitrix/agreement.php'); +require_once($this->INSTALL_PATH . '/../lib/repository/agreementrepository.php'); +require_once($this->INSTALL_PATH . '/../lib/service/orderloyaltydataservice.php'); +require_once($this->INSTALL_PATH . '/../lib/service/currencyservice.php'); +require_once($this->INSTALL_PATH . '/../lib/component/factory/clientfactory.php'); +require_once($this->INSTALL_PATH . '/../lib/component/apiclient/clientadapter.php'); +require_once($this->INSTALL_PATH . '/../lib/component/advanced/loyaltyinstaller.php'); From d4521c4ef579591abc287bbbf436044f6374923d Mon Sep 17 00:00:00 2001 From: ellynoize Date: Tue, 14 Jan 2025 11:38:46 +0300 Subject: [PATCH 2/4] bump --- CHANGELOG.md | 3 +++ intaro.retailcrm/description.ru | 2 +- intaro.retailcrm/install/version.php | 4 ++-- intaro.retailcrm/lib/component/constants.php | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a1b2c91..c2a4b5de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2025-01-14 v6.6.2 +- Исправлена выгрузка архива заказов при установке модуля + ## 2024-12-17 v6.6.1 - Исправлены API методы по взаимодействию с пользовательскими полями и справочниками diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index b7570130..35b66e67 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Исправлены API методы по взаимодействию с пользовательскими полями и справочниками +- Исправлена выгрузка архива заказов при установке модуля diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index c35d6152..0846376a 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.6.1', - 'VERSION_DATE' => '2024-12-17 13:00:00' + 'VERSION' => '6.6.2', + 'VERSION_DATE' => '2025-01-14 13:00:00' ]; diff --git a/intaro.retailcrm/lib/component/constants.php b/intaro.retailcrm/lib/component/constants.php index 327d22f0..311fe169 100644 --- a/intaro.retailcrm/lib/component/constants.php +++ b/intaro.retailcrm/lib/component/constants.php @@ -18,7 +18,7 @@ */ class Constants { - public const MODULE_VERSION = '6.6.1'; + public const MODULE_VERSION = '6.6.2'; public const CRM_PURCHASE_PRICE_NULL = 'purchasePrice_null'; public const BITRIX_USER_ID_PREFIX = 'bitrixUserId-'; public const CRM_USERS_MAP = 'crm_users_map'; From 862aaa842dad6fc82a7c9b08ffda2da8ae4680c5 Mon Sep 17 00:00:00 2001 From: ellynoize Date: Tue, 14 Jan 2025 11:42:21 +0300 Subject: [PATCH 3/4] style --- intaro.retailcrm/install/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intaro.retailcrm/install/index.php b/intaro.retailcrm/install/index.php index 48a45638..01bfd770 100644 --- a/intaro.retailcrm/install/index.php +++ b/intaro.retailcrm/install/index.php @@ -92,7 +92,8 @@ function DoInstall() require_once('install_deps.php'); } catch (Error $ex) { RCrmActions::eventLog( - 'RetailCRM module install error', 'intaro.retailcrm', + 'RetailCRM module install error', + 'intaro.retailcrm', $ex->getCode() . ': ' . $ex->getMessage() ); From 85b530e2bf1aceee0b2fd15d551b67c59aea8d26 Mon Sep 17 00:00:00 2001 From: ellynoize Date: Tue, 14 Jan 2025 15:02:33 +0300 Subject: [PATCH 4/4] renaming variabler --- intaro.retailcrm/install/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intaro.retailcrm/install/index.php b/intaro.retailcrm/install/index.php index 01bfd770..94fbef15 100644 --- a/intaro.retailcrm/install/index.php +++ b/intaro.retailcrm/install/index.php @@ -90,11 +90,11 @@ function DoInstall() { try { require_once('install_deps.php'); - } catch (Error $ex) { + } catch (Error $exception) { RCrmActions::eventLog( 'RetailCRM module install error', 'intaro.retailcrm', - $ex->getCode() . ': ' . $ex->getMessage() + $exception->getCode() . ': ' . $exception->getMessage() ); return false;