diff --git a/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php b/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php index 3fd214124..1fc9eaecd 100644 --- a/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php +++ b/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php @@ -210,7 +210,10 @@ class AdvsModuleServiceProvider extends AddonServiceProvider 'uses' => 'Visiosoft\AdvsModule\Http\Controller\OptionConfigurationController@confAddCart', ], - + // Admin ProductoptionsController + 'admin/advs/product_options' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ProductoptionsController@index', + 'admin/advs/product_options/create' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ProductoptionsController@create', + 'admin/advs/product_options/edit/{id}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ProductoptionsController@edit', ]; protected $middleware = [ diff --git a/addons/default/visiosoft/base-theme/resources/views/addons/anomaly/users-module/register.twig b/addons/default/visiosoft/base-theme/resources/views/addons/anomaly/users-module/register.twig index 6d8a34eb4..f2d8dd128 100644 --- a/addons/default/visiosoft/base-theme/resources/views/addons/anomaly/users-module/register.twig +++ b/addons/default/visiosoft/base-theme/resources/views/addons/anomaly/users-module/register.twig @@ -28,21 +28,23 @@ {% include 'visiosoft.theme.base::addons/anomaly/users-module/partials/register-form' %} -
- {{ form.fields.accept_terms|raw }} -
+ {% if setting_value('visiosoft.module.profile::show_checkbox_terms_on_register') %} +
+ {{ form.fields.accept_terms|raw }} +
-
- {{ form.fields.accept_protection_law|raw }} -
+
+ {{ form.fields.accept_protection_law|raw }} +
-
- {{ form.fields.accept_privacy_terms|raw }} -
+
+ {{ form.fields.accept_privacy_terms|raw }} +
-
- {{ form.fields.receive_sms_emails|raw }} -
+
+ {{ form.fields.receive_sms_emails|raw }} +
+ {% endif %}
diff --git a/addons/default/visiosoft/profile-module/migrations/2020_11_06_154603_visiosoft.module.profile__create_profession_and_educational_fields.php b/addons/default/visiosoft/profile-module/migrations/2020_11_06_154603_visiosoft.module.profile__create_profession_and_educational_fields.php new file mode 100644 index 000000000..425ce5ae6 --- /dev/null +++ b/addons/default/visiosoft/profile-module/migrations/2020_11_06_154603_visiosoft.module.profile__create_profession_and_educational_fields.php @@ -0,0 +1,64 @@ +streams()->findBySlugAndNamespace('users', 'users')) { + $fields = [ + [ + 'name' => trans('visiosoft.module.profile::field.education.name'), + 'slug' => 'education', + ], + [ + 'name' => trans('visiosoft.module.profile::field.state_of_education.name'), + 'slug' => 'state_of_education', + ], + [ + 'name' => trans('visiosoft.module.profile::field.profession.name'), + 'slug' => 'profession', + ], + ]; + + foreach ($fields as $field) { + $exists = $this->fields() + ->newQuery() + ->where('slug', $field['slug']) + ->where('namespace', 'users') + ->first(); + + if (!$exists) { + $userField = $this->fields()->create([ + 'name' => $field['name'], + 'namespace' => 'users', + 'slug' => $field['slug'], + 'type' => 'anomaly.field_type.text', + 'locked' => 0, + ]); + + $this->assignments()->create([ + 'stream_id' => $stream->id, + 'field_id' => $userField->id + ]); + } + } + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + /* + * I never go back on my word! + * That's my nindo: my ninja way! + * NARUTO + */ + } +} diff --git a/addons/default/visiosoft/profile-module/resources/assets/css/profile.scss b/addons/default/visiosoft/profile-module/resources/assets/css/profile.scss index 53e3144ce..3dafb014d 100644 --- a/addons/default/visiosoft/profile-module/resources/assets/css/profile.scss +++ b/addons/default/visiosoft/profile-module/resources/assets/css/profile.scss @@ -141,5 +141,9 @@ .birthday-field .input-group-addon { display: none; } + + .education-field > .tagify, .state_of_education-field > .tagify, .profession-field > .tagify { + height: initial; + } } } \ No newline at end of file diff --git a/addons/default/visiosoft/profile-module/resources/config/settings/sections.php b/addons/default/visiosoft/profile-module/resources/config/settings/sections.php index 824048352..c15a42369 100644 --- a/addons/default/visiosoft/profile-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/profile-module/resources/config/settings/sections.php @@ -7,7 +7,14 @@ return [ 'general_setting' => [ 'title' => 'visiosoft.module.profile::section.general_setting', 'fields' => [ - 'show_my_ads', 'upload_avatar', 'show_tax_office' + 'show_my_ads', + 'upload_avatar', + 'show_tax_office', + 'show_checkbox_terms_on_register', + 'show_education_profession', + 'education', + 'state_of_education', + 'profession', ], ], 'recaptcha' => [ diff --git a/addons/default/visiosoft/profile-module/resources/config/settings/settings.php b/addons/default/visiosoft/profile-module/resources/config/settings/settings.php index f9bea65e9..ef0446b69 100644 --- a/addons/default/visiosoft/profile-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/profile-module/resources/config/settings/settings.php @@ -34,4 +34,21 @@ return [ "max" => 1.0, ] ], + 'show_checkbox_terms_on_register' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], + 'show_education_profession' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => true, + 'mode' => 'checkbox' + ] + ], + "education" => "anomaly.field_type.tags", + "state_of_education" => "anomaly.field_type.tags", + "profession" => "anomaly.field_type.tags", ]; \ No newline at end of file diff --git a/addons/default/visiosoft/profile-module/resources/lang/en/field.php b/addons/default/visiosoft/profile-module/resources/lang/en/field.php index e11c7c876..13b390085 100644 --- a/addons/default/visiosoft/profile-module/resources/lang/en/field.php +++ b/addons/default/visiosoft/profile-module/resources/lang/en/field.php @@ -58,6 +58,15 @@ return [ 'birthday' => [ 'name' => 'Birthday' ], + 'education' => [ + 'name' => 'Education' + ], + 'state_of_education' => [ + 'name' => 'State of Education' + ], + 'profession' => [ + 'name' => 'Profession' + ], 'identification_number' => [ 'name' => 'Identification Number' ], diff --git a/addons/default/visiosoft/profile-module/resources/lang/en/setting.php b/addons/default/visiosoft/profile-module/resources/lang/en/setting.php index 9c1e08a97..6373b6ec9 100644 --- a/addons/default/visiosoft/profile-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/profile-module/resources/lang/en/setting.php @@ -10,6 +10,14 @@ return [ 'show_tax_office' => [ 'name' => 'Show Tax Office Field', ], + 'show_checkbox_terms_on_register' => [ + 'name' => 'Show Checkbox Terms on Register', + 'instructions' => 'Show the "Accept term", "protection law", "privacy term", "sms & emails" on the register form' + ], + 'show_education_profession' => [ + 'name' => 'Show Education and Profession Fields', + 'instructions' => 'Show the "Education", "State of Education" and "Profession" on the profile edit page' + ], 'google_captcha_site_key' => [ 'name' => 'Google Captcha Site Key', ], @@ -20,4 +28,13 @@ return [ 'name' => 'Score Threshold', 'instructions' => 'A value between 0 and 1. The higher the threshold the more strict ReCaptcha is in trying to determine if a user is a bot or not.', ], + 'education' => [ + 'name' => 'Education' + ], + 'state_of_education' => [ + 'name' => 'State of Education' + ], + 'profession' => [ + 'name' => 'Profession' + ], ]; diff --git a/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig b/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig index edde92e0b..81e7820ec 100644 --- a/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig +++ b/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig @@ -149,6 +149,64 @@ {{ profileForm.fields.birthday.input|raw }}
+ + {% if setting_value('visiosoft.module.profile::show_education_profession') %} +
+
+ + {{ profileForm.fields.education.value.input|raw }} + +
+
+
+
+ + +
+
+
+
+ + +
+
+ {% endif %}