diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/addon.php b/addons/default/visiosoft/advs-module/resources/lang/en/addon.php index 0eae4be7f..40f95d8aa 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/addon.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/addon.php @@ -4,4 +4,5 @@ return [ 'title' => 'Ads', 'name' => 'Ads Module', 'description' => 'Ads Module', + 'info' => 'This is the screen where you can add, delete and edit ads from the Ads page. On this page, you can simply do the operations such as post management and ad configuration.' ]; diff --git a/addons/default/visiosoft/cats-module/resources/lang/en/addon.php b/addons/default/visiosoft/cats-module/resources/lang/en/addon.php index 35bfec0c4..957b274b9 100644 --- a/addons/default/visiosoft/cats-module/resources/lang/en/addon.php +++ b/addons/default/visiosoft/cats-module/resources/lang/en/addon.php @@ -3,5 +3,6 @@ return [ 'title' => 'Category', 'name' => 'Category Module', - 'description' => '' + 'description' => '', + 'info' => 'This is the screen where you can add, delete and edit categories from the category page. You can easily manage main categories and sub-categories from this page.', ]; diff --git a/addons/default/visiosoft/cats-module/resources/lang/en/field.php b/addons/default/visiosoft/cats-module/resources/lang/en/field.php index c2148802a..11e211b50 100644 --- a/addons/default/visiosoft/cats-module/resources/lang/en/field.php +++ b/addons/default/visiosoft/cats-module/resources/lang/en/field.php @@ -30,6 +30,10 @@ return [ 'instructions' => 'It is used to add icons indicating the category type.', ], + 'parent' => 'Parent', + 'level' => 'Level', + 'count' => 'Ad Counts', + 'please_wait' => 'Please wait.Deleting Sub Categories', 'category_selection' => 'Category Selection', 'go_to_parent' => 'Go To Parent', diff --git a/addons/default/visiosoft/cats-module/src/Category/CategoryExport.php b/addons/default/visiosoft/cats-module/src/Category/CategoryExport.php new file mode 100644 index 000000000..2c8a6790f --- /dev/null +++ b/addons/default/visiosoft/cats-module/src/Category/CategoryExport.php @@ -0,0 +1,40 @@ +id, + $cats->name, + $cats->parent_category_id, + $cats->level, + $cats->count, + $cats->seo_keyword, + $cats->seo_description, + ]; + } + + public function headings(): array + { + return [ + 'ID', + trans('module::field.name.name'), + trans('module::field.parent'), + trans('module::field.level'), + trans('module::field.count'), + trans('module::field.seo_keyword.name'), + trans('module::field.seo_description.name'), + ]; + } +} diff --git a/addons/default/visiosoft/cats-module/src/Category/CategoryImport.php b/addons/default/visiosoft/cats-module/src/Category/CategoryImport.php new file mode 100644 index 000000000..c7dcf0f93 --- /dev/null +++ b/addons/default/visiosoft/cats-module/src/Category/CategoryImport.php @@ -0,0 +1,20 @@ + $row['name'], + 'slug' => Str::slug($row['name']), + 'parent_category_id' => $row['parent_id'] ?? null, + 'level' => $row['level'] ?? 0, + ]); + } + } +} diff --git a/addons/default/visiosoft/cats-module/src/CatsModuleServiceProvider.php b/addons/default/visiosoft/cats-module/src/CatsModuleServiceProvider.php index 60915487a..fc1813a8d 100644 --- a/addons/default/visiosoft/cats-module/src/CatsModuleServiceProvider.php +++ b/addons/default/visiosoft/cats-module/src/CatsModuleServiceProvider.php @@ -1,5 +1,6 @@ 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@adCountCalc', 'admin/cats/catlevelcalc' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@catLevelCalc', - 'admin/cats' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@index', + 'admin/cats' => [ + 'as' => 'visiosoft.module.cats::admin_cats', + 'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@index' + ], 'admin/cats/create' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@create', 'admin/cats/edit/{id}' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@edit', 'admin/cats/category/delete/{id}' => [ 'as' => 'visiosoft.module.cats::admin.delete_category', 'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@delete', ], + 'admin/cats/import' => [ + 'as' => 'visiosoft.module.cats::import', + 'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@import', + ], + 'admin/cats/export' => [ + 'as' => 'visiosoft.module.cats::export', + 'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@export', + ], // Sitemap 'sitemap.xml' => 'Visiosoft\CatsModule\Http\Controller\SitemapController@index', @@ -187,10 +199,24 @@ class CatsModuleServiceProvider extends AddonServiceProvider /** * Boot the addon. */ - public function boot() + public function boot(AddonCollection $addonCollection) { - // Run extra post-boot registration logic here. - // Use method injection or commands to bring in services. + $settings_url = [ + 'import' => [ + 'title' => 'visiosoft.module.advs::button.import', + 'href' => route('visiosoft.module.cats::import'), + 'page' => 'visiosoft.module.cats' + ], + 'export' => [ + 'title' => 'visiosoft.module.advs::button.export', + 'href' => route('visiosoft.module.cats::export'), + 'page' => 'visiosoft.module.cats' + ], + ]; + + foreach ($settings_url as $key => $value) { + $addonCollection->get($value['page'])->addSection($key, $value); + } } /** diff --git a/addons/default/visiosoft/cats-module/src/Http/Controller/Admin/CategoryController.php b/addons/default/visiosoft/cats-module/src/Http/Controller/Admin/CategoryController.php index ac9e18ca2..58bfb1049 100644 --- a/addons/default/visiosoft/cats-module/src/Http/Controller/Admin/CategoryController.php +++ b/addons/default/visiosoft/cats-module/src/Http/Controller/Admin/CategoryController.php @@ -1,13 +1,17 @@ action == "save" and $file = $fileRepository->find(request()->file)) { + if ($file->extension === 'xls' || $file->extension === 'xlsx') { + $pathToFolder = "/storage/streams/default/files-module/local/ads_excel/"; + Excel::import(new CategoryImport(), base_path() . $pathToFolder . $file->name); + $this->messages->success(trans('streams::message.create_success', ['name' => trans('module::addon.title')])); + } + } + + //Form Render + $builder->setFields([ + 'file' => [ + "type" => "anomaly.field_type.file", + "config" => [ + 'folders' => ["ads_excel"], + 'mode' => 'upload' + ] + ], + ]); + $builder->setActions([ + 'save' + ]); + + $builder->setOptions([ + 'redirect' => route('visiosoft.module.cats::admin_cats') + ]); + + return $builder->render(); + } + + public function export(){ + return Excel::download(new CategoryExport(), 'cats-' . time() . '.xlsx'); + } } diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/css/theme.css b/addons/default/visiosoft/defaultadmin-theme/resources/css/theme.css index 620fb2fdb..650f916ba 100644 --- a/addons/default/visiosoft/defaultadmin-theme/resources/css/theme.css +++ b/addons/default/visiosoft/defaultadmin-theme/resources/css/theme.css @@ -2762,6 +2762,10 @@ body { } } +.page-info { + background-color: rgba(17, 190, 246, 0.6); +} + /** bootstrap 4.1 Column Fix**/ .col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%} diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/views/layouts/default.twig b/addons/default/visiosoft/defaultadmin-theme/resources/views/layouts/default.twig index 8031c5e70..4c0dbe7bb 100644 --- a/addons/default/visiosoft/defaultadmin-theme/resources/views/layouts/default.twig +++ b/addons/default/visiosoft/defaultadmin-theme/resources/views/layouts/default.twig @@ -24,6 +24,10 @@ {{ breadcrumb() }} + {% if trans('module::addon.info') != 'module::addon.info' %} +
{{ trans('module::addon.info') }}
+ {% endif %} +
{% include "theme::partials/messages" %} {% include "theme::partials/buttons" %} diff --git a/addons/default/visiosoft/location-module/resources/lang/en/addon.php b/addons/default/visiosoft/location-module/resources/lang/en/addon.php index 1ae17f459..3ab808351 100644 --- a/addons/default/visiosoft/location-module/resources/lang/en/addon.php +++ b/addons/default/visiosoft/location-module/resources/lang/en/addon.php @@ -4,4 +4,5 @@ return [ 'title' => 'Location', 'name' => 'Location Module', 'description' => 'Description', + 'info' => 'On this page, you can manage country, city, district, neighborhood and village information.', ];