From 13cf7b8e5cbfb98753af8b2ff7c508da92d1efd6 Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Mon, 14 Aug 2023 10:00:58 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#91040=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=20=D1=81?= =?UTF-8?q?=D1=82=D0=B8=D0=BB=D1=8E=20=D0=BA=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classes/general/events/RetailCrmEvent.php | 10 +++++----- intaro.retailcrm/lang/en/install/index.php | 2 +- .../lib/component/installer/installertrait.php | 6 ++++-- intaro.retailcrm/updater.php | 18 ++++++++++-------- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/intaro.retailcrm/classes/general/events/RetailCrmEvent.php b/intaro.retailcrm/classes/general/events/RetailCrmEvent.php index ba524c0d..87b24255 100644 --- a/intaro.retailcrm/classes/general/events/RetailCrmEvent.php +++ b/intaro.retailcrm/classes/general/events/RetailCrmEvent.php @@ -663,7 +663,7 @@ class RetailCrmEvent /* @var CustomerService $customerService */ $customerService = ServiceLocator::get(CustomerService::class); - $customer = $customerService->createModel($arFields['USER_ID']); + $customer = $customerService->createModel($arFields['USER_ID']); $customerService->createOrUpdateCustomer($customer); @@ -674,12 +674,12 @@ class RetailCrmEvent && (int) $arFields['UF_AGREE_PL_INTARO'] === 1 && (int) $arFields['UF_PD_PROC_PL_INTARO'] === 1 ) { - $phone = $arFields['PERSONAL_PHONE'] ?? ''; - $card = $arFields['UF_CARD_NUM_INTARO'] ?? ''; - $customerId = (string) $arFields['USER_ID']; + $phone = $arFields['PERSONAL_PHONE'] ?? ''; + $card = $arFields['UF_CARD_NUM_INTARO'] ?? ''; + $customerId = (string) $arFields['USER_ID']; /** @var LoyaltyAccountService $service */ - $service = ServiceLocator::get(LoyaltyAccountService::class); + $service = ServiceLocator::get(LoyaltyAccountService::class); $createResponse = $service->createLoyaltyAccount($phone, $card, $customerId); $service->activateLpUserInBitrix($createResponse, $arFields['USER_ID']); diff --git a/intaro.retailcrm/lang/en/install/index.php b/intaro.retailcrm/lang/en/install/index.php index 4a1a998b..a1414f85 100644 --- a/intaro.retailcrm/lang/en/install/index.php +++ b/intaro.retailcrm/lang/en/install/index.php @@ -16,4 +16,4 @@ $MESS ['RETAILCRM_CURL_ERR'] = 'RetailCRM integration module requires PHP CURL e $MESS ['ERR_ARTICLE_IBLOCK'] = 'Articles are not set'; $MESS ['DATE_TIMEZONE_ERR'] = 'Timezone is not specified in php settings.'; $MESS ['SALE_VERSION_ERR'] = '\'Online-store\' module version must be higher than 16.'; -$MESS['UF_SUBSCRIBE_USER_EMAIL_TITLE'] = 'Agree to receive promotional newsletters'; +$MESS['UF_SUBSCRIBE_USER_EMAIL_TITLE'] = 'Agree to receive promotional newsletters'; diff --git a/intaro.retailcrm/lib/component/installer/installertrait.php b/intaro.retailcrm/lib/component/installer/installertrait.php index 968e3662..c8d25f15 100644 --- a/intaro.retailcrm/lib/component/installer/installertrait.php +++ b/intaro.retailcrm/lib/component/installer/installertrait.php @@ -253,13 +253,15 @@ trait InstallerTrait private function copy($directory, $template): void { $templatePath = $_SERVER['DOCUMENT_ROOT'] - . '/local/templates/.default/components/bitrix/' . $template['name'] . '/'. $directory; + . '/local/templates/.default/components/bitrix/' . $template['name'] . '/'. $directory + ; if (!file_exists($templatePath)) { $pathFrom = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/intaro.retailcrm/install/export/local/components/intaro/' . $template['name'] - . '/templates/' . $template['templateDirectory']; + . '/templates/' . $template['templateDirectory'] + ; CopyDirFiles( $pathFrom, diff --git a/intaro.retailcrm/updater.php b/intaro.retailcrm/updater.php index fe387d0c..60a990fb 100644 --- a/intaro.retailcrm/updater.php +++ b/intaro.retailcrm/updater.php @@ -1104,13 +1104,15 @@ class UpdateSubscribe foreach ($templateNames as $directory => $templates) { foreach ($templates as $template) { $templatePath = $_SERVER['DOCUMENT_ROOT'] - . '/local/templates/.default/components/bitrix/' . $template['name'] . '/' . $directory; + . '/local/templates/.default/components/bitrix/' . $template['name'] . '/' . $directory + ; if (!file_exists($templatePath)) { $pathFrom = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/intaro.retailcrm/install/export/local/components/intaro/' . $template['name'] - . '/templates/' . $template['templateDirectory']; + . '/templates/' . $template['templateDirectory'] + ; CopyDirFiles( $pathFrom, @@ -1147,18 +1149,18 @@ class UpdateSubscribe public function addCustomUserField(): self { $arProps = [ - 'ENTITY_ID' => 'USER', - 'FIELD_NAME' => 'UF_SUBSCRIBE_USER_EMAIL', - 'USER_TYPE_ID' => 'boolean', - 'MULTIPLE' => 'N', - 'MANDATORY' => 'N', + 'ENTITY_ID' => 'USER', + 'FIELD_NAME' => 'UF_SUBSCRIBE_USER_EMAIL', + 'USER_TYPE_ID' => 'boolean', + 'MULTIPLE' => 'N', + 'MANDATORY' => 'N', 'EDIT_FORM_LABEL' => ['ru' => 'Подписка на события'], ]; $props = array_merge($arProps, []); $obUserField = new CUserTypeEntity(); - $dbRes = CUserTypeEntity::GetList([], ['FIELD_NAME' => 'UF_SUBSCRIBE_USER_EMAIL'])->fetch(); + $dbRes = CUserTypeEntity::GetList([], ['FIELD_NAME' => 'UF_SUBSCRIBE_USER_EMAIL'])->fetch(); if (!$dbRes['ID']) { $obUserField->Add($props);