From 765f7017caa8586174ff5210c44d723adaccfb98 Mon Sep 17 00:00:00 2001 From: vedatakdogan Date: Tue, 22 Dec 2020 16:02:10 +0300 Subject: [PATCH 01/31] sahibinden theme rtl --- resources/streams/config/locales.php | 652 +++++++++++++++++++++++++++ 1 file changed, 652 insertions(+) create mode 100644 resources/streams/config/locales.php diff --git a/resources/streams/config/locales.php b/resources/streams/config/locales.php new file mode 100644 index 000000000..b72562e7f --- /dev/null +++ b/resources/streams/config/locales.php @@ -0,0 +1,652 @@ + env('LOCALE_HINTS', true), + + /* + |-------------------------------------------------------------------------- + | Enabled Locales + |-------------------------------------------------------------------------- + | + | Define an array of locales enabled for translatable input. + | + */ + + 'enabled' => explode(',', env('ENABLED_LOCALES', 'en')), + + /* + |-------------------------------------------------------------------------- + | Default + |-------------------------------------------------------------------------- + | + | The default locale for CONTENT. + | + */ + + 'default' => env('DEFAULT_LOCALE', env('LOCALE', 'en')), + + /* + |-------------------------------------------------------------------------- + | Supported Locales + |-------------------------------------------------------------------------- + | + | In order to enable a locale or translate anything + | the i18n locale key MUST be in this array. + | + */ + + 'supported' => [ + 'en' => [ + + 'direction' => 'ltr', + ], + 'fa' => [ + + 'direction' => 'ltr', + ], + 'de' => [ + + 'direction' => 'ltr', + ], + 'ar' => [ + + 'direction' => 'rtl', + ], + 'cs' => [ + + 'direction' => 'ltr', + ], + 'el' => [ + + 'direction' => 'ltr', + ], + 'es' => [ + + 'direction' => 'ltr', + ], + 'et' => [ + + 'direction' => 'ltr', + ], + 'fr' => [ + + 'direction' => 'ltr', + ], + 'fr-ca' => [ + + 'direction' => 'ltr', + ], + 'it' => [ + + 'direction' => 'ltr', + ], + 'nl' => [ + + 'direction' => 'ltr', + ], + 'sv' => [ + + 'direction' => 'ltr', + ], + 'sl' => [ + + 'direction' => 'ltr', + ], + 'sme' => [ + + 'direction' => 'ltr', + ], + 'pl' => [ + + 'direction' => 'ltr', + ], + 'pt' => [ + + 'direction' => 'ltr', + ], + 'pt-br' => [ + + 'direction' => 'ltr', + ], + 'br' => [ + + 'direction' => 'ltr', + ], + 'ru' => [ + + 'direction' => 'ltr', + ], + 'zh-cn' => [ + + 'direction' => 'ltr', + ], + 'zh-tw' => [ + + 'direction' => 'ltr', + ], + 'he' => [ + + 'direction' => 'ltr', + ], + 'lt' => [ + + 'direction' => 'ltr', + ], + 'fi' => [ + + 'direction' => 'ltr', + ], + 'da' => [ + + 'direction' => 'ltr', + ], + 'id' => [ + + 'direction' => 'ltr', + ], + 'hu' => [ + + 'direction' => 'ltr', + ], + 'th' => [ + + 'direction' => 'ltr', + ], + 'tr' => [ + + 'direction' => 'ltr', + ], + 'bn' => [ + + 'direction' => 'ltr', + ], + 'sq' => [ + + 'direction' => 'ltr', + ], + 'hi' => [ + + 'direction' => 'ltr', + ], + 'vi' => [ + + 'direction' => 'ltr', + ], + 'aa' => [ + 'direction' => 'ltr', + ], + 'ab' => [ + 'direction' => 'ltr', + ], + 'ae' => [ + 'direction' => 'ltr', + ], + 'af' => [ + 'direction' => 'ltr', + ], + 'ak' => [ + 'direction' => 'ltr', + ], + 'am' => [ + 'direction' => 'ltr', + ], + 'an' => [ + 'direction' => 'ltr', + ], + 'as' => [ + 'direction' => 'ltr', + ], + 'av' => [ + 'direction' => 'ltr', + ], + 'ay' => [ + 'direction' => 'ltr', + ], + 'az' => [ + 'direction' => 'ltr', + ], + 'ba' => [ + 'direction' => 'ltr', + ], + 'be' => [ + 'direction' => 'ltr', + ], + 'bg' => [ + 'direction' => 'ltr', + ], + 'bh' => [ + 'direction' => 'ltr', + ], + 'bi' => [ + 'direction' => 'ltr', + ], + 'bm' => [ + 'direction' => 'ltr', + ], + 'bo' => [ + 'direction' => 'ltr', + ], + 'bs' => [ + 'direction' => 'ltr', + ], + 'ca' => [ + 'direction' => 'ltr', + ], + 'ce' => [ + 'direction' => 'ltr', + ], + 'ch' => [ + 'direction' => 'ltr', + ], + 'co' => [ + 'direction' => 'ltr', + ], + 'cr' => [ + 'direction' => 'ltr', + ], + 'cu' => [ + 'direction' => 'ltr', + ], + 'cv' => [ + 'direction' => 'ltr', + ], + 'cy' => [ + 'direction' => 'ltr', + ], + 'dv' => [ + 'direction' => 'ltr', + ], + 'dz' => [ + 'direction' => 'ltr', + ], + 'ee' => [ + 'direction' => 'ltr', + ], + 'eo' => [ + 'direction' => 'ltr', + ], + 'eu' => [ + 'direction' => 'ltr', + ], + 'ff' => [ + 'direction' => 'ltr', + ], + 'fj' => [ + 'direction' => 'ltr', + ], + 'fo' => [ + 'direction' => 'ltr', + ], + 'fy' => [ + 'direction' => 'ltr', + ], + 'ga' => [ + 'direction' => 'ltr', + ], + 'gd' => [ + 'direction' => 'ltr', + ], + 'gl' => [ + 'direction' => 'ltr', + ], + 'gn' => [ + 'direction' => 'ltr', + ], + 'gu' => [ + 'direction' => 'ltr', + ], + 'gv' => [ + 'direction' => 'ltr', + ], + 'ha' => [ + 'direction' => 'ltr', + ], + 'ho' => [ + 'direction' => 'ltr', + ], + 'hr' => [ + 'direction' => 'ltr', + ], + 'ht' => [ + 'direction' => 'ltr', + ], + 'hy' => [ + 'direction' => 'ltr', + ], + 'hz' => [ + 'direction' => 'ltr', + ], + 'ig' => [ + 'direction' => 'ltr', + ], + 'ii' => [ + 'direction' => 'ltr', + ], + 'ik' => [ + 'direction' => 'ltr', + ], + 'io' => [ + 'direction' => 'ltr', + ], + 'is' => [ + 'direction' => 'ltr', + ], + 'iu' => [ + 'direction' => 'ltr', + ], + 'ja' => [ + 'direction' => 'ltr', + ], + 'jv' => [ + 'direction' => 'ltr', + ], + 'ka' => [ + 'direction' => 'ltr', + ], + 'kg' => [ + 'direction' => 'ltr', + ], + 'ki' => [ + 'direction' => 'ltr', + ], + 'kj' => [ + 'direction' => 'ltr', + ], + 'kk' => [ + 'direction' => 'ltr', + ], + 'kl' => [ + 'direction' => 'ltr', + ], + 'km' => [ + 'direction' => 'ltr', + ], + 'kn' => [ + 'direction' => 'ltr', + ], + 'ko' => [ + 'direction' => 'ltr', + ], + 'kr' => [ + 'direction' => 'ltr', + ], + 'ks' => [ + 'direction' => 'ltr', + ], + 'ku' => [ + 'direction' => 'ltr', + ], + 'kv' => [ + 'direction' => 'ltr', + ], + 'kw' => [ + 'direction' => 'ltr', + ], + 'ky' => [ + 'direction' => 'ltr', + ], + 'la' => [ + 'direction' => 'ltr', + ], + 'lb' => [ + 'direction' => 'ltr', + ], + 'lg' => [ + 'direction' => 'ltr', + ], + 'li' => [ + 'direction' => 'ltr', + ], + 'ln' => [ + 'direction' => 'ltr', + ], + 'lo' => [ + 'direction' => 'ltr', + ], + 'lu' => [ + 'direction' => 'ltr', + ], + 'lv' => [ + 'direction' => 'ltr', + ], + 'mg' => [ + 'direction' => 'ltr', + ], + 'mh' => [ + 'direction' => 'ltr', + ], + 'mi' => [ + 'direction' => 'ltr', + ], + 'mk' => [ + 'direction' => 'ltr', + ], + 'ml' => [ + 'direction' => 'ltr', + ], + 'mn' => [ + 'direction' => 'ltr', + ], + 'mr' => [ + 'direction' => 'ltr', + ], + 'ms' => [ + 'direction' => 'ltr', + ], + 'mt' => [ + 'direction' => 'ltr', + ], + 'my' => [ + 'direction' => 'ltr', + ], + 'na' => [ + 'direction' => 'ltr', + ], + 'nb' => [ + 'direction' => 'ltr', + ], + 'nd' => [ + 'direction' => 'ltr', + ], + 'ne' => [ + 'direction' => 'ltr', + ], + 'ng' => [ + 'direction' => 'ltr', + ], + 'nn' => [ + 'direction' => 'ltr', + ], + 'no' => [ + 'direction' => 'ltr', + ], + 'nr' => [ + 'direction' => 'ltr', + ], + 'nv' => [ + 'direction' => 'ltr', + ], + 'ny' => [ + 'direction' => 'ltr', + ], + 'oc' => [ + 'direction' => 'ltr', + ], + 'oj' => [ + 'direction' => 'ltr', + ], + 'om' => [ + 'direction' => 'ltr', + ], + 'or' => [ + 'direction' => 'ltr', + ], + 'os' => [ + 'direction' => 'ltr', + ], + 'pa' => [ + 'direction' => 'ltr', + ], + 'pi' => [ + 'direction' => 'ltr', + ], + 'ps' => [ + 'direction' => 'ltr', + ], + 'qu' => [ + 'direction' => 'ltr', + ], + 'rm' => [ + 'direction' => 'ltr', + ], + 'rn' => [ + 'direction' => 'ltr', + ], + 'ro' => [ + 'direction' => 'ltr', + ], + 'rw' => [ + 'direction' => 'ltr', + ], + 'sa' => [ + 'direction' => 'ltr', + ], + 'sc' => [ + 'direction' => 'ltr', + ], + 'sd' => [ + 'direction' => 'ltr', + ], + 'se' => [ + 'direction' => 'ltr', + ], + 'sg' => [ + 'direction' => 'ltr', + ], + 'si' => [ + 'direction' => 'ltr', + ], + 'sk' => [ + 'direction' => 'ltr', + ], + 'sm' => [ + 'direction' => 'ltr', + ], + 'sn' => [ + 'direction' => 'ltr', + ], + 'so' => [ + 'direction' => 'ltr', + ], + 'sr' => [ + 'direction' => 'ltr', + ], + 'ss' => [ + 'direction' => 'ltr', + ], + 'st' => [ + 'direction' => 'ltr', + ], + 'su' => [ + 'direction' => 'ltr', + ], + 'sw' => [ + 'direction' => 'ltr', + ], + 'ta' => [ + 'direction' => 'ltr', + ], + 'te' => [ + 'direction' => 'ltr', + ], + 'tg' => [ + 'direction' => 'ltr', + ], + 'ti' => [ + 'direction' => 'ltr', + ], + 'tk' => [ + 'direction' => 'ltr', + ], + 'tl' => [ + 'direction' => 'ltr', + ], + 'tn' => [ + 'direction' => 'ltr', + ], + 'to' => [ + 'direction' => 'ltr', + ], + 'ts' => [ + 'direction' => 'ltr', + ], + 'tt' => [ + 'direction' => 'ltr', + ], + 'tw' => [ + 'direction' => 'ltr', + ], + 'ty' => [ + 'direction' => 'ltr', + ], + 'ug' => [ + 'direction' => 'ltr', + ], + 'uk' => [ + 'direction' => 'ltr', + ], + 'ur' => [ + 'direction' => 'ltr', + ], + 'uz' => [ + 'direction' => 'ltr', + ], + 've' => [ + 'direction' => 'ltr', + ], + 'vo' => [ + 'direction' => 'ltr', + ], + 'wa' => [ + 'direction' => 'ltr', + ], + 'wo' => [ + 'direction' => 'ltr', + ], + 'xh' => [ + 'direction' => 'ltr', + ], + 'yi' => [ + 'direction' => 'ltr', + ], + 'yo' => [ + 'direction' => 'ltr', + ], + 'za' => [ + 'direction' => 'ltr', + ], + 'zh' => [ + 'direction' => 'ltr', + ], + 'zu' => [ + 'direction' => 'ltr', + ], + ] +]; From 59acc048316a78708cea1375a6eac5dba27ae7ef Mon Sep 17 00:00:00 2001 From: vedatakdogan Date: Tue, 22 Dec 2020 19:04:56 +0300 Subject: [PATCH 02/31] fixed maintenance --- app/Listeners/RunForSavedForm.php | 21 +++++++++++++++++++++ config/streams.php | 3 +++ 2 files changed, 24 insertions(+) create mode 100755 app/Listeners/RunForSavedForm.php diff --git a/app/Listeners/RunForSavedForm.php b/app/Listeners/RunForSavedForm.php new file mode 100755 index 000000000..a2b980b8f --- /dev/null +++ b/app/Listeners/RunForSavedForm.php @@ -0,0 +1,21 @@ +getBuilder(); + + if (get_class($builder->getRepository()) === SettingFormRepository::class) { + if ($builder->getFormValues()->has('maintenance') and $builder->getFormValues()->get('maintenance')) { + file_put_contents(storage_path('framework/down'), + json_encode(['time' => '', 'retry' => null, 'message' => null], + JSON_PRETTY_PRINT)); + } + } + } +} diff --git a/config/streams.php b/config/streams.php index bc4d41f38..7f273cb0a 100644 --- a/config/streams.php +++ b/config/streams.php @@ -17,6 +17,9 @@ return [ \Anomaly\Streams\Platform\Event\Booted::class => [ \App\Listeners\Translations::class ], + \Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved::class => [ + \App\Listeners\RunForSavedForm::class + ], ], /* From ea959b25d1cf7350eefc23ed0f5d40cc32cbad1d Mon Sep 17 00:00:00 2001 From: vedatakdogan Date: Thu, 24 Dec 2020 12:13:07 +0300 Subject: [PATCH 03/31] fixed comment --- .../{RunForSavedForm.php => EnableMaintenanceMode.php} | 2 +- config/streams.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename app/Listeners/{RunForSavedForm.php => EnableMaintenanceMode.php} (96%) diff --git a/app/Listeners/RunForSavedForm.php b/app/Listeners/EnableMaintenanceMode.php similarity index 96% rename from app/Listeners/RunForSavedForm.php rename to app/Listeners/EnableMaintenanceMode.php index a2b980b8f..13ebf8647 100755 --- a/app/Listeners/RunForSavedForm.php +++ b/app/Listeners/EnableMaintenanceMode.php @@ -3,7 +3,7 @@ use Anomaly\SettingsModule\Setting\Form\SettingFormRepository; use Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved; -class RunForSavedForm +class EnableMaintenanceMode { public function handle(FormWasSaved $event) diff --git a/config/streams.php b/config/streams.php index 7f273cb0a..190a1d821 100644 --- a/config/streams.php +++ b/config/streams.php @@ -18,7 +18,7 @@ return [ \App\Listeners\Translations::class ], \Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved::class => [ - \App\Listeners\RunForSavedForm::class + \App\Listeners\EnableMaintenanceMode::class ], ], From f7e063d953be3cc2cf3141848512bb0828f916b3 Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Thu, 24 Dec 2020 16:37:02 +0300 Subject: [PATCH 04/31] ads image upload limit --- .../advs-module/resources/config/settings/sections.php | 3 ++- .../advs-module/resources/config/settings/settings.php | 6 ++++++ .../visiosoft/media-field_type/resources/js/upload.js | 1 + .../media-field_type/resources/views/upload/index.twig | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) 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 8ac2928e0..38393a5f1 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -22,7 +22,8 @@ return [ 'fields' => [ 'latest-limit', 'popular_ads_limit', - 'default_view_type', + 'ads_image_limit', + 'default_view_type', 'price_area_hidden', 'hide_listing_standard_price', 'hide_zero_price', 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 70cb3439a..9c11a9f0d 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -362,4 +362,10 @@ return [ "default_value" => '#00a651', ] ], + 'ads_image_limit' => [ + "type" => "anomaly.field_type.integer", + "config" => [ + "default_value" => 25 + ] + ] ]; diff --git a/addons/default/visiosoft/media-field_type/resources/js/upload.js b/addons/default/visiosoft/media-field_type/resources/js/upload.js index 6628f434b..ed944366b 100644 --- a/addons/default/visiosoft/media-field_type/resources/js/upload.js +++ b/addons/default/visiosoft/media-field_type/resources/js/upload.js @@ -16,6 +16,7 @@ $(function () { var dropzone = new Dropzone('.dropzone:not(data-initialized)', { paramName: 'upload', + maxFiles: imageCount, resizeWidth: settings_image['resize_width'], resizeHeight: settings_image['resize_height'], autoProcessQueue: true, diff --git a/addons/default/visiosoft/media-field_type/resources/views/upload/index.twig b/addons/default/visiosoft/media-field_type/resources/views/upload/index.twig index bb51d1f01..0b85c9875 100644 --- a/addons/default/visiosoft/media-field_type/resources/views/upload/index.twig +++ b/addons/default/visiosoft/media-field_type/resources/views/upload/index.twig @@ -15,6 +15,11 @@ diff --git a/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableColumns.php b/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableColumns.php index 87e2280e1..64f303c65 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableColumns.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableColumns.php @@ -64,9 +64,27 @@ class AdvTableColumns if ($builder->isActiveView('advanced')) { + unset($columns['created_by'], $columns['country']); + $columns['is_get_adv'] = [ + 'attributes' => [ + 'html' => function (EntryModel $entry) { + $checked = ($entry->is_get_adv) ? 'checked' : ''; + return ''; + } + ], + 'class' => 'advs-price', + ]; + $columns['standard_price'] = [ + 'attributes' => [ + 'html' => function (EntryModel $entry) { + return ''; + } + ], + 'class' => 'advs-price', + ]; $columns['price']['attributes'] = [ 'html' => function (EntryModel $entry) { - return ''; + return ''; } ]; } diff --git a/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php b/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php index 88f672aa8..304b2f03a 100644 --- a/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php +++ b/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php @@ -46,6 +46,10 @@ class AdvsModuleServiceProvider extends AddonServiceProvider 'uses' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@assetsClear', ], 'admin/advs-users/choose/{advId}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@choose', + 'admin/advs/ajax/advanced/advanced-update' => [ + 'as' => 'visiosoft.module.advs::ajax_advanced_update', + 'uses' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@advancedUpdate', + ], 'admin/class/actions/{id}/{type}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@actions', 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 d05a65092..6962e2e4c 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 @@ -205,10 +205,8 @@ class AdvsController extends AdminController return Excel::download(new AdvsExport(), 'advs-' . time() . '.xlsx'); } - public function advancedEdit() + public function advancedUpdate() { - $available_colmuns - if() if ($this->request->has('advanced_column') and $this->request->has('advanced_entry_id') and $this->request->has('advanced_value')) { $entry_id = $this->request->get('advanced_entry_id'); $column = $this->request->get('advanced_column'); From 8884e1be0352a28432ca3de2bba820fcfa2915fa Mon Sep 17 00:00:00 2001 From: Fatih Alp Date: Mon, 28 Dec 2020 19:53:45 +0300 Subject: [PATCH 15/31] Update upload.js --- .../default/visiosoft/media-field_type/resources/js/upload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/default/visiosoft/media-field_type/resources/js/upload.js b/addons/default/visiosoft/media-field_type/resources/js/upload.js index ed944366b..4d01142a5 100644 --- a/addons/default/visiosoft/media-field_type/resources/js/upload.js +++ b/addons/default/visiosoft/media-field_type/resources/js/upload.js @@ -22,7 +22,7 @@ $(function () { autoProcessQueue: true, parallelUploads: 1, resizeMethod: 'contain', - resizeQuality: 0.8, + resizeQuality: 0.9, url: REQUEST_ROOT_PATH + '/streams/media-field_type/handle', headers: { 'X-CSRF-TOKEN': CSRF_TOKEN @@ -151,4 +151,4 @@ function updateQueryStringParameter(uri, key, value) { } else { return uri + separator + key + "=" + value; } -} \ No newline at end of file +} From b265587346dd47fe413922401d10f1ab823ec4a1 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Tue, 29 Dec 2020 16:50:57 +0300 Subject: [PATCH 16/31] remove variable name --- .../visiosoft/advs-module/resources/js/admin/advanced.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/resources/js/admin/advanced.js b/addons/default/visiosoft/advs-module/resources/js/admin/advanced.js index 7e7c9e4d9..c94938966 100644 --- a/addons/default/visiosoft/advs-module/resources/js/admin/advanced.js +++ b/addons/default/visiosoft/advs-module/resources/js/admin/advanced.js @@ -1,4 +1,4 @@ -var getUrlParameter = function getUrlParameter(sParam) { +function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, From 522f6c935068e42b2bfef7582e1aca44df259d0a Mon Sep 17 00:00:00 2001 From: Diatrex Date: Tue, 29 Dec 2020 17:41:40 +0300 Subject: [PATCH 17/31] =?UTF-8?q?#2917=20emlak24=20program=20dahilinde=20y?= =?UTF-8?q?ap=C4=B1lacaklar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/config/permissions.php | 5 +++++ .../advs-module/resources/lang/en/button.php | 1 + .../resources/lang/en/permission.php | 8 +++++++ .../advs-module/resources/lang/en/section.php | 3 +++ .../advs-module/resources/lang/en/stream.php | 3 +++ .../advs-module/src/Adv/AdvCollection.php | 21 +++++++++++++++++++ .../advs-module/src/Adv/AdvRepository.php | 21 +++++++++++++++---- .../Adv/Contract/AdvRepositoryInterface.php | 2 +- 8 files changed, 59 insertions(+), 5 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/config/permissions.php b/addons/default/visiosoft/advs-module/resources/config/permissions.php index cead467e5..282f8d0ba 100644 --- a/addons/default/visiosoft/advs-module/resources/config/permissions.php +++ b/addons/default/visiosoft/advs-module/resources/config/permissions.php @@ -46,4 +46,9 @@ return [ 'write', 'delete', ], + 'status' => [ + 'read', + 'write', + 'delete', + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/button.php b/addons/default/visiosoft/advs-module/resources/lang/en/button.php index 777bc94d0..88b42946a 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/button.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/button.php @@ -43,4 +43,5 @@ return [ 'fast_create' => 'Fast create', 'publish' => 'Publish', 'import' => 'Import', + 'new_status' => 'New Status', ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/permission.php b/addons/default/visiosoft/advs-module/resources/lang/en/permission.php index 0a094c9f1..1c540e8b2 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/permission.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/permission.php @@ -97,4 +97,12 @@ return [ 'delete' => 'Can delete option configuration?', ], ], + 'status' => [ + 'name' => 'Status', + 'option' => [ + 'read' => 'Can read status?', + 'write' => 'Can create/edit status?', + 'delete' => 'Can delete status?', + ], + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/section.php b/addons/default/visiosoft/advs-module/resources/lang/en/section.php index 6e1310527..d7f9f96a1 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/section.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/section.php @@ -56,4 +56,7 @@ return [ 'title' => 'Configuration', ], 'translations' => 'Translations', + 'status' => [ + 'title' => 'Status', + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/stream.php b/addons/default/visiosoft/advs-module/resources/lang/en/stream.php index 761fa569d..d94ccdc24 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/stream.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/stream.php @@ -31,4 +31,7 @@ return [ 'option_configuration' => [ 'name' => 'Configuration', ], + 'status' => [ + 'name' => 'Status', + ], ]; diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvCollection.php b/addons/default/visiosoft/advs-module/src/Adv/AdvCollection.php index 7d4729887..855fa19c0 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvCollection.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvCollection.php @@ -1,8 +1,29 @@ count(); + + return self::paginator($this->forPage($page, $pageSize), $total, $pageSize, $page, [ + 'path' => Paginator::resolveCurrentPath(), + 'pageName' => 'page', + ]); + } + + protected static function paginator($items, $total, $perPage, $currentPage, $options) + { + return Container::getInstance()->makeWith(LengthAwarePaginator::class, compact( + 'items', 'total', 'perPage', 'currentPage', 'options' + )); + } } diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index 72f9efe81..b39827ea4 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -11,6 +11,7 @@ use Anomaly\Streams\Platform\Entry\EntryRepository; use Visiosoft\CatsModule\Category\CategoryModel; use Visiosoft\LocationModule\City\CityModel; use Visiosoft\LocationModule\Country\CountryModel; +use Visiosoft\LocationModule\District\DistrictModel; class AdvRepository extends EntryRepository implements AdvRepositoryInterface { @@ -215,12 +216,16 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface { $country = CountryModel::query()->where('location_countries.id', $adv->country_id)->first(); $city = CityModel::query()->where('location_cities.id', $adv->city)->first(); + $district = DistrictModel::query()->where('location_districts.id', $adv->district)->first(); if ($country != null) { $adv->setAttribute('country_name', $country->name); } if ($city != null) { $adv->setAttribute('city_name', $city->name); } + if ($district != null) { + $adv->setAttribute('district_name', $district->name); + } return $adv; } @@ -460,14 +465,22 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface return $advs->update(['finish_at' => $newDate]); } - public function getByUsersIDs($usersIDs) + public function getByUsersIDs($usersIDs, $status = 'approved', $withDraft = false) { - return $this + $ads = $this ->newQuery() ->whereIn('advs_advs.created_by_id', $usersIDs) - ->where('advs_advs.slug', '!=', "") - ->where('advs_advs.status', 'approved') ->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s')); + + if ($status) { + $ads = $ads->where('advs_advs.status', 'approved'); + } + + if (!$withDraft) { + $ads = $ads->where('advs_advs.slug', '!=', ""); + } + + return $ads; } public function getPopular() diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php index 16984415e..1eaac9dac 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php @@ -45,7 +45,7 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface public function extendAds($allAds, $isAdmin = false); - public function getByUsersIDs($usersIDs); + public function getByUsersIDs($usersIDs, $status = 'approved', $withDraft = false); public function getPopular(); From e625fc7fd63ac619133a0ee39c6226e51d08e519 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 30 Dec 2020 12:48:02 +0300 Subject: [PATCH 18/31] added auto lang switcher for browser --- .../resources/config/settings/sections.php | 7 ++-- .../resources/config/settings/settings.php | 33 +++++++++++-------- .../advs-module/resources/lang/en/setting.php | 4 +++ .../advs-module/resources/lang/tr/setting.php | 4 +++ app/Providers/AppServiceProvider.php | 11 ++++++- 5 files changed, 41 insertions(+), 18 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 38393a5f1..2ee3b9126 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -22,9 +22,9 @@ return [ 'fields' => [ 'latest-limit', 'popular_ads_limit', - 'ads_image_limit', - 'default_view_type', - 'price_area_hidden', + 'ads_image_limit', + 'default_view_type', + 'price_area_hidden', 'hide_listing_standard_price', 'hide_zero_price', 'auto_approve', @@ -83,6 +83,7 @@ return [ 'translations' => [ 'title' => 'visiosoft.module.advs::section.translations', 'fields' => [ + 'lang_switcher_for_browser', 'override_text', ], ], 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 9c11a9f0d..dad9311c7 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -153,12 +153,12 @@ return [ 'mode' => 'checkbox' ] ], - 'price_area_hidden' => [ - 'type' => 'anomaly.field_type.boolean', - 'config' => [ - 'default_value' => false, - ] - ], + 'price_area_hidden' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + ] + ], 'enabled_currencies' => [ 'bind' => 'streams::currencies.enabled', 'env' => 'ADV_ENABLED_CURRENCIES', @@ -351,21 +351,26 @@ return [ 'env' => 'OVERRIDE_TEXT', ], 'steps_color' => [ - "type" => "anomaly.field_type.colorpicker", + "type" => "anomaly.field_type.colorpicker", "config" => [ "default_value" => '#209579', ] ], 'create_ad_button_color' => [ - "type" => "anomaly.field_type.colorpicker", + "type" => "anomaly.field_type.colorpicker", "config" => [ "default_value" => '#00a651', ] ], - 'ads_image_limit' => [ - "type" => "anomaly.field_type.integer", - "config" => [ - "default_value" => 25 - ] - ] + 'ads_image_limit' => [ + "type" => "anomaly.field_type.integer", + "config" => [ + "default_value" => 25 + ] + ], + 'lang_switcher_for_browser' => [ + 'type' => 'anomaly.field_type.boolean', + 'bind' => 'advs.lang_switcher_for_browser', + 'env' => 'LANG_SWITCHER_FOR_BROWSER', + ], ]; 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 ab4017740..8db143069 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -219,4 +219,8 @@ return [ 'name' => 'Create Ad Button Color', 'instructions' => 'Changes the button that shows up when the new ad category selection is finished.' ], + 'lang_switcher_for_browser' => [ + 'name' => 'Lang Switcher For Browser', + 'instructions' => 'Allows you to choose browser language as active language' + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/tr/setting.php b/addons/default/visiosoft/advs-module/resources/lang/tr/setting.php index a7fc6b867..53d647cdd 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/tr/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/tr/setting.php @@ -219,4 +219,8 @@ return [ 'name' => 'Reklam Düğmesi Rengi Oluştur', 'instructions' => 'Yeni reklam kategorisi seçimi bittiğinde görünen düğmeyi değiştirir.' ], + 'lang_switcher_for_browser' => [ + 'name' => 'Tarayıcı Diline Geç', + 'instructions' => 'Seçili aktif bir dil olmadığında tarayıcı dilini aktif dil olarak seçmenize izin verir' + ], ]; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 88c8e7a7e..73720e8fa 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -14,7 +14,16 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // + //Auto Language Switcher + view()->composer('*', function ($view) { + if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale'))) { + $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);//Get Browser Language + $acceptLang = config('streams::locales.enabled'); //Supported Language + $lang = in_array($lang, $acceptLang) ? $lang : config('streams::locales.default', 'en'); + App()->setLocale($lang); + Request()->session()->put('_locale', $lang); + } + }); } /** From ecba328fee9d5d130a4f7a13ff8bf6544eb71a2c Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 30 Dec 2020 13:00:31 +0300 Subject: [PATCH 19/31] added singlefile field type choose option --- .../resources/lang/en/message.php | 15 ++++++++------- .../resources/lang/tr/message.php | 1 + .../resources/views/input.twig | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/addons/default/visiosoft/singlefile-field_type/resources/lang/en/message.php b/addons/default/visiosoft/singlefile-field_type/resources/lang/en/message.php index fcb0fbbf5..62f9a383e 100644 --- a/addons/default/visiosoft/singlefile-field_type/resources/lang/en/message.php +++ b/addons/default/visiosoft/singlefile-field_type/resources/lang/en/message.php @@ -1,12 +1,13 @@ 'Which file would you like to use?', - 'choose_folder' => 'Which folder would you like to upload to?', - 'upload' => 'Click or drop files here to upload.', + 'choose_file' => 'Which file would you like to use?', + 'choose_folder' => 'Which folder would you like to upload to?', + 'upload' => 'Click or drop files here to upload.', 'no_file_selected' => 'No file selected.', - 'no_uploads' => 'No files uploaded.', - 'overwrite' => 'has already been uploaded. Would you like to overwrite it?', - 'uploading' => 'Uploading', - 'loading' => 'Loading', + 'no_uploads' => 'No files uploaded.', + 'overwrite' => 'has already been uploaded. Would you like to overwrite it?', + 'uploading' => 'Uploading', + 'loading' => 'Loading', + 'choose_file_option' => 'Choose File Option', ]; diff --git a/addons/default/visiosoft/singlefile-field_type/resources/lang/tr/message.php b/addons/default/visiosoft/singlefile-field_type/resources/lang/tr/message.php index 072410ffc..97e297004 100644 --- a/addons/default/visiosoft/singlefile-field_type/resources/lang/tr/message.php +++ b/addons/default/visiosoft/singlefile-field_type/resources/lang/tr/message.php @@ -9,4 +9,5 @@ return [ 'overwrite' => 'daha önce yüklenmiş. Üzerine kaydetmek ister misiniz?', 'uploading' => 'Karşıya Yükleniyor', 'loading' => 'Yükleniyor', + 'choose_file_option' => 'Bir Dosya Seçin', ]; diff --git a/addons/default/visiosoft/singlefile-field_type/resources/views/input.twig b/addons/default/visiosoft/singlefile-field_type/resources/views/input.twig index 4bc64b963..1a1e9a9f0 100644 --- a/addons/default/visiosoft/singlefile-field_type/resources/views/input.twig +++ b/addons/default/visiosoft/singlefile-field_type/resources/views/input.twig @@ -10,6 +10,7 @@ {{ trans('visiosoft.field_type.singlefile::button.upload') }} + {{ trans('visiosoft.field_type.singlefile::message.choose_file_option') }} {% endif %} {% endif %} From 7ce27aa33b5501ab40c9c7989c7aecb2c3024edc Mon Sep 17 00:00:00 2001 From: vedatakd Date: Thu, 31 Dec 2020 17:58:20 +0300 Subject: [PATCH 20/31] getcfo completed mizan --- .../advs-module/src/AdvsModulePlugin.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/addons/default/visiosoft/advs-module/src/AdvsModulePlugin.php b/addons/default/visiosoft/advs-module/src/AdvsModulePlugin.php index 947630c53..2005dd80e 100644 --- a/addons/default/visiosoft/advs-module/src/AdvsModulePlugin.php +++ b/addons/default/visiosoft/advs-module/src/AdvsModulePlugin.php @@ -120,4 +120,22 @@ class AdvsModulePlugin extends Plugin ), ]; } + + /** + * Get the filters. + * + * @return array + */ + public function getFilters() + { + return [ + new \Twig_SimpleFilter( + 'ksort', + function (array $array) { + ksort($array); + return $array; + } + ), + ]; + } } From 85e697f524558342e51c3f20c3fc00c8ad4a45d3 Mon Sep 17 00:00:00 2001 From: muammertop Date: Sun, 3 Jan 2021 12:53:45 +0300 Subject: [PATCH 21/31] #3066 sahibinden-theme ads detail desig edit mobile --- .../advs-module/resources/views/ad-detail/partials/map.twig | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/map.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/map.twig index 5df7ac7b8..4632edc42 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/map.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/map.twig @@ -1,4 +1,3 @@ -

