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 7d94fd80c..b745f7bf3 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,7 @@ return [ 'filter' => [ 'title' => 'visiosoft.module.advs::section.filter', 'fields' => [ - 'hide_price_filter', 'hide_date_filter', 'hide_photo_filter', 'hide_map_filter' + 'hide_price_filter', 'hide_date_filter', 'hide_photo_filter', 'hide_map_filter', 'user_filter_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 fe39dc59c..de242f57c 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -283,4 +283,10 @@ return [ 'default_value' => 'top-right', ] ], + 'user_filter_limit' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 5, + ], + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/css/custom.css b/addons/default/visiosoft/advs-module/resources/css/custom.css index 8b202042d..54242c139 100644 --- a/addons/default/visiosoft/advs-module/resources/css/custom.css +++ b/addons/default/visiosoft/advs-module/resources/css/custom.css @@ -40,4 +40,8 @@ .select2-container--default .select2-selection--single .select2-selection__arrow { top: unset; +} + +select[name=filter_User] + .select2 { + min-width: 20rem; } \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/css/list.css b/addons/default/visiosoft/advs-module/resources/css/list.css index cc9d284f0..b015844d4 100644 --- a/addons/default/visiosoft/advs-module/resources/css/list.css +++ b/addons/default/visiosoft/advs-module/resources/css/list.css @@ -220,4 +220,8 @@ a.sort-by-open-dropdown:hover { .filter-section .countries input[type=checkbox] { display: none; +} + +.gallery-tn { + object-fit: cover; } \ 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 ecf5f4b07..2311ecba7 100644 --- a/addons/default/visiosoft/advs-module/resources/js/list.js +++ b/addons/default/visiosoft/advs-module/resources/js/list.js @@ -151,7 +151,25 @@ $(document).ready(function () { // User filter $("select[name=filter_User]").select2({ - placeholder: $('select[name=filter_User] option:first-child').text() + placeholder: $('select[name=filter_User] option:first-child').text(), + ajax: { + url: '/api/profile/query-users', + dataType: 'json', + processResults: function (data) { + let formattedData = []; + + Object.keys(data).forEach(function (id) { + formattedData.push({ + 'id': id, + 'text': data[id] + }) + }) + + return { + results: formattedData + } + } + } }); // Country filter 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 07d95f740..2e748fcf5 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -176,4 +176,8 @@ return [ 'watermark_position' => [ 'name' => 'Watermark Position', ], + 'user_filter_limit' => [ + 'name' => 'User Filter Limit', + 'instructions' => 'In the admin panel' + ] ]; diff --git a/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig b/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig index eb087cf5a..d2140a2c8 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig @@ -7,7 +7,7 @@
-
diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/AdvsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/AdvsController.php index 2321df840..6a00e9400 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/AdvsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/AdvsController.php @@ -167,10 +167,6 @@ class AdvsController extends AdminController $cities = $cityModel->all()->pluck('name', 'id')->all(); - $users = $userModel->newQuery() - ->select(DB::raw("CONCAT_WS('', first_name, ' ', last_name, ' (', gsm_phone, ' || ', email, ')') AS display_name"), 'id') - ->pluck('display_name', 'id') - ->toArray(); $categories = $categoryModel::query()->where('parent_category_id', null) ->leftJoin('cats_category_translations', 'cats_category.id', '=', 'cats_category_translations.entry_id') ->where('locale', config('app.locale')) @@ -194,7 +190,6 @@ class AdvsController extends AdminController 'exact' => true, 'filter' => 'select', 'query' => UserFilterQuery::class, - 'options' => $users, ], 'status' => [ 'filter' => 'select', diff --git a/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryInterface.php b/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryInterface.php index d3c20ba24..0e6e89b7b 100644 --- a/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryInterface.php +++ b/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryInterface.php @@ -4,5 +4,31 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface; interface CategoryInterface extends EntryInterface { + public function getCat($id); + + public function getParentCats($id, $type = null); + + public function getCatLevel($id); + + public function getParentsCount($id); + + public function getSubCategories($id, $get = null); + + public function getAllSubCategories($id); + + public function deleteSubCategories($id); + + public function searchKeyword($keyword, $selected = null); + + public function getMainCategory(); + + public function getMeta_keywords($cat_id); + + public function getMeta_description($cat_id); + + public function getMeta_title($cat_id); + + public function getMains($id); + public function getParent(); } diff --git a/addons/default/visiosoft/profile-module/src/Http/Controller/Admin/UsersController.php b/addons/default/visiosoft/profile-module/src/Http/Controller/Admin/UsersController.php index d7d403317..090c58b74 100644 --- a/addons/default/visiosoft/profile-module/src/Http/Controller/Admin/UsersController.php +++ b/addons/default/visiosoft/profile-module/src/Http/Controller/Admin/UsersController.php @@ -1,6 +1,8 @@ term; + if ($term) { + return $userRepository->newQuery() + ->select(DB::raw("CONCAT_WS('', first_name, ' ', last_name, ' (', gsm_phone, ' || ', email, ')') AS name"), 'id') + ->where('first_name', 'LIKE', "%$term%") + ->orWhere('last_name', 'LIKE', "%$term%") + ->orWhere('gsm_phone', 'LIKE', "%$term%") + ->limit(setting_value('visiosoft.module.advs::user_filter_limit')) + ->pluck('name', 'id'); + } + } } diff --git a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php index 2c45177fe..bbedeac27 100644 --- a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php +++ b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php @@ -69,6 +69,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider 'as' => 'users::exportUsers', 'uses' => 'Visiosoft\ProfileModule\Http\Controller\Admin\UsersController@exportUsers' ], + 'api/profile/query-users' => 'Visiosoft\ProfileModule\Http\Controller\Admin\UsersController@queryUsers', // MyProfileController 'profile/ads' => [