From 0396525fa7ec8f8e0078cd5e9ae8459772f2f2f8 Mon Sep 17 00:00:00 2001 From: diashalabi Date: Mon, 4 Oct 2021 14:59:03 +0300 Subject: [PATCH 1/2] #4590 yenikurs.ocify.site improvments --- .../resources/config/settings/sections.php | 1 - .../resources/config/settings/settings.php | 7 ------- .../resources/css/new-create-new.scss | 2 +- .../resources/views/new-ad/new-create.twig | 2 +- .../advs-module/src/Adv/AdvModel.php | 19 +++++++++++++++++++ .../advs-module/src/Adv/AdvRepository.php | 1 - .../src/Adv/Contract/AdvInterface.php | 4 ++++ .../src/Http/Controller/AdvsController.php | 13 +++++++++++-- 8 files changed, 36 insertions(+), 13 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 2d6d88a69..0c9081ea4 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -60,7 +60,6 @@ return [ 'hide_standard_price_field', 'hide_options_field', 'hide_village_field', - 'hide_configurations', 'make_all_fields_required', '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 e3a092c52..3c1cf4ab6 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -146,13 +146,6 @@ return [ 'mode' => 'checkbox' ] ], - 'hide_configurations' => [ - 'type' => 'anomaly.field_type.boolean', - 'config' => [ - 'default_value' => false, - 'mode' => 'checkbox' - ] - ], 'make_all_fields_required' => [ 'type' => 'anomaly.field_type.boolean', 'config' => [ diff --git a/addons/default/visiosoft/advs-module/resources/css/new-create-new.scss b/addons/default/visiosoft/advs-module/resources/css/new-create-new.scss index f93008c30..139cbef8c 100644 --- a/addons/default/visiosoft/advs-module/resources/css/new-create-new.scss +++ b/addons/default/visiosoft/advs-module/resources/css/new-create-new.scss @@ -133,7 +133,7 @@ label { color: #4A4A4A; font-weight: 600; - input { + input, textarea { box-shadow: 0 calc(1rem / 16) calc(2rem / 16) rgba(0, 0, 0, .04); font-size: calc(17rem / 16); padding: 1.1rem 1.5rem; 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 a6bd38144..760e4c697 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 @@ -79,7 +79,7 @@ {% if setting_value('visiosoft.module.advs::market_place') %} - {{ addBlock('new-ad/fields', {'adv': adv})|raw }} + {{ addBlock('new-ad/fields', {'adv': adv, 'rawClassified': rawClassified})|raw }} {% endif %}
diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index dc33073a6..81148d09f 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -551,4 +551,23 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface ->where('status', '=', 'approved') ->where('slug', '!=', ''); } + + public function setConfig($key, $value) + { + $config = $this->config; + $config = $config ? (array) json_decode($config) : []; + + $config[$key] = $value; + + $this->config = json_encode($config); + $this->save(); + } + + public function getConfig($key) + { + $config = $this->config; + $config = $config ? (array) json_decode($config) : []; + + return $config[$key] ?? null; + } } diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index 9ca14836a..70abc6a69 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -277,7 +277,6 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface ->where('advs_advs.id', $id) ->leftJoin('users_users as u1', 'advs_advs.created_by_id', '=', 'u1.id') ->select('advs_advs.*', 'u1.first_name as first_name', 'u1.last_name as last_name', 'u1.id as owner_id') - ->inRandomOrder() ->first(); if ($adv) { diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php index 8d7913146..4db2bd4f3 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php @@ -99,4 +99,8 @@ interface AdvInterface extends EntryInterface public function lastCategory(); public function scopeCurrent($query); + + public function setConfig($key, $value); + + public function getConfig($key); } 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 526f83d9c..b8046c2ed 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php @@ -769,7 +769,8 @@ class AdvsController extends PublicController } return $this->view->make('visiosoft.module.advs::new-ad/new-create', compact( - 'request', 'formBuilder', 'cats_d', 'custom_fields')); + 'formBuilder', 'cats_d', 'custom_fields' + )); } public function store @@ -840,6 +841,10 @@ class AdvsController extends PublicController $adv->is_get_adv = ($this->request->is_get_adv and $get_categories_status) ? true : false; $adv->save(); + if ($adv->is_get_adv) { + $orderNote = \request('order_note') ?? ''; + $adv->setConfig('order_note', trim($orderNote)); + } //Todo Create Event if (is_module_installed('visiosoft.module.customfields')) { @@ -956,6 +961,7 @@ class AdvsController extends PublicController public function edit($id) { $adv = $this->adv_repository->find($id); + $rawClassified = $adv; if (is_null($adv)) { $this->messages->error(trans('visiosoft.module.advs::message.no_add_found')); @@ -1011,7 +1017,10 @@ class AdvsController extends PublicController return $this->view->make( 'visiosoft.module.advs::new-ad/new-create', - compact('id', 'cats_d', 'cats', 'adv', 'custom_fields', 'options', 'hidePrice','is_options', 'configurations') + compact( + 'id', 'cats_d', 'cats', 'adv', 'custom_fields', 'options', + 'hidePrice','is_options', 'configurations', 'rawClassified' + ) ); } From d4c23cee6785959e3b1e28de762cf60c886bd290 Mon Sep 17 00:00:00 2001 From: diashalabi Date: Wed, 6 Oct 2021 11:04:04 +0300 Subject: [PATCH 2/2] #4601 Membership Resources Report --- .../src/Http/Controller/MyProfileController.php | 1 - .../profile-module/src/ProfileModuleServiceProvider.php | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php index 1fa2d90d1..ded768322 100644 --- a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php +++ b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php @@ -6,7 +6,6 @@ use Anomaly\Streams\Platform\Model\Users\UsersUsersEntryModel; use Anomaly\UsersModule\User\Contract\UserRepositoryInterface; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\DB; use Visiosoft\AdvsModule\Adv\AdvModel; use Visiosoft\AdvsModule\Adv\Event\ChangeStatusAd; use Visiosoft\AdvsModule\Status\Contract\StatusRepositoryInterface; diff --git a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php index ede582c74..418e309fe 100644 --- a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php +++ b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php @@ -187,6 +187,10 @@ class ProfileModuleServiceProvider extends AddonServiceProvider public function boot(AddonCollection $addonCollection) { + if ($utmSource = request('utm_source')) { + setcookie('utm_source', $utmSource); + } + $slug = 'export'; $section = [ 'title' => 'visiosoft.module.profile::button.export',