From 4ae49141f42ab7261733f00019477ea0377dec97 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Thu, 12 Nov 2020 15:33:39 +0300 Subject: [PATCH 1/4] =?UTF-8?q?#2647=20emlak24=20yap=C4=B1lacaklar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../advs-module/resources/config/settings/sections.php | 8 +++++++- .../advs-module/resources/config/settings/settings.php | 7 +++++++ .../visiosoft/advs-module/resources/lang/en/section.php | 1 + .../visiosoft/advs-module/resources/lang/en/setting.php | 3 +++ .../location-module/resources/views/new-ad/map.twig | 6 ++++-- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index 8c0a8a34a..261bedbd7 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -28,9 +28,15 @@ return [ 'estimated_pending_time', 'default_published_time', 'default_GET', + 'listing_page_image', + ], + ], + 'create_ad' => [ + 'title' => 'visiosoft.module.advs::section.create_ad', + 'fields' => [ 'hide_standard_price_field', 'hide_options_field', - 'listing_page_image', + 'hide_village_field', 'show_breadcrumb_when_creating_ad', ], ], diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index b7a24c416..29077cf83 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -125,6 +125,13 @@ return [ 'mode' => 'checkbox' ] ], + 'hide_village_field' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], 'enabled_currencies' => [ 'bind' => 'streams::currencies.enabled', 'env' => 'ADV_ENABLED_CURRENCIES', diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/section.php b/addons/default/visiosoft/advs-module/resources/lang/en/section.php index cdd4948d1..1992005b1 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/section.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/section.php @@ -41,6 +41,7 @@ return [ 'ads' => 'Ads', 'user' => 'User', 'filter' => 'Filter', + 'create_ad' => 'Create Ad', 'options' => [ 'title' => 'Options', ], diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php index d4db6a482..f9f830959 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -100,6 +100,9 @@ return [ 'hide_options_field' => [ 'name' => 'Hide Options Field', ], + 'hide_village_field' => [ + 'name' => 'Hide Village Field', + ], 'enabled_currencies' => [ 'name' => 'Enabled Currencies', ], diff --git a/addons/default/visiosoft/location-module/resources/views/new-ad/map.twig b/addons/default/visiosoft/location-module/resources/views/new-ad/map.twig index 77a332555..d5a8d5b59 100644 --- a/addons/default/visiosoft/location-module/resources/views/new-ad/map.twig +++ b/addons/default/visiosoft/location-module/resources/views/new-ad/map.twig @@ -27,8 +27,10 @@ class="location-field district-data">{{ form.fields.district|raw }}
  • {{ form.fields.neighborhood|raw }}
  • -
  • {{ form.fields.village|raw }}
  • + {% if not setting_value('visiosoft.module.advs::hide_village_field') %} +
  • {{ form.fields.village|raw }}
  • + {% endif %}
    From 548736ee5af168e79f298d897b65fe575c5a9a4c Mon Sep 17 00:00:00 2001 From: Diatrex Date: Thu, 12 Nov 2020 15:50:18 +0300 Subject: [PATCH 2/4] =?UTF-8?q?#2647=20emlak24=20yap=C4=B1lacaklar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/config/settings/sections.php | 1 + .../resources/config/settings/settings.php | 7 +++++++ .../advs-module/resources/lang/en/setting.php | 4 ++++ .../views/new-ad/preview/preview.twig | 20 +++++++++++-------- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index 261bedbd7..e08ea77f7 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -37,6 +37,7 @@ return [ 'hide_standard_price_field', 'hide_options_field', 'hide_village_field', + 'hide_configurations', 'show_breadcrumb_when_creating_ad', ], ], diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index 29077cf83..4bc2ccf06 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -132,6 +132,13 @@ return [ 'mode' => 'checkbox' ] ], + 'hide_configurations' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], 'enabled_currencies' => [ 'bind' => 'streams::currencies.enabled', 'env' => 'ADV_ENABLED_CURRENCIES', diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php index f9f830959..957d0283c 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -103,6 +103,10 @@ return [ 'hide_village_field' => [ 'name' => 'Hide Village Field', ], + 'hide_configurations' => [ + 'name' => 'Hide the Configurations Button', + 'instructions' => 'Hide the Configurations Button in the Ad Preview Page', + ], 'enabled_currencies' => [ 'name' => 'Enabled Currencies', ], diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig index a3a710cec..2945d4193 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig @@ -16,10 +16,12 @@ {% else %} {% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %} {% endif %} - - {{trans('visiosoft.module.advs::button.create_configurations')}} - + {% if not setting_value('visiosoft.module.advs::hide_configurations') %} + + {{trans('visiosoft.module.advs::button.create_configurations')}} + + {% endif %} {{ trans('visiosoft.module.advs::field.edit') }} @@ -33,10 +35,12 @@
    - - {{trans('visiosoft.module.advs::button.create_configurations')}} - + {% if not setting_value('visiosoft.module.advs::hide_configurations') %} + + {{trans('visiosoft.module.advs::button.create_configurations')}} + + {% endif %} {{ trans('visiosoft.module.advs::field.edit') }} From e360e2f1015ee7131ca9b387b3e6092daf676ceb Mon Sep 17 00:00:00 2001 From: Diatrex Date: Thu, 12 Nov 2020 16:30:35 +0300 Subject: [PATCH 3/4] =?UTF-8?q?#2647=20emlak24=20yap=C4=B1lacaklar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../advs-module/resources/config/settings/sections.php | 1 + .../advs-module/resources/config/settings/settings.php | 7 +++++++ .../visiosoft/advs-module/resources/js/required-map.js | 7 +++++++ .../visiosoft/advs-module/resources/lang/en/message.php | 1 + .../visiosoft/advs-module/resources/lang/en/setting.php | 4 ++++ .../advs-module/resources/views/new-ad/new-create.twig | 7 +++++++ 6 files changed, 27 insertions(+) create mode 100644 addons/default/visiosoft/advs-module/resources/js/required-map.js diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index e08ea77f7..c53abdfbd 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -38,6 +38,7 @@ return [ 'hide_options_field', 'hide_village_field', 'hide_configurations', + 'make_map_required', 'show_breadcrumb_when_creating_ad', ], ], diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index 4bc2ccf06..a4a114634 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -139,6 +139,13 @@ return [ 'mode' => 'checkbox' ] ], + 'make_map_required' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], 'enabled_currencies' => [ 'bind' => 'streams::currencies.enabled', 'env' => 'ADV_ENABLED_CURRENCIES', diff --git a/addons/default/visiosoft/advs-module/resources/js/required-map.js b/addons/default/visiosoft/advs-module/resources/js/required-map.js new file mode 100644 index 000000000..d3c296193 --- /dev/null +++ b/addons/default/visiosoft/advs-module/resources/js/required-map.js @@ -0,0 +1,7 @@ +$('#createEditAdvForm').submit(function () { + if ($('input[name=map_Val]').val().length === 0) { + alert(selectLocationAlert) + return false + } + return true +}) \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/message.php b/addons/default/visiosoft/advs-module/resources/lang/en/message.php index 04526f1d0..8fb05b55f 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/message.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/message.php @@ -25,4 +25,5 @@ return [ 'no_add_found' => 'No Ad Found!', 'replicated_success' => 'The ad has been replicated successfully!', 'ad_doesnt_exist' => "This ad doesn't exist!", + 'select_location_error' => "Please select a location on the map!", ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php index 957d0283c..42f7059d0 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -107,6 +107,10 @@ return [ 'name' => 'Hide the Configurations Button', 'instructions' => 'Hide the Configurations Button in the Ad Preview Page', ], + 'make_map_required' => [ + 'name' => 'Make Map Required', + 'instructions' => 'Require the user to place a pin on the map when creating an ad', + ], 'enabled_currencies' => [ 'name' => 'Enabled Currencies', ], diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig index 40a74f785..73b7e6de6 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig @@ -206,6 +206,13 @@ var pick_option = "{{ trans('visiosoft.module.location::field.pick_option.name') }}" + {% if setting_value('visiosoft.module.advs::make_map_required') %} + + {{ asset_add("scripts.js", "visiosoft.module.advs::js/required-map.js") }} + {% endif %} + {{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }} {{ asset_add("scripts.js", "streams::js/form/form.js") }} {{ asset_add("scripts.js", "streams::js/form/translations.js") }} From 2006da4a962a6ced4030f7b9561cc7f9c2a87338 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Thu, 12 Nov 2020 17:19:10 +0300 Subject: [PATCH 4/4] =?UTF-8?q?#2647=20emlak24=20yap=C4=B1lacaklar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/config/settings/sections.php | 1 + .../resources/config/settings/settings.php | 7 +++++++ .../advs-module/resources/lang/en/setting.php | 3 +++ .../resources/views/list/partials/ads.twig | 12 +++++++----- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index c53abdfbd..75de1d0be 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -23,6 +23,7 @@ return [ 'latest-limit', 'popular_ads_limit', 'default_view_type', + 'hide_listing_standard_price', 'hide_zero_price', 'auto_approve', 'estimated_pending_time', diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index a4a114634..7ef868ffe 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -146,6 +146,13 @@ return [ 'mode' => 'checkbox' ] ], + 'hide_listing_standard_price' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], 'enabled_currencies' => [ 'bind' => 'streams::currencies.enabled', 'env' => 'ADV_ENABLED_CURRENCIES', diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php index 42f7059d0..56e9cf779 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -111,6 +111,9 @@ return [ 'name' => 'Make Map Required', 'instructions' => 'Require the user to place a pin on the map when creating an ad', ], + 'hide_listing_standard_price' => [ + 'name' => 'Hide Listing Standard Price', + ], 'enabled_currencies' => [ 'name' => 'Enabled Currencies', ], diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig index 0025fb8f8..4c2b43593 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig @@ -21,11 +21,13 @@
    -

    - {{ adv.standard_price != adv.price and adv.standard_price != '0' - ? adv.standard_price.currency() - : '' }} -

    + {% if not setting_value('visiosoft.module.advs::hide_listing_standard_price') %} +

    + {{ adv.standard_price != adv.price and adv.standard_price != '0' + ? adv.standard_price.currency() + : '' }} +

    + {% endif %} {{ adv.price != '0' ? adv.price.currency() : trans('visiosoft.module.advs::field.free') }}