diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/.parameters.php b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/.parameters.php new file mode 100644 index 00000000..4e44ff2b --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/.parameters.php @@ -0,0 +1,10 @@ +array( + "NAME" => GetMessage("USER_PROPERTY_NAME"), + "TYPE" => "STRING", + "DEFAULT" => "", + ), +); +?> \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/images/sec-unlocked.png b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/images/sec-unlocked.png new file mode 100644 index 00000000..b3ea2911 Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/images/sec-unlocked.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/images/sec.png b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/images/sec.png new file mode 100644 index 00000000..b9249a08 Binary files /dev/null and b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/images/sec.png differ diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/en/.parameters.php b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/en/.parameters.php new file mode 100644 index 00000000..c09d49d4 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/en/.parameters.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/en/template.php b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/en/template.php new file mode 100644 index 00000000..0a46530c --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/en/template.php @@ -0,0 +1,63 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/ru/.parameters.php b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/ru/.parameters.php new file mode 100644 index 00000000..2c713dfe --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/ru/.parameters.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/ru/template.php b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/ru/template.php new file mode 100644 index 00000000..5a4f7492 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/lang/ru/template.php @@ -0,0 +1,64 @@ + \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/style.css b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/style.css new file mode 100644 index 00000000..d2fd8983 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/style.css @@ -0,0 +1,5 @@ +div.bx-auth-reg input.bx-auth-input {vertical-align:middle;} +div.bx-auth-reg span.bx-auth-secure {background-color:#FFFAE3; border:1px solid #DEDBC8; padding:2px; display:inline-block; vertical-align:middle;} +div.bx-auth-reg div.bx-auth-secure-icon {background-image:url(images/sec.png); background-repeat:no-repeat; background-position:center; width:19px; height:18px;} +div.bx-auth-reg div.bx-auth-secure-unlock {background-image:url(images/sec-unlocked.png);} + diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/style.min.css b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/style.min.css new file mode 100644 index 00000000..a3a5be34 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/style.min.css @@ -0,0 +1 @@ +div.bx-auth-reg input.bx-auth-input{vertical-align:middle}div.bx-auth-reg span.bx-auth-secure{background-color:#fffae3;border:1px solid #dedbc8;padding:2px;display:inline-block;vertical-align:middle}div.bx-auth-reg div.bx-auth-secure-icon{background-image:url(images/sec.png);background-repeat:no-repeat;background-position:center;width:19px;height:18px}div.bx-auth-reg div.bx-auth-secure-unlock{background-image:url(images/sec-unlocked.png)} \ No newline at end of file diff --git a/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/template.php b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/template.php new file mode 100644 index 00000000..667c1936 --- /dev/null +++ b/intaro.retailcrm/install/export/local/components/intaro/main.register/templates/.default_subscribe/template.php @@ -0,0 +1,279 @@ + +
+ +IsAuthorized()):?> + +

+ + + $error) + if (intval($key) == 0 && $key !== 0) + $arResult["ERRORS"][$key] = str_replace("#FIELD_NAME#", """.GetMessage("REGISTER_FIELD_".$key).""", $error); + + ShowError(implode("
", $arResult["ERRORS"])); + +elseif($arResult["USE_EMAIL_CONFIRMATION"] === "Y"): +?> +

+ + + + +
+ ''): +?> + " /> + +" /> + + + + + + + + + + + + + +
*" autocomplete="off" />
" />
+
+ + + + + +
+ + + +
+ ''): +?> + " /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $arUserField):?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* + +
+ +
:*" autocomplete="off" class="bx-auth-input" /> + + " style="display:none"> +
+
+ + + +" autocomplete="off" />
" />IncludeComponent( + 'bitrix:main.calendar', + '', + array( + 'SHOW_INPUT' => 'N', + 'FORM_NAME' => 'regform', + 'INPUT_NAME' => 'REGISTER[PERSONAL_BIRTHDAY]', + 'SHOW_TIME' => 'N' + ), + null, + array("HIDE_ICONS"=>"Y") + ); + ?>
'' ? $arParams["USER_PROPERTY_NAME"] : GetMessage("USER_TYPE_EDIT_TAB")?>
:* + IncludeComponent( + "bitrix:system.field.edit", + $arUserField["USER_TYPE"]["USER_TYPE_ID"], + array("bVarsFromForm" => $arResult["bVarsFromForm"], "arUserField" => $arUserField, "form_name" => "regform"), null, array("HIDE_ICONS"=>"Y"));?>
+ " /> + " width="180" height="40" alt="CAPTCHA" /> +
:*
+ +
" />
+
+ +

