From bef50883caf0fbf572ae584a0f92834f656e2018 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Thu, 25 Mar 2021 12:11:30 +0300 Subject: [PATCH 1/4] fixed configuration sort order --- .../OptionConfigurationRepository.php | 137 ++++----- composer.json | 272 +++++++++--------- 2 files changed, 208 insertions(+), 201 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php b/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php index 8a315f90e..27c9d2847 100644 --- a/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php +++ b/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php @@ -9,85 +9,88 @@ use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueReposit class OptionConfigurationRepository extends EntryRepository implements OptionConfigurationRepositoryInterface { - /** - * The entry model. - * - * @var OptionConfigurationModel - */ - protected $model; - protected $advRepository; - protected $productOptionsValueRepository; + /** + * The entry model. + * + * @var OptionConfigurationModel + */ + protected $model; + protected $advRepository; + protected $productOptionsValueRepository; - /** - * Create a new OptionConfigurationRepository instance. - * - * @param OptionConfigurationModel $model - */ - public function __construct( - OptionConfigurationModel $model, - AdvRepositoryInterface $advRepository, - ProductoptionsValueRepositoryInterface $productoptionsValueRepository - ) - { - $this->model = $model; - $this->advRepository = $advRepository; - $this->productOptionsValueRepository = $productoptionsValueRepository; - } + /** + * Create a new OptionConfigurationRepository instance. + * + * @param OptionConfigurationModel $model + */ + public function __construct( + OptionConfigurationModel $model, + AdvRepositoryInterface $advRepository, + ProductoptionsValueRepositoryInterface $productoptionsValueRepository + ) + { + $this->model = $model; + $this->advRepository = $advRepository; + $this->productOptionsValueRepository = $productoptionsValueRepository; + } - public function createConfigration($ad_id, $price, $currency, $stock, $option_json) - { - return $this->create([ - 'parent_adv_id' => $ad_id, - 'price' => $price, - 'currency' => $currency, - 'stock' => $stock, - 'option_json' => $option_json, - ]); - } + public function createConfigration($ad_id, $price, $currency, $stock, $option_json) + { + return $this->create([ + 'parent_adv_id' => $ad_id, + 'price' => $price, + 'currency' => $currency, + 'stock' => $stock, + 'option_json' => $option_json, + ]); + } - public function getConf($ad_id) - { - $adv = $this->advRepository->find($ad_id); - $configurations = array(); + public function getConf($ad_id) + { + $adv = $this->advRepository->find($ad_id); + $configurations = array(); - $product_configurations = $this->model->where('stock', '>', '0')->where('parent_adv_id', $ad_id)->get(); + $product_configurations = $this->model->where('stock', '>', '0') + ->where('parent_adv_id', $ad_id) + ->orderBy('created_at', 'ASC') + ->get(); - foreach ($product_configurations as $product_configuration) { - $configurations_item = json_decode($product_configuration->option_json, true); - $option_group_value = ""; - foreach ($configurations_item as $option_id => $value) { - $value_entry = $this->productOptionsValueRepository->find($value); - $option_group_value .= " " . $value_entry->getName(); - } - $configurations[$product_configuration->getId()] = [ - 'name' => $option_group_value, - 'price' => $product_configuration->price, - 'currency' => $product_configuration->currency, - 'stock' => $product_configuration->stock, - 'adv' => $adv->name . ' (' . trim($option_group_value, ' ') . ')', - ]; - } + foreach ($product_configurations as $product_configuration) { + $configurations_item = json_decode($product_configuration->option_json, true); + $option_group_value = ""; + foreach ($configurations_item as $option_id => $value) { + $value_entry = $this->productOptionsValueRepository->find($value); + $option_group_value .= " " . $value_entry->getName(); + } + $configurations[$product_configuration->getId()] = [ + 'name' => $option_group_value, + 'price' => $product_configuration->price, + 'currency' => $product_configuration->currency, + 'stock' => $product_configuration->stock, + 'adv' => $adv->name . ' (' . trim($option_group_value, ' ') . ')', + ]; + } - return $configurations; - } + return $configurations; + } - public function getUnusedConfigs() - { - return $this->newQuery() + public function getUnusedConfigs() + { + return $this->newQuery() ->leftJoin('advs_advs as ads', 'advs_option_configuration.parent_adv_id', 'ads.id') ->whereNull('ads.id') ->orWhereNotNull('deleted_at') ->pluck('parent_adv_id') ->all(); - } + } - public function deleteUnusedConfigs($adsIDs) - { - return $this->newQuery()->whereIn('parent_adv_id', $adsIDs)->delete(); - } + public function deleteUnusedConfigs($adsIDs) + { + return $this->newQuery()->whereIn('parent_adv_id', $adsIDs)->delete(); + } - public function deleteAdsConfigs($adID) - { - return $this->newQuery()->where('parent_adv_id', $adID)->delete(); - } + public function deleteAdsConfigs($adID) + { + return $this->newQuery()->where('parent_adv_id', $adID)->delete(); + } } diff --git a/composer.json b/composer.json index f4ff8997a..24dafcd08 100644 --- a/composer.json +++ b/composer.json @@ -1,139 +1,143 @@ { - "name": "openclassify/openclassify", - "description": "OpenClassify is the extensible and most advanced open source classified app build with Laravel.", - "type": "project", - "keywords": [ - "OpenClassify", - "classified", - "open Classify" - ], - "license": "MIT", - "authors": [ - { - "name": "Visiosoft, Inc.", - "email": "support@visiosoft.com.tr" - } - ], - "require": { - "wikimedia/composer-merge-plugin": "~1.4.0", - "anomaly/streams-composer-plugin": "~1.1.0", - "visiosoft/streams-platform": "^1.7", - "anomaly/default_authenticator-extension": "~2.1.0", - "anomaly/throttle_security_check-extension": "~2.1.0", - "anomaly/private_storage_adapter-extension": "~1.0.0", - "anomaly/default_page_handler-extension": "~2.1.0", - "anomaly/user_security_check-extension": "~2.1.0", - "anomaly/xml_feed_widget-extension": "~2.1.0", - "anomaly/page_link_type-extension": "~2.1.0", - "anomaly/url_link_type-extension": "~2.1.0", - "anomaly/relationship-field_type": "~2.2.0", - "anomaly/colorpicker-field_type": "~2.3.0", - "anomaly/polymorphic-field_type": "~2.1.0", - "anomaly/checkboxes-field_type": "~2.4.0", - "anomaly/encrypted-field_type": "~2.1.0", - "anomaly/datetime-field_type": "~3.0.0", - "anomaly/repeater-field_type": "~1.3.0", - "anomaly/language-field_type": "~2.2.0", - "anomaly/multiple-field_type": "~2.3.0", - "anomaly/textarea-field_type": "~2.1.0", - "anomaly/markdown-field_type": "~3.1.0", - "anomaly/wysiwyg-field_type": "~3.1.0", - "anomaly/boolean-field_type": "~2.3.0", - "anomaly/country-field_type": "~2.3.0", - "anomaly/decimal-field_type": "~2.1.0", - "anomaly/integer-field_type": "~2.1.0", - "anomaly/editor-field_type": "~3.1.0", - "anomaly/select-field_type": "~2.3.0", - "anomaly/slider-field_type": "~3.0.0", - "anomaly/addon-field_type": "~2.2.0", - "anomaly/email-field_type": "~2.1.0", - "anomaly/state-field_type": "~2.3.0", - "anomaly/files-field_type": "~2.3.0", - "anomaly/tags-field_type": "~2.4.0", - "anomaly/slug-field_type": "~2.1.0", - "anomaly/text-field_type": "~2.2.0", - "anomaly/file-field_type": "~2.2.0", - "anomaly/url-field_type": "~2.2.0", - "anomaly/configuration-module": "~2.1.0", - "anomaly/preferences-module": "~2.2.0", - "anomaly/navigation-module": "~2.4.0", - "anomaly/dashboard-module": "~2.2.0", - "anomaly/redirects-module": "~2.3.0", - "anomaly/variables-module": "~2.4.0", - "anomaly/settings-module": "~2.4.0", - "anomaly/blocks-module": "~1.3.0", - "anomaly/search-module": "~3.0.0", - "anomaly/system-module": "~1.0.0", - "anomaly/users-module": "~2.5.0", - "anomaly/pages-module": "~2.6.0", - "anomaly/posts-module": "~2.6.0", - "anomaly/files-module": "~2.6.0", - "anomaly/contact-plugin": "~1.2.0", - "anomaly/helper-plugin": "~2.1.0", - "anomaly/robots-extension": "~2.1.0", - "anomaly/sitemap-extension": "~2.2.0", - "anomaly/html_block-extension": "~1.0.0", - "anomaly/wysiwyg_block-extension": "~1.0.0", - "ammadeuss/laravel-html-dom-parser": "^1.1", - "visiosoft/decimal-field_type": "~2.1.0", - "visiosoft/integer-field_type": "~2.1.0", - "visiosoft/list-field_type": "*", - "guzzlehttp/guzzle": "~6.3.3", - "composer/composer": "^1.6" - }, - "replace": { - "anomaly/streams-platform": "*" - }, - "require-dev": { - "filp/whoops": "~2.0", - "phpunit/phpunit": "^7.0", - "fzaninotto/faker": "~1.4", - "mockery/mockery": "0.9.*", - "symfony/css-selector": "3.1.*", - "symfony/dom-crawler": "3.1.*", - "anomaly/installer-module": "~2.3.0" - }, - "repositories": [ - { - "type": "composer", - "url": "https://packages.pyrocms.com" - }, - { - "type": "composer", - "url": "https://community.pyrocms.com" - } - ], - "autoload": { - "classmap": [ - "database" + "name": "openclassify/openclassify", + "description": "OpenClassify is the extensible and most advanced open source classified app build with Laravel.", + "type": "project", + "keywords": [ + "OpenClassify", + "classified", + "open Classify" ], - "psr-4": { - "App\\": "app/" - } - }, - "autoload-dev": { - "classmap": [ - "tests/TestCase.php" - ] - }, - "extra": { - "merge-plugin": { - "include": [ - "addons/*/*/*/composer.json", - "core/*/*/composer.json" - ], - "recurse": true, - "replace": false + "license": "MIT", + "authors": [ + { + "name": "Visiosoft, Inc.", + "email": "support@visiosoft.com.tr" + } + ], + "require": { + "wikimedia/composer-merge-plugin": "~1.4.0", + "anomaly/streams-composer-plugin": "~1.1.0", + "visiosoft/streams-platform": "^1.7", + "anomaly/default_authenticator-extension": "~2.1.0", + "anomaly/throttle_security_check-extension": "~2.1.0", + "anomaly/private_storage_adapter-extension": "~1.0.0", + "anomaly/default_page_handler-extension": "~2.1.0", + "anomaly/user_security_check-extension": "~2.1.0", + "anomaly/xml_feed_widget-extension": "~2.1.0", + "anomaly/page_link_type-extension": "~2.1.0", + "anomaly/url_link_type-extension": "~2.1.0", + "anomaly/relationship-field_type": "~2.2.0", + "anomaly/colorpicker-field_type": "~2.3.0", + "anomaly/polymorphic-field_type": "~2.1.0", + "anomaly/checkboxes-field_type": "~2.4.0", + "anomaly/encrypted-field_type": "~2.1.0", + "anomaly/datetime-field_type": "~3.0.0", + "anomaly/repeater-field_type": "~1.3.0", + "anomaly/language-field_type": "~2.2.0", + "anomaly/multiple-field_type": "~2.3.0", + "anomaly/textarea-field_type": "~2.1.0", + "anomaly/markdown-field_type": "~3.1.0", + "anomaly/wysiwyg-field_type": "~3.1.0", + "anomaly/boolean-field_type": "~2.3.0", + "anomaly/country-field_type": "~2.3.0", + "anomaly/decimal-field_type": "~2.1.0", + "anomaly/integer-field_type": "~2.1.0", + "anomaly/editor-field_type": "~3.1.0", + "anomaly/select-field_type": "~2.3.0", + "anomaly/slider-field_type": "~3.0.0", + "anomaly/addon-field_type": "~2.2.0", + "anomaly/email-field_type": "~2.1.0", + "anomaly/state-field_type": "~2.3.0", + "anomaly/files-field_type": "~2.3.0", + "anomaly/tags-field_type": "~2.4.0", + "anomaly/slug-field_type": "~2.1.0", + "anomaly/text-field_type": "~2.2.0", + "anomaly/file-field_type": "~2.2.0", + "anomaly/url-field_type": "~2.2.0", + "anomaly/configuration-module": "~2.1.0", + "anomaly/preferences-module": "~2.2.0", + "anomaly/navigation-module": "~2.4.0", + "anomaly/dashboard-module": "~2.2.0", + "anomaly/redirects-module": "~2.3.0", + "anomaly/variables-module": "~2.4.0", + "anomaly/settings-module": "~2.4.0", + "anomaly/blocks-module": "~1.3.0", + "anomaly/search-module": "~3.0.0", + "anomaly/system-module": "~1.0.0", + "anomaly/users-module": "~2.5.0", + "anomaly/pages-module": "~2.6.0", + "anomaly/posts-module": "~2.6.0", + "anomaly/files-module": "~2.6.0", + "anomaly/contact-plugin": "~1.2.0", + "anomaly/helper-plugin": "~2.1.0", + "anomaly/robots-extension": "~2.1.0", + "anomaly/sitemap-extension": "~2.2.0", + "anomaly/html_block-extension": "~1.0.0", + "anomaly/wysiwyg_block-extension": "~1.0.0", + "ammadeuss/laravel-html-dom-parser": "^1.1", + "visiosoft/decimal-field_type": "~2.1.0", + "visiosoft/integer-field_type": "~2.1.0", + "visiosoft/list-field_type": "*", + "guzzlehttp/guzzle": "~6.3.3", + "composer/composer": "^1.6" }, - "laravel": { - "dont-discover": [ - "*" - ] + "replace": { + "anomaly/streams-platform": "*" + }, + "require-dev": { + "filp/whoops": "~2.0", + "phpunit/phpunit": "^7.0", + "fzaninotto/faker": "~1.4", + "mockery/mockery": "0.9.*", + "symfony/css-selector": "3.1.*", + "symfony/dom-crawler": "3.1.*", + "anomaly/installer-module": "~2.3.0" + }, + "repositories": { + "0": { + "type": "composer", + "url": "https://packages.pyrocms.com" + }, + "1": { + "type": "composer", + "url": "https://community.pyrocms.com" + }, + "repo-name": { + "type": "composer", + "url": "https://repo.openclassify.com" + } + }, + "autoload": { + "classmap": [ + "database" + ], + "psr-4": { + "App\\": "app/" + } + }, + "autoload-dev": { + "classmap": [ + "tests/TestCase.php" + ] + }, + "extra": { + "merge-plugin": { + "include": [ + "addons/*/*/*/composer.json", + "core/*/*/composer.json" + ], + "recurse": true, + "replace": false + }, + "laravel": { + "dont-discover": [ + "*" + ] + } + }, + "config": { + "bin-dir": "bin", + "preferred-install": "dist", + "optimize-autoloader": true } - }, - "config": { - "bin-dir": "bin", - "preferred-install": "dist", - "optimize-autoloader": true - } } From ca771cf280b1949cbffa4850507896a53b4dfc38 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Thu, 25 Mar 2021 12:15:00 +0300 Subject: [PATCH 2/4] revert composer --- composer.json | 276 +++++++++++++++++++++++++------------------------- 1 file changed, 136 insertions(+), 140 deletions(-) diff --git a/composer.json b/composer.json index 24dafcd08..f4ff8997a 100644 --- a/composer.json +++ b/composer.json @@ -1,143 +1,139 @@ { - "name": "openclassify/openclassify", - "description": "OpenClassify is the extensible and most advanced open source classified app build with Laravel.", - "type": "project", - "keywords": [ - "OpenClassify", - "classified", - "open Classify" - ], - "license": "MIT", - "authors": [ - { - "name": "Visiosoft, Inc.", - "email": "support@visiosoft.com.tr" - } - ], - "require": { - "wikimedia/composer-merge-plugin": "~1.4.0", - "anomaly/streams-composer-plugin": "~1.1.0", - "visiosoft/streams-platform": "^1.7", - "anomaly/default_authenticator-extension": "~2.1.0", - "anomaly/throttle_security_check-extension": "~2.1.0", - "anomaly/private_storage_adapter-extension": "~1.0.0", - "anomaly/default_page_handler-extension": "~2.1.0", - "anomaly/user_security_check-extension": "~2.1.0", - "anomaly/xml_feed_widget-extension": "~2.1.0", - "anomaly/page_link_type-extension": "~2.1.0", - "anomaly/url_link_type-extension": "~2.1.0", - "anomaly/relationship-field_type": "~2.2.0", - "anomaly/colorpicker-field_type": "~2.3.0", - "anomaly/polymorphic-field_type": "~2.1.0", - "anomaly/checkboxes-field_type": "~2.4.0", - "anomaly/encrypted-field_type": "~2.1.0", - "anomaly/datetime-field_type": "~3.0.0", - "anomaly/repeater-field_type": "~1.3.0", - "anomaly/language-field_type": "~2.2.0", - "anomaly/multiple-field_type": "~2.3.0", - "anomaly/textarea-field_type": "~2.1.0", - "anomaly/markdown-field_type": "~3.1.0", - "anomaly/wysiwyg-field_type": "~3.1.0", - "anomaly/boolean-field_type": "~2.3.0", - "anomaly/country-field_type": "~2.3.0", - "anomaly/decimal-field_type": "~2.1.0", - "anomaly/integer-field_type": "~2.1.0", - "anomaly/editor-field_type": "~3.1.0", - "anomaly/select-field_type": "~2.3.0", - "anomaly/slider-field_type": "~3.0.0", - "anomaly/addon-field_type": "~2.2.0", - "anomaly/email-field_type": "~2.1.0", - "anomaly/state-field_type": "~2.3.0", - "anomaly/files-field_type": "~2.3.0", - "anomaly/tags-field_type": "~2.4.0", - "anomaly/slug-field_type": "~2.1.0", - "anomaly/text-field_type": "~2.2.0", - "anomaly/file-field_type": "~2.2.0", - "anomaly/url-field_type": "~2.2.0", - "anomaly/configuration-module": "~2.1.0", - "anomaly/preferences-module": "~2.2.0", - "anomaly/navigation-module": "~2.4.0", - "anomaly/dashboard-module": "~2.2.0", - "anomaly/redirects-module": "~2.3.0", - "anomaly/variables-module": "~2.4.0", - "anomaly/settings-module": "~2.4.0", - "anomaly/blocks-module": "~1.3.0", - "anomaly/search-module": "~3.0.0", - "anomaly/system-module": "~1.0.0", - "anomaly/users-module": "~2.5.0", - "anomaly/pages-module": "~2.6.0", - "anomaly/posts-module": "~2.6.0", - "anomaly/files-module": "~2.6.0", - "anomaly/contact-plugin": "~1.2.0", - "anomaly/helper-plugin": "~2.1.0", - "anomaly/robots-extension": "~2.1.0", - "anomaly/sitemap-extension": "~2.2.0", - "anomaly/html_block-extension": "~1.0.0", - "anomaly/wysiwyg_block-extension": "~1.0.0", - "ammadeuss/laravel-html-dom-parser": "^1.1", - "visiosoft/decimal-field_type": "~2.1.0", - "visiosoft/integer-field_type": "~2.1.0", - "visiosoft/list-field_type": "*", - "guzzlehttp/guzzle": "~6.3.3", - "composer/composer": "^1.6" - }, - "replace": { - "anomaly/streams-platform": "*" - }, - "require-dev": { - "filp/whoops": "~2.0", - "phpunit/phpunit": "^7.0", - "fzaninotto/faker": "~1.4", - "mockery/mockery": "0.9.*", - "symfony/css-selector": "3.1.*", - "symfony/dom-crawler": "3.1.*", - "anomaly/installer-module": "~2.3.0" - }, - "repositories": { - "0": { - "type": "composer", - "url": "https://packages.pyrocms.com" - }, - "1": { - "type": "composer", - "url": "https://community.pyrocms.com" - }, - "repo-name": { - "type": "composer", - "url": "https://repo.openclassify.com" - } - }, - "autoload": { - "classmap": [ - "database" - ], - "psr-4": { - "App\\": "app/" - } - }, - "autoload-dev": { - "classmap": [ - "tests/TestCase.php" - ] - }, - "extra": { - "merge-plugin": { - "include": [ - "addons/*/*/*/composer.json", - "core/*/*/composer.json" - ], - "recurse": true, - "replace": false - }, - "laravel": { - "dont-discover": [ - "*" - ] - } - }, - "config": { - "bin-dir": "bin", - "preferred-install": "dist", - "optimize-autoloader": true + "name": "openclassify/openclassify", + "description": "OpenClassify is the extensible and most advanced open source classified app build with Laravel.", + "type": "project", + "keywords": [ + "OpenClassify", + "classified", + "open Classify" + ], + "license": "MIT", + "authors": [ + { + "name": "Visiosoft, Inc.", + "email": "support@visiosoft.com.tr" } + ], + "require": { + "wikimedia/composer-merge-plugin": "~1.4.0", + "anomaly/streams-composer-plugin": "~1.1.0", + "visiosoft/streams-platform": "^1.7", + "anomaly/default_authenticator-extension": "~2.1.0", + "anomaly/throttle_security_check-extension": "~2.1.0", + "anomaly/private_storage_adapter-extension": "~1.0.0", + "anomaly/default_page_handler-extension": "~2.1.0", + "anomaly/user_security_check-extension": "~2.1.0", + "anomaly/xml_feed_widget-extension": "~2.1.0", + "anomaly/page_link_type-extension": "~2.1.0", + "anomaly/url_link_type-extension": "~2.1.0", + "anomaly/relationship-field_type": "~2.2.0", + "anomaly/colorpicker-field_type": "~2.3.0", + "anomaly/polymorphic-field_type": "~2.1.0", + "anomaly/checkboxes-field_type": "~2.4.0", + "anomaly/encrypted-field_type": "~2.1.0", + "anomaly/datetime-field_type": "~3.0.0", + "anomaly/repeater-field_type": "~1.3.0", + "anomaly/language-field_type": "~2.2.0", + "anomaly/multiple-field_type": "~2.3.0", + "anomaly/textarea-field_type": "~2.1.0", + "anomaly/markdown-field_type": "~3.1.0", + "anomaly/wysiwyg-field_type": "~3.1.0", + "anomaly/boolean-field_type": "~2.3.0", + "anomaly/country-field_type": "~2.3.0", + "anomaly/decimal-field_type": "~2.1.0", + "anomaly/integer-field_type": "~2.1.0", + "anomaly/editor-field_type": "~3.1.0", + "anomaly/select-field_type": "~2.3.0", + "anomaly/slider-field_type": "~3.0.0", + "anomaly/addon-field_type": "~2.2.0", + "anomaly/email-field_type": "~2.1.0", + "anomaly/state-field_type": "~2.3.0", + "anomaly/files-field_type": "~2.3.0", + "anomaly/tags-field_type": "~2.4.0", + "anomaly/slug-field_type": "~2.1.0", + "anomaly/text-field_type": "~2.2.0", + "anomaly/file-field_type": "~2.2.0", + "anomaly/url-field_type": "~2.2.0", + "anomaly/configuration-module": "~2.1.0", + "anomaly/preferences-module": "~2.2.0", + "anomaly/navigation-module": "~2.4.0", + "anomaly/dashboard-module": "~2.2.0", + "anomaly/redirects-module": "~2.3.0", + "anomaly/variables-module": "~2.4.0", + "anomaly/settings-module": "~2.4.0", + "anomaly/blocks-module": "~1.3.0", + "anomaly/search-module": "~3.0.0", + "anomaly/system-module": "~1.0.0", + "anomaly/users-module": "~2.5.0", + "anomaly/pages-module": "~2.6.0", + "anomaly/posts-module": "~2.6.0", + "anomaly/files-module": "~2.6.0", + "anomaly/contact-plugin": "~1.2.0", + "anomaly/helper-plugin": "~2.1.0", + "anomaly/robots-extension": "~2.1.0", + "anomaly/sitemap-extension": "~2.2.0", + "anomaly/html_block-extension": "~1.0.0", + "anomaly/wysiwyg_block-extension": "~1.0.0", + "ammadeuss/laravel-html-dom-parser": "^1.1", + "visiosoft/decimal-field_type": "~2.1.0", + "visiosoft/integer-field_type": "~2.1.0", + "visiosoft/list-field_type": "*", + "guzzlehttp/guzzle": "~6.3.3", + "composer/composer": "^1.6" + }, + "replace": { + "anomaly/streams-platform": "*" + }, + "require-dev": { + "filp/whoops": "~2.0", + "phpunit/phpunit": "^7.0", + "fzaninotto/faker": "~1.4", + "mockery/mockery": "0.9.*", + "symfony/css-selector": "3.1.*", + "symfony/dom-crawler": "3.1.*", + "anomaly/installer-module": "~2.3.0" + }, + "repositories": [ + { + "type": "composer", + "url": "https://packages.pyrocms.com" + }, + { + "type": "composer", + "url": "https://community.pyrocms.com" + } + ], + "autoload": { + "classmap": [ + "database" + ], + "psr-4": { + "App\\": "app/" + } + }, + "autoload-dev": { + "classmap": [ + "tests/TestCase.php" + ] + }, + "extra": { + "merge-plugin": { + "include": [ + "addons/*/*/*/composer.json", + "core/*/*/composer.json" + ], + "recurse": true, + "replace": false + }, + "laravel": { + "dont-discover": [ + "*" + ] + } + }, + "config": { + "bin-dir": "bin", + "preferred-install": "dist", + "optimize-autoloader": true + } } From 98bcc6ac135e4283b65084f44e803d0bd1aee799 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Thu, 25 Mar 2021 12:41:34 +0300 Subject: [PATCH 3/4] district require is optional --- .../resources/assets/js/create.js | 2 +- .../resources/config/settings/sections.php | 1 + .../resources/config/settings/settings.php | 6 +++ .../resources/lang/en/setting.php | 3 ++ .../src/Adress/Form/AdressFormFields.php | 4 +- .../Http/Controller/MyProfileController.php | 37 +++++++++++-------- 6 files changed, 36 insertions(+), 17 deletions(-) diff --git a/addons/default/visiosoft/profile-module/resources/assets/js/create.js b/addons/default/visiosoft/profile-module/resources/assets/js/create.js index 70d9e843f..bdb26f95f 100644 --- a/addons/default/visiosoft/profile-module/resources/assets/js/create.js +++ b/addons/default/visiosoft/profile-module/resources/assets/js/create.js @@ -15,7 +15,7 @@ function Locations(cat, level, name) { url: "/class/ajax", success: function (msg) { $('select[name="' + name + '"]').find('option').remove(); - $('select[name="' + name + '"]').append(''); + $('select[name="' + name + '"]').append(''); $.each(msg, function (key, value) { $('select[name="' + name + '"]').append(''); }); 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 6a042d197..bddef91f7 100644 --- a/addons/default/visiosoft/profile-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/profile-module/resources/config/settings/sections.php @@ -7,6 +7,7 @@ return [ 'general_setting' => [ 'title' => 'visiosoft.module.profile::section.general_setting', 'fields' => [ + 'required_district', 'show_my_ads', 'upload_avatar', 'show_tax_office', 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 35e8ba2f3..a31fc1386 100644 --- a/addons/default/visiosoft/profile-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/profile-module/resources/config/settings/settings.php @@ -70,4 +70,10 @@ return [ "education" => "anomaly.field_type.tags", "state_of_education" => "anomaly.field_type.tags", "profession" => "anomaly.field_type.tags", + 'required_district' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + ] + ], ]; \ No newline at end of file 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 ff66a5ce9..66f1d2099 100644 --- a/addons/default/visiosoft/profile-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/profile-module/resources/lang/en/setting.php @@ -47,4 +47,7 @@ return [ 'name' => 'Hide Register Type in Profile Page', 'instructions' => 'Hides the register type field in the profile edit page.', ], + 'required_district' => [ + 'name' => 'Required District' + ], ]; diff --git a/addons/default/visiosoft/profile-module/src/Adress/Form/AdressFormFields.php b/addons/default/visiosoft/profile-module/src/Adress/Form/AdressFormFields.php index 1f99c9871..f650d7375 100644 --- a/addons/default/visiosoft/profile-module/src/Adress/Form/AdressFormFields.php +++ b/addons/default/visiosoft/profile-module/src/Adress/Form/AdressFormFields.php @@ -26,7 +26,9 @@ class AdressFormFields 'city' => [ 'required' => true, ], - 'district', + 'district' => [ + 'required' => setting_value( 'visiosoft.module.profile::required_district'), + ], 'adress_content' => [ 'required' => true, ], 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 3bc410054..18f60162f 100644 --- a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php +++ b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php @@ -134,8 +134,15 @@ class MyProfileController extends PublicController { $message = []; + $error_district = false; + if (setting_value('visiosoft.module.profile::required_district') and (!$this->request->district or $this->request->district == "")) { + $error_district = true; + } + $error = $form->build()->validate()->getFormErrors()->getMessages(); - if (!empty($error)) { + + if (!empty($error) or $error_district) { + $this->messages->flush(); $message['status'] = "error"; $message['msg'] = trans('visiosoft.module.profile::message.required_all'); return $message; @@ -248,19 +255,19 @@ class MyProfileController extends PublicController return response()->json(['status' => 'success', 'data' => $profile]); } - public function getEducation(Request $request) - { - $user = $this->userRepository->find(auth()->id()); - $education = EducationModel::all(); - $educationPart = EducationPartModel::query()->where('education_id', $user->education)->get(); - return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200); - } + public function getEducation(Request $request) + { + $user = $this->userRepository->find(auth()->id()); + $education = EducationModel::all(); + $educationPart = EducationPartModel::query()->where('education_id', $user->education)->get(); + return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200); + } - public function changeEducation(Request $request) - { - if ($request->info == 'education') { - $education = EducationPartModel::query()->where('education_id', $request->education)->get(); - } - return response()->json(['data' => $education], 200); - } + public function changeEducation(Request $request) + { + if ($request->info == 'education') { + $education = EducationPartModel::query()->where('education_id', $request->education)->get(); + } + return response()->json(['data' => $education], 200); + } } From 40ccde45c070ac0f56aacdaa1ba0cc0ab9d6bdae Mon Sep 17 00:00:00 2001 From: vedatakd Date: Thu, 25 Mar 2021 16:28:50 +0300 Subject: [PATCH 4/4] fixes for muammer --- .../advs-module/resources/js/filter_modal.js | 11 +---------- .../visiosoft/advs-module/resources/js/list.js | 8 +++++--- .../resources/views/list/partials/filter-modal.twig | 4 +++- .../resources/views/list/partials/list-filter.twig | 4 ++-- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/js/filter_modal.js b/addons/default/visiosoft/advs-module/resources/js/filter_modal.js index 0f371ad38..c466f2781 100644 --- a/addons/default/visiosoft/advs-module/resources/js/filter_modal.js +++ b/addons/default/visiosoft/advs-module/resources/js/filter_modal.js @@ -129,13 +129,4 @@ $('.set_category').on('click', function () { $('#filterModal').find('form').attr("action", '/advs/list'); $('#filterModal').modal('toggle'); -}); - -// Move filter on small screen -$(window).on("load resize", function () { - const width = (window.innerWidth > 0) ? window.innerWidth : screen.width; - if (width <= 575) { - const detach = $('#listFilterForm').detach(); - $('#modalListFilterForm').append(detach); - } -}); +}); \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/js/list.js b/addons/default/visiosoft/advs-module/resources/js/list.js index fa86de6d9..b8d1099da 100644 --- a/addons/default/visiosoft/advs-module/resources/js/list.js +++ b/addons/default/visiosoft/advs-module/resources/js/list.js @@ -163,7 +163,8 @@ $(document).ready(function () { }); function getCities(country) { - return crudAjax(`id=${country}`, '/ajax/getCities', 'POST', () => {}, true) + return crudAjax(`id=${country}`, '/ajax/getCities', 'POST', () => { + }, true) .then(function (cities) { $('select[name="filter_City"]').html(""); $.each(cities, function (index, value) { @@ -172,9 +173,10 @@ function getCities(country) { }) } -$("#listFilterForm").submit(function(e) { +$("#listFilterForm, #listFilterFormMobile").submit(function (e) { // Disable unselected inputs - const inputs = $('#listFilterForm :input'); + const inputs = $('#' + $(this).attr('id') + ' :input'); + [...inputs].forEach((input) => { if (input.type === 'checkbox' || input.type === 'radio') { if ($(input).prop("checked") == false) { diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/filter-modal.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/filter-modal.twig index 8ba54e038..e7f3483d3 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/filter-modal.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/filter-modal.twig @@ -35,7 +35,9 @@ {% endif %} -
+
+ {% include 'visiosoft.module.advs::list/partials/list-filter' with {"filter_id": 'listFilterFormMobile'} %} +
diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig index 24015510f..d977a7892 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig @@ -1,5 +1,5 @@ {% set formHtml %} -
+ {% endset %} {% set catSlug = null %} {% set citySlug = null %} @@ -12,7 +12,7 @@ {% endif %} {% if catSlug %} {% set formHtml %} - + {% endset %} {% endif %} {{ formHtml }}