diff --git a/intaro.retailcrm/include.php b/intaro.retailcrm/include.php index 282d0836..2f7f6499 100644 --- a/intaro.retailcrm/include.php +++ b/intaro.retailcrm/include.php @@ -11,6 +11,7 @@ use Intaro\RetailCrm\Service\OrderLoyaltyDataService; use Intaro\RetailCrm\Service\LoyaltyService; use Intaro\RetailCrm\Service\LoyaltyAccountService; use Intaro\RetailCrm\Service\CustomerService; +use Intaro\RetailCrm\Service\SubscriberService; use Intaro\RetailCrm\Vendor\Doctrine\Common\Annotations\AnnotationReader; use Intaro\RetailCrm\Vendor\Doctrine\Common\Annotations\AnnotationRegistry; use \Intaro\RetailCrm\Component\Builder\Api\CustomerBuilder; @@ -42,7 +43,8 @@ ServiceLocator::registerServices([ LoyaltyService::class, CustomerService::class, OrderLoyaltyDataService::class, - CustomerBuilder::class + CustomerBuilder::class, + SubscriberService::class ]); $arJsConfig = [ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/account.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/account.php new file mode 100644 index 00000000..4458f217 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/account.php @@ -0,0 +1,90 @@ +IsAuthorized()) +{ + LocalRedirect($arResult['PATH_TO_AUTH_PAGE']); +} + +if ($arParams['SET_TITLE'] === 'Y') +{ + $APPLICATION->SetTitle(Loc::getMessage("SPS_TITLE_ACCOUNT")); +} + +if ($arParams["MAIN_CHAIN_NAME"] !== '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_ACCOUNT")); + +if ($arParams['SHOW_ACCOUNT_COMPONENT'] !== 'N') +{ + $APPLICATION->IncludeComponent( + "bitrix:sale.personal.account", + "bootstrap_v4", + [ + "SET_TITLE" => "N", + "AUTH_FORM_IN_TEMPLATE" => 'Y', + ], + $component + ); +} +if ($arParams['SHOW_ACCOUNT_PAY_COMPONENT'] !== 'N' && $USER->IsAuthorized()) +{ + ?> +
+
+ +
+
+ +
+
+ IncludeComponent( + "bitrix:sale.account.pay", + "bootstrap_v4", + Array( + "COMPONENT_TEMPLATE" => "bootstrap_v4", + "REFRESHED_COMPONENT_MODE" => "Y", + "ELIMINATED_PAY_SYSTEMS" => $arParams['ACCOUNT_PAYMENT_ELIMINATED_PAY_SYSTEMS'], + "PATH_TO_BASKET" => $arParams['PATH_TO_BASKET'], + "PATH_TO_PAYMENT" => $arParams['PATH_TO_PAYMENT'], + "PERSON_TYPE" => $arParams['ACCOUNT_PAYMENT_PERSON_TYPE'], + "REDIRECT_TO_CURRENT_PAGE" => "N", + "SELL_AMOUNT" => $arParams['ACCOUNT_PAYMENT_SELL_TOTAL'], + "SELL_CURRENCY" => $arParams['ACCOUNT_PAYMENT_SELL_CURRENCY'], + "SELL_SHOW_FIXED_VALUES" => $arParams['ACCOUNT_PAYMENT_SELL_SHOW_FIXED_VALUES'], + "SELL_SHOW_RESULT_SUM" => $arParams['ACCOUNT_PAYMENT_SELL_SHOW_RESULT_SUM'], + "SELL_TOTAL" => $arParams['ACCOUNT_PAYMENT_SELL_TOTAL'], + "SELL_USER_INPUT" => $arParams['ACCOUNT_PAYMENT_SELL_USER_INPUT'], + "SELL_VALUES_FROM_VAR" => "N", + "SELL_VAR_PRICE_VALUE" => "", + "SET_TITLE" => "N", + "CONTEXT_SITE_ID" => $arParams["CONTEXT_SITE_ID"], + "AUTH_FORM_IN_TEMPLATE" => 'Y', + ), + $component + ); + } + ?> +
+
diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/component.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/component.php new file mode 100644 index 00000000..040caec8 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/component.php @@ -0,0 +1,29 @@ +IsAuthorized()) { + die(); +} + +try { + if (!Loader::includeModule('intaro.retailcrm')) { + die(GetMessage('MODULE_NOT_INSTALL')); + } +} catch (Throwable $exception) { + die(GetMessage('MODULE_NOT_INSTALL') . ': ' . $exception->getMessage()); +} + +try { + $arResult["arUser"]["SUBSCRIBE"] = SubscriberService::getSubscribeStatusUser(); + + $this->IncludeComponentTemplate(); +} catch (\Throwable $exception) { + $arResult['ERRORS'] = $exception->getMessage(); + + $this->IncludeComponentTemplate(); +} \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/images/sec-unlocked.png b/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/images/sec-unlocked.png new file mode 100644 index 00000000..b3ea2911 Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/images/sec-unlocked.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/images/sec.png b/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/images/sec.png new file mode 100644 index 00000000..b9249a08 Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/images/sec.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/lang/en/template.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/lang/en/template.php new file mode 100644 index 00000000..e64ef10c --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/bitrix/main.profile/.default/lang/en/template.php @@ -0,0 +1,18 @@ + + +
+ +
+ + + " /> + " /> +
+
+ 0) + { + if ($arResult["arUser"]["TIMESTAMP_X"] <> '') + { + ?> +
+ + +
+ '') + { + ?> +
+ + +
+ +
+ +
+
+ +
+
+
+ + " /> +
+
+
+ +
+ +
+ " /> +
+
+ +
+ +
+ " /> +
+
+
+ +
+ " /> +
+
+
+ +
+ " /> +
+
+ +
+ +
+ +
+
+
+ +
+ + +
+
+ +
+
+
+ +
+ /> +
+
+
+
+
+ 0) ? Loc::getMessage("MAIN_SAVE") : Loc::getMessage("MAIN_ADD"))?>"> + "> +
+
+ +
+ +
+ IncludeComponent( + "bitrix:socserv.auth.split", + ".default", + [ + "SHOW_PROFILES" => "Y", + "ALLOW_DELETE" => "Y", + ], + false + ); + } + ?> +
+ +
+ +
\ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_black.png b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_black.png new file mode 100644 index 00000000..1fa0f31f Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_black.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_blue.png b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_blue.png new file mode 100644 index 00000000..d097cce9 Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_blue.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_green.png b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_green.png new file mode 100644 index 00000000..8f95932e Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_green.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_red.png b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_red.png new file mode 100644 index 00000000..c5059129 Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_red.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_yellow.png b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_yellow.png new file mode 100644 index 00000000..b48cc87c Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/subscribe/images/wt_yellow.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/index.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/index.php new file mode 100644 index 00000000..3fe73783 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/index.php @@ -0,0 +1,133 @@ + '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} + +$this->addExternalCss("/bitrix/css/main/font-awesome.css"); +$theme = Bitrix\Main\Config\Option::get("main", "wizard_eshop_bootstrap_theme_id", "blue", SITE_ID); + +$availablePages = array(); + +if ($arParams['SHOW_ORDER_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_ORDERS'], + "name" => Loc::getMessage("SPS_ORDER_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_ACCOUNT_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_ACCOUNT'], + "name" => Loc::getMessage("SPS_ACCOUNT_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_PRIVATE_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_PRIVATE'], + "name" => Loc::getMessage("SPS_PERSONAL_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_ORDER_PAGE'] === 'Y') +{ + + $delimeter = ($arParams['SEF_MODE'] === 'Y') ? "?" : "&"; + $availablePages[] = array( + "path" => $arResult['PATH_TO_ORDERS'].$delimeter."filter_history=Y", + "name" => Loc::getMessage("SPS_ORDER_PAGE_HISTORY"), + "icon" => '' + ); +} + +if ($arParams['SHOW_PROFILE_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_PROFILE'], + "name" => Loc::getMessage("SPS_PROFILE_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_BASKET_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arParams['PATH_TO_BASKET'], + "name" => Loc::getMessage("SPS_BASKET_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_SUBSCRIBE_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_SUBSCRIBE'], + "name" => Loc::getMessage("SPS_SUBSCRIBE_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_CONTACT_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arParams['PATH_TO_CONTACT'], + "name" => Loc::getMessage("SPS_CONTACT_PAGE_NAME"), + "icon" => '' + ); +} + +$customPagesList = CUtil::JsObjectToPhp($arParams['~CUSTOM_PAGES']); +if ($customPagesList) +{ + foreach ($customPagesList as $page) + { + $availablePages[] = array( + "path" => $page[0], + "name" => $page[1], + "icon" => (mb_strlen($page[2])) ? '' : "" + ); + } +} + +if (empty($availablePages)) +{ + ShowError(Loc::getMessage("SPS_ERROR_NOT_CHOSEN_ELEMENT")); +} +else +{ + ?> +
+ +
+ +
+ +
+ diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/account.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/account.php new file mode 100644 index 00000000..34dfa144 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/account.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/index.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/index.php new file mode 100644 index 00000000..1b784447 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/index.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_cancel.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_cancel.php new file mode 100644 index 00000000..5292744c --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_cancel.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_detail.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_detail.php new file mode 100644 index 00000000..4463ec0a --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_detail.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_list.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_list.php new file mode 100644 index 00000000..b59ec203 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/order_list.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/orders.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/orders.php new file mode 100644 index 00000000..b59ec203 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/orders.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/private.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/private.php new file mode 100644 index 00000000..75e29d51 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/private.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile.php new file mode 100644 index 00000000..3fe62b56 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile_detail.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile_detail.php new file mode 100644 index 00000000..3fe62b56 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile_detail.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile_list.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile_list.php new file mode 100644 index 00000000..3fe62b56 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/profile_list.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/subscribe.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/subscribe.php new file mode 100644 index 00000000..a2bda0c1 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/subscribe.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/template.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/template.php new file mode 100644 index 00000000..1b784447 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/en/template.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/ru/account.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/ru/account.php new file mode 100644 index 00000000..21d4ba23 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/lang/ru/account.php @@ -0,0 +1,5 @@ +IsAuthorized()) +{ + LocalRedirect($arResult['PATH_TO_AUTH_PAGE']); +} + +if ($arParams["MAIN_CHAIN_NAME"] <> '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_ORDERS"), $arResult['PATH_TO_ORDERS']); +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_ORDER_DETAIL", array("#ID#" => $arResult["VARIABLES"]["ID"]))); +$APPLICATION->IncludeComponent( + "bitrix:sale.personal.order.cancel", + "bootstrap_v4", + array( + "PATH_TO_LIST" => $arResult["PATH_TO_ORDERS"], + "PATH_TO_DETAIL" => $arResult["PATH_TO_ORDER_DETAIL"], + "AUTH_FORM_IN_TEMPLATE" => 'Y', + "SET_TITLE" =>$arParams["SET_TITLE"], + "ID" => $arResult["VARIABLES"]["ID"], + "CONTEXT_SITE_ID" => $arParams["CONTEXT_SITE_ID"], + ), + $component +); +?> diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/order_detail.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/order_detail.php new file mode 100644 index 00000000..07e689ac --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/order_detail.php @@ -0,0 +1,56 @@ +IsAuthorized()) +{ + LocalRedirect($arResult['PATH_TO_AUTH_PAGE']); +} + +if ($arParams["MAIN_CHAIN_NAME"] <> '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_ORDERS"), $arResult['PATH_TO_ORDERS']); +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_ORDER_DETAIL", array("#ID#" => urldecode($arResult["VARIABLES"]["ID"])))); +$arDetParams = array( + "PATH_TO_LIST" => $arResult["PATH_TO_ORDERS"], + "PATH_TO_CANCEL" => $arResult["PATH_TO_ORDER_CANCEL"], + "PATH_TO_COPY" => $arResult["PATH_TO_ORDER_COPY"], + "PATH_TO_PAYMENT" => $arParams["PATH_TO_PAYMENT"], + "SET_TITLE" =>$arParams["SET_TITLE"], + "ID" => $arResult["VARIABLES"]["ID"], + "ACTIVE_DATE_FORMAT" => $arParams["ACTIVE_DATE_FORMAT"], + "ALLOW_INNER" => $arParams["ALLOW_INNER"], + "ONLY_INNER_FULL" => $arParams["ONLY_INNER_FULL"], + "CACHE_TYPE" => $arParams["CACHE_TYPE"], + "CACHE_TIME" => $arParams["CACHE_TIME"], + "CACHE_GROUPS" => $arParams["CACHE_GROUPS"], + "RESTRICT_CHANGE_PAYSYSTEM" => $arParams["ORDER_RESTRICT_CHANGE_PAYSYSTEM"], + "REFRESH_PRICES" => $arParams["ORDER_REFRESH_PRICES"], + "DISALLOW_CANCEL" => $arParams["ORDER_DISALLOW_CANCEL"], + "HIDE_USER_INFO" => $arParams["ORDER_HIDE_USER_INFO"], + "AUTH_FORM_IN_TEMPLATE" => 'Y', + "CONTEXT_SITE_ID" => $arParams["CONTEXT_SITE_ID"], + "CUSTOM_SELECT_PROPS" => $arParams["CUSTOM_SELECT_PROPS"] + ); +foreach($arParams as $key => $val) +{ + if(mb_strpos($key, "PROP_") !== false) + $arDetParams[$key] = $val; +} + +$APPLICATION->IncludeComponent( + "bitrix:sale.personal.order.detail", + "bootstrap_v4", + $arDetParams, + $component +); +?> diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/orders.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/orders.php new file mode 100644 index 00000000..ba38cce6 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/orders.php @@ -0,0 +1,62 @@ +IsAuthorized()) +{ + LocalRedirect($arResult['PATH_TO_AUTH_PAGE']); +} + +if ($arParams["MAIN_CHAIN_NAME"] !== '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} + +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_ORDERS"), $arResult['PATH_TO_ORDERS']); +$APPLICATION->IncludeComponent( + "bitrix:sale.personal.order.list", + "bootstrap_v4", + array( + "PATH_TO_DETAIL" => $arResult["PATH_TO_ORDER_DETAIL"], + "PATH_TO_CANCEL" => $arResult["PATH_TO_ORDER_CANCEL"], + "PATH_TO_CATALOG" => $arParams["PATH_TO_CATALOG"], + "PATH_TO_COPY" => $arResult["PATH_TO_ORDER_COPY"], + "PATH_TO_BASKET" => $arParams["PATH_TO_BASKET"], + "PATH_TO_PAYMENT" => $arParams["PATH_TO_PAYMENT"], + "SAVE_IN_SESSION" => $arParams["SAVE_IN_SESSION"], + "ORDERS_PER_PAGE" => $arParams["ORDERS_PER_PAGE"], + "SET_TITLE" =>$arParams["SET_TITLE"], + "ID" => $arResult["VARIABLES"]["ID"], + "NAV_TEMPLATE" => $arParams["NAV_TEMPLATE"], + "ACTIVE_DATE_FORMAT" => $arParams["ACTIVE_DATE_FORMAT"], + "HISTORIC_STATUSES" => $arParams["ORDER_HISTORIC_STATUSES"], + "ALLOW_INNER" => $arParams["ALLOW_INNER"], + "ONLY_INNER_FULL" => $arParams["ONLY_INNER_FULL"], + "CACHE_TYPE" => $arParams["CACHE_TYPE"], + "CACHE_TIME" => $arParams["CACHE_TIME"], + "CACHE_GROUPS" => $arParams["CACHE_GROUPS"], + "DEFAULT_SORT" => $arParams["ORDER_DEFAULT_SORT"], + "DISALLOW_CANCEL" => $arParams["ORDER_DISALLOW_CANCEL"], + "RESTRICT_CHANGE_PAYSYSTEM" => $arParams["ORDER_RESTRICT_CHANGE_PAYSYSTEM"], + "REFRESH_PRICES" => $arParams["ORDER_REFRESH_PRICES"], + "CONTEXT_SITE_ID" => $arParams["CONTEXT_SITE_ID"], + "AUTH_FORM_IN_TEMPLATE" => 'Y', + ), + $component +); diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/private.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/private.php new file mode 100644 index 00000000..5baad315 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/private.php @@ -0,0 +1,119 @@ +AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_PRIVATE")); +if ($arParams['SET_TITLE'] == 'Y') +{ + $APPLICATION->SetTitle(Loc::getMessage("SPS_TITLE_PRIVATE")); +} + +if (!$USER->IsAuthorized() || $arResult['SHOW_LOGIN_FORM'] === 'Y') +{ + if ($arParams['USE_PRIVATE_PAGE_TO_AUTH'] !== 'Y') + { + ob_start(); + $APPLICATION->AuthForm('', false, false, 'N', false); + $authForm = ob_get_clean(); + } + else + { + if ($arResult['SHOW_FORGOT_PASSWORD_FORM'] === 'Y') + { + ob_start(); + $APPLICATION->IncludeComponent( + 'bitrix:main.auth.forgotpasswd', + '.default', + array( + 'AUTH_AUTH_URL' => $arResult['PATH_TO_PRIVATE'], +// 'AUTH_REGISTER_URL' => 'register.php', + ), + false + ); + $authForm = ob_get_clean(); + } + elseif($arResult['SHOW_CHANGE_PASSWORD_FORM'] === 'Y') + { + ob_start(); + $APPLICATION->IncludeComponent( + 'bitrix:main.auth.changepasswd', + '.default', + array( + 'AUTH_AUTH_URL' => $arResult['PATH_TO_PRIVATE'], +// 'AUTH_REGISTER_URL' => 'register.php', + ), + false + ); + $authForm = ob_get_clean(); + } + else + { + ob_start(); + $APPLICATION->IncludeComponent( + 'bitrix:main.auth.form', + '.default', + array( + 'AUTH_FORGOT_PASSWORD_URL' => $arResult['PATH_TO_PASSWORD_RESTORE'], +// 'AUTH_REGISTER_URL' => 'register.php', + 'AUTH_SUCCESS_URL' => $arResult['AUTH_SUCCESS_URL'], + 'DISABLE_SOCSERV_AUTH' => $arParams['DISABLE_SOCSERV_AUTH'], + ), + false + ); + $authForm = ob_get_clean(); + } + } + + ?> +
+ +
+
+
+ +
+ +
+
+ IncludeComponent( + "bitrix:main.profile", + "", + Array( + "SET_TITLE" =>$arParams["SET_TITLE"], + "AJAX_MODE" => $arParams['AJAX_MODE_PRIVATE'], + "SEND_INFO" => $arParams["SEND_INFO_PRIVATE"], + "CHECK_RIGHTS" => $arParams['CHECK_RIGHTS_PRIVATE'], + "EDITABLE_EXTERNAL_AUTH_ID" => $arParams['EDITABLE_EXTERNAL_AUTH_ID'], + "DISABLE_SOCSERV_AUTH" => $arParams['DISABLE_SOCSERV_AUTH'] + ), + $component + ); +} diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/profile.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/profile.php new file mode 100644 index 00000000..383537fa --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/profile.php @@ -0,0 +1,42 @@ +IsAuthorized()) +{ + LocalRedirect($arResult['PATH_TO_AUTH_PAGE']); +} + +if ($arParams["MAIN_CHAIN_NAME"] !== '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_PROFILE")); +$APPLICATION->IncludeComponent( + "bitrix:sale.personal.profile.list", + "bootstrap_v4", + [ + "PATH_TO_DETAIL" => $arResult['PATH_TO_PROFILE_DETAIL'], + "PATH_TO_DELETE" => $arResult['PATH_TO_PROFILE_DELETE'], + "PER_PAGE" => $arParams["PROFILES_PER_PAGE"], + "SET_TITLE" =>$arParams["SET_TITLE"], + "AUTH_FORM_IN_TEMPLATE" => 'Y', + ], + $component +); diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/profile_detail.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/profile_detail.php new file mode 100644 index 00000000..2abc0e7c --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/profile_detail.php @@ -0,0 +1,35 @@ +IsAuthorized()) +{ + LocalRedirect($arResult['PATH_TO_AUTH_PAGE']); +} + +if ($arParams["MAIN_CHAIN_NAME"] <> '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_PROFILE")); +$APPLICATION->IncludeComponent( + "bitrix:sale.personal.profile.detail", + "bootstrap_v4", + array( + "PATH_TO_LIST" => $arResult["PATH_TO_PROFILE"], + "PATH_TO_DETAIL" => $arResult["PATH_TO_PROFILE_DETAIL"], + "SET_TITLE" =>$arParams["SET_TITLE"], + "USE_AJAX_LOCATIONS" => $arParams['USE_AJAX_LOCATIONS_PROFILE'], + "COMPATIBLE_LOCATION_MODE" => $arParams['COMPATIBLE_LOCATION_MODE_PROFILE'], + "ID" => $arResult["VARIABLES"]["ID"], + "AUTH_FORM_IN_TEMPLATE" => 'Y', + ), + $component +); +?> diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/style.css b/intaro.retailcrm/install/export/local/components/intaro/subscribe/style.css new file mode 100644 index 00000000..3286c06b --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/style.css @@ -0,0 +1,49 @@ +.sale-personal-section-index-block { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + margin: 15px 0; + padding: 0; + height: 87%; + border-radius: 3px; + background-size: cover; + color: #fff; + text-align: center; + text-transform: uppercase; + opacity: .8; + transition: all 0.3s; + justify-content: space-around; + background-color: var(--theme-color-primary, #51cbce); +} + +@media (max-width: 992px) { + .sale-personal-section-index-block { + margin: 8px 0; + height: auto; + } +} + +.sale-personal-section-index-block:hover { opacity: 1; } + +.sale-personal-section-index-block-link, +.sale-personal-section-index-block-link:hover, +.sale-personal-section-index-block-link:active, +.sale-personal-section-index-block-link:focus, +.sale-personal-section-index-block-link:visited { + display: block; + padding: 25px 5px; + width: 100%; + color: #fff; + text-decoration: none; +} + +.sale-personal-section-index-block-link { color: #fff; } + +.sale-personal-section-index-block-ico { font-size: 64px; } + +.sale-personal-section-index-block-name { + color: #fff; + font-size: 15px; + margin: 0; + padding: 0; +} \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/style.min.css b/intaro.retailcrm/install/export/local/components/intaro/subscribe/style.min.css new file mode 100644 index 00000000..4f72b311 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/style.min.css @@ -0,0 +1 @@ +.sale-personal-section-index-block{display:-webkit-box;display:-ms-flexbox;display:flex;margin:15px 0;padding:0;height:87%;border-radius:3px;background-size:cover;color:#fff;text-align:center;text-transform:uppercase;opacity:.8;transition:all .3s;justify-content:space-around;background-color:var(--theme-color-primary,#51cbce)}@media(max-width:992px){.sale-personal-section-index-block{margin:8px 0;height:auto}}.sale-personal-section-index-block:hover{opacity:1}.sale-personal-section-index-block-link,.sale-personal-section-index-block-link:hover,.sale-personal-section-index-block-link:active,.sale-personal-section-index-block-link:focus,.sale-personal-section-index-block-link:visited{display:block;padding:25px 5px;width:100%;color:#fff;text-decoration:none}.sale-personal-section-index-block-link{color:#fff}.sale-personal-section-index-block-ico{font-size:64px}.sale-personal-section-index-block-name{color:#fff;font-size:15px;margin:0;padding:0} \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/subscribe.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/subscribe.php new file mode 100644 index 00000000..b5051bec --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/subscribe.php @@ -0,0 +1,31 @@ +IsAuthorized()) +{ + LocalRedirect($arResult['PATH_TO_AUTH_PAGE']); +} + +if ($arParams["MAIN_CHAIN_NAME"] <> '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} +$APPLICATION->AddChainItem(Loc::getMessage("SPS_CHAIN_SUBSCRIBE_NEW")); +$APPLICATION->IncludeComponent( + 'bitrix:catalog.product.subscribe.list', + "bootstrap_v4", + array( + 'SET_TITLE' => $arParams['SET_TITLE'], + 'DETAIL_URL' => $arParams['SUBSCRIBE_DETAIL_URL'] + ), + $component +); + diff --git a/intaro.retailcrm/install/export/local/components/intaro/subscribe/template.php b/intaro.retailcrm/install/export/local/components/intaro/subscribe/template.php new file mode 100644 index 00000000..827667b9 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/subscribe/template.php @@ -0,0 +1,132 @@ + '') +{ + $APPLICATION->AddChainItem(htmlspecialcharsbx($arParams["MAIN_CHAIN_NAME"]), $arResult['SEF_FOLDER']); +} + +$this->addExternalCss("/bitrix/css/main/font-awesome.css"); +$theme = Bitrix\Main\Config\Option::get("main", "wizard_eshop_bootstrap_theme_id", "blue", SITE_ID); + +$availablePages = array(); + +if ($arParams['SHOW_ORDER_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_ORDERS'], + "name" => Loc::getMessage("SPS_ORDER_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_ACCOUNT_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_ACCOUNT'], + "name" => Loc::getMessage("SPS_ACCOUNT_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_PRIVATE_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_PRIVATE'], + "name" => Loc::getMessage("SPS_PERSONAL_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_ORDER_PAGE'] === 'Y') +{ + + $delimeter = ($arParams['SEF_MODE'] === 'Y') ? "?" : "&"; + $availablePages[] = array( + "path" => $arResult['PATH_TO_ORDERS'].$delimeter."filter_history=Y", + "name" => Loc::getMessage("SPS_ORDER_PAGE_HISTORY"), + "icon" => '' + ); +} + +if ($arParams['SHOW_PROFILE_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_PROFILE'], + "name" => Loc::getMessage("SPS_PROFILE_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_BASKET_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arParams['PATH_TO_BASKET'], + "name" => Loc::getMessage("SPS_BASKET_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_SUBSCRIBE_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arResult['PATH_TO_SUBSCRIBE'], + "name" => Loc::getMessage("SPS_SUBSCRIBE_PAGE_NAME"), + "icon" => '' + ); +} + +if ($arParams['SHOW_CONTACT_PAGE'] === 'Y') +{ + $availablePages[] = array( + "path" => $arParams['PATH_TO_CONTACT'], + "name" => Loc::getMessage("SPS_CONTACT_PAGE_NAME"), + "icon" => '' + ); +} + +$customPagesList = CUtil::JsObjectToPhp($arParams['~CUSTOM_PAGES']); +if ($customPagesList) +{ + foreach ($customPagesList as $page) + { + $availablePages[] = array( + "path" => $page[0], + "name" => $page[1], + "icon" => (mb_strlen($page[2])) ? '' : "" + ); + } +} + +if (empty($availablePages)) +{ + ShowError(Loc::getMessage("SPS_ERROR_NOT_CHOSEN_ELEMENT")); +} +else +{ + ?> +
+ +
+ +
+ +
+ diff --git a/intaro.retailcrm/lib/service/SubscriberService.php b/intaro.retailcrm/lib/service/SubscriberService.php new file mode 100644 index 00000000..87585a80 --- /dev/null +++ b/intaro.retailcrm/lib/service/SubscriberService.php @@ -0,0 +1,16 @@ +GetID())->Fetch(); + + return isset($userFields['UF_SUBSCRIBE_EMAIL']) && $userFields['UF_SUBSCRIBE_EMAIL'] == '1'; + } +} \ No newline at end of file