+ + + +

*

+ + +
\ No newline at end of file diff --git a/intaro.retailcrm/lib/component/installer/installertrait.php b/intaro.retailcrm/lib/component/installer/installertrait.php index 34368180..968e3662 100644 --- a/intaro.retailcrm/lib/component/installer/installertrait.php +++ b/intaro.retailcrm/lib/component/installer/installertrait.php @@ -74,19 +74,35 @@ trait InstallerTrait $templateNames = [ 'default_loyalty' => [ - 'sale.order.ajax', - 'sale.basket.basket', - 'main.register', + 0 => [ + 'name' => 'sale.order.ajax', + 'templateDirectory' => '.default' + ], + 1 => [ + 'name' => 'sale.basket.basket', + 'templateDirectory' => '.default' + ], + 2 => [ + 'name' => 'main.register', + 'templateDirectory' => '.default' + ], ], 'default_subscribe' => [ - 'sale.personal.section' + 0 => [ + 'name' => 'sale.personal.section', + 'templateDirectory' => '.default' + ], + 1 => [ + 'name' => 'main.register', + 'templateDirectory' => '.default_subscribe' + ] ] ]; - foreach ($templateNames as $directory => $names) { - foreach ($names as $name) { - $this->copy($directory, $name); + foreach ($templateNames as $directory => $templates) { + foreach ($templates as $template) { + $this->copy($directory, $template); } } } @@ -234,16 +250,16 @@ trait InstallerTrait } } - private function copy($directory, $name): void + private function copy($directory, $template): void { $templatePath = $_SERVER['DOCUMENT_ROOT'] - . '/local/templates/.default/components/bitrix/' . $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/' - . $name - . '/templates/.default'; + . $template['name'] + . '/templates/' . $template['templateDirectory']; CopyDirFiles( $pathFrom, diff --git a/intaro.retailcrm/updater.php b/intaro.retailcrm/updater.php index 3f46fea7..f7c9ea08 100644 --- a/intaro.retailcrm/updater.php +++ b/intaro.retailcrm/updater.php @@ -1090,24 +1090,31 @@ class UpdateSubscribe $templateNames = [ 'default_subscribe' => [ - 'sale.personal.section' + 0 => [ + 'name' => 'sale.personal.section', + 'templateDirectory' => '.default' + ], + 1 => [ + 'name' => 'main.register', + 'templateDirectory' => '.default_subscribe' + ] ] ]; - foreach ($templateNames as $directory => $names) { - foreach ($names as $name) { - $lpTemplatePath = $_SERVER['DOCUMENT_ROOT'] - . '/local/templates/.default/components/bitrix/' . $name . '/' . $directory; + foreach ($templateNames as $directory => $templates) { + foreach ($templates as $template) { + $templatePath = $_SERVER['DOCUMENT_ROOT'] + . '/local/templates/.default/components/bitrix/' . $template['name'] . '/' . $directory; - if (!file_exists($lpTemplatePath)) { + if (!file_exists($templatePath)) { $pathFrom = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/intaro.retailcrm/install/export/local/components/intaro/' - . $name - . '/templates/.default'; + . $template['name'] + . '/templates/' . $template['templateDirectory']; CopyDirFiles( $pathFrom, - $lpTemplatePath, + $templatePath, true, true, false