mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #975 from openclassify/vedatakdn
fixed location filter
This commit is contained in:
commit
c6cc88eaca
@ -67,7 +67,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!setting_value('visiosoft.module.location::hide_location_filter') and isset($param['country'])) {
|
||||
if (!setting_value('visiosoft.module.location::hide_location_filter')) {
|
||||
$country = !empty($param['country']) ? $param['country'] : setting_value('visiosoft.module.location::default_country');
|
||||
if ($country) {
|
||||
$query = $query->where('country_id', $country);
|
||||
|
||||
@ -483,9 +483,9 @@ class AdvsController extends PublicController
|
||||
$adv = $this->adv_repository->getListItemAdv($id);
|
||||
}
|
||||
|
||||
if ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id())) {
|
||||
if ((auth()->user() and auth()->user()->hasRole('admin')) or ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id()))) {
|
||||
// Check if created by exists
|
||||
if (!$adv->created_by) {
|
||||
if ((auth()->user() and !auth()->user()->hasRole('admin')) and !$adv->created_by) {
|
||||
$this->messages->error('visiosoft.module.advs::message.this_ad_is_not_valid_anymore');
|
||||
return $this->redirect->route('visiosoft.module.advs::list');
|
||||
}
|
||||
|
||||
@ -18,9 +18,10 @@ class UsersController extends AdminController
|
||||
$term = request()->term;
|
||||
if ($term) {
|
||||
return $userRepository->newQuery()
|
||||
->select(DB::raw("CONCAT_WS('', first_name, ' ', last_name, ' (', gsm_phone, ' || ', email, ')') AS name"), 'id')
|
||||
->select(DB::raw("CONCAT_WS('', first_name, ' ', last_name, ' (', gsm_phone, ' || ', display_name, ' || ', email, ')') AS name"), 'id')
|
||||
->where('first_name', 'LIKE', "%$term%")
|
||||
->orWhere('last_name', 'LIKE', "%$term%")
|
||||
->orWhere('display_name', 'LIKE', "%$term%")
|
||||
->orWhere('gsm_phone', 'LIKE', "%$term%")
|
||||
->limit(setting_value('visiosoft.module.advs::user_filter_limit'))
|
||||
->pluck('name', 'id');
|
||||
|
||||
@ -68,6 +68,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
||||
'profile/class/extendTime/{id},{type}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@extendAds',
|
||||
'profile/message/show/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@showMessage',
|
||||
'profile/close-account' => [
|
||||
'middleware' => 'auth',
|
||||
'as' => 'visiosoft.module.profile::profile_close_account',
|
||||
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@disableAccount'
|
||||
],
|
||||
|
||||
@ -9,12 +9,14 @@ SET time_zone = "+00:00";
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
|
||||
INSERT INTO `default_settings_settings` (`id`, `sort_order`, `created_at`, `created_by_id`, `updated_at`, `updated_by_id`, `key`, `value`) VALUES
|
||||
(7, 7, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::date_format', 'j F, Y'),
|
||||
(8, 8, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::time_format', 'H:i'),
|
||||
(11, 11, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::standard_theme', 'visiosoft.theme.base'),
|
||||
(12, 12, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::admin_theme', 'visiosoft.theme.defaultadmin'),
|
||||
(15, 15, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::enabled_locales', 'a:11:{i:0;s:2:\"en\";i:1;s:2:\"fa\";i:2;s:2:\"ar\";i:3;s:2:\"el\";i:4;s:2:\"es\";i:5;s:2:\"fr\";i:6;s:2:\"it\";i:7;s:2:\"nl\";i:8;s:2:\"pt\";i:9;s:2:\"ru\";i:10;s:2:\"tr\";}');
|
||||
INSERT INTO `default_settings_settings` (`created_at`,`key`, `value`) VALUES
|
||||
('2019-07-15 06:48:46', 'streams::date_format', 'j F, Y'),
|
||||
('2019-07-15 06:48:46', 'streams::time_format', 'H:i'),
|
||||
('2019-07-15 06:48:46', 'streams::name', 'PHP Classifieds software'),
|
||||
('2019-07-15 06:48:46', 'streams::description', 'OpenClassify is modular and most advanced open source classified platform build with Laravel.Use it in real estate classifieds, auto, e-commerce and other ...'),
|
||||
('2019-07-15 06:48:46', 'streams::standard_theme', 'visiosoft.theme.base'),
|
||||
('2019-07-15 06:48:46', 'streams::admin_theme', 'visiosoft.theme.defaultadmin'),
|
||||
('2019-07-15 06:48:46', 'streams::enabled_locales', 'a:11:{i:0;s:2:\"en\";i:1;s:2:\"fa\";i:2;s:2:\"ar\";i:3;s:2:\"el\";i:4;s:2:\"es\";i:5;s:2:\"fr\";i:6;s:2:\"it\";i:7;s:2:\"nl\";i:8;s:2:\"pt\";i:9;s:2:\"ru\";i:10;s:2:\"tr\";}');
|
||||
COMMIT;
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user