{% if(adv.map_Val == "") %} {{ trans('visiosoft.module.advs::field.no_location') }} {% else %} @@ -51,4 +50,3 @@ {% endif %} -

\ No newline at end of file From 4d64d281eaa69b8465ddb81ecddedaec93c05faa Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 4 Jan 2021 10:39:11 +0300 Subject: [PATCH 22/31] move seeder --- .../profile-module/src/ProfileModuleSeeder.php | 16 ---------------- database/seeds/DatabaseSeeder.php | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/addons/default/visiosoft/profile-module/src/ProfileModuleSeeder.php b/addons/default/visiosoft/profile-module/src/ProfileModuleSeeder.php index 158ad05c8..50e69cfe6 100644 --- a/addons/default/visiosoft/profile-module/src/ProfileModuleSeeder.php +++ b/addons/default/visiosoft/profile-module/src/ProfileModuleSeeder.php @@ -43,21 +43,5 @@ class ProfileModuleSeeder extends Seeder { // Users Fields Seeder $this->call(UsersFieldsSeeder::class); - - if (is_null($this->folders->findBy('slug', 'favicon'))) { - $disk = $this->disks->findBySlug('local'); - - $this->folders->create([ - 'en' => [ - 'name' => 'Favicon', - 'description' => 'A folder for Favicon.', - ], - 'slug' => 'favicon', - 'disk' => $disk, - 'allowed_types' => [ - 'ico','png', - ], - ]); - }; } } \ No newline at end of file diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index b90ff0f09..f9a9d30db 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -156,5 +156,23 @@ class DatabaseSeeder extends Seeder ], ]); } + + + //Favicon Folder + if (is_null($this->folders->findBy('slug', 'favicon'))) { + $disk = $this->disks->findBySlug('local'); + + $this->folders->create([ + 'en' => [ + 'name' => 'Favicon', + 'description' => 'A folder for Favicon.', + ], + 'slug' => 'favicon', + 'disk' => $disk, + 'allowed_types' => [ + 'ico','png', + ], + ]); + }; } } From 1264e3cbd6192b2e25b5f56f7f0b3684a42425a4 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Mon, 4 Jan 2021 13:55:28 +0300 Subject: [PATCH 23/31] #3045 product options error --- .../advs-module/src/Adv/AdvObserver.php | 7 +++++ .../Adv/Command/DeleteOptionConfiguration.php | 19 ++++++++++++++ .../Admin/OptionConfigurationController.php | 26 +++++++++---------- ...OptionConfigurationRepositoryInterface.php | 6 +++++ .../OptionConfigurationRepository.php | 20 ++++++++++++++ 5 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 addons/default/visiosoft/advs-module/src/Adv/Command/DeleteOptionConfiguration.php diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvObserver.php b/addons/default/visiosoft/advs-module/src/Adv/AdvObserver.php index 982e22883..b16e6d295 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvObserver.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvObserver.php @@ -1,8 +1,15 @@ dispatch(new DeleteOptionConfiguration($entry)); + parent::deleting($entry); + } } diff --git a/addons/default/visiosoft/advs-module/src/Adv/Command/DeleteOptionConfiguration.php b/addons/default/visiosoft/advs-module/src/Adv/Command/DeleteOptionConfiguration.php new file mode 100644 index 000000000..3f8e0c3ad --- /dev/null +++ b/addons/default/visiosoft/advs-module/src/Adv/Command/DeleteOptionConfiguration.php @@ -0,0 +1,19 @@ +ad = $ad; + } + + public function handle(OptionConfigurationRepositoryInterface $optionConfigurationRepository) + { + $optionConfigurationRepository->deleteAdsConfigs($this->ad->id); + } +} diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/OptionConfigurationController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/OptionConfigurationController.php index 2115f408f..49ff56a1b 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/OptionConfigurationController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/OptionConfigurationController.php @@ -1,29 +1,27 @@ getUnusedConfigs(); + + if (count($unusedConfigs)) { + $optionConfigurationRepository->deleteUnusedConfigs(); + } + return $table->render(); } - /** - * Create a new entry. - * - * @param OptionConfigurationFormBuilder $form - * @return \Symfony\Component\HttpFoundation\Response - */ public function create(OptionConfigurationFormBuilder $form) { $form->setOption('redirect', route('visiosoft.module.advs::configrations.index')); diff --git a/addons/default/visiosoft/advs-module/src/OptionConfiguration/Contract/OptionConfigurationRepositoryInterface.php b/addons/default/visiosoft/advs-module/src/OptionConfiguration/Contract/OptionConfigurationRepositoryInterface.php index d483bd89c..400efc70f 100644 --- a/addons/default/visiosoft/advs-module/src/OptionConfiguration/Contract/OptionConfigurationRepositoryInterface.php +++ b/addons/default/visiosoft/advs-module/src/OptionConfiguration/Contract/OptionConfigurationRepositoryInterface.php @@ -7,4 +7,10 @@ interface OptionConfigurationRepositoryInterface extends EntryRepositoryInterfac public function createConfigration($ad_id,$price,$currency,$stock,$option_json); public function getConf($ad_id); + + public function getUnusedConfigs(); + + public function deleteUnusedConfigs($adsIDs); + + public function deleteAdsConfigs($adID); } diff --git a/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php b/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php index a471830d6..8a315f90e 100644 --- a/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php +++ b/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php @@ -70,4 +70,24 @@ class OptionConfigurationRepository extends EntryRepository implements OptionCon return $configurations; } + + 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 deleteAdsConfigs($adID) + { + return $this->newQuery()->where('parent_adv_id', $adID)->delete(); + } } From a79a8feef08c9a3b792e6775a1295ae7cc235947 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Mon, 4 Jan 2021 15:43:19 +0300 Subject: [PATCH 24/31] #3081 Image upload error when ad posting --- .../default/visiosoft/media-field_type/resources/js/upload.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/default/visiosoft/media-field_type/resources/js/upload.js b/addons/default/visiosoft/media-field_type/resources/js/upload.js index 4d01142a5..b49930cf0 100644 --- a/addons/default/visiosoft/media-field_type/resources/js/upload.js +++ b/addons/default/visiosoft/media-field_type/resources/js/upload.js @@ -34,8 +34,7 @@ $(function () { formData.append('folder', element.data('folder')); }, renameFile: function (file) { - let newName = new Date().getTime() + '_' + file.name; - return newName; + return new Date().getTime() + '_' + file.name.replace(/ /g, '_'); }, accept: function (file, done) { $.get(REQUEST_ROOT_PATH + '/streams/media-field_type/exists/' + element.data('folder'), {'file': file.name}, function (data) { From 369abd71adf1892766333f17199bdd173157933b Mon Sep 17 00:00:00 2001 From: Diatrex Date: Mon, 4 Jan 2021 15:47:52 +0300 Subject: [PATCH 25/31] bug fix --- .../src/Http/Controller/Admin/OptionConfigurationController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/OptionConfigurationController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/OptionConfigurationController.php index 49ff56a1b..6c80d5b12 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/OptionConfigurationController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/OptionConfigurationController.php @@ -16,7 +16,7 @@ class OptionConfigurationController extends AdminController $unusedConfigs = $optionConfigurationRepository->getUnusedConfigs(); if (count($unusedConfigs)) { - $optionConfigurationRepository->deleteUnusedConfigs(); + $optionConfigurationRepository->deleteUnusedConfigs($unusedConfigs); } return $table->render(); From fdb162fdc787940c7105dccfbff22627065c394e Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 4 Jan 2021 17:10:03 +0300 Subject: [PATCH 26/31] fixed convert currency response message --- .../advs-module/src/Adv/AdvModel.php | 22 +++++++++----- .../advs-module/src/Adv/AdvRepository.php | 30 +++++++++++-------- .../src/Adv/Table/Handler/ConvertCurrency.php | 4 ++- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index d6bbfe168..b501e7c76 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -1,9 +1,9 @@ value('visiosoft.module.advs::free_currencyconverterapi_key'); - $response = $client->get('http://free.currencyconverterapi.com/api/v6/convert?q=' - . $url . '&compact=y&apiKey=' . $freeCurrencyKey); + + $client = new \GuzzleHttp\Client(); + $response = $client->request('GET', 'http://free.currencyconverterapi.com/api/v6/convert', ['query' => [ + 'q' => $url, + 'compact' => 'y', + 'apiKey' => $freeCurrencyKey + ]]); + if ($response->getStatusCode() == '200') { $response = (array)\GuzzleHttp\json_decode($response->getBody()->getContents()); if (!empty($response)) { @@ -132,8 +137,11 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface $foreign_currency[$currencyIn] = $price * $rate; } } - } catch (\Exception $e) { - $this->messages->error((!is_null($e->getMessage())) ? $e->getMessage() : trans('streams::error.500.message')); + } catch (\GuzzleHttp\Exception\ClientException $e) { + $response = $e->getResponse(); + $responseBodyAsString = $response->getBody()->getContents(); + $response = json_decode($responseBodyAsString, true); + $messages->error($response['error']); } } } diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index b39827ea4..0970d1336 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -102,20 +102,26 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface if (!empty($param['user'])) { $query = $query->where('advs_advs.created_by_id', $param['user']); } + $currency = setting_value('streams::currency'); + if (!empty($param['currency'])) { - if (!empty($param['min_price'])) { - $num = $param['min_price']; - $int = (int)$num; - $column = "JSON_EXTRACT(foreign_currencies, '$." . $param['currency'] . "') >=" . $int; - $query = $query->whereRaw($column); - } - if (!empty($param['max_price'])) { - $num = $param['max_price']; - $int = (int)$num; - $column = "JSON_EXTRACT(foreign_currencies, '$." . $param['currency'] . "') <=" . $int; - $query = $query->whereRaw($column); - } + $currency = $param['currency']; } + + if (!empty($param['min_price'])) { + $num = $param['min_price']; + $int = (int)$num; + $column = "JSON_EXTRACT(foreign_currencies, '$." . $currency . "') >= " . $int; + $query = $query->whereRaw($column); + } + + if (!empty($param['max_price'])) { + $num = $param['max_price']; + $int = (int)$num; + $column = "JSON_EXTRACT(foreign_currencies, '$." . $currency . "') <= " . $int; + $query = $query->whereRaw($column); + } + if (!empty($param['date'])) { if ($param['date'] === 'day') { $query = $query->where('advs_advs.publish_at', '>=', Carbon::now()->subDay()); diff --git a/addons/default/visiosoft/advs-module/src/Adv/Table/Handler/ConvertCurrency.php b/addons/default/visiosoft/advs-module/src/Adv/Table/Handler/ConvertCurrency.php index 6c0e47ff3..c9fc56ce5 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Table/Handler/ConvertCurrency.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Table/Handler/ConvertCurrency.php @@ -13,7 +13,9 @@ class ConvertCurrency extends ActionHandler foreach ($selected as $id) { $entry = $model->newQuery()->find($id); - $model->foreignCurrency($entry->currency, $entry->price, $id, $settingRepository); + if ($entry) { + $model->foreignCurrency($entry->currency, $entry->price, $id, $settingRepository); + } } if ($selected) { $this->messages->success(trans('visiosoft.module.advs::message.currency_converted')); From 9265b47a6ec468d06582ec4c7c7d372ba2df4b4d Mon Sep 17 00:00:00 2001 From: vedatakd Date: Tue, 5 Jan 2021 11:17:31 +0300 Subject: [PATCH 27/31] GET feature enhancements --- .../advs-module/resources/config/settings/sections.php | 1 + .../advs-module/resources/config/settings/settings.php | 8 ++++++++ .../visiosoft/advs-module/resources/lang/en/setting.php | 4 ++++ .../visiosoft/advs-module/resources/lang/tr/setting.php | 4 ++++ .../advs-module/src/Http/Controller/advsController.php | 3 ++- 5 files changed, 19 insertions(+), 1 deletion(-) 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 2ee3b9126..b54f66702 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -31,6 +31,7 @@ return [ 'estimated_pending_time', 'default_published_time', 'default_GET', + 'get_categories', 'listing_page_image', 'show_ads_count', ], 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 dad9311c7..e5bca4a16 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -373,4 +373,12 @@ return [ 'bind' => 'advs.lang_switcher_for_browser', 'env' => 'LANG_SWITCHER_FOR_BROWSER', ], + 'get_categories' => [ + 'type' => 'anomaly.field_type.checkboxes', + 'config' => [ + 'options' => function (\Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface $categoryRepository) { + return $categoryRepository->mainCats()->pluck('name', 'id')->all(); + }, + ], + ], ]; 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 8db143069..28be23772 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -223,4 +223,8 @@ return [ 'name' => 'Lang Switcher For Browser', 'instructions' => 'Allows you to choose browser language as active language' ], + 'get_categories' => [ + 'name' => 'GET Categories', + 'instructions' => 'It represents the categories in which the GET property will be valid.' + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/tr/setting.php b/addons/default/visiosoft/advs-module/resources/lang/tr/setting.php index 53d647cdd..c4201db02 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/tr/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/tr/setting.php @@ -223,4 +223,8 @@ return [ 'name' => 'Tarayıcı Diline Geç', 'instructions' => 'Seçili aktif bir dil olmadığında tarayıcı dilini aktif dil olarak seçmenize izin verir' ], + 'get_categories' => [ + 'name' => 'GET Kategorileri', + 'instructions' => 'GET özelliğinin geçerli olacağı kategorileri temsil eder.' + ], ]; 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 89fad88d1..71cf0e237 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -781,7 +781,8 @@ class AdvsController extends PublicController } } - $adv->is_get_adv = $request->is_get_adv; + $get_categories = in_array($adv->cat1, setting_value('visiosoft.module.advs::get_categories')); + $adv->is_get_adv = ($request->is_get_adv and $get_categories) ? true : false; $adv->save(); //algolia Search Module From 92b54219186d5796c38b9680f2b1d3e267ba6806 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Tue, 5 Jan 2021 13:48:14 +0300 Subject: [PATCH 28/31] ax --- .../profile-module/resources/images/location.svg | 11 +++++++++-- .../resources/images/social-media.svg | 14 ++++++++++++-- .../profile-module/resources/images/website.svg | 16 ++++++++++++++-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/addons/default/visiosoft/profile-module/resources/images/location.svg b/addons/default/visiosoft/profile-module/resources/images/location.svg index 74fcde598..0b5a83c2a 100644 --- a/addons/default/visiosoft/profile-module/resources/images/location.svg +++ b/addons/default/visiosoft/profile-module/resources/images/location.svg @@ -1,2 +1,9 @@ - - + + + + + + + + + diff --git a/addons/default/visiosoft/profile-module/resources/images/social-media.svg b/addons/default/visiosoft/profile-module/resources/images/social-media.svg index e948e1bfc..90ea51fba 100644 --- a/addons/default/visiosoft/profile-module/resources/images/social-media.svg +++ b/addons/default/visiosoft/profile-module/resources/images/social-media.svg @@ -1,2 +1,12 @@ - - + + + + + + + + + + + + diff --git a/addons/default/visiosoft/profile-module/resources/images/website.svg b/addons/default/visiosoft/profile-module/resources/images/website.svg index babe27185..2a7d601fe 100644 --- a/addons/default/visiosoft/profile-module/resources/images/website.svg +++ b/addons/default/visiosoft/profile-module/resources/images/website.svg @@ -1,2 +1,14 @@ - - + + + + + + + + + + + + + + From d8d2869339f205e34eb8e83c8dbbf435bc3ccee4 Mon Sep 17 00:00:00 2001 From: samed Date: Thu, 7 Jan 2021 11:53:13 +0300 Subject: [PATCH 29/31] account freez --- .../profile-module/resources/views/profile/detail.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig b/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig index 9694864cf..9d20e64b4 100644 --- a/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig +++ b/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig @@ -92,7 +92,7 @@

{{ trans('visiosoft.module.profile::message.disable_account') }}

- + From ec008183d8a415e3f05219e8929cd57109ae53c4 Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Thu, 7 Jan 2021 15:05:05 +0300 Subject: [PATCH 30/31] =?UTF-8?q?#3002=20maabir=20pdf.rar=20geli=C5=9Ftirm?= =?UTF-8?q?e=20talebi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...osoft.module.advs__add_doc-files_field.php | 26 +++ .../advs-module/resources/lang/en/field.php | 1 + .../resources/views/ad-detail/detail.twig | 6 + .../resources/views/new-ad/new-create.twig | 1 + .../src/Adv/Form/AdvFormBuilder.php | 3 +- .../src/Http/Controller/advsController.php | 1 + .../media-field_type/resources/js/upload.js | 32 ++-- .../src/Http/Controller/UploadController.php | 172 +++++++++--------- database/seeds/DatabaseSeeder.php | 18 ++ 9 files changed, 165 insertions(+), 95 deletions(-) create mode 100644 addons/default/visiosoft/advs-module/migrations/2021_01_06_110331_visiosoft.module.advs__add_doc-files_field.php diff --git a/addons/default/visiosoft/advs-module/migrations/2021_01_06_110331_visiosoft.module.advs__add_doc-files_field.php b/addons/default/visiosoft/advs-module/migrations/2021_01_06_110331_visiosoft.module.advs__add_doc-files_field.php new file mode 100644 index 000000000..72343feed --- /dev/null +++ b/addons/default/visiosoft/advs-module/migrations/2021_01_06_110331_visiosoft.module.advs__add_doc-files_field.php @@ -0,0 +1,26 @@ + 'advs', + ]; + + protected $fields = [ + 'doc_files' => [ + 'type' => 'visiosoft.field_type.media', + 'config' => [ + 'folders' => ["ads_documents"], + 'mode' => 'upload', + ], + ], + ]; + + protected $assignments = [ + 'doc_files' + ]; +} diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/field.php b/addons/default/visiosoft/advs-module/resources/lang/en/field.php index cb6b0ae4b..4f8860df0 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/field.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/field.php @@ -319,6 +319,7 @@ return [ 'congratulations' => 'Congratulations', 'ad_desc' => 'Ad Description', 'upload_photos' => 'Upload Photos', + 'upload_files' => 'Upload Files', 'additional_fields' => 'Additional Fields', 'ad_location' => 'Ad Location', diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig index 3c1678bf9..f7335e0c4 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig @@ -36,6 +36,12 @@ + + {% if setting_value('visiosoft.theme.base::ad_details_tab') %} {% if blocks('ad-item-content-block-area') is null %} 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 2b71af7c6..51b205a21 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 @@ -178,6 +178,7 @@
{{ form.fields.files.input |raw }} +
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 02b855771..ef1e7e90e 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Form/AdvFormBuilder.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Form/AdvFormBuilder.php @@ -53,7 +53,8 @@ class AdvFormBuilder extends FormBuilder 'class' => 'hidden d-none mapVal' ], 'files', - 'popular_adv', + 'doc_files', + 'popular_adv', 'adv_day', 'product_options_value' ]; 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 89fad88d1..e7100af2a 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -1,5 +1,6 @@ uploader->upload($this->request->file('upload'), $this->folders->find($this->request->get('folder'))); + $doc_folder = app(FolderRepositoryInterface::class)->findBySlug('ads_documents')->id; + $mimes = explode('/', $this->request->file('upload')->getMimeType()); + + if ($mimes[0] == 'image'){ + $file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($this->request->get('folder'))); + } else { + $file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($doc_folder)); + } + if ($file) { + if ($mimes[0] == 'image'){ - $settings_key = [ - 'image_resize_backend', - 'full_image_width', - 'full_image_height', - 'medium_image_width', - 'medium_image_height', - 'thumbnail_width', - 'thumbnail_height', - 'add_canvas', - 'image_canvas_width', - 'image_canvas_height', - 'watermark_type', - 'watermark_text', - 'watermark_image', - 'watermark_position' - ]; + $settings_key = [ + 'image_resize_backend', + 'full_image_width', + 'full_image_height', + 'medium_image_width', + 'medium_image_height', + 'thumbnail_width', + 'thumbnail_height', + 'add_canvas', + 'image_canvas_width', + 'image_canvas_height', + 'watermark_type', + 'watermark_text', + 'watermark_image', + 'watermark_position' + ]; - $settings_value = array(); + $settings_value = array(); - foreach ($settings_key as $key) { - $settings_value[$key] = setting_value('visiosoft.module.advs::' . $key); - } + foreach ($settings_key as $key) { + $settings_value[$key] = setting_value('visiosoft.module.advs::' . $key); + } - $fullImg = WaterMark::make($this->request->file('upload')->getRealPath()); + $fullImg = WaterMark::make($this->request->file('upload')->getRealPath()); - if ($settings_value['image_resize_backend']) { - $fullImg = $fullImg->resize(null, $settings_value['full_image_height'], - function ($constraint) { - $constraint->aspectRatio(); - }); - } + if ($settings_value['image_resize_backend']) { + $fullImg = $fullImg->resize(null, $settings_value['full_image_height'], + function ($constraint) { + $constraint->aspectRatio(); + }); + } - $mdImg = WaterMark::make($this->request->file('upload')->getRealPath()) - ->resize(null, $settings_value['medium_image_height'], function ($constraint) { - $constraint->aspectRatio(); - }); + $mdImg = WaterMark::make($this->request->file('upload')->getRealPath()) + ->resize(null, $settings_value['medium_image_height'], function ($constraint) { + $constraint->aspectRatio(); + }); - if ($settings_value['add_canvas']) { + if ($settings_value['add_canvas']) { - $fullImg->resizeCanvas( - $settings_value['image_canvas_width'], $settings_value['image_canvas_height'], - 'center', false, 'fff' - ); + $fullImg->resizeCanvas( + $settings_value['image_canvas_width'], $settings_value['image_canvas_height'], + 'center', false, 'fff' + ); - $mdImg->resizeCanvas( - $settings_value['medium_image_width'], $settings_value['medium_image_height'], - 'center', false, 'fff' - ); - } + $mdImg->resizeCanvas( + $settings_value['medium_image_width'], $settings_value['medium_image_height'], + 'center', false, 'fff' + ); + } - $image_types = array('full' => $fullImg, 'medium' => $mdImg); + $image_types = array('full' => $fullImg, 'medium' => $mdImg); - foreach ($image_types as $key => $image) { + foreach ($image_types as $key => $image) { - if ($settings_value['watermark_type'] == 'image') { + if ($settings_value['watermark_type'] == 'image') { - if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) { - $watermark = WaterMark::make(app_storage_path() . '/files-module/local/' . $watermarkimage->path()); - $image->insert($watermark, $settings_value['watermark_position']); - } + if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) { + $watermark = WaterMark::make(app_storage_path() . '/files-module/local/' . $watermarkimage->path()); + $image->insert($watermark, $settings_value['watermark_position']); + } - } else { - $v = "top"; - $h = "center"; - $w = $image->width() / 2; - $h1 = $image->height() / 2; - $font_size = $w / 20; - $image->text($settings_value['watermark_text'], $w, $h1, function ($font) use ($v, $h, $font_size) { - $font->file(public_path('Antonio-Bold.ttf')); - $font->size($font_size); - $font->align($h); - $font->valign($v); - }); - } - if ($key === "full") { - $fileName = $file->getAttributes()['name']; - } else { - $fileName = 'md-' . $file->getAttributes()['name']; + } else { + $v = "top"; + $h = "center"; + $w = $image->width() / 2; + $h1 = $image->height() / 2; + $font_size = $w / 20; + $image->text($settings_value['watermark_text'], $w, $h1, function ($font) use ($v, $h, $font_size) { + $font->file(public_path('Antonio-Bold.ttf')); + $font->size($font_size); + $font->align($h); + $font->valign($v); + }); + } + if ($key === "full") { + $fileName = $file->getAttributes()['name']; + } else { + $fileName = 'md-' . $file->getAttributes()['name']; - $this->createFile($this->request->get('folder'),$fileName,$image); - } - $image->save(app_storage_path() . '/files-module/local/images/' . $fileName); - } + $this->createFile($this->request->get('folder'),$fileName,$image); + } + $image->save(app_storage_path() . '/files-module/local/images/' . $fileName); + } + } return $this->response->json($file->getAttributes()); } @@ -173,15 +183,15 @@ class UploadController extends AdminController return response()->json(['status' => 'error']); } - public function createFile($folder, $filename, $image) - { - $this->files->create([ - 'folder_id' => $folder, - 'name' => $filename, - 'disk_id' => 1, - 'size' => $image->filesize(), - 'mime_type' => $image->mime, - 'extension' => $image->extension, - ]); - } + public function createFile($folder, $filename, $image = null) + { + $this->files->create([ + 'folder_id' => $folder, + 'name' => $filename, + 'disk_id' => 1, + 'size' => $image->filesize(), + 'mime_type' => $image->mime, + 'extension' => $image->extension, + ]); + } } diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index f9a9d30db..680ca7d31 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -174,5 +174,23 @@ class DatabaseSeeder extends Seeder ], ]); }; + + + //Create Ads Documents Folder + if (!$this->folders->findBySlug('ads_documents')) { + $disk = $this->disks->findBySlug('local'); + + $this->folders->create([ + 'en' => [ + 'name' => 'Ads Documents', + 'description' => 'A folder for Ads Documents.', + ], + 'slug' => 'ads_documents', + 'disk' => $disk, + 'allowed_types' => [ + 'pdf', 'doc', 'docx', 'xls', 'xlsx', + ], + ]); + }; } } From 80abc3459683638ca89e00f314324575e8767432 Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Thu, 7 Jan 2021 15:24:47 +0300 Subject: [PATCH 31/31] =?UTF-8?q?#3002=20maabir=20pdf.rar=20geli=C5=9Ftirm?= =?UTF-8?q?e=20talebi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../advs-module/resources/views/new-ad/new-create.twig | 10 +++++++++- .../visiosoft/media-field_type/resources/js/upload.js | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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 51b205a21..99dfcc9f1 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 @@ -178,7 +178,15 @@
{{ form.fields.files.input |raw }} - + + {% for docs in form.fields.doc_files.value %} +
+ {{ docs.name }} + + +
+
+ {% endfor %}
diff --git a/addons/default/visiosoft/media-field_type/resources/js/upload.js b/addons/default/visiosoft/media-field_type/resources/js/upload.js index 1acfadf92..60a15d064 100644 --- a/addons/default/visiosoft/media-field_type/resources/js/upload.js +++ b/addons/default/visiosoft/media-field_type/resources/js/upload.js @@ -115,6 +115,13 @@ function deleteImage(e, id) { $('.imageList').find('div[data-id="' + id + '"]').remove() } +function deleteDocs(id) { + var key_item = $.inArray(id, docsUploaded); + docsUploaded.splice(key_item, 1); + $('input[name="doc_files"]').val(docsUploaded.join(',')) + $('.doc_list').find('#' + id).remove() +} + function rotateImage(e, id) { e.preventDefault()