From b879f11c99002b55aa0daae58e69b624cd584afe Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Sun, 25 Jul 2021 23:19:27 +0200 Subject: [PATCH] Add new version in repository --- Gruntfile.js | 550 +++++++++++++----- app/Console/Kernel.php | 4 +- app/Datatables/Botanic/FamiliesDataTable.php | 37 +- app/Datatables/Botanic/GenresDataTable.php | 12 +- app/Datatables/Botanic/SpeciesDataTable.php | 56 +- app/Datatables/Botanic/VarietiesDataTable.php | 61 +- app/Datatables/ParentDataTable.php | 351 +++++------ .../Shop/ArticleFamiliesDataTable.php | 28 - .../Shop/ArticleNaturesDataTable.php | 27 + app/Datatables/Shop/ArticlesDataTable.php | 34 +- app/Datatables/Shop/CategoriesDataTable.php | 29 +- app/Datatables/Shop/CustomersDataTable.php | 31 +- app/Datatables/Shop/InvoicesDataTable.php | 29 +- app/Datatables/Shop/OffersDataTable.php | 28 + app/Datatables/Shop/OrdersDataTable.php | 25 +- app/Datatables/Shop/PackagesDataTable.php | 34 +- .../Shop/PriceGenericCategoriesDataTable.php | 29 +- .../Shop/PriceGenericsDataTable.php | 31 - app/Datatables/Shop/PriceListsDataTable.php | 38 ++ app/Datatables/Shop/SaleChannelsDataTable.php | 25 + app/Datatables/Shop/TagGroupsDataTable.php | 29 +- app/Datatables/Shop/TagsDataTable.php | 33 +- app/Datatables/Shop/TariffsDataTable.php | 29 + app/Datatables/Shop/UnitiesDataTable.php | 35 +- app/Datatables/Shop/VariationsDataTable.php | 28 + app/Exceptions/Handler.php | 6 +- app/Exports/Botanic/FamiliesExport.php | 5 +- app/Exports/Botanic/GenresExport.php | 5 +- app/Exports/Botanic/SpeciesExport.php | 5 +- app/Exports/Botanic/VarietiesExport.php | 5 +- .../Controllers/Admin/Botanic/Controller.php | 13 + .../Admin/Botanic/FamilyController.php | 55 ++ .../Botanic}/GenreController.php | 21 +- .../Admin/Botanic/SpecieController.php | 63 ++ .../Admin/Botanic/VarietyController.php | 77 +++ app/Http/Controllers/Admin/Controller.php | 9 + .../Admin/Core/App/ApplicationController.php | 53 ++ .../Core/App/ApplicationModuleController.php | 61 ++ .../Controllers/Admin/Core/App/Controller.php | 9 + .../Admin/Core/Auth/Controller.php | 9 + .../Admin/Core/Auth/PermissionController.php | 71 +++ .../Admin/Core/Auth/RoleController.php | 96 +++ .../Admin/Core/Auth/TeamController.php | 75 +++ .../Admin/Core/Auth/UserController.php | 183 ++++++ .../Controllers/Admin/Core/Controller.php | 8 + app/Http/Controllers/Admin/HomeController.php | 16 +- .../Admin/Shop/ArticleController.php | 68 +++ .../Admin/Shop/ArticleNatureController.php | 49 ++ .../Shop}/CategoryController.php | 17 +- .../Controllers/Admin/Shop/Controller.php | 13 + .../Admin/Shop/CustomerController.php | 45 ++ .../Shop}/DashboardController.php | 4 +- .../Controllers/Admin/Shop/HomeController.php | 29 + .../Admin/Shop/InvoiceController.php | 45 ++ .../Shop}/InvoiceItemController.php | 14 +- .../Admin/Shop/OfferController.php | 45 ++ .../Admin/Shop/OrderController.php | 45 ++ .../Shop}/OrderPaymentController.php | 14 +- .../Admin/Shop/PackageController.php | 65 +++ .../Shop/PriceGenericCategoryController.php | 48 ++ .../Admin/Shop/PriceListController.php | 85 +++ .../Admin/Shop/PriceListValuesController.php | 69 +++ .../Admin/Shop/SaleChannelController.php | 46 ++ .../Admin => Admin/Shop}/TagController.php | 15 +- .../Admin/Shop/TagGroupController.php | 58 ++ .../Admin/Shop/TariffController.php | 67 +++ .../Admin => Admin/Shop}/TaxController.php | 13 +- .../Admin/Shop/UnityController.php | 66 +++ .../Admin/Shop/VariationController.php | 57 ++ .../Auth/ConfirmPasswordController.php | 2 +- .../Auth/ForgotPasswordController.php | 16 + app/Http/Controllers/Auth/LoginController.php | 59 +- .../Auth/PasswordSecurityController.php | 71 +++ .../Controllers/Auth/RegisterController.php | 31 +- .../Auth/ResetPasswordController.php | 22 +- .../Auth/VerificationController.php | 3 +- .../Botanic/Admin/FamilyController.php | 58 -- .../Botanic/Admin/SpecieController.php | 63 -- .../Botanic/Admin/VarietyController.php | 79 --- app/Http/Controllers/JS/CacheController.php | 22 - .../Shop/Admin/ArticleController.php | 80 --- .../Shop/Admin/ArticleFamilyController.php | 56 -- .../Shop/Admin/ArticlePriceController.php | 88 --- .../Shop/Admin/CustomerController.php | 47 -- .../Controllers/Shop/Admin/HomeController.php | 29 - .../Shop/Admin/InventoryController.php | 86 --- .../Shop/Admin/InventoryPlaceController.php | 86 --- .../Shop/Admin/InvoiceController.php | 46 -- .../Shop/Admin/OrderController.php | 46 -- .../Shop/Admin/PackageController.php | 66 --- .../Admin/PriceGenericCategoryController.php | 48 -- .../Shop/Admin/PriceGenericController.php | 68 --- .../Shop/Admin/TagGroupController.php | 59 -- .../Shop/Admin/UnityController.php | 67 --- .../Controllers/Shop/ArticleController.php | 12 +- .../Controllers/Shop/CategoryController.php | 6 +- .../Controllers/Shop/CustomerController.php | 10 +- app/Http/Controllers/Shop/HomeController.php | 44 +- .../Controllers/Shop/InvoiceController.php | 12 +- app/Http/Controllers/Shop/OrderController.php | 12 +- app/Http/Middleware/Authenticate.php | 2 +- .../Middleware/RedirectIfAuthenticated.php | 6 +- app/Imports/CustomersImport.php | 6 +- app/Install.php | 2 +- app/Menu/Botanic.php | 17 +- app/Menu/Customers.php | 7 +- app/Menu/Orders.php | 17 +- app/Menu/Shop.php | 47 +- app/Models/Botanic/Family.php | 16 +- app/Models/Botanic/Genre.php | 15 +- app/Models/Botanic/Specie.php | 26 +- app/Models/Botanic/Variety.php | 52 +- app/Models/Core/App/Application.php | 8 +- app/Models/Core/App/ApplicationClient.php | 47 ++ app/Models/Core/App/ApplicationModule.php | 6 +- app/Models/Core/App/ApplicationPage.php | 6 +- app/Models/Core/Auth/PasswordReset.php | 20 + app/Models/Core/Auth/PasswordSecurity.php | 23 + app/Models/Core/Auth/Permission.php | 40 +- app/Models/Core/Auth/PermissionCategory.php | 32 +- app/Models/Core/Auth/PermissionRole.php | 4 +- app/Models/Core/Auth/PermissionUser.php | 6 +- app/Models/Core/Auth/Role.php | 39 +- app/Models/Core/Auth/RoleUser.php | 5 +- app/Models/Core/Auth/Team.php | 3 +- app/Models/Core/Auth/TeamUser.php | 4 +- app/Models/Core/Auth/User.php | 197 +------ app/Models/Core/Auth/UserClient.php | 33 ++ app/Models/Core/Auth/UserStatus.php | 32 + app/Models/Core/Auth/UserStatusTeam.php | 32 + app/Models/Core/Media.php | 1 - app/Models/Shop/Article.php | 113 ++-- app/Models/Shop/ArticleComponent.php | 17 - app/Models/Shop/ArticleFamily.php | 29 - app/Models/Shop/ArticleNature.php | 22 + app/Models/Shop/ArticlePrice.php | 36 +- app/Models/Shop/Basket.php | 24 + app/Models/Shop/Category.php | 14 +- app/Models/Shop/Customer.php | 32 +- app/Models/Shop/CustomerAddress.php | 5 +- app/Models/Shop/DistributionChannel.php | 19 + app/Models/Shop/Invoice.php | 4 +- app/Models/Shop/InvoiceItem.php | 4 +- app/Models/Shop/Merchandise.php | 20 + app/Models/Shop/Offer.php | 26 + app/Models/Shop/Order.php | 4 +- app/Models/Shop/OrderPayment.php | 4 +- app/Models/Shop/Package.php | 28 +- app/Models/Shop/Price.php | 63 +- app/Models/Shop/PriceGeneric.php | 40 -- app/Models/Shop/PriceGenericCategory.php | 10 +- app/Models/Shop/PriceGenericValue.php | 30 - app/Models/Shop/PriceList.php | 29 + app/Models/Shop/PriceListValue.php | 32 + app/Models/Shop/SaleChannel.php | 11 + app/Models/Shop/Shelve.php | 29 + app/Models/Shop/Tag.php | 27 +- app/Models/Shop/TagGroup.php | 22 +- app/Models/Shop/Tariff.php | 30 + app/Models/Shop/TariffUnity.php | 16 + app/Models/Shop/Tax.php | 5 +- app/Models/Shop/Unity.php | 59 +- app/Models/Shop/Variation.php | 21 + app/Providers/BroadcastServiceProvider.php | 2 +- app/Providers/RouteServiceProvider.php | 10 +- app/Repositories/Botanic/Families.php | 86 +-- app/Repositories/Botanic/Genres.php | 83 ++- app/Repositories/Botanic/Species.php | 23 +- app/Repositories/Botanic/Varieties.php | 176 +++--- app/Repositories/Config.php | 56 +- .../Core/App/ApplicationClients.php | 91 +++ .../Core/App/ApplicationModules.php | 56 ++ .../Core/App/ApplicationPages.php | 5 +- app/Repositories/Core/App/Applications.php | 48 +- app/Repositories/Core/Auth/NewUser.php | 20 +- .../Core/Auth/PasswordSecurities.php | 20 + app/Repositories/Core/Auth/Passwords.php | 36 ++ app/Repositories/Core/Auth/Permissions.php | 8 +- app/Repositories/Core/Auth/ResetPassword.php | 4 +- app/Repositories/Core/Auth/Roles.php | 72 +-- app/Repositories/Core/Auth/Teams.php | 54 +- app/Repositories/Core/Auth/UserClients.php | 158 +++++ .../Core/Auth/UserStatusTeams.php | 26 + app/Repositories/Core/Auth/UserStatuses.php | 100 ++++ app/Repositories/Core/Auth/Users.php | 236 ++++++-- app/Repositories/Core/DataTable.php | 22 +- app/Repositories/Core/Database.php | 24 +- app/Repositories/Core/DateCalculation.php | 77 +++ app/Repositories/Core/DateHelper.php | 20 +- app/Repositories/Core/DateRange.php | 270 +++++---- app/Repositories/Core/DateTime.php | 228 ++++---- app/Repositories/Core/Debug.php | 3 + app/Repositories/Core/File.php | 73 +++ app/Repositories/Core/HelperDate.php | 77 +++ app/Repositories/Core/Mailer.php | 15 +- app/Repositories/Core/Media.php | 87 ++- app/Repositories/Core/Menu/Builder.php | 5 +- app/Repositories/Core/Menu/Logs.php | 12 +- app/Repositories/Core/Menu/Users.php | 18 +- app/Repositories/Core/Stat.php | 43 +- app/Repositories/Core/Storage.php | 98 ++++ app/Repositories/Core/Tag.php | 35 +- app/Repositories/Core/Upload.php | 267 +++++---- app/Repositories/Core/User/Basket.php | 95 ++- .../Core/User/Notifications/NewUser.php | 20 +- .../Core/User/Notifications/ResetPassword.php | 4 +- app/Repositories/Core/User/PasswordResets.php | 1 - app/Repositories/Core/User/ShopCart.php | 18 + app/Repositories/Shop/ArticleComponents.php | 6 +- ...ArticleFamilies.php => ArticleNatures.php} | 26 +- app/Repositories/Shop/ArticlePrices.php | 140 +++-- app/Repositories/Shop/Articles.php | 275 +++++---- app/Repositories/Shop/Categories.php | 28 +- app/Repositories/Shop/CategoryTrees.php | 24 +- app/Repositories/Shop/Customers.php | 72 ++- app/Repositories/Shop/Invoices.php | 72 ++- app/Repositories/Shop/Orders.php | 74 +-- app/Repositories/Shop/Packages.php | 82 ++- .../Shop/PriceGenericCategories.php | 76 --- app/Repositories/Shop/PriceGenericValues.php | 70 --- app/Repositories/Shop/PriceGenerics.php | 82 --- app/Repositories/Shop/PriceListValues.php | 67 +++ app/Repositories/Shop/PriceLists.php | 70 +++ app/Repositories/Shop/Prices.php | 79 +-- app/Repositories/Shop/SaleChannels.php | 48 ++ app/Repositories/Shop/TagGroups.php | 10 +- app/Repositories/Shop/Tags.php | 9 +- app/Repositories/Shop/TariffUnities.php | 48 ++ app/Repositories/Shop/Tariffs.php | 63 ++ app/Repositories/Shop/Taxes.php | 17 +- app/Repositories/Shop/Unities.php | 77 +-- app/Repositories/Shop/Variations.php | 85 +++ app/User.php | 33 +- build/Admin/Auth/permissions.js | 44 -- build/Admin/Auth/roles.js | 50 -- build/Admin/Auth/teams.js | 51 -- build/Admin/Auth/users.js | 347 ----------- build/Shop/admin/customer.js | 105 ---- build/css/main.css | 51 ++ build/js/include/boilerplate.js | 49 ++ build/js/include/core/helpers.js | 21 + build/js/include/fancytree.js | 94 +++ build/js/include/file.js | 409 +++++++++++++ .../include/plugins/datatables_lang/de.json | 41 ++ .../include/plugins/datatables_lang/en.json | 23 + .../include/plugins/datatables_lang/fr.json | 29 + .../include/plugins/datatables_lang/it.json | 23 + .../include/plugins/datatables_lang/jp.json | 23 + .../include/plugins/datatables_lang/sp.json | 28 + build/js/include/uploader.js | 109 ++++ composer.json | 4 +- config/boilerplate/app.php | 4 +- config/boilerplate/auth.php | 4 +- config/boilerplate/laratrust.php | 6 +- config/boilerplate/locale.php | 15 + config/boilerplate/menu.php | 4 +- config/boilerplate/theme.php | 2 +- config/boilerplate/themes/default.php | 14 +- config/boilerplate/themes/green.php | 50 ++ config/medialibrary.php | 156 ----- ...021_05_21_001707_create_comments_table.php | 31 - ...6_05_192053_create_activity_log_table.php} | 0 ...21_06_05_192053_create_comments_table.php} | 0 ...21_06_05_192053_teamwork_setup_tables.php} | 0 ... 2021_07_25_182012_create_media_table.php} | 0 package.json | 199 ++++--- resources/lang/fr/shop.php | 90 ++- resources/lang/fr/system.php | 6 + .../views/Botanic/Admin/Genres/form.blade.php | 27 - .../Botanic/Admin/Species/edit.blade.php | 27 - .../Botanic/Admin/Species/form.blade.php | 57 -- .../Botanic/Admin/Varieties/form.blade.php | 42 -- .../Admin/ArticleFamilies/create.blade.php | 15 - .../Shop/Admin/ArticleFamilies/edit.blade.php | 16 - .../Shop/Admin/ArticleFamilies/list.blade.php | 9 - .../views/Shop/Admin/Articles/edit.blade.php | 15 - .../Admin/Articles/partials/prices.blade.php | 2 - .../partials/product/description.blade.php | 5 - .../partials/product/images.blade.php | 1 - .../Shop/Admin/Categories/list.blade.php | 21 - .../Dashboard/_partials/report.blade.php | 23 - .../views/Shop/Admin/Packages/form.blade.php | 18 - .../PriceGenericCategories/create.blade.php | 13 - .../PriceGenericCategories/edit.blade.php | 14 - .../PriceGenericCategories/form.blade.php | 15 - .../PriceGenericCategories/list.blade.php | 13 - .../PriceGenerics/partials/filters.blade.php | 8 - .../Botanic}/Families/create.blade.php | 4 +- .../Botanic}/Families/edit.blade.php | 4 +- .../Botanic}/Families/form.blade.php | 32 +- .../Botanic}/Families/list.blade.php | 2 +- .../Botanic}/Families/show.blade.php | 0 .../Botanic}/Genres/create.blade.php | 4 +- .../Botanic}/Genres/edit.blade.php | 6 +- .../views/admin/Botanic/Genres/form.blade.php | 43 ++ .../Botanic}/Genres/list.blade.php | 2 +- .../Botanic}/Genres/show.blade.php | 0 .../Botanic}/Species/create.blade.php | 4 +- .../admin/Botanic/Species/edit.blade.php | 14 + .../admin/Botanic/Species/form.blade.php | 56 ++ .../Botanic}/Species/list.blade.php | 2 +- .../Botanic}/Species/show.blade.php | 0 .../Botanic}/Varieties/create.blade.php | 4 +- .../Botanic}/Varieties/edit.blade.php | 4 +- .../admin/Botanic/Varieties/form.blade.php | 55 ++ .../Botanic}/Varieties/list.blade.php | 2 +- .../Botanic}/Varieties/show.blade.php | 0 .../Core/App/Application/create.blade.php | 21 + .../Core/App/Application/dashboard.blade.php | 12 + .../admin/Core/App/Application/edit.blade.php | 23 + .../App/Application/exports/excel.blade.php | 3 + .../App/Application/exports/print.blade.php | 18 + .../admin/Core/App/Application/form.blade.php | 31 + .../Core/App/Application/index.blade.php | 57 ++ .../admin/Core/App/Application/list.blade.php | 31 + .../Core/App/Application/modal.blade.php | 76 +++ .../Application/partials/dashboard.blade.php} | 0 .../Application/partials/filters.blade.php | 2 + .../admin/Core/App/Application/show.blade.php | 16 + .../App/ApplicationModule/create.blade.php | 21 + .../App/ApplicationModule/dashboard.blade.php | 12 + .../Core/App/ApplicationModule/edit.blade.php | 24 + .../ApplicationModule/exports/excel.blade.php | 3 + .../ApplicationModule/exports/print.blade.php | 18 + .../Core/App/ApplicationModule/form.blade.php | 25 + .../App/ApplicationModule/index.blade.php | 57 ++ .../Core/App/ApplicationModule/list.blade.php | 31 + .../App/ApplicationModule/modal.blade.php | 76 +++ .../partials/dashboard.blade.php} | 0 .../partials/filters.blade.php | 2 + .../Core/App/ApplicationModule/show.blade.php | 16 + .../Core/Auth/Permission/create.blade.php | 21 + .../admin/Core/Auth/Permission/edit.blade.php | 23 + .../admin/Core/Auth/Permission/form.blade.php | 25 + .../Core/Auth/Permission/index.blade.php | 20 + .../Core/Auth/Permission/manage.blade.php | 55 ++ .../Permission/partials/filters.blade.php | 3 + .../admin/Core/Auth/Permission/show.blade.php | 28 + .../admin/Core/Auth/Role/create.blade.php | 21 + .../views/admin/Core/Auth/Role/edit.blade.php | 23 + .../views/admin/Core/Auth/Role/form.blade.php | 20 + .../admin/Core/Auth/Role/index.blade.php | 29 + .../admin/Core/Auth/Role/manage.blade.php | 47 ++ .../Core/Auth/Role/partials/filters.blade.php | 3 + .../Core/Auth/Role/row-permission.blade.php | 15 + .../views/admin/Core/Auth/Role/show.blade.php | 28 + .../Core/Auth/Role/table-permission.blade.php | 13 + .../admin/Core/Auth/Team/create.blade.php | 21 + .../views/admin/Core/Auth/Team/edit.blade.php | 23 + .../views/admin/Core/Auth/Team/form.blade.php | 65 +++ .../views/admin/Core/Auth/Team/form.twig | 23 + .../admin/Core/Auth/Team/index.blade.php | 20 + .../admin/Core/Auth/Team/manage.blade.php | 55 ++ .../views/admin/Core/Auth/Team/manage.twig | 82 +++ .../Core/Auth/Team/partials/filters.blade.php | 3 + .../views/admin/Core/Auth/Team/show.blade.php | 28 + .../admin/Core/Auth/User/create.blade.php | 21 + .../views/admin/Core/Auth/User/edit.blade.php | 23 + .../views/admin/Core/Auth/User/form.blade.php | 65 +++ .../admin/Core/Auth/User/index.blade.php | 57 ++ .../admin/Core/Auth/User/manage.blade.php | 55 ++ .../admin/Core/Auth/User/modal.blade.php | 61 ++ .../Core/Auth/User/modalProfile.blade.php | 59 ++ .../Core/Auth/User/partials/filters.blade.php | 3 + .../Auth/User/partials/identifier.blade.php | 7 + .../Core/Auth/User/partials/roles.blade.php | 3 + .../admin/Core/Auth/User/roles.blade.php | 19 + .../views/admin/Core/Auth/User/show.blade.php | 28 + .../Shop/ArticleNatures/create.blade.php | 15 + .../admin/Shop/ArticleNatures/edit.blade.php | 16 + .../Shop/ArticleNatures}/form.blade.php | 4 +- .../admin/Shop/ArticleNatures/list.blade.php | 9 + .../Shop/ArticleNatures}/show.blade.php | 0 .../Shop}/Articles/create.blade.php | 4 +- .../views/admin/Shop/Articles/edit.blade.php | 15 + .../Shop}/Articles/form.blade.php | 39 +- .../Shop}/Articles/list.blade.php | 4 +- .../partials/characteristics.blade.php | 75 +-- .../Shop}/Articles/partials/filters.blade.php | 0 .../generic_prices/attributes.blade.php | 2 +- .../generic_prices/block_attribute.blade.php | 0 .../block_attribute_new.blade.php | 0 .../block_generic_price.blade.php | 2 +- .../block_generic_price_new.blade.php | 2 +- .../generic_prices/generic_prices.blade.php | 6 +- .../list-generic_prices.blade.php | 2 +- .../Shop/Articles/partials/prices.blade.php | 2 + .../partials/prices/attributes.blade.php | 2 +- .../partials/prices/block_price.blade.php | 0 .../partials/prices/block_price_new.blade.php | 0 .../partials/prices/list-prices.blade.php | 2 +- .../Articles/partials/prices/prices.blade.php | 8 +- .../partials/product/description.blade.php | 16 + .../partials/product/images.blade.php | 1 + .../Articles/partials/product/tags.blade.php | 2 +- .../Shop/Articles/partials/seo.blade.php} | 0 .../Shop/Articles/partials/shipping.blade.php | 0 .../Shop/Articles/partials/stock.blade.php | 0 .../Shop}/Articles/show.blade.php | 0 .../Shop}/Categories/create.blade.php | 4 +- .../Shop}/Categories/edit.blade.php | 4 +- .../Shop}/Categories/form.blade.php | 2 +- .../admin/Shop/Categories/list.blade.php | 21 + .../Shop}/Categories/partials/tree.blade.php | 2 +- .../Shop}/Categories/show.blade.php | 0 .../Shop}/Customers/create.blade.php | 6 +- .../Shop}/Customers/edit.blade.php | 4 +- .../Shop}/Customers/form.blade.php | 0 .../Shop}/Customers/list.blade.php | 2 +- .../Shop}/Customers/show.blade.php | 0 .../Dashboard/_partials/counter.blade.php | 16 +- .../Dashboard/_partials/evolutions.blade.php | 0 .../Dashboard/_partials/infobox.blade.php | 0 .../_partials/latestOrders.blade.php | 0 .../_partials/latest_members.blade.php | 0 .../_partials/ordersByTypes.blade.php | 0 .../Shop/Dashboard/_partials/report.blade.php | 23 + .../_partials/salesByPeriod.blade.php | 4 +- .../Shop}/Dashboard/_partials/stats.blade.php | 8 +- .../Shop}/Dashboard/_partials/stock.blade.php | 0 .../Dashboard/components/chart.blade.php | 0 .../Dashboard/components/counter.blade.php | 0 .../Dashboard/components/evolutions.blade.php | 0 .../Dashboard/components/infobox.blade.php | 0 .../Dashboard/components/infobox2.blade.php | 0 .../components/latest_orders.blade.php | 0 .../Shop}/Dashboard/components/map.blade.php | 0 .../components/monthly_report.blade.php | 0 .../Shop}/Dashboard/index.blade.php | 4 +- .../Shop}/Invoices/create.blade.php | 4 +- .../Shop}/Invoices/edit.blade.php | 4 +- .../Shop}/Invoices/form.blade.php | 0 .../Shop}/Invoices/list.blade.php | 2 +- .../Shop}/Invoices/show.blade.php | 0 .../views/admin/Shop/Offers/create.blade.php | 13 + .../views/admin/Shop/Offers/edit.blade.php | 14 + .../views/admin/Shop/Offers/form.blade.php | 65 +++ .../views/admin/Shop/Offers/list.blade.php | 9 + .../Shop/Offers}/show.blade.php | 0 .../Shop}/Orders/create.blade.php | 6 +- .../Shop}/Orders/edit.blade.php | 6 +- .../Shop}/Orders/form.blade.php | 0 .../Shop}/Orders/list.blade.php | 2 +- .../Shop/Orders}/show.blade.php | 0 .../Shop}/Packages/create.blade.php | 4 +- .../Shop}/Packages/edit.blade.php | 4 +- .../views/admin/Shop/Packages/form.blade.php | 9 + .../Shop}/Packages/index.blade.php | 8 +- .../Shop}/Packages/list.blade.php | 4 +- .../Shop}/Packages/partials/filters.blade.php | 0 .../Shop/Packages}/show.blade.php | 0 .../Shop/PriceListValues}/create.blade.php | 4 +- .../Shop/PriceListValues}/edit.blade.php | 4 +- .../Shop/PriceListValues}/form.blade.php | 10 +- .../Shop/PriceListValues}/list.blade.php | 4 +- .../partials/block_price.blade.php | 0 .../partials/block_price_new.blade.php | 0 .../partials/filters.blade.php | 0 .../partials/list-prices.blade.php | 2 +- .../partials/prices.blade.php | 8 +- .../partials/table-prices.blade.php | 0 .../Shop/PriceListValues}/show.blade.php | 0 .../admin/Shop/PriceLists/create.blade.php | 13 + .../admin/Shop/PriceLists/edit.blade.php | 14 + .../admin/Shop/PriceLists/form.blade.php | 15 + .../admin/Shop/PriceLists/list.blade.php | 13 + .../admin/Shop/PriceLists/modal.blade.php | 52 ++ .../PriceLists/partials/block_price.blade.php | 80 +++ .../partials/block_price_new.blade.php | 51 ++ .../PriceLists/partials/filters.blade.php | 3 + .../PriceLists/partials/list-prices.blade.php | 16 + .../Shop/PriceLists/partials/prices.blade.php | 102 ++++ .../partials/table-prices.blade.php | 29 + .../Shop/PriceLists}/show.blade.php | 0 .../admin/Shop/SaleChannels/create.blade.php | 11 + .../admin/Shop/SaleChannels/edit.blade.php | 15 + .../admin/Shop/SaleChannels/form.blade.php | 22 + .../admin/Shop/SaleChannels/list.blade.php | 9 + .../Shop/SaleChannels}/show.blade.php | 0 .../Shop}/TagGroups/create.blade.php | 4 +- .../Shop}/TagGroups/edit.blade.php | 4 +- .../Shop}/TagGroups/form.blade.php | 0 .../Shop}/TagGroups/list.blade.php | 2 +- .../Shop/TagGroups}/show.blade.php | 0 .../Shop}/Tags/create.blade.php | 6 +- .../Admin => admin/Shop}/Tags/edit.blade.php | 6 +- .../Admin => admin/Shop}/Tags/form.blade.php | 0 .../Admin => admin/Shop}/Tags/list.blade.php | 2 +- .../views/admin/Shop/Tags/show.blade.php | 36 ++ .../views/admin/Shop/Tariffs/create.blade.php | 13 + .../views/admin/Shop/Tariffs/edit.blade.php | 13 + .../views/admin/Shop/Tariffs/form.blade.php | 90 +++ .../views/admin/Shop/Tariffs/list.blade.php | 11 + .../views/admin/Shop/Tariffs/show.blade.php | 36 ++ .../Shop}/Unities/create.blade.php | 6 +- .../Shop}/Unities/edit.blade.php | 4 +- .../Shop}/Unities/form.blade.php | 5 - .../Shop}/Unities/index.blade.php | 8 +- .../Shop}/Unities/list.blade.php | 4 +- .../Shop}/Unities/partials/filters.blade.php | 0 .../views/admin/Shop/Unities/show.blade.php | 36 ++ .../admin/Shop/Variations/create.blade.php | 15 + .../admin/Shop/Variations/edit.blade.php | 16 + .../admin/Shop/Variations/form.blade.php | 38 ++ .../admin/Shop/Variations/list.blade.php | 9 + .../admin/Shop/Variations/show.blade.php | 36 ++ resources/views/auth/login.blade.php | 6 + .../auth/passwords/change_password.blade.php | 47 ++ .../views/components/button-cancel.blade.php | 2 +- .../views/components/button-save.blade.php | 2 +- .../components/form/autocomplete.blade.php | 2 +- .../uploader/mini-gallery.blade.php | 40 +- .../components/uploader/widget.blade.php | 5 +- resources/views/home.blade.php | 5 - resources/views/layout/footer.blade.php | 3 - resources/views/layout/index.blade.php | 143 +++-- resources/views/load/appender.blade.php | 77 --- resources/views/load/chart/chartjs.blade.php | 6 + .../views/load/chart/highcharts.blade.php | 14 + resources/views/load/chart/highmaps.blade.php | 10 + resources/views/load/chart/maps.blade.php | 84 +++ resources/views/load/chart/maps.js | 35 ++ resources/views/load/chat/chat.blade.php | 200 +++++++ resources/views/load/chat/chatbot.blade.php | 47 ++ resources/views/load/codemirror.blade.php | 49 ++ resources/views/load/countdown.blade.php | 10 + resources/views/load/datatables.blade.php | 82 ++- resources/views/load/editor.blade.php | 15 - resources/views/load/editor/tinymce.blade.php | 39 -- resources/views/load/fancytree.blade.php | 74 +-- resources/views/load/fileinput.blade.php | 25 - resources/views/load/form/appender.blade.php | 2 +- .../views/load/form/autocomplete.blade.php | 7 +- .../views/load/form/datepicker.blade.php | 4 +- .../load/form/{editor => }/editor.blade.php | 0 .../views/load/form/editor/tinymce.blade.php | 3 +- resources/views/load/form/save.blade.php | 14 +- resources/views/load/form/select2.blade.php | 19 +- resources/views/load/form/toggle.blade.php | 1 - .../load/form/upload/fileinput.blade.php | 8 +- .../views/load/form/upload/upload.blade.php | 6 +- resources/views/load/layout/chevron.blade.php | 6 +- resources/views/load/layout/modal.blade.php | 25 +- .../views/load/layout/nicescroll.blade.php | 7 +- resources/views/load/mirada.blade.php | 311 ++++++++++ resources/views/load/modal.blade.php | 114 ---- resources/views/load/moment.blade.php | 2 +- resources/views/load/pdf/pdfjs.blade.php | 52 ++ resources/views/load/pdf/pdfjs2.blade.php | 56 ++ resources/views/load/pdf/pdfobject.blade.php | 30 + resources/views/load/pdf/viewerjs.blade.php | 9 + resources/views/load/select2.blade.php | 18 - resources/views/load/set_options.blade.php | 25 - resources/views/load/slick.blade.php | 10 + resources/views/load/toggle.blade.php | 34 -- resources/views/load/url_on_tab.blade.php | 18 + resources/views/load/user.blade.php | 29 + .../views/users/permissions/create.blade.php | 52 -- .../views/users/permissions/edit.blade.php | 52 -- .../views/users/permissions/list.blade.php | 85 --- resources/views/users/roles/create.blade.php | 74 --- resources/views/users/roles/edit.blade.php | 78 --- resources/views/users/roles/list.blade.php | 95 --- resources/views/users/teams/create.blade.php | 74 --- resources/views/users/teams/edit.blade.php | 52 -- resources/views/users/teams/list.blade.php | 108 ---- resources/views/users/users/agenda.blade.php | 12 - resources/views/users/users/create.blade.php | 100 ---- resources/views/users/users/edit.blade.php | 97 --- resources/views/users/users/list.blade.php | 88 --- resources/views/users/users/profile.blade.php | 132 ----- .../Admin => Admin/Botanic}/Families.php | 0 .../Admin => Admin/Botanic}/Genres.php | 0 .../Admin => Admin/Botanic}/Species.php | 0 .../Admin => Admin/Botanic}/Varieties.php | 0 .../Admin => Admin/Botanic}/route.php | 2 +- routes/Admin/Shop/ArticleNatures.php | 12 + .../{Shop/Admin => Admin/Shop}/Articles.php | 4 +- .../{Shop/Admin => Admin/Shop}/Categories.php | 0 routes/Admin/Shop/CustomerAddresses.php | 12 + .../{Shop/Admin => Admin/Shop}/Customers.php | 0 .../Admin => Admin/Shop}/InvoiceItems.php | 0 .../{Shop/Admin => Admin/Shop}/Invoices.php | 0 routes/Admin/Shop/Offers.php | 10 + .../Admin => Admin/Shop}/OrderPayments.php | 0 routes/{Shop/Admin => Admin/Shop}/Orders.php | 0 .../{Shop/Admin => Admin/Shop}/Packages.php | 8 +- routes/Admin/Shop/PriceListValues.php | 11 + routes/Admin/Shop/PriceLists.php | 16 + routes/Admin/Shop/SaleChannels.php | 11 + .../{Shop/Admin => Admin/Shop}/TagGroups.php | 0 routes/{Shop/Admin => Admin/Shop}/Tags.php | 0 routes/Admin/Shop/TariffUnities.php | 12 + routes/Admin/Shop/Tariffs.php | 14 + routes/{Shop/Admin => Admin/Shop}/Unities.php | 8 +- routes/Admin/Shop/Variations.php | 14 + routes/{Shop/Admin => Admin/Shop}/route.php | 14 +- routes/Admin/route.php | 2 + routes/Botanic/route.php | 1 - routes/Shop/Admin/ArticleFamilies.php | 12 - routes/Shop/Admin/ArticlePrices.php | 4 - routes/Shop/Admin/Inventories.php | 4 - routes/Shop/Admin/InventoryPlaces.php | 4 - routes/Shop/Admin/PriceGenericCategories.php | 12 - routes/Shop/Admin/PriceGenerics.php | 13 - routes/Shop/Articles.php | 1 - routes/Shop/route.php | 2 - routes/web.php | 4 - 608 files changed, 12235 insertions(+), 7513 deletions(-) delete mode 100644 app/Datatables/Shop/ArticleFamiliesDataTable.php create mode 100644 app/Datatables/Shop/ArticleNaturesDataTable.php create mode 100644 app/Datatables/Shop/OffersDataTable.php delete mode 100644 app/Datatables/Shop/PriceGenericsDataTable.php create mode 100644 app/Datatables/Shop/PriceListsDataTable.php create mode 100644 app/Datatables/Shop/SaleChannelsDataTable.php create mode 100644 app/Datatables/Shop/TariffsDataTable.php create mode 100644 app/Datatables/Shop/VariationsDataTable.php create mode 100644 app/Http/Controllers/Admin/Botanic/Controller.php create mode 100644 app/Http/Controllers/Admin/Botanic/FamilyController.php rename app/Http/Controllers/{Botanic/Admin => Admin/Botanic}/GenreController.php (60%) create mode 100644 app/Http/Controllers/Admin/Botanic/SpecieController.php create mode 100644 app/Http/Controllers/Admin/Botanic/VarietyController.php create mode 100644 app/Http/Controllers/Admin/Controller.php create mode 100644 app/Http/Controllers/Admin/Core/App/ApplicationController.php create mode 100644 app/Http/Controllers/Admin/Core/App/ApplicationModuleController.php create mode 100644 app/Http/Controllers/Admin/Core/App/Controller.php create mode 100644 app/Http/Controllers/Admin/Core/Auth/Controller.php create mode 100644 app/Http/Controllers/Admin/Core/Auth/PermissionController.php create mode 100644 app/Http/Controllers/Admin/Core/Auth/RoleController.php create mode 100644 app/Http/Controllers/Admin/Core/Auth/TeamController.php create mode 100644 app/Http/Controllers/Admin/Core/Auth/UserController.php create mode 100644 app/Http/Controllers/Admin/Core/Controller.php create mode 100644 app/Http/Controllers/Admin/Shop/ArticleController.php create mode 100644 app/Http/Controllers/Admin/Shop/ArticleNatureController.php rename app/Http/Controllers/{Shop/Admin => Admin/Shop}/CategoryController.php (79%) create mode 100644 app/Http/Controllers/Admin/Shop/Controller.php create mode 100644 app/Http/Controllers/Admin/Shop/CustomerController.php rename app/Http/Controllers/{Shop/Admin => Admin/Shop}/DashboardController.php (85%) create mode 100644 app/Http/Controllers/Admin/Shop/HomeController.php create mode 100644 app/Http/Controllers/Admin/Shop/InvoiceController.php rename app/Http/Controllers/{Shop/Admin => Admin/Shop}/InvoiceItemController.php (81%) create mode 100644 app/Http/Controllers/Admin/Shop/OfferController.php create mode 100644 app/Http/Controllers/Admin/Shop/OrderController.php rename app/Http/Controllers/{Shop/Admin => Admin/Shop}/OrderPaymentController.php (81%) create mode 100644 app/Http/Controllers/Admin/Shop/PackageController.php create mode 100644 app/Http/Controllers/Admin/Shop/PriceGenericCategoryController.php create mode 100644 app/Http/Controllers/Admin/Shop/PriceListController.php create mode 100644 app/Http/Controllers/Admin/Shop/PriceListValuesController.php create mode 100644 app/Http/Controllers/Admin/Shop/SaleChannelController.php rename app/Http/Controllers/{Shop/Admin => Admin/Shop}/TagController.php (72%) create mode 100644 app/Http/Controllers/Admin/Shop/TagGroupController.php create mode 100644 app/Http/Controllers/Admin/Shop/TariffController.php rename app/Http/Controllers/{Shop/Admin => Admin/Shop}/TaxController.php (73%) create mode 100644 app/Http/Controllers/Admin/Shop/UnityController.php create mode 100644 app/Http/Controllers/Admin/Shop/VariationController.php create mode 100644 app/Http/Controllers/Auth/PasswordSecurityController.php delete mode 100644 app/Http/Controllers/Botanic/Admin/FamilyController.php delete mode 100644 app/Http/Controllers/Botanic/Admin/SpecieController.php delete mode 100644 app/Http/Controllers/Botanic/Admin/VarietyController.php delete mode 100644 app/Http/Controllers/JS/CacheController.php delete mode 100644 app/Http/Controllers/Shop/Admin/ArticleController.php delete mode 100644 app/Http/Controllers/Shop/Admin/ArticleFamilyController.php delete mode 100644 app/Http/Controllers/Shop/Admin/ArticlePriceController.php delete mode 100644 app/Http/Controllers/Shop/Admin/CustomerController.php delete mode 100644 app/Http/Controllers/Shop/Admin/HomeController.php delete mode 100644 app/Http/Controllers/Shop/Admin/InventoryController.php delete mode 100644 app/Http/Controllers/Shop/Admin/InventoryPlaceController.php delete mode 100644 app/Http/Controllers/Shop/Admin/InvoiceController.php delete mode 100644 app/Http/Controllers/Shop/Admin/OrderController.php delete mode 100644 app/Http/Controllers/Shop/Admin/PackageController.php delete mode 100644 app/Http/Controllers/Shop/Admin/PriceGenericCategoryController.php delete mode 100644 app/Http/Controllers/Shop/Admin/PriceGenericController.php delete mode 100644 app/Http/Controllers/Shop/Admin/TagGroupController.php delete mode 100644 app/Http/Controllers/Shop/Admin/UnityController.php create mode 100644 app/Models/Core/App/ApplicationClient.php create mode 100644 app/Models/Core/Auth/PasswordReset.php create mode 100644 app/Models/Core/Auth/PasswordSecurity.php create mode 100644 app/Models/Core/Auth/UserClient.php create mode 100644 app/Models/Core/Auth/UserStatus.php create mode 100644 app/Models/Core/Auth/UserStatusTeam.php delete mode 100644 app/Models/Shop/ArticleComponent.php delete mode 100644 app/Models/Shop/ArticleFamily.php create mode 100644 app/Models/Shop/ArticleNature.php create mode 100644 app/Models/Shop/Basket.php create mode 100644 app/Models/Shop/DistributionChannel.php create mode 100644 app/Models/Shop/Merchandise.php create mode 100644 app/Models/Shop/Offer.php delete mode 100644 app/Models/Shop/PriceGeneric.php delete mode 100644 app/Models/Shop/PriceGenericValue.php create mode 100644 app/Models/Shop/PriceList.php create mode 100644 app/Models/Shop/PriceListValue.php create mode 100644 app/Models/Shop/SaleChannel.php create mode 100644 app/Models/Shop/Shelve.php create mode 100644 app/Models/Shop/Tariff.php create mode 100644 app/Models/Shop/TariffUnity.php create mode 100644 app/Models/Shop/Variation.php create mode 100644 app/Repositories/Core/App/ApplicationClients.php create mode 100644 app/Repositories/Core/App/ApplicationModules.php create mode 100644 app/Repositories/Core/Auth/PasswordSecurities.php create mode 100644 app/Repositories/Core/Auth/Passwords.php create mode 100644 app/Repositories/Core/Auth/UserClients.php create mode 100644 app/Repositories/Core/Auth/UserStatusTeams.php create mode 100644 app/Repositories/Core/Auth/UserStatuses.php create mode 100644 app/Repositories/Core/DateCalculation.php create mode 100644 app/Repositories/Core/File.php create mode 100644 app/Repositories/Core/HelperDate.php create mode 100644 app/Repositories/Core/Storage.php create mode 100644 app/Repositories/Core/User/ShopCart.php rename app/Repositories/Shop/{ArticleFamilies.php => ArticleNatures.php} (56%) delete mode 100644 app/Repositories/Shop/PriceGenericCategories.php delete mode 100644 app/Repositories/Shop/PriceGenericValues.php delete mode 100644 app/Repositories/Shop/PriceGenerics.php create mode 100644 app/Repositories/Shop/PriceListValues.php create mode 100644 app/Repositories/Shop/PriceLists.php create mode 100644 app/Repositories/Shop/SaleChannels.php create mode 100644 app/Repositories/Shop/TariffUnities.php create mode 100644 app/Repositories/Shop/Tariffs.php create mode 100644 app/Repositories/Shop/Variations.php delete mode 100644 build/Admin/Auth/permissions.js delete mode 100644 build/Admin/Auth/roles.js delete mode 100644 build/Admin/Auth/teams.js delete mode 100644 build/Admin/Auth/users.js delete mode 100644 build/Shop/admin/customer.js create mode 100644 build/js/include/boilerplate.js create mode 100644 build/js/include/core/helpers.js create mode 100644 build/js/include/fancytree.js create mode 100644 build/js/include/file.js create mode 100644 build/js/include/plugins/datatables_lang/de.json create mode 100644 build/js/include/plugins/datatables_lang/en.json create mode 100644 build/js/include/plugins/datatables_lang/fr.json create mode 100644 build/js/include/plugins/datatables_lang/it.json create mode 100644 build/js/include/plugins/datatables_lang/jp.json create mode 100644 build/js/include/plugins/datatables_lang/sp.json create mode 100644 build/js/include/uploader.js create mode 100644 config/boilerplate/locale.php create mode 100644 config/boilerplate/themes/green.php delete mode 100644 config/medialibrary.php delete mode 100644 database/migrations/2021_05_21_001707_create_comments_table.php rename database/migrations/{2021_05_21_001707_create_activity_log_table.php => 2021_06_05_192053_create_activity_log_table.php} (100%) rename database/migrations/{2021_04_08_142711_create_comments_table.php => 2021_06_05_192053_create_comments_table.php} (100%) rename database/migrations/{2021_05_21_001707_teamwork_setup_tables.php => 2021_06_05_192053_teamwork_setup_tables.php} (100%) rename database/migrations/{2021_05_21_001707_create_media_table.php => 2021_07_25_182012_create_media_table.php} (100%) create mode 100644 resources/lang/fr/system.php delete mode 100644 resources/views/Botanic/Admin/Genres/form.blade.php delete mode 100644 resources/views/Botanic/Admin/Species/edit.blade.php delete mode 100644 resources/views/Botanic/Admin/Species/form.blade.php delete mode 100644 resources/views/Botanic/Admin/Varieties/form.blade.php delete mode 100644 resources/views/Shop/Admin/ArticleFamilies/create.blade.php delete mode 100644 resources/views/Shop/Admin/ArticleFamilies/edit.blade.php delete mode 100644 resources/views/Shop/Admin/ArticleFamilies/list.blade.php delete mode 100644 resources/views/Shop/Admin/Articles/edit.blade.php delete mode 100644 resources/views/Shop/Admin/Articles/partials/prices.blade.php delete mode 100644 resources/views/Shop/Admin/Articles/partials/product/description.blade.php delete mode 100644 resources/views/Shop/Admin/Articles/partials/product/images.blade.php delete mode 100644 resources/views/Shop/Admin/Categories/list.blade.php delete mode 100644 resources/views/Shop/Admin/Dashboard/_partials/report.blade.php delete mode 100644 resources/views/Shop/Admin/Packages/form.blade.php delete mode 100644 resources/views/Shop/Admin/PriceGenericCategories/create.blade.php delete mode 100644 resources/views/Shop/Admin/PriceGenericCategories/edit.blade.php delete mode 100644 resources/views/Shop/Admin/PriceGenericCategories/form.blade.php delete mode 100644 resources/views/Shop/Admin/PriceGenericCategories/list.blade.php delete mode 100644 resources/views/Shop/Admin/PriceGenerics/partials/filters.blade.php rename resources/views/{Botanic/Admin => admin/Botanic}/Families/create.blade.php (76%) rename resources/views/{Botanic/Admin => admin/Botanic}/Families/edit.blade.php (73%) rename resources/views/{Botanic/Admin => admin/Botanic}/Families/form.blade.php (60%) rename resources/views/{Botanic/Admin => admin/Botanic}/Families/list.blade.php (68%) rename resources/views/{Botanic/Admin => admin/Botanic}/Families/show.blade.php (100%) rename resources/views/{Botanic/Admin => admin/Botanic}/Genres/create.blade.php (71%) rename resources/views/{Botanic/Admin => admin/Botanic}/Genres/edit.blade.php (58%) create mode 100644 resources/views/admin/Botanic/Genres/form.blade.php rename resources/views/{Botanic/Admin => admin/Botanic}/Genres/list.blade.php (69%) rename resources/views/{Botanic/Admin => admin/Botanic}/Genres/show.blade.php (100%) rename resources/views/{Botanic/Admin => admin/Botanic}/Species/create.blade.php (73%) create mode 100644 resources/views/admin/Botanic/Species/edit.blade.php create mode 100644 resources/views/admin/Botanic/Species/form.blade.php rename resources/views/{Botanic/Admin => admin/Botanic}/Species/list.blade.php (69%) rename resources/views/{Botanic/Admin => admin/Botanic}/Species/show.blade.php (100%) rename resources/views/{Botanic/Admin => admin/Botanic}/Varieties/create.blade.php (76%) rename resources/views/{Botanic/Admin => admin/Botanic}/Varieties/edit.blade.php (77%) create mode 100644 resources/views/admin/Botanic/Varieties/form.blade.php rename resources/views/{Botanic/Admin => admin/Botanic}/Varieties/list.blade.php (68%) rename resources/views/{Botanic/Admin => admin/Botanic}/Varieties/show.blade.php (100%) create mode 100644 resources/views/admin/Core/App/Application/create.blade.php create mode 100644 resources/views/admin/Core/App/Application/dashboard.blade.php create mode 100644 resources/views/admin/Core/App/Application/edit.blade.php create mode 100644 resources/views/admin/Core/App/Application/exports/excel.blade.php create mode 100644 resources/views/admin/Core/App/Application/exports/print.blade.php create mode 100644 resources/views/admin/Core/App/Application/form.blade.php create mode 100644 resources/views/admin/Core/App/Application/index.blade.php create mode 100644 resources/views/admin/Core/App/Application/list.blade.php create mode 100644 resources/views/admin/Core/App/Application/modal.blade.php rename resources/views/{Shop/Admin/Articles/partials/seo.blade.php => admin/Core/App/Application/partials/dashboard.blade.php} (100%) create mode 100644 resources/views/admin/Core/App/Application/partials/filters.blade.php create mode 100644 resources/views/admin/Core/App/Application/show.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/create.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/dashboard.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/edit.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/exports/excel.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/exports/print.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/form.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/index.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/list.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/modal.blade.php rename resources/views/{Shop/Admin/Articles/partials/shipping.blade.php => admin/Core/App/ApplicationModule/partials/dashboard.blade.php} (100%) create mode 100644 resources/views/admin/Core/App/ApplicationModule/partials/filters.blade.php create mode 100644 resources/views/admin/Core/App/ApplicationModule/show.blade.php create mode 100644 resources/views/admin/Core/Auth/Permission/create.blade.php create mode 100644 resources/views/admin/Core/Auth/Permission/edit.blade.php create mode 100644 resources/views/admin/Core/Auth/Permission/form.blade.php create mode 100644 resources/views/admin/Core/Auth/Permission/index.blade.php create mode 100644 resources/views/admin/Core/Auth/Permission/manage.blade.php create mode 100644 resources/views/admin/Core/Auth/Permission/partials/filters.blade.php create mode 100644 resources/views/admin/Core/Auth/Permission/show.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/create.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/edit.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/form.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/index.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/manage.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/partials/filters.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/row-permission.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/show.blade.php create mode 100644 resources/views/admin/Core/Auth/Role/table-permission.blade.php create mode 100644 resources/views/admin/Core/Auth/Team/create.blade.php create mode 100644 resources/views/admin/Core/Auth/Team/edit.blade.php create mode 100644 resources/views/admin/Core/Auth/Team/form.blade.php create mode 100644 resources/views/admin/Core/Auth/Team/form.twig create mode 100644 resources/views/admin/Core/Auth/Team/index.blade.php create mode 100644 resources/views/admin/Core/Auth/Team/manage.blade.php create mode 100644 resources/views/admin/Core/Auth/Team/manage.twig create mode 100644 resources/views/admin/Core/Auth/Team/partials/filters.blade.php create mode 100644 resources/views/admin/Core/Auth/Team/show.blade.php create mode 100644 resources/views/admin/Core/Auth/User/create.blade.php create mode 100644 resources/views/admin/Core/Auth/User/edit.blade.php create mode 100644 resources/views/admin/Core/Auth/User/form.blade.php create mode 100644 resources/views/admin/Core/Auth/User/index.blade.php create mode 100644 resources/views/admin/Core/Auth/User/manage.blade.php create mode 100644 resources/views/admin/Core/Auth/User/modal.blade.php create mode 100644 resources/views/admin/Core/Auth/User/modalProfile.blade.php create mode 100644 resources/views/admin/Core/Auth/User/partials/filters.blade.php create mode 100644 resources/views/admin/Core/Auth/User/partials/identifier.blade.php create mode 100644 resources/views/admin/Core/Auth/User/partials/roles.blade.php create mode 100644 resources/views/admin/Core/Auth/User/roles.blade.php create mode 100644 resources/views/admin/Core/Auth/User/show.blade.php create mode 100644 resources/views/admin/Shop/ArticleNatures/create.blade.php create mode 100644 resources/views/admin/Shop/ArticleNatures/edit.blade.php rename resources/views/{Shop/Admin/ArticleFamilies => admin/Shop/ArticleNatures}/form.blade.php (59%) create mode 100644 resources/views/admin/Shop/ArticleNatures/list.blade.php rename resources/views/{Shop/Admin/ArticleFamilies => admin/Shop/ArticleNatures}/show.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/create.blade.php (73%) create mode 100644 resources/views/admin/Shop/Articles/edit.blade.php rename resources/views/{Shop/Admin => admin/Shop}/Articles/form.blade.php (72%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/list.blade.php (76%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/characteristics.blade.php (57%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/filters.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/generic_prices/attributes.blade.php (60%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/generic_prices/block_attribute.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/generic_prices/block_attribute_new.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/generic_prices/block_generic_price.blade.php (81%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/generic_prices/block_generic_price_new.blade.php (60%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/generic_prices/generic_prices.blade.php (87%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/generic_prices/list-generic_prices.blade.php (76%) create mode 100644 resources/views/admin/Shop/Articles/partials/prices.blade.php rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/prices/attributes.blade.php (60%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/prices/block_price.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/prices/block_price_new.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/prices/list-prices.blade.php (83%) rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/prices/prices.blade.php (90%) create mode 100644 resources/views/admin/Shop/Articles/partials/product/description.blade.php create mode 100644 resources/views/admin/Shop/Articles/partials/product/images.blade.php rename resources/views/{Shop/Admin => admin/Shop}/Articles/partials/product/tags.blade.php (91%) rename resources/views/{Shop/Admin/Articles/partials/stock.blade.php => admin/Shop/Articles/partials/seo.blade.php} (100%) create mode 100644 resources/views/admin/Shop/Articles/partials/shipping.blade.php create mode 100644 resources/views/admin/Shop/Articles/partials/stock.blade.php rename resources/views/{Shop/Admin => admin/Shop}/Articles/show.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Categories/create.blade.php (73%) rename resources/views/{Shop/Admin => admin/Shop}/Categories/edit.blade.php (75%) rename resources/views/{Shop/Admin => admin/Shop}/Categories/form.blade.php (87%) create mode 100644 resources/views/admin/Shop/Categories/list.blade.php rename resources/views/{Shop/Admin => admin/Shop}/Categories/partials/tree.blade.php (95%) rename resources/views/{Shop/Admin => admin/Shop}/Categories/show.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Customers/create.blade.php (76%) rename resources/views/{Shop/Admin => admin/Shop}/Customers/edit.blade.php (75%) rename resources/views/{Shop/Admin => admin/Shop}/Customers/form.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Customers/list.blade.php (81%) rename resources/views/{Shop/Admin => admin/Shop}/Customers/show.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/counter.blade.php (65%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/evolutions.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/infobox.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/latestOrders.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/latest_members.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/ordersByTypes.blade.php (100%) create mode 100644 resources/views/admin/Shop/Dashboard/_partials/report.blade.php rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/salesByPeriod.blade.php (90%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/stats.blade.php (71%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/_partials/stock.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/components/chart.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/components/counter.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/components/evolutions.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/components/infobox.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/components/infobox2.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/components/latest_orders.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/components/map.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/components/monthly_report.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Dashboard/index.blade.php (74%) rename resources/views/{Shop/Admin => admin/Shop}/Invoices/create.blade.php (76%) rename resources/views/{Shop/Admin => admin/Shop}/Invoices/edit.blade.php (77%) rename resources/views/{Shop/Admin => admin/Shop}/Invoices/form.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Invoices/list.blade.php (81%) rename resources/views/{Shop/Admin => admin/Shop}/Invoices/show.blade.php (100%) create mode 100644 resources/views/admin/Shop/Offers/create.blade.php create mode 100644 resources/views/admin/Shop/Offers/edit.blade.php create mode 100644 resources/views/admin/Shop/Offers/form.blade.php create mode 100644 resources/views/admin/Shop/Offers/list.blade.php rename resources/views/{Shop/Admin/Orders => admin/Shop/Offers}/show.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Orders/create.blade.php (77%) rename resources/views/{Shop/Admin => admin/Shop}/Orders/edit.blade.php (77%) rename resources/views/{Shop/Admin => admin/Shop}/Orders/form.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Orders/list.blade.php (80%) rename resources/views/{Shop/Admin/Packages => admin/Shop/Orders}/show.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Packages/create.blade.php (72%) rename resources/views/{Shop/Admin => admin/Shop}/Packages/edit.blade.php (72%) create mode 100644 resources/views/admin/Shop/Packages/form.blade.php rename resources/views/{Shop/Admin => admin/Shop}/Packages/index.blade.php (72%) rename resources/views/{Shop/Admin => admin/Shop}/Packages/list.blade.php (78%) rename resources/views/{Shop/Admin => admin/Shop}/Packages/partials/filters.blade.php (100%) rename resources/views/{Shop/Admin/PriceGenericCategories => admin/Shop/Packages}/show.blade.php (100%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/create.blade.php (73%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/edit.blade.php (76%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/form.blade.php (70%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/list.blade.php (76%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/partials/block_price.blade.php (100%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/partials/block_price_new.blade.php (100%) rename resources/views/{Shop/Admin/PriceGenericCategories => admin/Shop/PriceListValues}/partials/filters.blade.php (100%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/partials/list-prices.blade.php (81%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/partials/prices.blade.php (91%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/partials/table-prices.blade.php (100%) rename resources/views/{Shop/Admin/PriceGenerics => admin/Shop/PriceListValues}/show.blade.php (100%) create mode 100644 resources/views/admin/Shop/PriceLists/create.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/edit.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/form.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/list.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/modal.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/partials/block_price.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/partials/block_price_new.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/partials/filters.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/partials/list-prices.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/partials/prices.blade.php create mode 100644 resources/views/admin/Shop/PriceLists/partials/table-prices.blade.php rename resources/views/{Shop/Admin/TagGroups => admin/Shop/PriceLists}/show.blade.php (100%) create mode 100644 resources/views/admin/Shop/SaleChannels/create.blade.php create mode 100644 resources/views/admin/Shop/SaleChannels/edit.blade.php create mode 100644 resources/views/admin/Shop/SaleChannels/form.blade.php create mode 100644 resources/views/admin/Shop/SaleChannels/list.blade.php rename resources/views/{Shop/Admin/Tags => admin/Shop/SaleChannels}/show.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/TagGroups/create.blade.php (75%) rename resources/views/{Shop/Admin => admin/Shop}/TagGroups/edit.blade.php (75%) rename resources/views/{Shop/Admin => admin/Shop}/TagGroups/form.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/TagGroups/list.blade.php (79%) rename resources/views/{Shop/Admin/Unities => admin/Shop/TagGroups}/show.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Tags/create.blade.php (74%) rename resources/views/{Shop/Admin => admin/Shop}/Tags/edit.blade.php (75%) rename resources/views/{Shop/Admin => admin/Shop}/Tags/form.blade.php (100%) rename resources/views/{Shop/Admin => admin/Shop}/Tags/list.blade.php (76%) create mode 100644 resources/views/admin/Shop/Tags/show.blade.php create mode 100644 resources/views/admin/Shop/Tariffs/create.blade.php create mode 100644 resources/views/admin/Shop/Tariffs/edit.blade.php create mode 100644 resources/views/admin/Shop/Tariffs/form.blade.php create mode 100644 resources/views/admin/Shop/Tariffs/list.blade.php create mode 100644 resources/views/admin/Shop/Tariffs/show.blade.php rename resources/views/{Shop/Admin => admin/Shop}/Unities/create.blade.php (75%) rename resources/views/{Shop/Admin => admin/Shop}/Unities/edit.blade.php (73%) rename resources/views/{Shop/Admin => admin/Shop}/Unities/form.blade.php (58%) rename resources/views/{Shop/Admin => admin/Shop}/Unities/index.blade.php (72%) rename resources/views/{Shop/Admin => admin/Shop}/Unities/list.blade.php (78%) rename resources/views/{Shop/Admin => admin/Shop}/Unities/partials/filters.blade.php (100%) create mode 100644 resources/views/admin/Shop/Unities/show.blade.php create mode 100644 resources/views/admin/Shop/Variations/create.blade.php create mode 100644 resources/views/admin/Shop/Variations/edit.blade.php create mode 100644 resources/views/admin/Shop/Variations/form.blade.php create mode 100644 resources/views/admin/Shop/Variations/list.blade.php create mode 100644 resources/views/admin/Shop/Variations/show.blade.php create mode 100644 resources/views/auth/passwords/change_password.blade.php delete mode 100644 resources/views/load/appender.blade.php create mode 100644 resources/views/load/chart/chartjs.blade.php create mode 100644 resources/views/load/chart/highcharts.blade.php create mode 100644 resources/views/load/chart/highmaps.blade.php create mode 100644 resources/views/load/chart/maps.blade.php create mode 100644 resources/views/load/chart/maps.js create mode 100644 resources/views/load/chat/chat.blade.php create mode 100644 resources/views/load/chat/chatbot.blade.php create mode 100644 resources/views/load/codemirror.blade.php create mode 100644 resources/views/load/countdown.blade.php delete mode 100644 resources/views/load/editor.blade.php delete mode 100644 resources/views/load/editor/tinymce.blade.php delete mode 100644 resources/views/load/fileinput.blade.php rename resources/views/load/form/{editor => }/editor.blade.php (100%) create mode 100644 resources/views/load/mirada.blade.php delete mode 100644 resources/views/load/modal.blade.php create mode 100644 resources/views/load/pdf/pdfjs.blade.php create mode 100644 resources/views/load/pdf/pdfjs2.blade.php create mode 100644 resources/views/load/pdf/pdfobject.blade.php create mode 100644 resources/views/load/pdf/viewerjs.blade.php delete mode 100644 resources/views/load/select2.blade.php delete mode 100644 resources/views/load/set_options.blade.php create mode 100644 resources/views/load/slick.blade.php delete mode 100644 resources/views/load/toggle.blade.php create mode 100644 resources/views/load/url_on_tab.blade.php create mode 100644 resources/views/load/user.blade.php delete mode 100644 resources/views/users/permissions/create.blade.php delete mode 100644 resources/views/users/permissions/edit.blade.php delete mode 100644 resources/views/users/permissions/list.blade.php delete mode 100644 resources/views/users/roles/create.blade.php delete mode 100644 resources/views/users/roles/edit.blade.php delete mode 100644 resources/views/users/roles/list.blade.php delete mode 100644 resources/views/users/teams/create.blade.php delete mode 100644 resources/views/users/teams/edit.blade.php delete mode 100644 resources/views/users/teams/list.blade.php delete mode 100644 resources/views/users/users/agenda.blade.php delete mode 100644 resources/views/users/users/create.blade.php delete mode 100644 resources/views/users/users/edit.blade.php delete mode 100644 resources/views/users/users/list.blade.php delete mode 100644 resources/views/users/users/profile.blade.php rename routes/{Botanic/Admin => Admin/Botanic}/Families.php (100%) rename routes/{Botanic/Admin => Admin/Botanic}/Genres.php (100%) rename routes/{Botanic/Admin => Admin/Botanic}/Species.php (100%) rename routes/{Botanic/Admin => Admin/Botanic}/Varieties.php (100%) rename routes/{Botanic/Admin => Admin/Botanic}/route.php (61%) create mode 100644 routes/Admin/Shop/ArticleNatures.php rename routes/{Shop/Admin => Admin/Shop}/Articles.php (86%) rename routes/{Shop/Admin => Admin/Shop}/Categories.php (100%) create mode 100644 routes/Admin/Shop/CustomerAddresses.php rename routes/{Shop/Admin => Admin/Shop}/Customers.php (100%) rename routes/{Shop/Admin => Admin/Shop}/InvoiceItems.php (100%) rename routes/{Shop/Admin => Admin/Shop}/Invoices.php (100%) create mode 100644 routes/Admin/Shop/Offers.php rename routes/{Shop/Admin => Admin/Shop}/OrderPayments.php (100%) rename routes/{Shop/Admin => Admin/Shop}/Orders.php (100%) rename routes/{Shop/Admin => Admin/Shop}/Packages.php (53%) create mode 100644 routes/Admin/Shop/PriceListValues.php create mode 100644 routes/Admin/Shop/PriceLists.php create mode 100644 routes/Admin/Shop/SaleChannels.php rename routes/{Shop/Admin => Admin/Shop}/TagGroups.php (100%) rename routes/{Shop/Admin => Admin/Shop}/Tags.php (100%) create mode 100644 routes/Admin/Shop/TariffUnities.php create mode 100644 routes/Admin/Shop/Tariffs.php rename routes/{Shop/Admin => Admin/Shop}/Unities.php (54%) create mode 100644 routes/Admin/Shop/Variations.php rename routes/{Shop/Admin => Admin/Shop}/route.php (57%) delete mode 100644 routes/Shop/Admin/ArticleFamilies.php delete mode 100644 routes/Shop/Admin/ArticlePrices.php delete mode 100644 routes/Shop/Admin/Inventories.php delete mode 100644 routes/Shop/Admin/InventoryPlaces.php delete mode 100644 routes/Shop/Admin/PriceGenericCategories.php delete mode 100644 routes/Shop/Admin/PriceGenerics.php diff --git a/Gruntfile.js b/Gruntfile.js index 60be0934..86dddd71 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,121 +1,139 @@ var jsBase = [ 'node_modules/jquery/dist/jquery.min.js', - 'node_modules/jquery-migrate/jquery-migrate.min.js', + 'node_modules/jquery-migrate/dist/jquery-migrate.min.js', + 'node_modules/jquery-ui-dist/jquery-ui.min.js' +] + +var jsBootstrap = [ 'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js', + 'node_modules/bootbox/dist/bootbox.all.min.js', ] -var cssBase = [ - 'node_modules/bootstrap/dist/css/bootstrap.min.css', -] - -var cssIcons = [ - 'node_modules/font-awesome/css/font-awesome.css', -] - -var jsCompatibilty = [ +var jsCompat = [ 'node_modules/promise-polyfill/dist/polyfill.min.js', - 'node_modules/es6-promise/dist/es6-promise.min.js' + 'node_modules/es6-promise/dist/es6-promise.min.js', +] + + +var jsAdminLTE = [ + jsBase, + jsBootstrap, + 'node_modules/sizzle/dist/sizzle.min.js', + 'node_modules/admin-lte/dist/js/adminlte.min.js', + 'node_modules/toastr/build/toastr.min.js', ] var jsCoreInclude = [ -'build/js/include/core/appender.js', -// 'build/js/include/core/cache.js', -// 'build/js/include/core/handlebars.js', -// 'build/js/include/core/lang.js', + // 'build/js/include/core/appender.js', + // 'build/js/include/core/cache.js', + // 'build/js/include/core/handlebars.js', + // 'build/js/include/core/lang.js', 'build/js/include/core/objectLength.js', -// 'build/js/include/core/session.js', + // 'build/js/include/core/session.js', 'build/js/include/core/url.js', -// 'build/js/include/core/user.js', -// 'build/js/include/form/check_fields.js', -// 'build/js/include/form/checkbox.js', -// 'build/js/include/form/datetime.js', -// 'build/js/include/form/multi-select.js', -// 'build/js/include/form/radio.js', -// 'build/js/include/form/select.js', + 'build/js/include/core/user.js', + // 'build/js/include/form/check_fields.js', + // 'build/js/include/form/checkbox.js', + // 'build/js/include/form/datetime.js', + // 'build/js/include/form/multi-select.js', + 'build/js/include/form/radio.js', + // 'build/js/include/form/select.js', 'build/js/include/form/upload.js', -// 'build/js/include/form/validator.js', + 'build/js/include/form/validator.js', 'build/js/include/layout/animate.js', -// 'build/js/include/layout/message.js', -// 'build/js/include/layout/modal.js', + 'build/js/include/layout/message.js', + // 'build/js/include/layout/modal.js', 'build/js/include/layout/scroll.js', -// 'build/js/include/layout/tooltip.js', -// 'build/js/include/datatable.js', + 'build/js/include/layout/tooltip.js', + // 'build/js/include/datatable.js', 'build/js/include/file.js', 'build/js/include/uploader.js', ] -var jsMain = [ -// 'node_modules/sweetalert2/dist/sweetalert2.all.min.js', -// 'node_modules/inputmask/dist/min/jquery.inputmask.bundle.min.js', -/* 'node_modules/summernote/dist/summernote.min.js', - 'node_modules/summernote/dist/lang/summernote-fr-FR.min.js', -*/ -// 'node_modules/@activix/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js', -// 'node_modules/@activix/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js', - 'node_modules/bootstrap-fileinput/js/plugins/piexif.min.js', - 'node_modules/bootstrap-fileinput/js/plugins/sortable.min.js', -// 'node_modules/bootstrap-slider/dist/bootstrap-slider.min.js', -// 'node_modules/bootstrap-validate/dist/bootstrap-validate.js', -// 'node_modules/jQuery-QueryBuilder/dist/js/jquery-builder.standalone.min.js', -/* 'node_modules/jQuery-QueryBuilder/dist/i18n/query-builder.fr.js', */ -/* 'node_modules/isotope-layout/dist/isotope.pkgd.min.js', */ +var jsBundle = [ + 'node_modules/jquery-ui-sortable/jquery-ui.min.js', 'node_modules/jquery-serializejson/jquery.serializejson.min.js', - 'node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js', - 'node_modules/wew.js/dist/wew.min.js', - 'node_modules/jquery.are-you-sure/jquery.are-you-sure.js', -/* 'node_modules/letteringjs/jquery.lettering.js', */ -/* 'node_modules/textillate/jquery.textillate.js', */ - 'node_modules/jqtree/tree.jquery.js', - 'node_modules/numeral/min/numeral.min.js', - 'node_modules/numeral/min/locales/fr.min.js', - 'build/js/include/plugins/jquery.hcaptions.js', - jsCoreInclude - // 'build/js/include/confirm.js', + // 'node_modules/moment/min/moment.min.js', + 'node_modules/jquery-placeholder/jquery.placeholder.js', + // 'node_modules/daterangepicker/daterangepicker.js', + // 'node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js', + // 'node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js', + 'node_modules/@claviska/jquery-minicolors/jquery.minicolors.js', + 'node_modules/bootstrap-validate/dist/bootstrap-validate.js', + 'node_modules/bootstrap-validator/dist/validator.min.js', + 'node_modules/jquery-validation/dist/jquery.validate.min.js', + 'node_modules/jquery-confirm/dist/jquery-confirm.min.js', + 'node_modules/jquery.cookie/jquery.cookie.js', + 'node_modules/jquery.filer/js/jquery.filer.min.js', + 'node_modules/jquery-file-download/src/Scripts/jquery.fileDownload.js', + 'node_modules/jquery-jeditable/dist/jquery.jeditable.min.js', + 'node_modules/jquery.quicksearch/dist/jquery.quicksearch.min.js', + 'node_modules/jquery.nicescroll/dist/jquery.nicescroll.js', + 'node_modules/jquery-slimscroll/jquery.slimscroll.min.js', + // 'node_modules/superclick/dist/js/superclick.min.js', + // 'node_modules/dropzone/dist/min/dropzone.min.js', + 'node_modules/handlebars/dist/handlebars.min.js', + 'node_modules/swag/lib/swag.min.js', + 'node_modules/multiselect/js/jquery.multi-select.js', + 'node_modules/screenfull/dist/screenfull.js', + 'node_modules/underscore/underscore-min.js', + // 'Admin/js/themes/admin/layout.js', +// 'node_modules/wew.js/dist/wew.min.js' +] + +var jsMain = [ + jsCompat, + jsCoreInclude, + jsBundle, +] + +var cssPrint = [ + // 'node_modules/bootstrap/dist/css/bootstrap.min.css', + 'node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css', + 'build/print.css' +] + +var cssBundle = [ + 'node_modules/bootstrap/dist/css/bootstrap.min.css', + 'node_modules/animate.css/animate.min.css', + 'node_modules/dropzone/dist/min/dropzone.min.css', + 'node_modules/daterangepicker/daterangepicker.css', + 'node_modules/jquery-confirm/dist/jquery-confirm.min.css', + 'node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css', + 'node_modules/bootstrap-sweetalert/dist/sweetalert.css', + 'node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css', + 'node_modules/@claviska/jquery-minicolors/jquery.minicolors.css', + 'node_modules/jquery.filer/css/jquery.filer.css', + 'node_modules/jquery.filer/css/themes/jquery.filer-dragdropbox-theme.css', + 'node_modules/jquery.filer/assets/fonts/jquery.filer-icons/jquery-filer.css', +] + +var cssIcons = [ + 'node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css', ] var cssMain = [ -// 'node_modules/sweetalert2/dist/sweetalert2.min.css', -// 'node_modules/inputmask/css/inputmask.css', -// 'node_modules/summernote/dist/summernote.css', -// 'node_modules/@activix/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css', -// 'node_modules/bootstrap-slider/dist/css/bootstrap-slider.min.css', -// 'node_modules/jQuery-QueryBuilder/dist/css/query-builder.default.min.css', - 'node_modules/animate.css/animate.min.css', - 'node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css', - 'node_modules/jqtree/jqtree.css', -// 'build/css/modal-option.css', - 'build/css/shadow.css', -// 'build/css/utility.css', - 'build/css/main.css' -] - -var jsSite = [ - jsBase -] - -var cssSite = [ - cssBase, + cssBundle, cssIcons, - 'node_modules/animate.css/animate.min.css', - 'build/css/shadow.css', - 'build/css/site.css' + 'build/css/main.css', ] var jsDataTables = [ + // 'build/Suite/js/datatables.js', 'node_modules/jszip/dist/jszip.min.js', 'node_modules/pdfmake/build/pdfmake.min.js', 'node_modules/pdfmake/build/vfs_fonts.js', - 'node_modules/datatables/media/js/jquery.dataTables.min.js', + 'node_modules/datatables.net/js/jquery.dataTables.min.js', 'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js', - 'node_modules/datatables.net-autofill/js/autoFill.min.js', - 'node_modules/datatables.net-autofill/js/autoFill.bootstrap.min.js', + 'node_modules/datatables.net-autofill/js/dataTables.autoFill.min.js', + 'node_modules/datatables.net-autofill-bs4/js/autoFill.bootstrap4.min.js', 'node_modules/datatables.net-buttons/js/dataTables.buttons.min.js', 'node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js', 'node_modules/datatables.net-buttons/js/buttons.html5.min.js', 'node_modules/datatables.net-buttons/js/buttons.print.min.js', 'node_modules/datatables.net-buttons/js/buttons.colVis.min.js', 'node_modules/datatables.net-colreorder/js/dataTables.colReorder.min.js', - 'node_modules/datatables.net-colreorder-bs4/js/dataTables.colReorder-bs4.min.js', + 'node_modules/datatables.net-colreorder-bs4/js/colReorder.bootstrap4.min.js', 'node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js', 'node_modules/datatables.net-fixedheader-bs4/js/fixedHeader.bootstrap4.min.js', 'node_modules/datatables.net-fixedcolumns/js/dataTables.fixedColumns.min.js', @@ -124,21 +142,18 @@ var jsDataTables = [ 'node_modules/datatables.net-keytable-bs4/js/keyTable.bootstrap4.min.js', 'node_modules/datatables.net-responsive/js/dataTables.responsive.min.js', 'node_modules/datatables.net-rowreorder/js/dataTables.rowReorder.min.js', - 'node_modules/datatables.net-rowreorder-bs4/js/dataTables.rowReorder.botstrap4.min.js', + 'node_modules/datatables.net-rowreorder-bs4/js/rowReorder.bootstrap4.min.js', 'node_modules/datatables.net-scroller/js/dataTables.scroller.min.js', 'node_modules/datatables.net-scroller-bs4/js/scroller.bootstrap4.min.js', 'node_modules/datatables.net-select/js/dataTables.select.min.js', 'node_modules/datatables.net-select-bs4/js/select.bootstrap4.min.js', - 'node_modules/yadcf/jquery.dataTables.yadcf.js', - 'build/js/modal.js', - 'build/js/datatables.js', + /* 'node_modules/yadcf/jquery.dataTables.yadcf.js', */ ]; var cssDataTables = [ - // 'node_modules/datatables/media/css/jquery.dataTables.min.css', 'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css', + 'node_modules/datatables.net-autofill-bs4/css/autoFill.bootstrap4.min.css', 'node_modules/dataTables.net-buttons-bs4/css/buttons.bootstrap4.min.css', - 'node_modules/datatables.net-autofill/css/autoFill.bootstrap.min.css', 'node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css', 'node_modules/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.min.css', 'node_modules/datatables.net-fixedcolumns-bs4/css/fixedColumns.bootstrap4.min.css', @@ -146,18 +161,9 @@ var cssDataTables = [ 'node_modules/datatables.net-rowreorder-bs4/css/rowReorder.bootstrap4.min.css', 'node_modules/datatables.net-scroller-bs4/css/scroller.bootstrap4.min.css', 'node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css', - 'node_modules/yadcf/jquery.dataTables.yadcf.css', - 'build/dataTables.bootstrap.min.css', +/* 'node_modules/yadcf/jquery.dataTables.yadcf.css', */ ]; -var jsCalendar = [ - 'node_modules/fullcalendar/dist/fullcalendar.min.js', - 'node_modules/fullcalendar/dist/locale/fr.js' -] - -var cssCalendar = [ - 'node_modules/fullcalendar/dist/fullcalendar.min.css', -] module.exports = function(grunt) { @@ -171,28 +177,19 @@ module.exports = function(grunt) { build: { files: [ { - 'public/js/main.min.js': jsMain, - 'public/js/site.js': jsSite, - 'public/js/datatables.min.js': jsDataTables, - 'public/js/calendar.min.js': jsCalendar - }, - { - expand: true, - cwd: 'build/js/modules', - src: '**/*.js', - dest: 'public/js', - rename: function (dest, src) { - return dest + '/' + src.replace('.js', '.min.js'); - } + 'public/assets/js/main.min.js': jsMain, + 'public/assets/css/main.min.css': cssMain, + 'public/assets/plugins/datatables.min.js': jsDataTables, + 'public/assets/plugins/adminlte/adminlte.min.js': jsAdminLTE }, ] }, }, eslint: { - target: ['build/js/*'] + target: ['public/assets/js/*'] }, webstandards: { - 'src': ['build/js/*'] + 'src': ['public/assets/js/*'] }, concat: { options: { @@ -200,36 +197,28 @@ module.exports = function(grunt) { }, mainjs: { src: jsMain, - dest: 'public/js/main.min.js' + dest: 'public/assets/js/main.min.js' }, maincss: { src: cssMain, - dest: 'public/css/main.min.css' + dest: 'public/assets/css/main.min.css' }, - sitejs: { - src: jsSite, - dest: 'public/js/site.min.js' + printcss: { + src: cssPrint, + dest: 'public/assets/css/print.min.css' }, - sitecss: { - src: cssSite, - dest: 'public/css/site.min.css' + adminltejs: { + src: jsAdminLTE, + dest: 'public/assets/plugins/adminlte/adminlte.min.js' }, datatablesjs: { src: jsDataTables, - dest: 'public/js/datatables.min.js' + dest: 'public/assets/plugins/datatables.min.js' }, datatablescss: { src: cssDataTables, - dest: 'public/css/datatables.min.css' + dest: 'public/assets/plugins/datatables.min.css' }, - calendarjs: { - src: jsCalendar, - dest: 'public/js/calendar.min.js' - }, - calendarcss: { - src: cssCalendar, - dest: 'public/css/calendar.min.css' - } }, cssmin: { options: { @@ -239,7 +228,10 @@ module.exports = function(grunt) { target: { files: [ { - 'public/css/main.min.css': cssMain + 'public/assets/css/main.min.css': cssMain + }, + { + 'public/assets/css/print.min.css': cssPrint }, ] } @@ -249,33 +241,81 @@ module.exports = function(grunt) { files: [ { expand: true, - cwd: 'node_modules/bootstrap/dist/fonts/', + cwd: 'node_modules/@fortawesome/fontawesome-free/webfonts/', src: ['**'], - dest: 'public/fonts/' + dest: 'public/assets/fonts/' }, { expand: true, - cwd: 'node_modules/font-awesome/fonts/', + cwd: 'build/fonts', src: ['**'], - dest: 'public/fonts/' + dest: 'public/assets/fonts/' }, { expand: true, - cwd: 'node_modules/summernote/dist/font/', + cwd: 'build/img', src: ['**'], - dest: 'public/css/font/' + dest: 'public/assets/img/' }, { expand: true, - cwd: 'node_modules/datatables/media/images/', + cwd: 'build/lang', src: ['**'], - dest: 'public/images/' + dest: 'public/assets/lang/' }, { expand: true, - cwd: 'node_modules/bootstrap4-toggle/', + cwd: 'build/plugins', src: ['**'], - dest: 'public/assets/plugins/bootstrap4-toggle', + dest: 'public/assets/plugins/' + }, + { + expand: true, + cwd: 'build/assets/tpl', + src: ['**'], + dest: 'public/assets/tpl/' + }, + { + expand: true, + cwd: 'node_modules/owp.glyphicons/', + src: ['**'], + dest: 'public/assets/fonts/glyphicons' + }, + { + expand: true, + cwd: 'node_modules/summernote/dist/', + src: ['**'], + dest: 'public/assets/plugins/summernote' + }, + { + expand: true, + cwd: 'node_modules/jquery.filer/assets/fonts/jquery.filer-icons/', + src: ['**'], + dest: 'public/assets/assets/fonts/jquery.filer-icons/' + }, + { + expand: true, + cwd: 'node_modules/icheck/skins/square/', + src: ['blue.png'], + dest: 'public/assets/apps/Admin/css/' + }, + { + expand: true, + cwd: 'node_modules/icheck/skins/square/', + src: ['blue@2x.png'], + dest: 'public/assets/apps/Admin/css/' + }, + { + expand: true, + cwd: 'node_modules/@claviska/jquery-minicolors/', + src: ['jquery.minicolors.png'], + dest: 'public/assets/css/' + }, + { + expand: true, + cwd: 'node_modules/@claviska/jquery-minicolors/', + src: ['jquery.minicolors.*'], + dest: 'public/assets/plugins/jquery-minicolors', }, { expand: true, @@ -285,9 +325,219 @@ module.exports = function(grunt) { }, { expand: true, - cwd: 'build/img/', + cwd: 'node_modules/jquery.quicksearch/dist/', + src: ['jquery.quicksearch.min.js.map'], + dest: 'public/assets/js/' + }, + { + expand: true, + cwd: 'node_modules/jquery.quicksearch/dist/', + src: ['**/*.map'], + dest: 'public/js' + }, + { + expand: true, + cwd: 'node_modules/pdfmake/build/', + src: ['pdfmake.min.js.map'], + dest: 'public/assets/plugins/' + }, + { + expand: true, + cwd: 'build/Suite/js/widgets/daterangepicker/Lang', src: ['**'], - dest: 'public/img/' + dest: 'public/assets/plugins/daterangepicker', + }, + { + expand: true, + cwd: 'node_modules/chart.js/dist/', + src: ['**'], + dest: 'public/assets/plugins/chartjs' + }, + { + expand: true, + cwd: 'node_modules/highcharts/', + src: ['**'], + dest: 'public/assets/plugins/highcharts' + }, + { + expand: true, + cwd: 'node_modules/@highcharts/map-collection/', + src: ['**'], + dest: 'public/assets/plugins/highcharts/map', + }, + { + expand: true, + cwd: 'node_modules/nestable2/dist/', + src: ['**'], + dest: 'public/assets/plugins/nestable2' + }, + { + expand: true, + cwd: 'node_modules/jquery.fancytree/dist/', + src: ['**'], + dest: 'public/assets/plugins/fancytree' + }, + { + expand: true, + cwd: 'node_modules/bootstrap-autocomplete/dist/latest/', + src: ['bootstrap-autocomplete.min.js'], + dest: 'public/assets/plugins/autocomplete' + }, + { + expand: true, + cwd: 'node_modules/slick-carousel/slick/', + src: ['**'], + dest: 'public/assets/plugins/slick', + }, + { + expand: true, + cwd: 'node_modules/jquery-slimscroll/', + src: ['jquery.slimscroll.min.js'], + dest: 'public/assets/plugins', + }, + { + expand: true, + cwd: 'node_modules/jquery.nicescroll/dist/', + src: ['jquery.nicescroll.min.js'], + dest: 'public/assets/plugins', + }, + { + expand: true, + cwd: 'node_modules/bootstrap4-toggle/', + src: ['**'], + dest: 'public/assets/plugins/bootstrap4-toggle', + }, + { + expand: true, + cwd: 'node_modules/bootstrap-fileinput/css/', + src: ['**/*.min.css'], + dest: 'public/assets/plugins/bootstrap-fileinput/css', + }, + { + expand: true, + cwd: 'node_modules/bootstrap-fileinput/js/', + src: ['**'], + dest: 'public/assets/plugins/bootstrap-fileinput/js', + }, + { + expand: true, + cwd: 'node_modules/bootstrap-fileinput/img/', + src: ['**'], + dest: 'public/assets/plugins/bootstrap-fileinput/img', + }, + { + expand: true, + cwd: 'node_modules/bootstrap-fileinput/themes/fa/', + src: ['**'], + dest: 'public/assets/plugins/bootstrap-fileinput/themes/fa', + }, + { + expand: true, + cwd: 'node_modules/bootstrap-fileinput/themes/fas/', + src: ['**'], + dest: 'public/assets/plugins/bootstrap-fileinput/themes/fas', + }, + { + expand: true, + cwd: 'node_modules/pdfobject/', + src: ['**'], + dest: 'public/assets/plugins/pdfobject', + }, + { + expand: true, + cwd: 'build/plugins/pdfjs/', + src: ['**'], + dest: 'public/assets/plugins/pdfjs', + }, + { + expand: true, + cwd: 'node_modules/bootstrap4-duallistbox/dist/', + src: ['*.min.*'], + dest: 'public/assets/plugins/bootstrap4-duallistbox', + }, + { + expand: true, + cwd: 'node_modules/select2/dist/', + src: ['**'], + dest: 'public/assets/plugins/select2', + }, + { + expand: true, + cwd: 'node_modules/tempusdominus-bootstrap-4/build/', + src: ['**'], + dest: 'public/assets/plugins/datepicker', + }, + { + expand: true, + cwd: 'node_modules/moment/min/', + src: ['**'], + dest: 'public/assets/plugins/moment', + }, + { + expand: true, + cwd: 'node_modules/bootstrap-fileinput/js/', + src: ['**'], + dest: 'public/assets/plugins/fileinput', + }, + { + expand: true, + cwd: 'node_modules/bootstrap-fileinput/css/', + src: ['**'], + dest: 'public/assets/plugins/fileinput', + }, + { + expand: true, + cwd: 'node_modules/bootstrap-fileinput/themes/', + src: ['**'], + dest: 'public/assets/plugins/fileinput', + }, + { + expand: true, + cwd: 'node_modules/tinymce/', + src: ['**'], + dest: 'public/assets/plugins/tinymce', + }, + { + expand: true, + cwd: 'build/js/include/plugins/datatables_lang/', + src: ['*.json'], + dest: 'public/assets/plugins/datatables_lang', + }, + { + expand: true, + cwd: 'vendor/sebastienheyd/boilerplate/src/public/plugins/tinymce/plugins/', + src: ['**'], + dest: 'public/assets/plugins/tinymce/plugins', + }, + { + expand: true, + cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/plugins/stickytoolbar/', + src: ['**'], + dest: 'public/assets/plugins/tinymce/plugins/stickytoolbar', + }, + { + expand: true, + cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/langs/', + src: ['**'], + dest: 'public/assets/plugins/tinymce/langs', + }, + { + expand: true, + cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/skins/', + src: ['**'], + dest: 'public/assets/plugins/tinymce/skins/ui', + }, + { + expand: true, + cwd: 'vendor/sebastienheyd/boilerplate/src/public/plugins/tinymce/skins/ui/boilerplate/', + src: ['**'], + dest: 'public/assets/plugins/tinymce/skins/ui/boilerplate', + }, + { + expand: true, + cwd: 'build/js/include/', + src: ['boilerplate.js'], + dest: 'public/assets/plugins', }, ], } @@ -295,11 +545,21 @@ module.exports = function(grunt) { watch: { dist: { files: [ - 'build/*', + 'Admin/*', ], tasks: ['concat', 'copy'] } }, + handlebars: { + compile: { + options: { + namespace: "JST" + }, + files: { + "assets/tpl/content.hbs": "public/assets/tpl/content.hbs" + } + } + } }); // Load the plugin that provides the "uglify" task. diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a8c51585..db7c2e24 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -19,7 +19,7 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule + * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) @@ -37,6 +37,6 @@ class Kernel extends ConsoleKernel { $this->load(__DIR__.'/Commands'); - require base_path('routes/console.php'); + include base_path('routes/console.php'); } } diff --git a/app/Datatables/Botanic/FamiliesDataTable.php b/app/Datatables/Botanic/FamiliesDataTable.php index aa35023d..fd48d551 100644 --- a/app/Datatables/Botanic/FamiliesDataTable.php +++ b/app/Datatables/Botanic/FamiliesDataTable.php @@ -8,25 +8,24 @@ use App\Models\Botanic\Family; class FamiliesDataTable extends DataTable { - public $model_name = 'families'; + public $model_name = 'families'; - public function query(Family $model) - { - $model = $model::withCount(['genres','species','varieties']); - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('name')->title('Nom'), - Column::make('alias'), - Column::make('latin'), - Column::make('genres_count')->title('Nb genres')->searchable(false)->addClass('text-right'), - Column::make('species_count')->title('Nb espèces')->searchable(false)->addClass('text-right'), - Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'), - self::makeColumnButtons(), - ]; - } + public function query(Family $model) + { + $model = $model::withCount(['genres','species','varieties']); + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('name')->title('Nom'), + Column::make('alias'), + Column::make('latin'), + Column::make('genres_count')->title('Nb genres')->searchable(false)->addClass('text-right'), + Column::make('species_count')->title('Nb espèces')->searchable(false)->addClass('text-right'), + Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Botanic/GenresDataTable.php b/app/Datatables/Botanic/GenresDataTable.php index 0d28db6c..64e7d56e 100644 --- a/app/Datatables/Botanic/GenresDataTable.php +++ b/app/Datatables/Botanic/GenresDataTable.php @@ -19,11 +19,12 @@ class GenresDataTable extends DataTable public function modifier($datatables) { $datatables - ->editColumn('family_name', function(Genre $genre) { - return $genre->family ? $genre->family->name : ''; - }) - ->rawColumns(['genre_name', 'action']) - ; + ->editColumn( + 'family_name', function (Genre $genre) { + return $genre->family ? $genre->family->name : ''; + } + ) + ->rawColumns(['genre_name', 'action']); return Parent::modifier($datatables); } @@ -39,5 +40,4 @@ class GenresDataTable extends DataTable self::makeColumnButtons(), ]; } - } diff --git a/app/Datatables/Botanic/SpeciesDataTable.php b/app/Datatables/Botanic/SpeciesDataTable.php index babe4dfc..fde75326 100644 --- a/app/Datatables/Botanic/SpeciesDataTable.php +++ b/app/Datatables/Botanic/SpeciesDataTable.php @@ -8,36 +8,36 @@ use App\Models\Botanic\Specie; class SpeciesDataTable extends DataTable { - public $model_name = 'species'; + public $model_name = 'species'; - public function query(Specie $model) - { - $model = $model::withCount('varieties')->with('genre'); - return self::buildQuery($model); - } + public function query(Specie $model) + { + $model = $model::withCount('varieties')->with('genre'); + return self::buildQuery($model); + } - public function modifier($datatables) - { - $datatables - ->editColumn('genre_name', function(Specie $specie) { - return $specie->genre ? $specie->genre->name : ''; - }) - ->rawColumns(['genre_name', 'action']) - ; - return Parent::modifier($datatables); - } + public function modifier($datatables) + { + $datatables + ->editColumn( + 'genre_name', function (Specie $specie) { + return $specie->genre ? $specie->genre->name : ''; + } + ) + ->rawColumns(['genre_name', 'action']); + return Parent::modifier($datatables); + } - protected function getColumns() - { - return [ - Column::make('name')->title('Nom'), - Column::make('alias'), - Column::make('genre.name')->data('genre_name')->title('Genre'), - Column::make('latin'), - Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'), - self::makeColumnButtons(), - ]; - } - + protected function getColumns() + { + return [ + Column::make('name')->title('Nom'), + Column::make('alias'), + Column::make('genre.name')->data('genre_name')->title('Genre'), + Column::make('latin'), + Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Botanic/VarietiesDataTable.php b/app/Datatables/Botanic/VarietiesDataTable.php index e11e0368..6170e719 100644 --- a/app/Datatables/Botanic/VarietiesDataTable.php +++ b/app/Datatables/Botanic/VarietiesDataTable.php @@ -8,39 +8,40 @@ use App\Models\Botanic\Variety; class VarietiesDataTable extends DataTable { - public $model_name = 'varieties'; + public $model_name = 'varieties'; - public function query(Variety $model) - { - // $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*'); - $model = $model::joinRelations('Specie')->select('botanic_varieties.*','botanic_species.name as specie_name')->with('Specie')->withCount('Articles'); - return self::buildQuery($model); - } + public function query(Variety $model) + { + // $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*'); + $model = $model::joinRelations('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with('Specie')->withCount('Articles'); + return self::buildQuery($model); + } - public function modifier($datatables) - { - $datatables - ->editColumn('photo', function(Variety $variety) { - $media = $variety->getFirstMedia(); - dump($variety); - return "{{ $media('thumb') }}"; - }) - ->rawColumns(['photo', 'action']) - ; - return Parent::modifier($datatables); - } + public function modifier($datatables) + { + $datatables + ->editColumn( + 'photo', function (Variety $variety) { + $media = $variety->getFirstMedia(); + // dump($media); + // return $media('thumb'); + return ''; + } + ) + ->rawColumns(['photo', 'action']); + return Parent::modifier($datatables); + } - protected function getColumns() - { - return [ - Column::make('Specie.name')->data('specie_name')->title('Espèce'), - Column::make('name')->title('Nom'), - Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false), - Column::make('photo')->title('')->searchable(false)->orderable(false), - self::makeColumnButtons(), - ]; - } - + protected function getColumns() + { + return [ + Column::make('Specie.name')->data('specie_name')->title('Espèce'), + Column::make('name')->title('Nom'), + Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false), + Column::make('photo')->title('')->searchable(false)->orderable(false), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/ParentDataTable.php b/app/Datatables/ParentDataTable.php index 399293f1..a2182e9e 100644 --- a/app/Datatables/ParentDataTable.php +++ b/app/Datatables/ParentDataTable.php @@ -10,195 +10,200 @@ use Yajra\DataTables\Services\DataTable; class ParentDataTable extends DataTable { - public $rowReorder = true; - public $rowReorderSelector; // ['selector' => 'tr'] - public $colReorder = false; - public $fixedColumns = false; - public $scrollX = false; - public $scrollCollapse = true; - public $sortedColumn = 0; - public $sortedOrder = 'asc'; - public $stateSave = false; + public $rowReorder = true; + public $rowReorderSelector; // ['selector' => 'tr'] + public $colReorder = false; + public $fixedColumns = false; + public $scrollX = false; + public $scrollCollapse = true; + public $sortedColumn = 0; + public $sortedOrder = 'asc'; + public $stateSave = false; - /** - * Build DataTable class. - * - * @param mixed $query Results from query() method. - * @return \Yajra\DataTables\DataTableAbstract - */ - public function dataTable($query) - { - return $this->modifier(datatables()->eloquent($query)); - } + /** + * Build DataTable class. + * + * @param mixed $query Results from query() method. + * @return \Yajra\DataTables\DataTableAbstract + */ + public function dataTable($query) + { + return $this->modifier(datatables()->eloquent($query)); + } - public function modifier($datatables) - { - return $this->addButtons($datatables->setRowId('{{$id}}')); - } + public function modifier($datatables) + { + return $this->addButtons($datatables->setRowId('{{$id}}')); + } - /** - * Add buttons DataTable class. - * - * @param mixed $query Results from query() method. - * @return \Yajra\DataTables\DataTableAbstract - */ - public function addButtons($datatables) - { - return $datatables->addColumn('action', $this->getHtmlButtons()); - } + /** + * Add buttons DataTable class. + * + * @param mixed $query Results from query() method. + * @return \Yajra\DataTables\DataTableAbstract + */ + public function addButtons($datatables) + { + return $datatables->addColumn('action', $this->getHtmlButtons()); + } - public function getHtmlButtons() - { - $buttons = ''; + public function getHtmlButtons() + { + $buttons = ''; - // $buttons .= ''; - // $buttons .= ''; - $buttons .= ''; - $buttons .= ''; - return $buttons; - // return view('components.datatables.buttons.row_action'); - } + // $buttons .= ''; + // $buttons .= ''; + $buttons .= ''; + $buttons .= ''; + return $buttons; + // return view('components.datatables.buttons.row_action'); + } - public function makeColumnButtons() - { - return Column::computed('action') - ->title('') - ->exportable(false) - ->printable(false) - ->searchable(false) - ->width("74") - ->addClass('text-center text-nowrap'); - } + public function makeColumnButtons() + { + return Column::computed('action') + ->title('') + ->exportable(false) + ->printable(false) + ->searchable(false) + ->width("74") + ->addClass('text-center text-nowrap'); + } - public static function isFilteredByField($field) - { - return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false); - } + public static function isFilteredByField($field) + { + return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false); + } - /** - * Get query source of dataTable. - * - * @param \App\Family $model - * @return \Illuminate\Database\Eloquent\Builder - */ - public function buildQuery($model) - { - return $model->newQuery(); - } - - /** - * Optional method if you want to use html builder. - * - * @return \Yajra\DataTables\Html\Builder - */ - public function html() - { - return $this->buildHtml(strtolower($this->model_name) . '-table'); - } + /** + * Get query source of dataTable. + * + * @param \App\Family $model + * @return \Illuminate\Database\Eloquent\Builder + */ + public function buildQuery($model) + { + return $model->newQuery(); + } + + /** + * Optional method if you want to use html builder. + * + * @return \Yajra\DataTables\Html\Builder + */ + public function html() + { + return $this->buildHtml(strtolower($this->model_name) . '-table'); + } - /** - * Optional method if you want to use html builder. - * - * @return \Yajra\DataTables\Html\Builder - */ - public function buildHtml($table_id = false, $selector = false) - { - $table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table'; - $selector = $selector ? $selector : '#' . $this->model_name . '-filters'; - return $this->builder() - ->setTableId($table_id) - ->parameters($this->getParameters()) - ->columns($this->getColumns()) - ->ajax([ - 'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }', - 'url' => isset($this->url) ? $this->url : '' - ]) - ->dom($this->getDom()) - ->orderBy($this->sortedColumn,$this->sortedOrder) - ->buttons($this->getButtons()); - } + /** + * Optional method if you want to use html builder. + * + * @return \Yajra\DataTables\Html\Builder + */ + public function buildHtml($table_id = false, $selector = false) + { + $table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table'; + $selector = $selector ? $selector : '#' . $this->model_name . '-filters'; + return $this->builder() + ->setTableId($table_id) + ->parameters($this->getParameters()) + ->columns($this->getColumns()) + ->ajax( + [ + 'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }', + 'url' => isset($this->url) ? $this->url : '' + ] + ) + ->dom($this->getDom()) + ->orderBy($this->sortedColumn, $this->sortedOrder) + ->buttons($this->getButtons()); + } - public function getButtons() { - return [ - Button::make('export'), - Button::make('print'), - Button::make('colvis'), - Button::make('columnsToggle') - ]; - } + public function getButtons() + { + return [ + Button::make('export'), + Button::make('print'), + Button::make('colvis'), + Button::make('columnsToggle') + ]; + } - public function getParameters() - { - $data = [ - 'pageLength' => 5, - 'scrollX' => $this->scrollX, - 'scrollCollapse' => $this->scrollCollapse, - 'searchDelay' => 500, - 'colReorder' => $this->colReorder, - 'fixedColumns' => $this->fixedColumns, - // 'autoWidth' => false, - 'stateSave' => $this->stateSave - ]; - if ($this->rowReorder) { - $data['rowReorder'] = ['selector' => $this->rowReorderSelector]; - } - return $data; - } + public function getParameters() + { + $data = [ + 'pageLength' => 5, + 'scrollX' => $this->scrollX, + 'scrollCollapse' => $this->scrollCollapse, + 'searchDelay' => 500, + 'colReorder' => $this->colReorder, + 'fixedColumns' => $this->fixedColumns, + // 'autoWidth' => false, + 'stateSave' => $this->stateSave + ]; + if ($this->rowReorder) { + $data['rowReorder'] = ['selector' => $this->rowReorderSelector]; + } + return $data; + } - public function getDom() - { - $dom = ''; - // $dom .= $this->getDatatablesHeaderDefault(); - $dom .= "rt"; - $dom .= $this->getDatatablesFooterDefault(); - return $dom; - } + public function getDom() + { + $dom = ''; + // $dom .= $this->getDatatablesHeaderDefault(); + $dom .= "rt"; + $dom .= $this->getDatatablesFooterDefault(); + return $dom; + } - public function getDatatablesHeader() { - return view('components.datatables.header'); - } + public function getDatatablesHeader() + { + return view('components.datatables.header'); + } - public function getDatatablesHeaderDefault() { - // return "
"; - /* - - $dom = 't<"row datatable-pager light"<"col-md-12"' - . '<"datatable-more-export-buttons filter-buttons pull-left">' - . '<"datatable-more-export-favorites-buttons filter-buttons pull-left">' - . '<"datatable-more-export-basket-buttons filter-buttons pull-left">' - . '<"datatable-download-buttons filter-buttons pull-left">' - . '>>' - . '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>'; + public function getDatatablesHeaderDefault() + { + // return "
"; + /* - */ - - $dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>"; - return $dom; - // return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>'; + $dom = 't<"row datatable-pager light"<"col-md-12"' + . '<"datatable-more-export-buttons filter-buttons pull-left">' + . '<"datatable-more-export-favorites-buttons filter-buttons pull-left">' + . '<"datatable-more-export-basket-buttons filter-buttons pull-left">' + . '<"datatable-download-buttons filter-buttons pull-left">' + . '>>' + . '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>'; - } + */ + + $dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>"; + return $dom; + // return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>'; + } - public function getDatatablesFooterDefault() { - return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>"; - } + public function getDatatablesFooterDefault() + { + return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>"; + } - /** - * Get filename for export. - * - * @return string - */ - protected function filename() - { - return self::buildFilename($this->model_name); - } + /** + * Get filename for export. + * + * @return string + */ + protected function filename() + { + return self::buildFilename($this->model_name); + } - /** - * Get filename for export. - * - * @return string - */ - protected function buildFilename($name) - { - return $name . '_' . date('YmdHis'); - } -} \ No newline at end of file + /** + * Get filename for export. + * + * @return string + */ + protected function buildFilename($name) + { + return $name . '_' . date('YmdHis'); + } +} diff --git a/app/Datatables/Shop/ArticleFamiliesDataTable.php b/app/Datatables/Shop/ArticleFamiliesDataTable.php deleted file mode 100644 index af307353..00000000 --- a/app/Datatables/Shop/ArticleFamiliesDataTable.php +++ /dev/null @@ -1,28 +0,0 @@ -title('Nom'), - Column::make('articles_count')->title('Nb articles')->addClass('text-right'), - self::makeColumnButtons(), - ]; - } - -} diff --git a/app/Datatables/Shop/ArticleNaturesDataTable.php b/app/Datatables/Shop/ArticleNaturesDataTable.php new file mode 100644 index 00000000..de9dbed6 --- /dev/null +++ b/app/Datatables/Shop/ArticleNaturesDataTable.php @@ -0,0 +1,27 @@ +title('Nom'), + Column::make('articles_count')->title('Nb articles')->addClass('text-right'), + self::makeColumnButtons(), + ]; + } +} diff --git a/app/Datatables/Shop/ArticlesDataTable.php b/app/Datatables/Shop/ArticlesDataTable.php index 3bb7143a..f257a4e2 100644 --- a/app/Datatables/Shop/ArticlesDataTable.php +++ b/app/Datatables/Shop/ArticlesDataTable.php @@ -8,24 +8,22 @@ use App\Models\Shop\Article; class ArticlesDataTable extends DataTable { - public $model_name = 'articles'; + public $model_name = 'articles'; - public function query(Article $model) - { - // $model = $model::with('Family')->select('shop_articles.*','family.name as family_name')->join('shop_article_families as family', 'family.id', '=', 'shop_articles.article_family_id')->groupBy('shop_articles.id'); - $model = $model::with('article_family')->select('shop_articles.*'); - // $model = $model::joinRelations('Family')->select('shop_articles.*','shop_article_families.name as family_name'); - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('article_family.name')->title('Famille')->orderable(false), - Column::make('name')->title('Nom'), - self::makeColumnButtons(), - ]; - - } + public function query(Article $model) + { + // $model = $model::with('Family')->select('shop_articles.*','family.name as family_name')->join('shop_article_families as family', 'family.id', '=', 'shop_articles.article_family_id')->groupBy('shop_articles.id'); + $model = $model::with('article_nature')->select('shop_articles.*'); + // $model = $model::joinRelations('Family')->select('shop_articles.*','shop_article_families.name as family_name'); + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('article_nature.name')->title('Nature')->orderable(false), + Column::make('name')->title('Nom'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/CategoriesDataTable.php b/app/Datatables/Shop/CategoriesDataTable.php index d70a2955..5a631c1e 100644 --- a/app/Datatables/Shop/CategoriesDataTable.php +++ b/app/Datatables/Shop/CategoriesDataTable.php @@ -8,21 +8,20 @@ use App\Models\Shop\Category; class CategoriesDataTable extends DataTable { - public $model_name = 'categories'; + public $model_name = 'categories'; - public function query(Category $model) - { - $model = $model::withCount('articles'); - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('name')->title('Nom'), - Column::make('articles_count')->title('Nb Articles')->class('text-right')->searchable(false), - self::makeColumnButtons(), - ]; - } + public function query(Category $model) + { + $model = $model::withCount('articles'); + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('name')->title('Nom'), + Column::make('articles_count')->title('Nb Articles')->class('text-right')->searchable(false), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/CustomersDataTable.php b/app/Datatables/Shop/CustomersDataTable.php index 1f26340f..ebc6b70c 100644 --- a/app/Datatables/Shop/CustomersDataTable.php +++ b/app/Datatables/Shop/CustomersDataTable.php @@ -8,22 +8,21 @@ use App\Models\Shop\Customer; class CustomersDataTable extends DataTable { - public $model_name = 'customers'; + public $model_name = 'customers'; - public function query(Customer $model) - { - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('name')->title('Nom'), - Column::make('address')->title('Adresse'), - Column::make('zipcode')->title('Code postal'), - Column::make('city')->title('Ville'), - self::makeColumnButtons(), - ]; - } + public function query(Customer $model) + { + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('name')->title('Nom'), + Column::make('address')->title('Adresse'), + Column::make('zipcode')->title('Code postal'), + Column::make('city')->title('Ville'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/InvoicesDataTable.php b/app/Datatables/Shop/InvoicesDataTable.php index f13b576e..57f11fca 100644 --- a/app/Datatables/Shop/InvoicesDataTable.php +++ b/app/Datatables/Shop/InvoicesDataTable.php @@ -8,21 +8,20 @@ use App\Models\Shop\Invoice; class InvoicesDataTable extends DataTable { - public $model_name = 'Invoices'; + public $model_name = 'Invoices'; - public function query(Invoice $model) - { - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('status.name'), - Column::make('customer.name'), - Column::make('total'), - self::makeColumnButtons(), - ]; - } + public function query(Invoice $model) + { + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('status.name'), + Column::make('customer.name'), + Column::make('total'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/OffersDataTable.php b/app/Datatables/Shop/OffersDataTable.php new file mode 100644 index 00000000..d027b967 --- /dev/null +++ b/app/Datatables/Shop/OffersDataTable.php @@ -0,0 +1,28 @@ +with(['article','variation','tariff'])->select(['shop_offers.*']); + return self::buildQuery($model); + } + + protected function getColumns() + { + return [ + Column::make('article.name')->title('Article'), + Column::make('variation.name')->title('Déclinaison'), + Column::make('tariff.name')->title('Tarif'), + self::makeColumnButtons(), + ]; + } +} diff --git a/app/Datatables/Shop/OrdersDataTable.php b/app/Datatables/Shop/OrdersDataTable.php index 6084b3a2..09b6cf62 100644 --- a/app/Datatables/Shop/OrdersDataTable.php +++ b/app/Datatables/Shop/OrdersDataTable.php @@ -8,19 +8,18 @@ use App\Models\Shop\Order; class OrdersDataTable extends DataTable { - public $model_name = 'orders'; + public $model_name = 'orders'; - public function query(Product $model) - { - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('name'), - self::makeColumnButtons(), - ]; - } + public function query(Product $model) + { + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('name'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/PackagesDataTable.php b/app/Datatables/Shop/PackagesDataTable.php index 44a68457..9813494e 100644 --- a/app/Datatables/Shop/PackagesDataTable.php +++ b/app/Datatables/Shop/PackagesDataTable.php @@ -8,28 +8,18 @@ use App\Models\Shop\Package; class PackagesDataTable extends DataTable { - public $model_name = 'packages'; + public $model_name = 'packages'; - public function query(Package $model) - { - $model = $model::with(['article_family'])->select('shop_packages.*'); - $model = self::filterByFamily($model); - return self::buildQuery($model); - } - - public static function filterByFamily($model, $family_id = false) - { - $family_id = $family_id ? $family_id : self::isFilteredByField('family_id'); - return $family_id ? $model->byArticleFamily($family_id) : $model; - } - - protected function getColumns() - { - return [ - Column::make('article_family.name')->title('Famille d\'articles'), - Column::make('value')->title('Valeur'), - self::makeColumnButtons(), - ]; - } + public function query(Package $model) + { + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('value')->title('Valeur'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/PriceGenericCategoriesDataTable.php b/app/Datatables/Shop/PriceGenericCategoriesDataTable.php index 95e21596..5af74331 100644 --- a/app/Datatables/Shop/PriceGenericCategoriesDataTable.php +++ b/app/Datatables/Shop/PriceGenericCategoriesDataTable.php @@ -8,21 +8,20 @@ use App\Models\Shop\PriceGenericCategory; class PriceGenericCategoriesDataTable extends DataTable { - public $model_name = 'price_generic_categories'; + public $model_name = 'price_generic_categories'; - public function query(PriceGenericCategory $model) - { - $model = $model->withCount('price_generics'); - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('name')->title('Nom'), - Column::make('price_generics_count')->title('Nb Tarifs')->class('text-right'), - self::makeColumnButtons(), - ]; - } + public function query(PriceGenericCategory $model) + { + $model = $model->withCount('price_generics'); + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('name')->title('Nom'), + Column::make('price_generics_count')->title('Nb Tarifs')->class('text-right'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/PriceGenericsDataTable.php b/app/Datatables/Shop/PriceGenericsDataTable.php deleted file mode 100644 index 320eb3fd..00000000 --- a/app/Datatables/Shop/PriceGenericsDataTable.php +++ /dev/null @@ -1,31 +0,0 @@ -withCount('prices'); - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('category.name')->title('Catégorie'), - Column::make('name')->title('Nom'), - Column::make('price_by_unit.price')->title('Prix HT')->class('text-right'), - Column::make('price_by_unit.price_taxed')->title('Prix TTC')->class('text-right'), - Column::make('prices_count')->title('Nb tarifs')->class('text-right'), - self::makeColumnButtons(), - ]; - } - -} diff --git a/app/Datatables/Shop/PriceListsDataTable.php b/app/Datatables/Shop/PriceListsDataTable.php new file mode 100644 index 00000000..60635dd4 --- /dev/null +++ b/app/Datatables/Shop/PriceListsDataTable.php @@ -0,0 +1,38 @@ +url = route('Admin.Shop.PriceLists.index'); + } + + public function query(PriceList $model) + { + $model = self::filterByTariff($model); + return self::buildQuery($model); + } + + public static function filterByTariff($model, $tariff_id = false) + { + $tariff_id = $tariff_id ? $tariff_id : self::isFilteredByField('tariff_id'); + return $tariff_id ? $model->byTariff($tariff_id) : $model; + } + + + protected function getColumns() + { + return [ + Column::make('name')->title('Nom'), + self::makeColumnButtons(), + ]; + } +} diff --git a/app/Datatables/Shop/SaleChannelsDataTable.php b/app/Datatables/Shop/SaleChannelsDataTable.php new file mode 100644 index 00000000..fcb754c7 --- /dev/null +++ b/app/Datatables/Shop/SaleChannelsDataTable.php @@ -0,0 +1,25 @@ +title('Nom'), + self::makeColumnButtons(), + ]; + } +} diff --git a/app/Datatables/Shop/TagGroupsDataTable.php b/app/Datatables/Shop/TagGroupsDataTable.php index 93d18d1a..48667349 100644 --- a/app/Datatables/Shop/TagGroupsDataTable.php +++ b/app/Datatables/Shop/TagGroupsDataTable.php @@ -8,21 +8,20 @@ use App\Models\Shop\TagGroup; class TagGroupsDataTable extends DataTable { - public $model_name = 'tag_groups'; + public $model_name = 'tag_groups'; - public function query(TagGroup $model) - { - $model = $model::withCount('tags'); - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('name'), - Column::make('tags_count')->title('Nb de tags')->searchable(false)->addClass('text-right'), - self::makeColumnButtons(), - ]; - } + public function query(TagGroup $model) + { + $model = $model::withCount('tags'); + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('name'), + Column::make('tags_count')->title('Nb de tags')->searchable(false)->addClass('text-right'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/TagsDataTable.php b/app/Datatables/Shop/TagsDataTable.php index 7fe2a3aa..48326937 100644 --- a/app/Datatables/Shop/TagsDataTable.php +++ b/app/Datatables/Shop/TagsDataTable.php @@ -8,23 +8,22 @@ use App\Models\Shop\Tag; class TagsDataTable extends DataTable { - public $model_name = 'tags'; - public $rowReorder = ['selector' => 'tr']; + public $model_name = 'tags'; + public $rowReorder = ['selector' => 'tr']; - public function query(Tag $model) - { - $model = $model::with('group')->select(['tags.*']); - return self::buildQuery($model); - } - - protected function getColumns() - { - return [ - Column::make('group.name')->title('Groupe'), - Column::make('sort_order')->title('Ordre'), - Column::make('name')->title('Nom'), - self::makeColumnButtons(), - ]; - } + public function query(Tag $model) + { + $model = $model::with('group')->select(['tags.*']); + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('group.name')->title('Groupe'), + Column::make('sort_order')->title('Ordre'), + Column::make('name')->title('Nom'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/TariffsDataTable.php b/app/Datatables/Shop/TariffsDataTable.php new file mode 100644 index 00000000..da6ec451 --- /dev/null +++ b/app/Datatables/Shop/TariffsDataTable.php @@ -0,0 +1,29 @@ +with(['sale_channel'])->select(['shop_tariffs.*']); + return self::buildQuery($model); + } + + protected function getColumns() + { + return [ + Column::make('sale_channel.name')->title('Canal de vente'), + Column::make('code')->title('Code'), + Column::make('ref')->title('Référence'), + Column::make('name')->title('Nom'), + self::makeColumnButtons(), + ]; + } +} diff --git a/app/Datatables/Shop/UnitiesDataTable.php b/app/Datatables/Shop/UnitiesDataTable.php index 4d1d32ba..cda6a972 100644 --- a/app/Datatables/Shop/UnitiesDataTable.php +++ b/app/Datatables/Shop/UnitiesDataTable.php @@ -8,29 +8,18 @@ use App\Models\Shop\Unity; class UnitiesDataTable extends DataTable { - public $model_name = 'unities'; + public $model_name = 'unities'; - public function query(Unity $model) - { - $model = $model::with(['package.article_family'])->select('shop_unities.*'); - $model = self::filterByFamily($model); - return self::buildQuery($model); - } - - public static function filterByFamily($model, $family_id = false) - { - $family_id = $family_id ? $family_id : self::isFilteredByField('family_id'); - return $family_id ? $model->byArticleFamily($family_id) : $model; - } - - protected function getColumns() - { - return [ - Column::make('package.article_family.name')->title('Famille'), - Column::make('package.value')->title('Package'), - Column::make('value')->title('Valeur'), - self::makeColumnButtons(), - ]; - } + public function query(Unity $model) + { + return self::buildQuery($model); + } + protected function getColumns() + { + return [ + Column::make('value')->title('Valeur'), + self::makeColumnButtons(), + ]; + } } diff --git a/app/Datatables/Shop/VariationsDataTable.php b/app/Datatables/Shop/VariationsDataTable.php new file mode 100644 index 00000000..27b073f9 --- /dev/null +++ b/app/Datatables/Shop/VariationsDataTable.php @@ -0,0 +1,28 @@ +with(['package','unity']); + return self::buildQuery($model); + } + + protected function getColumns() + { + return [ + Column::make('package.value')->title('Package'), + Column::make('quantity')->title('Quantité')->class('text-right'), + Column::make('unity.value')->title('Unité'), + self::makeColumnButtons(), + ]; + } +} diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 4a4a8d83..f95b3b3f 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -29,7 +29,7 @@ class Handler extends ExceptionHandler /** * Report or log an exception. * - * @param \Exception $exception + * @param \Exception $exception * @return void * * @throws \Exception @@ -42,8 +42,8 @@ class Handler extends ExceptionHandler /** * Render an exception into an HTTP response. * - * @param \Illuminate\Http\Request $request - * @param \Exception $exception + * @param \Illuminate\Http\Request $request + * @param \Exception $exception * @return \Symfony\Component\HttpFoundation\Response * * @throws \Exception diff --git a/app/Exports/Botanic/FamiliesExport.php b/app/Exports/Botanic/FamiliesExport.php index cb0f458d..2a5e0e20 100644 --- a/app/Exports/Botanic/FamiliesExport.php +++ b/app/Exports/Botanic/FamiliesExport.php @@ -12,9 +12,8 @@ class FamiliesExport implements FromQuery { use Exportable; - public function query() + public function query() { return Family::query(); } - -} \ No newline at end of file +} diff --git a/app/Exports/Botanic/GenresExport.php b/app/Exports/Botanic/GenresExport.php index 38b833f7..a0c0cd99 100644 --- a/app/Exports/Botanic/GenresExport.php +++ b/app/Exports/Botanic/GenresExport.php @@ -12,9 +12,8 @@ class GenresExport implements FromQuery { use Exportable; - public function query() + public function query() { return Genre::query(); } - -} \ No newline at end of file +} diff --git a/app/Exports/Botanic/SpeciesExport.php b/app/Exports/Botanic/SpeciesExport.php index 37c918ed..b9f668ea 100644 --- a/app/Exports/Botanic/SpeciesExport.php +++ b/app/Exports/Botanic/SpeciesExport.php @@ -12,9 +12,8 @@ class SpeciesExport implements FromQuery { use Exportable; - public function query() + public function query() { return Specie::query(); } - -} \ No newline at end of file +} diff --git a/app/Exports/Botanic/VarietiesExport.php b/app/Exports/Botanic/VarietiesExport.php index c747706e..77e8320d 100644 --- a/app/Exports/Botanic/VarietiesExport.php +++ b/app/Exports/Botanic/VarietiesExport.php @@ -12,9 +12,8 @@ class VarietiesExport implements FromQuery { use Exportable; - public function query() + public function query() { return Variety::query(); } - -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Admin/Botanic/Controller.php b/app/Http/Controllers/Admin/Botanic/Controller.php new file mode 100644 index 00000000..bfdb9c9c --- /dev/null +++ b/app/Http/Controllers/Admin/Botanic/Controller.php @@ -0,0 +1,13 @@ +render('Admin.Botanic.Families.list'); + } + + public function getDatatable(Request $request) + { + return Families::getTables($request->all()); + } + + public function create() + { + return view('Admin.Botanic.Families.create', $data ?? []); + } + + public function store(Request $request) + { + $data = $request->all(); + $ret = Families::store($data); + return redirect()->route('Admin.Botanic.Families.index'); + } + + public function show($id) + { + $data = Families::get($id); + return view('Admin.Botanic.Families.view', $data); + } + + public function edit($id) + { + $data['family'] = Families::get($id)->toArray(); + return view('Admin.Botanic.Families.edit', $data); + } + + public function destroy($id) + { + return Families::destroy($id); + } + + public function exportExcel() + { + return Families::exportExcel(); + } +} diff --git a/app/Http/Controllers/Botanic/Admin/GenreController.php b/app/Http/Controllers/Admin/Botanic/GenreController.php similarity index 60% rename from app/Http/Controllers/Botanic/Admin/GenreController.php rename to app/Http/Controllers/Admin/Botanic/GenreController.php index cab9ff1b..f0337ae8 100644 --- a/app/Http/Controllers/Botanic/Admin/GenreController.php +++ b/app/Http/Controllers/Admin/Botanic/GenreController.php @@ -1,9 +1,8 @@ render('Botanic.Admin.Genres.list'); + return $dataTable->render('Admin.Botanic.Genres.list'); } public function getDatatable(Request $request) @@ -23,26 +22,27 @@ class GenreController extends Controller public function create() { - return view('Botanic.Admin.Genres.create'); + $data['families'] = Families::getOptions(); + return view('Admin.Botanic.Genres.create', $data); } public function store(Request $request) { $ret = Genres::store($request); - return redirect()->route('Botanic.Admin.Genres.index'); + return redirect()->route('Admin.Botanic.Genres.index'); } public function show($id) { - $data = Genres::get($id); - return view('Botanic.Admin.Genres.view', $data); + $data['genre'] = Genres::get($id); + return view('Admin.Botanic.Genres.view', $data); } public function edit($id) { - $data = Genres::get($id); + $data['genre'] = Genres::get($id); $data['families'] = Families::getOptions(); - return view('Botanic.Admin.Genres.edit', $data); + return view('Admin.Botanic.Genres.edit', $data); } public function destroy($id) @@ -50,9 +50,8 @@ class GenreController extends Controller return Genres::destroy($id); } - public function exportExcel() + public function exportExcel() { return Genres::exportExcel(); } - } diff --git a/app/Http/Controllers/Admin/Botanic/SpecieController.php b/app/Http/Controllers/Admin/Botanic/SpecieController.php new file mode 100644 index 00000000..c642a5ae --- /dev/null +++ b/app/Http/Controllers/Admin/Botanic/SpecieController.php @@ -0,0 +1,63 @@ +render('Admin.Botanic.Species.list'); + } + + public function getDatatable(Request $request) + { + return Species::getDatatable($request->all()); + } + + public function getOptions() + { + return response()->json(Species::getOptions()); + } + + public function create() + { + $data['genres'] = Genres::getOptions(); + return view('Admin.Botanic.Species.create', $data); + } + + public function store(Request $request) + { + $data = $request->all(); + $ret = Species::store($data); + return redirect()->route('Admin.Botanic.Species.index'); + } + + public function show($id) + { + $data = Species::get($id); + return view('Admin.Botanic.Species.view', $data); + } + + public function edit($id) + { + $data['specie'] = Species::get($id); + $data['genres'] = Genres::getOptions(); + return view('Admin.Botanic.Species.edit', $data); + } + + public function destroy($id) + { + return Species::destroy($id); + } + + public function exportExcel() + { + return Species::exportExcel(); + } +} diff --git a/app/Http/Controllers/Admin/Botanic/VarietyController.php b/app/Http/Controllers/Admin/Botanic/VarietyController.php new file mode 100644 index 00000000..842a2413 --- /dev/null +++ b/app/Http/Controllers/Admin/Botanic/VarietyController.php @@ -0,0 +1,77 @@ +render('Admin.Botanic.Varieties.list'); + } + + public function getOptionsWithSpecie() + { + return response()->json(Varieties::getOptionsWithSpecie()); + } + + public function create() + { + $data['species'] = Species::getOptions(); + $data['tags_list'] = TagGroups::getTreeTags(); + return view('Admin.Botanic.Varieties.create', $data); + } + + public function store(Request $request) + { + $data = $request->all(); + Varieties::storeFull($data); + return redirect()->route('Admin.Botanic.Varieties.index'); + } + + public function show($id) + { + return view('Admin.Botanic.Varieties.view', Varieties::get($id)); + } + + public function edit($id) + { + $data = Varieties::getFull($id); + $data['species'] = Species::getOptions(); + $data['tags_list'] = TagGroups::getTreeTags(); + return view('Admin.Botanic.Varieties.edit', $data); + } + + public function destroy($id) + { + return Varieties::destroy($id); + } + + public function getImages(Request $request, $id = false, $can_edit = true) + { + $id = $id ? $id : $request->input('id'); + $data['images'] = Varieties::getImages($id); + $data['can_edit'] = $can_edit; + return view('components.uploader.mini-gallery-items', $data); + } + + public function deleteImage(Request $request) + { + $id = $request->input('id'); + $index = $request->input('index'); + return Varieties::deleteImage($id, $index); + } + + public function exportExcel() + { + return Varieties::exportExcel(); + } +} diff --git a/app/Http/Controllers/Admin/Controller.php b/app/Http/Controllers/Admin/Controller.php new file mode 100644 index 00000000..63846c3d --- /dev/null +++ b/app/Http/Controllers/Admin/Controller.php @@ -0,0 +1,9 @@ +render('admin.Core.App.Application.index', $data); + } + + public function getDatatable() + { + return Applications::getDatatable(); + } + + public function edit(Request $request, $id = false) + { + $id = $id ? $id : $request->input('id'); + $data = \App\Repositories\Config::init(); + $data = Applications::select_by_id($id); + return view('admin.Core.App.Application.edit', $data); + } + + public function store(Request $request) + { + Applications::store($request->all()); + return response()->json(['error' => 0]); + } + + public function destroy(Request $request, $id = false) + { + $id = $id ? $id : $request->input('id'); + Applications::destroy($id); + return response()->json(['error' => 0]); + } + + public function toggleActive(Request $request) + { + $data = Applications::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0); + return response()->json(['error' => 0]); + } +} diff --git a/app/Http/Controllers/Admin/Core/App/ApplicationModuleController.php b/app/Http/Controllers/Admin/Core/App/ApplicationModuleController.php new file mode 100644 index 00000000..6ff44731 --- /dev/null +++ b/app/Http/Controllers/Admin/Core/App/ApplicationModuleController.php @@ -0,0 +1,61 @@ +render('admin.Core.App.ApplicationModule.index', $data); + } + + public function getDatatable() + { + return ApplicationModules::getDatatable(); + } + + public function create() + { + $data = \App\Repositories\Config::init(); + $data['applications'] = Applications::getOptions(); + return view('admin.Core.App.ApplicationModule.create', $data); + } + + public function edit(Request $request, $id = false) + { + $id = $id ? $id : $request->input('id'); + $data = \App\Repositories\Config::init(); + $data = ApplicationModules::get($id)->toArray(); + $data['applications'] = Applications::getOptions(); + return view('admin.Core.App.ApplicationModule.edit', $data); + } + + public function store(Request $request) + { + ApplicationModules::store($request->all()); + return redirect()->route('admin.Core.App.ApplicationModule.index') + ->with('growl', [__('admin.successadd'), 'success']); + } + + public function destroy(Request $request, $id = false) + { + $id = $id ? $id : $request->input('id'); + ApplicationModules::destroy($id); + return response()->json(['error' => 0]); + } + + public function toggleActive(Request $request) + { + $data = ApplicationModules::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0); + return response()->json(['error' => 0]); + } +} diff --git a/app/Http/Controllers/Admin/Core/App/Controller.php b/app/Http/Controllers/Admin/Core/App/Controller.php new file mode 100644 index 00000000..5bf43289 --- /dev/null +++ b/app/Http/Controllers/Admin/Core/App/Controller.php @@ -0,0 +1,9 @@ +middleware('ability:admin,permissions_crud'); + } + + public function index(PermissionsDataTable $dataTable) + { + $data = \App\Repositories\Config::init(); + return $dataTable->render('admin.Core.Auth.Permission.index', $data); + } + + public function create() + { + $data = \App\Repositories\Config::init(); + $data['roles'] = Users::getRolesToEdit(); + $data['applications'] = Applications::getOptions(); + $data['application_modules'] = ApplicationModules::getOptions(); + return view('admin.Core.Auth.Permission.create', $data); + } + + public function edit(Request $request, $id = false) + { + $id = (int) $id ? $id : $request->input('id'); + $data = \App\Repositories\Config::init(); + $data['permission'] = Permissions::get($id); + $data['roles'] = Users::getRolesToEdit(); + $data['applications'] = Applications::getOptions(); + $data['application_modules'] = ApplicationModules::getOptions(); + return view('admin.Core.Auth.Permission.edit', $data); + } + + public function store(Request $request) + { + $data = $request->all(); + unset($data['roles']); + unset($data['_token']); + + /* + $this->validate($request, [ + 'name' => 'required|unique:permissions,name', + 'display_name' => 'required', + 'description' => 'required', + ]); + $data['name'] = Str::slug($data['display_name']); + */ + + Permissions::store($data); + return redirect()->route('Admin.Core.Auth.Permission.index')->with('growl', [__('permissions.successadd'), 'success']); + } + + public function destroy($id) + { + Permissions::destroy($id); + return response()->json(['error' => 0]); + } +} diff --git a/app/Http/Controllers/Admin/Core/Auth/RoleController.php b/app/Http/Controllers/Admin/Core/Auth/RoleController.php new file mode 100644 index 00000000..c59cedb4 --- /dev/null +++ b/app/Http/Controllers/Admin/Core/Auth/RoleController.php @@ -0,0 +1,96 @@ +get()->toArray(); + return $dataTable->render('admin.Core.Auth.Role.index', $data); + } + + public function getTable(Request $request) + { + $model = Role::orderBy('name')->get(); + return Datatables::of($model)->make(true); + } + + public function create() + { + $data = \App\Repositories\Config::init(); + return view('admin.Core.Auth.Role.create', $data); + } + + public function edit(Request $request, $id = false) + { + $id = $id ? $id : $request->input('id'); + $data = \App\Repositories\Config::init(); + $data['role'] = Roles::getWithPermissions($id); + $data['modules'] = ApplicationModule::with('permissions')->get()->toArray(); + + return view('admin.Core.Auth.Role.edit', $data); + } + + public function store(Request $request) + { + Roles::store($request->all()); + return response()->json(['error' => 0]); + } + + public function destroy(Request $request, $id = false) + { + $id = $id ? $id : $request->input('id'); + Roles::destroy($id); + return response()->json(['error' => 0]); + } + + public function manage(Request $request, $id = false) + { + $data = []; + $id = (int) $id ? $id : $request->input('id'); + $data['role'] = Role::with('permissions')->find($id)->toArray(); + $permissions = Permission::orderBy('app')->orderBy('module')->orderBy('action')->get(); + foreach ($permissions as $permission) { + $data[$permission->app][$permission->module][] = [ + 'action' => $permission->action, + 'description' => $permission->description, + 'id' => $permission->id, + ]; + } + // Debug::fdump($data); + // Debug::fdump($permissions); + // exit; + $data['permissions'] = $data; + return view('admin.Core.Auth.Role.manage', $data); + } + + public function manage_store(Request $request) + { + $data = $request->all(); + $role = Role::find($data['role_id']); + foreach ($data['permissions'] as $key) { + $permission = Permission::find($key); + $role->attachPermission($permission); + } + return response()->json(['error' => 0]); + } + + public function toggleActive(Request $request) + { + $data = Roles::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0); + return response()->json(['error' => 0]); + } +} diff --git a/app/Http/Controllers/Admin/Core/Auth/TeamController.php b/app/Http/Controllers/Admin/Core/Auth/TeamController.php new file mode 100644 index 00000000..226f9698 --- /dev/null +++ b/app/Http/Controllers/Admin/Core/Auth/TeamController.php @@ -0,0 +1,75 @@ +middleware('ability:admin,teams_crud'); + } + + public function index() + { + return view('admin.Core.Auth.Team.list', ['teams' => Team::all()]); + } + + public function create() + { + return view('admin.Core.Auth.Team.create'); + } + + public function store(Request $request) + { + $input = $request->all(); + $input['name'] = Str::slug($input['display_name']); + $request->replace($input); + + $this->validate( + $request, [ + 'name' => 'required|unique:teams,name', + 'display_name' => 'required', + 'description' => 'required', + ] + ); + + $team = Team::create($input); + $team->teams()->sync(array_keys($request->input('team', []))); + + return redirect()->route('admin.Teams.edit', $team) + ->with('growl', [__('teams.successadd'), 'success']); + } + + public function edit($id) + { + $team = Team::find($id); + + return view('admin.Core.Auth.Team.edit', compact('team', 'teams')); + } + + public function update(Request $request, $id) + { + $this->validate( + $request, [ + 'display_name' => 'required', + 'description' => 'required', + ] + ); + + $team = Team::find($id); + + return redirect()->route('admin.Teams.edit', $team) + ->with('growl', [__('teams.successmod'), 'success']); + } + + public function destroy($id) + { + Team::destroy($id); + } +} diff --git a/app/Http/Controllers/Admin/Core/Auth/UserController.php b/app/Http/Controllers/Admin/Core/Auth/UserController.php new file mode 100644 index 00000000..12e6bf81 --- /dev/null +++ b/app/Http/Controllers/Admin/Core/Auth/UserController.php @@ -0,0 +1,183 @@ +render('admin.Core.Auth.User.index', $data); + } + + public function modalCreate() + { + $data['roles'] = Users::getRolesToEdit(); + return view('admin.Core.Auth.User.modal', $data); + } + + public function modalEdit($id = false) + { + $user = $id ? Users::get($id) : false; + $data['roles'] = Users::getRolesToEdit(); + $data['user'] = $user ? $user->toArray() : []; + $data['user']['roles'] = $user->roles->pluck('id')->toArray(); + return view('admin.Core.Auth.User.modal', $data); + } + + public function storeAjax(Request $request) + { + $data = $request->all(); + $ret = Users::store($data); + return response()->json(['code' => '200']); + } + + public function create() + { + $data = \App\Repositories\Config::init(); + $data['roles'] = Users::getRolesToEdit(); + return view('admin.Core.Auth.User.create', $data); + } + + public function store(Request $request) + { + /* + $this->validate($request, [ + 'last_name' => 'required', + 'first_name' => 'required', + 'email' => 'required|email|unique:users,email,NULL,id,deleted_at,NULL', + ]); + */ + $input = $request->all(); + if (empty($input['password'])) { + unset($input['password']); + } + $user = Users::store($input); + + return redirect()->route('admin.Core.Auth.User.index') + ->with('growl', [__('boilerplate::users.successadd'), 'success']); + } + + public function edit($id) + { + $data = \App\Repositories\Config::init(); + $data['roles'] = Users::getRolesToEdit(); + $data['user'] = Users::get($id); + return view('admin.Core.Auth.User.edit', $data); + } + + public function destroy($id) + { + Users::delete($id); + } + + public function firstLogin($token, Request $request) + { + $user = User::where(['remember_token' => $token])->firstOrFail(); + + return view('boilerplate::auth.firstlogin', compact('user', 'token')); + } + + public function firstLoginPost(Request $request) + { + $this->validate( + $request, [ + 'token' => 'required', + 'password' => 'required|min:8', + 'password_confirmation' => 'required|same:password', + ] + ); + + $user = User::where(['remember_token' => $request->input('token')])->first(); + + $user->password = bcrypt($request->input('password')); + $user->remember_token = Str::random(32); + $user->last_login = Carbon::now()->toDateTimeString(); + $user->save(); + + Auth::attempt(['email' => $user->email, 'password' => $request->input('password'), 'active' => 1]); + + return redirect()->route('boilerplate.dashboard') + ->with('growl', [__('boilerplate::users.newpassword'), 'success']); + } + + public function profile() + { + $user = Users::get(); + $data['user'] = $user ? $user->toArray() : []; + $data['user']['name'] = $user->name; + $data['user']['avatar'] = Users::getAvatar($user->id); + return view('admin.Core.Auth.User.modalProfile', $data); + } + + public function profilePost(Request $request) + { + $this->validate( + $request, [ + 'avatar' => 'mimes:jpeg,png|max:10000', + 'last_name' => 'required', + 'first_name' => 'required', + 'password_confirmation' => 'same:password', + ] + ); + + $avatar = $request->file('avatar'); + $user = Auth::user(); + + if ($avatar && $file = $avatar->isValid()) { + $destinationPath = dirname($user->avatar_path); + if (!is_dir($destinationPath)) { + mkdir($destinationPath, 0766, true); + } + $extension = $avatar->getClientOriginalExtension(); + $fileName = md5($user->id.$user->email).'_tmp.'.$extension; + $avatar->move($destinationPath, $fileName); + + Image::make($destinationPath.DIRECTORY_SEPARATOR.$fileName) + ->fit(100, 100) + ->save($user->avatar_path); + + unlink($destinationPath.DIRECTORY_SEPARATOR.$fileName); + } + + $input = $request->all(); + + if ($input['password'] !== null) { + $input['password'] = bcrypt($input['password']); + $input['remember_token'] = Str::random(32); + } else { + unset($input['password']); + } + + $user->update($input); + + return redirect()->route('boilerplate.user.profile') + ->with('growl', [__('boilerplate::users.profile.successupdate'), 'success']); + } + + public function avatarDelete() + { + $user = Auth::user(); + if (is_file($user->avatar_path)) { + unlink($user->avatar_path); + } + } + + public function toggleActive(Request $request) + { + $data = Users::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0); + return response()->json(['error' => 0]); + } +} diff --git a/app/Http/Controllers/Admin/Core/Controller.php b/app/Http/Controllers/Admin/Core/Controller.php new file mode 100644 index 00000000..42ff91c3 --- /dev/null +++ b/app/Http/Controllers/Admin/Core/Controller.php @@ -0,0 +1,8 @@ +middleware('auth'); - } + public function __construct() + { + $this->middleware('auth'); + } - public function index() - { - return view('home'); - } + public function index() + { + return view('admin.Shop.Dashboard.index'); + } } diff --git a/app/Http/Controllers/Admin/Shop/ArticleController.php b/app/Http/Controllers/Admin/Shop/ArticleController.php new file mode 100644 index 00000000..2cb878d5 --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/ArticleController.php @@ -0,0 +1,68 @@ +input('q'); + return response()->json(Articles::autocomplete($str)); + } + + public function index(ArticlesDataTable $dataTable) + { + $data['families'] = ArticleNatures::getOptions(); + return $dataTable->render('Admin.Shop.Articles.list', $data); + } + + public function create() + { + $data = Articles::getMeta(); + return view('Admin.Shop.Articles.create', $data); + } + + public function store(Request $request) + { + $data = $request->all(); + Articles::storeFull($data); + return redirect()->route('Admin.Shop.Articles.index'); + } + + public function show($id) + { + $data = Articles::get($id); + return view('Admin.Shop.Articles.view', $data); + } + + public function edit($id) + { + $data = Articles::getFull($id); + return view('Admin.Shop.Articles.edit', $data); + } + + public function destroy($id) + { + return Articles::destroy($id); + } + + public function getImages(Request $request, $id = false) + { + $id = $id ? $id : $request->input('id'); + $data['images'] = Articles::getImages($id); + return view('components.uploader.mini-gallery-items', $data); + } + + public function deleteImage(Request $request) + { + $id = $request->input('id'); + $index = $request->input('index'); + return Articles::deleteImage($id, $index); + } +} diff --git a/app/Http/Controllers/Admin/Shop/ArticleNatureController.php b/app/Http/Controllers/Admin/Shop/ArticleNatureController.php new file mode 100644 index 00000000..4460183a --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/ArticleNatureController.php @@ -0,0 +1,49 @@ +render('Admin.Shop.ArticleNatures.list'); + } + + public function getDatatable(Request $request) + { + return ArticleNatures::getTables($request->all()); + } + + public function create() + { + return view('Admin.Shop.ArticleNatures.create'); + } + + public function store(Request $request) + { + $ret = ArticleNatures::store($request->all()); + return redirect()->route('Admin.Shop.ArticleNatures.index'); + } + + public function show($id) + { + $data['article_nature'] = ArticleNatures::get($id); + return view('Admin.Shop.ArticleNatures.view', $data); + } + + public function edit($id) + { + $data['article_nature'] = ArticleNatures::get($id); + return view('Admin.Shop.ArticleNatures.edit', $data); + } + + public function destroy($id) + { + return ArticleNatures::destroy($id); + } +} diff --git a/app/Http/Controllers/Shop/Admin/CategoryController.php b/app/Http/Controllers/Admin/Shop/CategoryController.php similarity index 79% rename from app/Http/Controllers/Shop/Admin/CategoryController.php rename to app/Http/Controllers/Admin/Shop/CategoryController.php index a9cb7918..4ce696d1 100644 --- a/app/Http/Controllers/Shop/Admin/CategoryController.php +++ b/app/Http/Controllers/Admin/Shop/CategoryController.php @@ -1,19 +1,17 @@ render('Shop.Admin.Categories.list'); + return $dataTable->render('Admin.Shop.Categories.list'); } public function getDatatable(Request $request) @@ -26,26 +24,26 @@ class CategoryController extends Controller $data = []; $data['category_id'] = 0; $data['categories'] = Categories::getOptions(); - return view('Shop.Admin.Categories.create', $data); + return view('Admin.Shop.Categories.create', $data); } public function store(Request $request) { $ret = Categories::store($request->all()); - return redirect()->route('Shop.Admin.Categories.index'); + return redirect()->route('Admin.Shop.Categories.index'); } public function show($id) { $data = Categories::get($id); - return view('Shop.Admin.Categories.view', $data); + return view('Admin.Shop.Categories.view', $data); } public function edit($id) { $data = Categories::get($id)->toArray(); $data['categories'] = Categories::getOptions(); - return view('Shop.Admin.Categories.edit', $data); + return view('Admin.Shop.Categories.edit', $data); } public function update(Request $request) @@ -79,5 +77,4 @@ class CategoryController extends Controller $type = $request->input('type'); return Categories::moveTree($node_id, $target_id, $type); } - } diff --git a/app/Http/Controllers/Admin/Shop/Controller.php b/app/Http/Controllers/Admin/Shop/Controller.php new file mode 100644 index 00000000..09647047 --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/Controller.php @@ -0,0 +1,13 @@ +render('Admin.Shop.Customers.list', $data); + } + + public function create() + { + return view('Admin.Shop.Customers.create'); + } + + public function store(Request $request) + { + $ret = Customers::store($request->all()); + return redirect()->route('Admin.Shop.Customers.index'); + } + + public function show($id) + { + $data['customer'] = Customers::get($id); + return view('Admin.Shop.Customers.view', $data); + } + + public function edit($id) + { + $data['customer'] = Customers::get($id)->toArray(); + return view('Admin.Shop.Customers.edit', $data); + } + + public function destroy($id) + { + return Customers::destroy($id); + } +} diff --git a/app/Http/Controllers/Shop/Admin/DashboardController.php b/app/Http/Controllers/Admin/Shop/DashboardController.php similarity index 85% rename from app/Http/Controllers/Shop/Admin/DashboardController.php rename to app/Http/Controllers/Admin/Shop/DashboardController.php index 287a2e51..dd90a8ff 100644 --- a/app/Http/Controllers/Shop/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/Shop/DashboardController.php @@ -1,6 +1,6 @@ middleware('auth'); + } + + /** + * Show the application dashboard. + * + * @return \Illuminate\Contracts\Support\Renderable + */ + public function index() + { + return redirect('dashboard'); + } +} diff --git a/app/Http/Controllers/Admin/Shop/InvoiceController.php b/app/Http/Controllers/Admin/Shop/InvoiceController.php new file mode 100644 index 00000000..713c8066 --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/InvoiceController.php @@ -0,0 +1,45 @@ +render('Admin.Shop.Invoices.list', $data); + } + + public function create() + { + return view('Admin.Shop.Invoices.create'); + } + + public function store(Request $request) + { + $ret = Invoices::store($request->all()); + return redirect()->route('Admin.Shop.Invoices.index'); + } + + public function show($id) + { + $data = Invoices::get($id); + return view('Admin.Shop.Invoices.view', $data); + } + + public function edit($id) + { + $data['customer'] = Invoices::get($id)->toArray(); + return view('Admin.Shop.Invoices.edit', $data); + } + + public function destroy($id) + { + return Invoices::destroy($id); + } +} diff --git a/app/Http/Controllers/Shop/Admin/InvoiceItemController.php b/app/Http/Controllers/Admin/Shop/InvoiceItemController.php similarity index 81% rename from app/Http/Controllers/Shop/Admin/InvoiceItemController.php rename to app/Http/Controllers/Admin/Shop/InvoiceItemController.php index 396a96d8..52be1e6c 100644 --- a/app/Http/Controllers/Shop/Admin/InvoiceItemController.php +++ b/app/Http/Controllers/Admin/Shop/InvoiceItemController.php @@ -1,6 +1,6 @@ render('Admin.Shop.Offers.list', $data ?? []); + } + + public function create() + { + return view('Admin.Shop.Offers.create'); + } + + public function store(Request $request) + { + $ret = Offers::store($request->all()); + return redirect()->route('Admin.Shop.Offers.index'); + } + + public function show($id) + { + $data = Offers::get($id); + return view('Admin.Shop.Offers.view', $data); + } + + public function edit($id) + { + $data['customer'] = Offers::get($id)->toArray(); + return view('Admin.Shop.Offers.edit', $data); + } + + public function destroy($id) + { + return Offers::destroy($id); + } +} diff --git a/app/Http/Controllers/Admin/Shop/OrderController.php b/app/Http/Controllers/Admin/Shop/OrderController.php new file mode 100644 index 00000000..b0ded7bd --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/OrderController.php @@ -0,0 +1,45 @@ +render('Admin.Shop.Orders.list', $data); + } + + public function create() + { + return view('Admin.Shop.Orders.create'); + } + + public function store(Request $request) + { + $ret = Orders::store($request->all()); + return redirect()->route('Admin.Shop.Orders.index'); + } + + public function show($id) + { + $data = Orders::get($id); + return view('Admin.Shop.Orders.view', $data); + } + + public function edit($id) + { + $data['customer'] = Orders::get($id)->toArray(); + return view('Admin.Shop.Orders.edit', $data); + } + + public function destroy($id) + { + return Orders::destroy($id); + } +} diff --git a/app/Http/Controllers/Shop/Admin/OrderPaymentController.php b/app/Http/Controllers/Admin/Shop/OrderPaymentController.php similarity index 81% rename from app/Http/Controllers/Shop/Admin/OrderPaymentController.php rename to app/Http/Controllers/Admin/Shop/OrderPaymentController.php index 6ec75db5..5be39849 100644 --- a/app/Http/Controllers/Shop/Admin/OrderPaymentController.php +++ b/app/Http/Controllers/Admin/Shop/OrderPaymentController.php @@ -1,6 +1,6 @@ render('Admin.Shop.Packages.list', $data); + } + + public function getDatatable(Request $request) + { + return Packages::getTables($request->all()); + } + + public function getOptionsByFamily(Request $request) + { + $id = $request->input('family_id'); + return response()->json(Packages::getSelectByFamily($id)); + } + + public function create() + { + $data['families'] = ArticleNatures::getOptions(); + return view('Admin.Shop.Packages.create', $data); + } + + public function store(Request $request) + { + $ret = Packages::store($request->all()); + return redirect()->route('Admin.Shop.Packages.index'); + } + + public function show($id) + { + $data = Packages::get($id); + return view('Admin.Shop.Packages.view', $data); + } + + public function edit($id) + { + $data['package'] = Packages::get($id); + $data['families'] = ArticleNatures::getOptions(); + return view('Admin.Shop.Packages.edit', $data); + } + + public function update(Request $request) + { + // + } + + public function destroy($id) + { + return Packages::destroy($id); + } +} diff --git a/app/Http/Controllers/Admin/Shop/PriceGenericCategoryController.php b/app/Http/Controllers/Admin/Shop/PriceGenericCategoryController.php new file mode 100644 index 00000000..646408d1 --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/PriceGenericCategoryController.php @@ -0,0 +1,48 @@ +render('Admin.Shop.PriceGenericCategories.list'); + } + + public function create() + { + $data['families'] = ArticleNatures::getOptions(); + return view('Admin.Shop.PriceGenericCategories.create', $data); + } + + public function edit($id) + { + $data['families'] = ArticleNatures::getOptions(); + $data['generic_category'] = PriceGenericCategories::get($id)->toArray(); + return view('Admin.Shop.PriceGenericCategories.edit', $data); + } + + public function store(Request $request) + { + $ret = PriceGenericCategories::store($request->all()); + return redirect()->route('Admin.Shop.PriceGenericCategories.index'); + } + + public function show($id) + { + $data = PriceGenericCategories::get($id); + return view('Admin.Shop.PriceGenericCategories.view', $data); + } + + public function destroy($id) + { + return PriceGenericCategories::destroy($id); + } +} diff --git a/app/Http/Controllers/Admin/Shop/PriceListController.php b/app/Http/Controllers/Admin/Shop/PriceListController.php new file mode 100644 index 00000000..4ec447d8 --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/PriceListController.php @@ -0,0 +1,85 @@ +render('Admin.Shop.PriceLists.list', $data); + } + + public function create() + { + $data = []; + $data['sale_channels'] = SaleChannels::getOptions(); + return view('Admin.Shop.PriceLists.create', $data); + } + + public function edit($id) + { + $data['price_list'] = PriceLists::get($id); + $data['sale_channels'] = SaleChannels::getOptions(); + return view('Admin.Shop.PriceLists.edit', $data); + } + + public function modalCreate($tariff_id) + { + $data = []; + $data['price_list']['tariff_id'] = $tariff_id; + $data['price_list']['price_list_values'] = array_fill(0, 3, ''); + $data['sale_channels'] = SaleChannels::getOptions(); + $data['statuses'] = Tariffs::getStatuses(); + return view('Admin.Shop.PriceLists.modal', $data); + } + + public function modalEdit($id) + { + $data['price_list'] = PriceLists::getFull($id); + $data['sale_channels'] = SaleChannels::getOptions(); + $data['statuses'] = Tariffs::getStatuses(); + return view('Admin.Shop.PriceLists.modal', $data); + } + + public function store(Request $request) + { + $ret = PriceLists::store($request->all()); + return redirect()->route('Admin.Shop.PriceLists.index'); + } + + public function storeAjax(Request $request) + { + $data = $request->all(); + $ret = PriceLists::store($data); + return response()->json(['code' => '200']); + } + + public function show($id) + { + $data = PriceLists::get($id); + return view('Admin.Shop.PriceLists.view', $data); + } + + public function destroy($id) + { + return PriceLists::destroy($id); + } + + public function getPrice($id) + { + $data['generic'] = PriceLists::getFull($id); + return view('Admin.Shop.PriceLists.partials.table-prices', $data); + } +} diff --git a/app/Http/Controllers/Admin/Shop/PriceListValuesController.php b/app/Http/Controllers/Admin/Shop/PriceListValuesController.php new file mode 100644 index 00000000..cad248d8 --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/PriceListValuesController.php @@ -0,0 +1,69 @@ +render('Admin.Shop.PriceListValues.list', $data); + } + + public function getDatatable(Request $request) + { + return PriceListValues::getTables($request->all()); + } + + public function create() + { + $data['unities'] = Unities::getOptions(); + $data['taxes_options'] = Taxes::getOptions(); + $data['categories'] = PriceListValueCategories::getOptions(); + return view('Admin.Shop.PriceListValues.create', $data); + } + + public function edit($id) + { + $data['generic'] = PriceListValues::getFull($id)->toArray(); + $data['packages'] = Packages::getSelectByFamily($data['generic']['category']['article_family_id']); + $data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : []; + $data['taxes_options'] = Taxes::getOptions(); + $data['categories'] = PriceListValueCategories::getOptions(); + return view('Admin.Shop.PriceListValues.edit', $data); + } + + public function store(Request $request) + { + $ret = PriceListValues::store($request->all()); + return redirect()->route('Admin.Shop.PriceListValues.index'); + } + + public function show($id) + { + $data = PriceListValues::get($id); + return view('Admin.Shop.PriceListValues.view', $data); + } + + public function destroy($id) + { + return PriceListValues::destroy($id); + } + + public function getPrice($id) + { + $data['generic'] = PriceListValues::getFull($id); + return view('Admin.Shop.PriceListValues.partials.table-prices', $data); + } +} diff --git a/app/Http/Controllers/Admin/Shop/SaleChannelController.php b/app/Http/Controllers/Admin/Shop/SaleChannelController.php new file mode 100644 index 00000000..0df07be8 --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/SaleChannelController.php @@ -0,0 +1,46 @@ +render('Admin.Shop.SaleChannels.list', $data ?? []); + } + + public function create() + { + return view('Admin.Shop.SaleChannels.create', $data ?? []); + } + + public function store(Request $request) + { + $ret = SaleChannels::store($request->all()); + return redirect()->route('Admin.Shop.SaleChannels.index'); + } + + public function show($id) + { + $data['sale_channel'] = SaleChannels::get($id); + return view('Admin.Shop.SaleChannels.view', $data); + } + + public function edit($id) + { + $data['sale_channel'] = SaleChannels::get($id); + return view('Admin.Shop.SaleChannels.edit', $data); + } + + public function destroy($id) + { + return SaleChannels::destroy($id); + } +} diff --git a/app/Http/Controllers/Shop/Admin/TagController.php b/app/Http/Controllers/Admin/Shop/TagController.php similarity index 72% rename from app/Http/Controllers/Shop/Admin/TagController.php rename to app/Http/Controllers/Admin/Shop/TagController.php index 39d61dc6..e7c3b32e 100644 --- a/app/Http/Controllers/Shop/Admin/TagController.php +++ b/app/Http/Controllers/Admin/Shop/TagController.php @@ -1,19 +1,19 @@ render('Shop.Admin.Tags.list'); + return $dataTable->render('Admin.Shop.Tags.list'); } public function getDatatable(Request $request) @@ -25,26 +25,26 @@ class TagController extends Controller { $data = []; $data['tag_groups'] = TagGroups::getOptions(); - return view('Shop.Admin.Tags.create', $data); + return view('Admin.Shop.Tags.create', $data); } public function store(Request $request) { $ret = Tags::store($request->all()); - return redirect()->route('Shop.Admin.Tags.index'); + return redirect()->route('Admin.Shop.Tags.index'); } public function show($id) { $data = Tags::get($id); - return view('Shop.Admin.Tags.view', $data); + return view('Admin.Shop.Tags.view', $data); } public function edit($id) { $data = Tags::get($id); $data['tag_groups'] = TagGroups::getOptions(); - return view('Shop.Admin.Tags.edit', $data); + return view('Admin.Shop.Tags.edit', $data); } public function update(Request $request) @@ -56,5 +56,4 @@ class TagController extends Controller { return Tags::destroy($id); } - } diff --git a/app/Http/Controllers/Admin/Shop/TagGroupController.php b/app/Http/Controllers/Admin/Shop/TagGroupController.php new file mode 100644 index 00000000..efc333ff --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/TagGroupController.php @@ -0,0 +1,58 @@ +render('Admin.Shop.TagGroups.list'); + } + + public function getDatatable(Request $request) + { + return TagGroups::getTables($request->all()); + } + + public function create() + { + $data['article_families'] = ArticleNatures::getOptions(); + return view('Admin.Shop.TagGroups.create', $data); + } + + public function store(Request $request) + { + $ret = TagGroups::store($request->all()); + return redirect()->route('Admin.Shop.TagGroups.index'); + } + + public function show($id) + { + $data = TagGroups::get($id); + return view('Admin.Shop.TagGroups.view', $data); + } + + public function edit($id) + { + $data = TagGroups::get($id); + $data['article_families'] = ArticleNatures::getOptions(); + return view('Admin.Shop.TagGroups.edit', $data); + } + + public function update(Request $request) + { + // + } + + public function destroy($id) + { + return TagGroups::destroy($id); + } +} diff --git a/app/Http/Controllers/Admin/Shop/TariffController.php b/app/Http/Controllers/Admin/Shop/TariffController.php new file mode 100644 index 00000000..15824783 --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/TariffController.php @@ -0,0 +1,67 @@ +input('q'); + return response()->json(Tariffs::autocomplete($str)); + } + + public function index(TariffsDataTable $dataTable) + { + return $dataTable->render('Admin.Shop.Tariffs.list'); + } + + public function create() + { + $data['sale_channels'] = SaleChannels::getOptions(); + $data['statuses'] = Tariffs::getStatuses(); + $data['tariff_unities'] = TariffUnities::getOptions(); + + $model = new PriceListsDataTable(); + $data['datatables']['price_lists'] = $model->html(); + + return view('Admin.Shop.Tariffs.create', $data); + } + + public function show($id) + { + $data['tariff'] = Tariffs::getFull($id); + return view('Admin.Shop.Tariffs.view', $data); + } + + public function edit($id) + { + $data['tariff'] = Tariffs::get($id); + $data['sale_channels'] = SaleChannels::getOptions(); + $data['statuses'] = Tariffs::getStatuses(); + $data['tariff_unities'] = TariffUnities::getOptions(); + + $model = new PriceListsDataTable(); + $data['datatables']['price_lists'] = $model->html(); + + return view('Admin.Shop.Tariffs.edit', $data); + } + + public function store(Request $request) + { + $ret = Tariffs::store($request->all()); + return redirect()->route('Admin.Shop.Tariffs.index'); + } + + public function destroy($id) + { + return Tariffs::destroy($id); + } +} diff --git a/app/Http/Controllers/Shop/Admin/TaxController.php b/app/Http/Controllers/Admin/Shop/TaxController.php similarity index 73% rename from app/Http/Controllers/Shop/Admin/TaxController.php rename to app/Http/Controllers/Admin/Shop/TaxController.php index 2e315358..f6202f8e 100644 --- a/app/Http/Controllers/Shop/Admin/TaxController.php +++ b/app/Http/Controllers/Admin/Shop/TaxController.php @@ -1,6 +1,6 @@ render('Shop.Admin.Taxes.list'); + return $dataTable->render('Admin.Shop.Taxes.list'); } public function getDatatable(Request $request) @@ -23,26 +23,26 @@ class TaxController extends Controller { $data = []; $data['groups'] = TagGroups::getOptions(); - return view('Shop.Admin.Taxes.create', $data); + return view('Admin.Shop.Taxes.create', $data); } public function store(Request $request) { $ret = Taxes::store($request->all()); - return redirect()->route('Shop.Admin.Taxes.index'); + return redirect()->route('Admin.Shop.Taxes.index'); } public function show($id) { $data = Taxes::get($id); - return view('Shop.Admin.Taxes.view', $data); + return view('Admin.Shop.Taxes.view', $data); } public function edit($id) { $data = Taxes::get($id); $data['groups'] = TagGroups::getOptions(); - return view('Shop.Admin.Taxes.edit', $data); + return view('Admin.Shop.Taxes.edit', $data); } public function update(Request $request) @@ -54,5 +54,4 @@ class TaxController extends Controller { return Taxes::destroy($id); } - } diff --git a/app/Http/Controllers/Admin/Shop/UnityController.php b/app/Http/Controllers/Admin/Shop/UnityController.php new file mode 100644 index 00000000..ebbf36aa --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/UnityController.php @@ -0,0 +1,66 @@ +render('Admin.Shop.Unities.list', $data); + } + + public function getDatatable(Request $request) + { + return Unities::getTables($request->all()); + } + + public function getOptionsByPackage(Request $request) + { + $id = $request->input('package_id'); + return response()->json(Unities::getOptionsByPackage($id)); + } + + public function create() + { + $data['packages'] = Packages::getOptions(); + return view('Admin.Shop.Unities.create'); + } + + public function store(Request $request) + { + $ret = Unities::store($request->all()); + return redirect()->route('Admin.Shop.Unities.index'); + } + + public function show($id) + { + $data = Unities::get($id); + return view('Admin.Shop.Unities.view', $data); + } + + public function edit($id) + { + $data['packages'] = Packages::getOptions(); + $data['unity'] = Unities::get($id)->toArray(); + return view('Admin.Shop.Unities.edit', $data); + } + + public function destroy($id) + { + return Unities::destroy($id); + } + + public function update($id) + { + } +} diff --git a/app/Http/Controllers/Admin/Shop/VariationController.php b/app/Http/Controllers/Admin/Shop/VariationController.php new file mode 100644 index 00000000..a6af071c --- /dev/null +++ b/app/Http/Controllers/Admin/Shop/VariationController.php @@ -0,0 +1,57 @@ +input('q'); + return response()->json(Variations::autocomplete($str)); + } + + public function index(VariationsDataTable $dataTable) + { + return $dataTable->render('Admin.Shop.Variations.list'); + } + + public function create() + { + $data['packages'] = Packages::getOptions(); + $data['unities'] = Unities::getOptions(); + return view('Admin.Shop.Variations.create', $data); + } + + public function edit($id) + { + $data['variation'] = Variations::get($id); + $data['packages'] = Packages::getOptions(); + $data['unities'] = Unities::getOptions(); + return view('Admin.Shop.Variations.edit', $data); + } + + public function store(Request $request) + { + $ret = Variations::store($request->all()); + return redirect()->route('Admin.Shop.Variations.index'); + } + + public function show($id) + { + $data = Variations::get($id); + return view('Admin.Shop.Variations.view', $data); + } + + public function destroy($id) + { + return Variations::destroy($id); + } +} diff --git a/app/Http/Controllers/Auth/ConfirmPasswordController.php b/app/Http/Controllers/Auth/ConfirmPasswordController.php index 138c1f08..5869409c 100644 --- a/app/Http/Controllers/Auth/ConfirmPasswordController.php +++ b/app/Http/Controllers/Auth/ConfirmPasswordController.php @@ -26,7 +26,7 @@ class ConfirmPasswordController extends Controller * * @var string */ - protected $redirectTo = RouteServiceProvider::HOME; + protected $redirectTo = ''; /** * Create a new controller instance. diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 465c39cc..c39194c8 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -19,4 +19,20 @@ class ForgotPasswordController extends Controller */ use SendsPasswordResetEmails; + + /** + * Create a new controller instance. + * + * @return void + */ + public function __construct() + { + $this->middleware('guest'); + } + + public function showLinkRequestForm() + { + $data = \App\Repositories\Config::init(); + return view('auth.passwords.email', $data); + } } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 18a0d088..b5e17ce6 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -3,38 +3,49 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; -use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\AuthenticatesUsers; +use Illuminate\Support\Facades\Auth; +use Illuminate\Http\Request; +use App\Repositories\Layout; +use Carbon\Carbon; class LoginController extends Controller { - /* - |-------------------------------------------------------------------------- - | Login Controller - |-------------------------------------------------------------------------- - | - | This controller handles authenticating users for the application and - | redirecting them to your home screen. The controller uses a trait - | to conveniently provide its functionality to your applications. - | - */ - use AuthenticatesUsers; + protected $redirectTo = '/'; - /** - * Where to redirect users after login. - * - * @var string - */ - protected $redirectTo = RouteServiceProvider::HOME; - - /** - * Create a new controller instance. - * - * @return void - */ public function __construct() { $this->middleware('guest')->except('logout'); + $this->middleware('guest:web')->except('logout'); + } + + public function showLoginForm() + { + $data = \App\Repositories\Config::init(); + return view('auth.login', $data); + } + + public function authenticated(Request $request, $user) + { + $request->session()->forget('password_expired_id'); + + if ($user->passwordSecurity->password_expiry_days > 0) { + $password_updated_at = $user->passwordSecurity->password_updated_at; + $password_expiry_days = $user->passwordSecurity->password_expiry_days; + $password_expiry_at = Carbon::parse($password_updated_at)->addDays($password_expiry_days); + if ($password_expiry_at->lessThan(Carbon::now())) { + $request->session()->put('password_expired_id', $user->id); + auth()->logout(); + return redirect('/reset-password')->with('message', "Your password is expired. You need to change your password."); + } + } + + return redirect()->intended($this->redirectPath()); + } + + public function username() + { + return 'username'; } } diff --git a/app/Http/Controllers/Auth/PasswordSecurityController.php b/app/Http/Controllers/Auth/PasswordSecurityController.php new file mode 100644 index 00000000..6c873ccc --- /dev/null +++ b/app/Http/Controllers/Auth/PasswordSecurityController.php @@ -0,0 +1,71 @@ +session()->get('password_expired_id'); + if (!isset($password_expired_id)) { + return redirect('/login'); + } + return view('auth.reset_password'); + } + + // reset password + public function resetPassword(Request $request) + { + // check expire id + $password_expired_id = $request->session()->get('password_expired_id'); + if (!isset($password_expired_id)) { + return redirect('/login'); + } + + // validate + $validatedData = $request->validate( + [ + 'current_password' => 'required', + 'new_password' => 'required|string|min:6|confirmed', + ] + ); + + // the requests + $request_current_password = $request->current_password; + $request_new_password = $request->new_password; + $request_new_password_confirm = $request->new_password_confirm; + + // the passwords matches + $user = User::find($password_expired_id); + if (!(Hash::check($request_current_password, $user->password))) { + return redirect()->back()->with("error", "Your current password does not matches with the password you provided. Please try again."); + } + + // current password and new password are same + if (strcmp($request_current_password, $request->new_password) == 0) { + return redirect()->back()->with("error", "New password cannot be same as your current password. Please choose a different password."); + } + + // new password and new password confirm doesn't match + if (strcmp($request_new_password, $request_new_password_confirm) == 1) { + return redirect()->back()->with("error", "New password doesn't match with confirm password."); + } + + // change Password + $user->password = bcrypt($request->new_password); + $user->save(); + + // update password update time + $user->passwordSecurity->password_updated_at = Carbon::now(); + $user->passwordSecurity->save(); + + return redirect('/login')->with("status", "Password changed successfully. Now you can login!"); + } +} diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 74ff68d2..14e82aa3 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -2,12 +2,11 @@ namespace App\Http\Controllers\Auth; +use App\User; use App\Http\Controllers\Controller; -use App\Providers\RouteServiceProvider; -use App\Models\Core\Auth\User; -use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; +use Illuminate\Foundation\Auth\RegistersUsers; class RegisterController extends Controller { @@ -29,7 +28,7 @@ class RegisterController extends Controller * * @var string */ - protected $redirectTo = RouteServiceProvider::HOME; + protected $redirectTo = '/home'; /** * Create a new controller instance. @@ -38,36 +37,40 @@ class RegisterController extends Controller */ public function __construct() { - $this->middleware('guest'); + $this->middleware('auth'); } /** * Get a validator for an incoming registration request. * - * @param array $data + * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { - return Validator::make($data, [ - 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], - 'password' => ['required', 'string', 'min:8', 'confirmed'], - ]); + return Validator::make( + $data, [ + 'name' => 'required|string|max:255', + 'email' => 'required|string|email|max:255|unique:users', + 'password' => 'required|string|min:6|confirmed', + ] + ); } /** * Create a new user instance after a valid registration. * - * @param array $data + * @param array $data * @return \App\User */ protected function create(array $data) { - return User::create([ + return User::create( + [ 'name' => $data['name'], 'email' => $data['email'], 'password' => Hash::make($data['password']), - ]); + ] + ); } } diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index b1726a36..c59c873a 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers\Auth; +use Illuminate\Http\Request; use App\Http\Controllers\Controller; -use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\ResetsPasswords; class ResetPasswordController extends Controller @@ -26,5 +26,23 @@ class ResetPasswordController extends Controller * * @var string */ - protected $redirectTo = RouteServiceProvider::HOME; + protected $redirectTo = '/home'; + + /** + * Create a new controller instance. + * + * @return void + */ + public function __construct() + { + $this->middleware('guest'); + } + + public function showResetForm(Request $request, $token = null) + { + $data = \App\Repositories\Config::init(); + $data['token'] = $token; + $data['email'] = $request->email; + return view('auth.passwords.reset', $data); + } } diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php index 5e749af8..23a43a84 100644 --- a/app/Http/Controllers/Auth/VerificationController.php +++ b/app/Http/Controllers/Auth/VerificationController.php @@ -3,7 +3,6 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; -use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\VerifiesEmails; class VerificationController extends Controller @@ -26,7 +25,7 @@ class VerificationController extends Controller * * @var string */ - protected $redirectTo = RouteServiceProvider::HOME; + protected $redirectTo = '/home'; /** * Create a new controller instance. diff --git a/app/Http/Controllers/Botanic/Admin/FamilyController.php b/app/Http/Controllers/Botanic/Admin/FamilyController.php deleted file mode 100644 index d0e21465..00000000 --- a/app/Http/Controllers/Botanic/Admin/FamilyController.php +++ /dev/null @@ -1,58 +0,0 @@ -render('Botanic.Admin.Families.list'); - } - - public function getDatatable(Request $request) - { - return Families::getTables($request->all()); - } - - public function create() - { - $data = []; - return view('Botanic.Admin.Families.create', $data); - } - - public function store(Request $request) - { - $ret = Families::store($request); - return redirect()->route('Botanic.Admin.Families.index'); - } - - public function show($id) - { - $data = Families::get($id); - return view('Botanic.Admin.Families.view', $data); - } - - public function edit($id) - { - $data['family'] = Families::get($id)->toArray(); - return view('Botanic.Admin.Families.edit', $data); - } - - public function destroy($id) - { - return Families::destroy($id); - } - - public function exportExcel() - { - return Families::exportExcel(); - } - -} diff --git a/app/Http/Controllers/Botanic/Admin/SpecieController.php b/app/Http/Controllers/Botanic/Admin/SpecieController.php deleted file mode 100644 index df0b0c2d..00000000 --- a/app/Http/Controllers/Botanic/Admin/SpecieController.php +++ /dev/null @@ -1,63 +0,0 @@ -render('Botanic.Admin.Species.list'); - } - - public function getDatatable(Request $request) - { - return Species::getDatatable($request->all()); - } - - public function getOptions() - { - return response()->json(Species::getOptions()); - } - - public function create() - { - return view('Botanic.Admin.Species.create'); - } - - public function store(Request $request) - { - $data = $request->all(); - $ret = Species::store($data); - return redirect()->route('Botanic.Admin.Species.index'); - } - - public function show($id) - { - $data = Species::get($id); - return view('Botanic.Admin.Species.view', $data); - } - - public function edit($id) - { - $data = Species::get($id); - $data['genres'] = Genres::getOptions(); - return view('Botanic.Admin.Species.edit', $data); - } - - public function destroy($id) - { - return Species::destroy($id); - } - - public function exportExcel() - { - return Species::exportExcel(); - } -} diff --git a/app/Http/Controllers/Botanic/Admin/VarietyController.php b/app/Http/Controllers/Botanic/Admin/VarietyController.php deleted file mode 100644 index a43500fa..00000000 --- a/app/Http/Controllers/Botanic/Admin/VarietyController.php +++ /dev/null @@ -1,79 +0,0 @@ -render('Botanic.Admin.Varieties.list'); - } - - public function getOptionsWithSpecie() - { - return response()->json(Varieties::getOptionsWithSpecie()); - } - - public function create() - { - $data['tags_list'] = TagGroups::getTreeTags(); - return view('Botanic.Admin.Varieties.create', $data); - } - - public function store(Request $request) - { - $data = $request->all(); - Varieties::storeFull($data); - return redirect()->route('Botanic.Admin.Varieties.index'); - } - - public function show($id) - { - return view('Botanic.Admin.Varieties.view', Varieties::get($id)); - } - - public function edit($id) - { - $data = Varieties::getFull($id); - $data['species'] = Species::getOptions(); - $data['tags_list'] = TagGroups::getTreeTags(); - return view('Botanic.Admin.Varieties.edit', $data); - } - - public function destroy($id) - { - return Varieties::destroy($id); - } - - public function getImages(Request $request, $id = false, $can_edit = true) - { - $id = $id ? $id : $request->input('id'); - $data['images'] = Varieties::getImages($id); - $data['can_edit'] = $can_edit; - return view('components.uploader.mini-gallery-items', $data); - } - - public function deleteImage(Request $request) - { - $id = $request->input('id'); - $index = $request->input('index'); - return Varieties::deleteImage($id, $index); - } - - public function exportExcel() - { - return Varieties::exportExcel(); - } - - -} diff --git a/app/Http/Controllers/JS/CacheController.php b/app/Http/Controllers/JS/CacheController.php deleted file mode 100644 index 43eeb29e..00000000 --- a/app/Http/Controllers/JS/CacheController.php +++ /dev/null @@ -1,22 +0,0 @@ -render('Shop.Admin.Articles.list', $data); - } - - public function getDatatable(Request $request) - { - return Articles::getTables($request->all()); - } - - public function create() - { - $data = $this->getMeta(); - return view('Shop.Admin.Articles.create', $data); - } - - public function store(Request $request) - { - $data = $request->all(); - // dump($data); - // exit; - Articles::storeFull($data); - return redirect()->route('Shop.Admin.Articles.index'); - } - - public function show($id) - { - $data = Articles::get($id); - return view('Shop.Admin.Articles.view', $data); - } - - public function edit($id) - { - $data = Articles::getFull($id); - return view('Shop.Admin.Articles.edit', $data); - } - - public function update(Request $request) - { - // - } - - public function destroy($id) - { - return Articles::destroy($id); - } - - public function getMeta($data = []) - { - return Articles::getMeta($data); - } - - public function getImages(Request $request, $id = false) - { - $id = $id ? $id : $request->input('id'); - $data['images'] = Articles::getImages($id); - return view('components.uploader.mini-gallery-items', $data); - } - - public function deleteImage(Request $request) - { - $id = $request->input('id'); - $index = $request->input('index'); - return Articles::deleteImage($id, $index); - } -} diff --git a/app/Http/Controllers/Shop/Admin/ArticleFamilyController.php b/app/Http/Controllers/Shop/Admin/ArticleFamilyController.php deleted file mode 100644 index 74559ec3..00000000 --- a/app/Http/Controllers/Shop/Admin/ArticleFamilyController.php +++ /dev/null @@ -1,56 +0,0 @@ -render('Shop.Admin.ArticleFamilies.list'); - } - - public function getDatatable(Request $request) - { - return ArticleFamilies::getTables($request->all()); - } - - public function create() - { - return view('Shop.Admin.ArticleFamilies.create'); - } - - public function store(Request $request) - { - $ret = ArticleFamilies::store($request->all()); - return redirect()->route('Shop.Admin.ArticleFamilies.index'); - } - - public function show($id) - { - $data = ArticleFamilies::get($id); - return view('Shop.Admin.ArticleFamilies.view', $data); - } - - public function edit($id) - { - $data = ArticleFamilies::get($id); - return view('Shop.Admin.ArticleFamilies.edit', $data); - } - - public function update(Request $request) - { - // - } - - public function destroy($id) - { - return ArticleFamilies::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/ArticlePriceController.php b/app/Http/Controllers/Shop/Admin/ArticlePriceController.php deleted file mode 100644 index 58662b90..00000000 --- a/app/Http/Controllers/Shop/Admin/ArticlePriceController.php +++ /dev/null @@ -1,88 +0,0 @@ -render('Shop.Admin.Customers.list', $data); - } - - public function create() - { - return view('Shop.Admin.Customers.create'); - } - - public function store(Request $request) - { - $ret = Customers::store($request->all()); - return redirect()->route('Shop.Admin.Customers.index'); - } - - public function show($id) - { - $data['customer'] = Customers::get($id); - return view('Shop.Admin.Customers.view', $data); - } - - public function edit($id) - { - $data['customer'] = Customers::get($id)->toArray(); - return view('Shop.Admin.Customers.edit', $data); - } - - public function destroy($id) - { - return Customers::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/HomeController.php b/app/Http/Controllers/Shop/Admin/HomeController.php deleted file mode 100644 index 48675fad..00000000 --- a/app/Http/Controllers/Shop/Admin/HomeController.php +++ /dev/null @@ -1,29 +0,0 @@ -middleware('auth'); - } - - /** - * Show the application dashboard. - * - * @return \Illuminate\Contracts\Support\Renderable - */ - public function index() - { - return redirect('dashboard'); - } -} diff --git a/app/Http/Controllers/Shop/Admin/InventoryController.php b/app/Http/Controllers/Shop/Admin/InventoryController.php deleted file mode 100644 index b5e44994..00000000 --- a/app/Http/Controllers/Shop/Admin/InventoryController.php +++ /dev/null @@ -1,86 +0,0 @@ -render('Shop.Admin.Invoices.list', $data); - } - - public function create() - { - return view('Shop.Admin.Invoices.create'); - } - - public function store(Request $request) - { - $ret = Invoices::store($request->all()); - return redirect()->route('Shop.Admin.Invoices.index'); - } - - public function show($id) - { - $data = Invoices::get($id); - return view('Shop.Admin.Invoices.view', $data); - } - - public function edit($id) - { - $data['customer'] = Invoices::get($id)->toArray(); - return view('Shop.Admin.Invoices.edit', $data); - } - - public function destroy($id) - { - return Invoices::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/OrderController.php b/app/Http/Controllers/Shop/Admin/OrderController.php deleted file mode 100644 index b8a97dab..00000000 --- a/app/Http/Controllers/Shop/Admin/OrderController.php +++ /dev/null @@ -1,46 +0,0 @@ -render('Shop.Admin.Orders.list', $data); - } - - public function create() - { - return view('Shop.Admin.Orders.create'); - } - - public function store(Request $request) - { - $ret = Orders::store($request->all()); - return redirect()->route('Shop.Admin.Orders.index'); - } - - public function show($id) - { - $data = Orders::get($id); - return view('Shop.Admin.Orders.view', $data); - } - - public function edit($id) - { - $data['customer'] = Orders::get($id)->toArray(); - return view('Shop.Admin.Orders.edit', $data); - } - - public function destroy($id) - { - return Orders::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/PackageController.php b/app/Http/Controllers/Shop/Admin/PackageController.php deleted file mode 100644 index 58818faa..00000000 --- a/app/Http/Controllers/Shop/Admin/PackageController.php +++ /dev/null @@ -1,66 +0,0 @@ -render('Shop.Admin.Packages.list', $data); - } - - public function getDatatable(Request $request) - { - return Packages::getTables($request->all()); - } - - public function getOptionsByFamily(Request $request) - { - $id = $request->input('family_id'); - return response()->json(Packages::getSelectByFamily($id)); - } - - public function create() - { - $data['families'] = ArticleFamilies::getOptions(); - return view('Shop.Admin.Packages.create', $data); - } - - public function store(Request $request) - { - $ret = Packages::store($request->all()); - return redirect()->route('Shop.Admin.Packages.index'); - } - - public function show($id) - { - $data = Packages::get($id); - return view('Shop.Admin.Packages.view', $data); - } - - public function edit($id) - { - $data['package'] = Packages::get($id); - $data['families'] = ArticleFamilies::getOptions(); - return view('Shop.Admin.Packages.edit', $data); - } - - public function update(Request $request) - { - // - } - - public function destroy($id) - { - return Packages::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/PriceGenericCategoryController.php b/app/Http/Controllers/Shop/Admin/PriceGenericCategoryController.php deleted file mode 100644 index 4a551078..00000000 --- a/app/Http/Controllers/Shop/Admin/PriceGenericCategoryController.php +++ /dev/null @@ -1,48 +0,0 @@ -render('Shop.Admin.PriceGenericCategories.list'); - } - - public function create() - { - $data['families'] = ArticleFamilies::getOptions(); - return view('Shop.Admin.PriceGenericCategories.create', $data); - } - - public function edit($id) - { - $data['families'] = ArticleFamilies::getOptions(); - $data['generic_category'] = PriceGenericCategories::get($id)->toArray(); - return view('Shop.Admin.PriceGenericCategories.edit', $data); - } - - public function store(Request $request) - { - $ret = PriceGenericCategories::store($request->all()); - return redirect()->route('Shop.Admin.PriceGenericCategories.index'); - } - - public function show($id) - { - $data = PriceGenericCategories::get($id); - return view('Shop.Admin.PriceGenericCategories.view', $data); - } - - public function destroy($id) - { - return PriceGenericCategories::destroy($id); - } -} diff --git a/app/Http/Controllers/Shop/Admin/PriceGenericController.php b/app/Http/Controllers/Shop/Admin/PriceGenericController.php deleted file mode 100644 index 4424a457..00000000 --- a/app/Http/Controllers/Shop/Admin/PriceGenericController.php +++ /dev/null @@ -1,68 +0,0 @@ -render('Shop.Admin.PriceGenerics.list', $data); - } - - public function getDatatable(Request $request) - { - return PriceGenerics::getTables($request->all()); - } - - public function create() - { - $data['unities'] = Unities::getOptions(); - $data['taxes_options'] = Taxes::getOptions(); - $data['categories'] = PriceGenericCategories::getOptions(); - return view('Shop.Admin.PriceGenerics.create',$data); - } - - public function edit($id) - { - $data['generic'] = PriceGenerics::getFull($id)->toArray(); - $data['packages'] = Packages::getSelectByFamily($data['generic']['category']['article_family_id']); - $data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : []; - $data['taxes_options'] = Taxes::getOptions(); - $data['categories'] = PriceGenericCategories::getOptions(); - return view('Shop.Admin.PriceGenerics.edit', $data); - } - - public function store(Request $request) - { - $ret = PriceGenerics::store($request->all()); - return redirect()->route('Shop.Admin.PriceGenerics.index'); - } - - public function show($id) - { - $data = PriceGenerics::get($id); - return view('Shop.Admin.PriceGenerics.view', $data); - } - - public function destroy($id) - { - return PriceGenerics::destroy($id); - } - - public function getPrice($id) { - $data['generic'] = PriceGenerics::getFull($id); - return view('Shop.Admin.PriceGenerics.partials.table-prices', $data); - } -} diff --git a/app/Http/Controllers/Shop/Admin/TagGroupController.php b/app/Http/Controllers/Shop/Admin/TagGroupController.php deleted file mode 100644 index e8ad9e97..00000000 --- a/app/Http/Controllers/Shop/Admin/TagGroupController.php +++ /dev/null @@ -1,59 +0,0 @@ -render('Shop.Admin.TagGroups.list'); - } - - public function getDatatable(Request $request) - { - return TagGroups::getTables($request->all()); - } - - public function create() - { - $data['article_families'] = ArticleFamilies::getOptions(); - return view('Shop.Admin.TagGroups.create', $data); - } - - public function store(Request $request) - { - $ret = TagGroups::store($request->all()); - return redirect()->route('Shop.Admin.TagGroups.index'); - } - - public function show($id) - { - $data = TagGroups::get($id); - return view('Shop.Admin.TagGroups.view', $data); - } - - public function edit($id) - { - $data = TagGroups::get($id); - $data['article_families'] = ArticleFamilies::getOptions(); - return view('Shop.Admin.TagGroups.edit', $data); - } - - public function update(Request $request) - { - // - } - - public function destroy($id) - { - return TagGroups::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/UnityController.php b/app/Http/Controllers/Shop/Admin/UnityController.php deleted file mode 100644 index 884090ff..00000000 --- a/app/Http/Controllers/Shop/Admin/UnityController.php +++ /dev/null @@ -1,67 +0,0 @@ -render('Shop.Admin.Unities.list', $data); - } - - public function getDatatable(Request $request) - { - return Unities::getTables($request->all()); - } - - public function getOptionsByPackage(Request $request) - { - $id = $request->input('package_id'); - return response()->json(Unities::getOptionsByPackage($id)); - } - - public function create() - { - $data['packages'] = Packages::getOptions(); - return view('Shop.Admin.Unities.create'); - } - - public function store(Request $request) - { - $ret = Unities::store($request->all()); - return redirect()->route('Shop.Admin.Unities.index'); - } - - public function show($id) - { - $data = Unities::get($id); - return view('Shop.Admin.Unities.view', $data); - } - - public function edit($id) - { - $data['packages'] = Packages::getOptions(); - $data['unity'] = Unities::get($id)->toArray(); - return view('Shop.Admin.Unities.edit', $data); - } - - public function destroy($id) - { - return Unities::destroy($id); - } - - public function update($id) { - - } - -} diff --git a/app/Http/Controllers/Shop/ArticleController.php b/app/Http/Controllers/Shop/ArticleController.php index 070ba386..17c80c64 100644 --- a/app/Http/Controllers/Shop/ArticleController.php +++ b/app/Http/Controllers/Shop/ArticleController.php @@ -32,7 +32,7 @@ class ArticleController extends Controller /** * Store a newly created resource in storage. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -43,7 +43,7 @@ class ArticleController extends Controller /** * Display the specified resource. * - * @param \App\Article $article + * @param \App\Article $article * @return \Illuminate\Http\Response */ public function show($id) @@ -54,7 +54,7 @@ class ArticleController extends Controller /** * Show the form for editing the specified resource. * - * @param \App\Article $article + * @param \App\Article $article * @return \Illuminate\Http\Response */ public function edit($id) @@ -65,8 +65,8 @@ class ArticleController extends Controller /** * Update the specified resource in storage. * - * @param \Illuminate\Http\Request $request - * @param \App\Article $article + * @param \Illuminate\Http\Request $request + * @param \App\Article $article * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -77,7 +77,7 @@ class ArticleController extends Controller /** * Remove the specified resource from storage. * - * @param \App\Article $article + * @param \App\Article $article * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/Shop/CategoryController.php b/app/Http/Controllers/Shop/CategoryController.php index b0d7993c..b05c35f8 100644 --- a/app/Http/Controllers/Shop/CategoryController.php +++ b/app/Http/Controllers/Shop/CategoryController.php @@ -6,15 +6,14 @@ use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Repositories\Shop\Categories; -use App\Datatables\Shop\CategoriesDataTable; +use App\Datatables\Shop\CategoriesDataTable; class CategoryController extends Controller { - public function index(CategoriesDataTable $dataTable) { return $dataTable->render('Shop.Categories.list'); - } + } public function getDatatable(Request $request) { @@ -31,5 +30,4 @@ class CategoryController extends Controller { return response()->json(Categories::getTree()); } - } diff --git a/app/Http/Controllers/Shop/CustomerController.php b/app/Http/Controllers/Shop/CustomerController.php index 0a8542ed..5e3d032a 100644 --- a/app/Http/Controllers/Shop/CustomerController.php +++ b/app/Http/Controllers/Shop/CustomerController.php @@ -12,7 +12,7 @@ class CustomerController extends Controller /** * Display the specified resource. * - * @param \App\Customer $customer + * @param \App\Customer $customer * @return \Illuminate\Http\Response */ public function show(Customer $customer) @@ -23,7 +23,7 @@ class CustomerController extends Controller /** * Show the form for editing the specified resource. * - * @param \App\Customer $customer + * @param \App\Customer $customer * @return \Illuminate\Http\Response */ public function edit(Customer $customer) @@ -34,8 +34,8 @@ class CustomerController extends Controller /** * Update the specified resource in storage. * - * @param \Illuminate\Http\Request $request - * @param \App\Customer $customer + * @param \Illuminate\Http\Request $request + * @param \App\Customer $customer * @return \Illuminate\Http\Response */ public function update(Request $request, Customer $customer) @@ -46,7 +46,7 @@ class CustomerController extends Controller /** * Remove the specified resource from storage. * - * @param \App\Customer $customer + * @param \App\Customer $customer * @return \Illuminate\Http\Response */ public function destroy(Customer $customer) diff --git a/app/Http/Controllers/Shop/HomeController.php b/app/Http/Controllers/Shop/HomeController.php index a042d567..8836a637 100644 --- a/app/Http/Controllers/Shop/HomeController.php +++ b/app/Http/Controllers/Shop/HomeController.php @@ -10,27 +10,27 @@ use App\Repositories\Shop\Categories; class HomeController extends Controller { - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() - { - // $this->middleware('auth'); - } + /** + * Create a new controller instance. + * + * @return void + */ + public function __construct() + { + // $this->middleware('auth'); + } - /** - * Show the application dashboard. - * - * @return \Illuminate\Contracts\Support\Renderable - */ - public function index() - { - $data['categories'] = Categories::getTree(); - $data['category'] = Categories::get(15)->toArray(); - $data['articles'] = Articles::getByCategory(0)->toArray(); - // dump($data); - return view('Shop.home', $data); - } + /** + * Show the application dashboard. + * + * @return \Illuminate\Contracts\Support\Renderable + */ + public function index() + { + $data['categories'] = Categories::getTree(); + $data['category'] = Categories::get(15)->toArray(); + $data['articles'] = Articles::getByCategory(0)->toArray(); + // dump($data); + return view('Shop.home', $data); + } } diff --git a/app/Http/Controllers/Shop/InvoiceController.php b/app/Http/Controllers/Shop/InvoiceController.php index 3f214e56..2ab16fdd 100644 --- a/app/Http/Controllers/Shop/InvoiceController.php +++ b/app/Http/Controllers/Shop/InvoiceController.php @@ -32,7 +32,7 @@ class InvoiceController extends Controller /** * Store a newly created resource in storage. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -43,7 +43,7 @@ class InvoiceController extends Controller /** * Display the specified resource. * - * @param \App\Invoice $invoice + * @param \App\Invoice $invoice * @return \Illuminate\Http\Response */ public function show(Invoice $invoice) @@ -54,7 +54,7 @@ class InvoiceController extends Controller /** * Show the form for editing the specified resource. * - * @param \App\Invoice $invoice + * @param \App\Invoice $invoice * @return \Illuminate\Http\Response */ public function edit(Invoice $invoice) @@ -65,8 +65,8 @@ class InvoiceController extends Controller /** * Update the specified resource in storage. * - * @param \Illuminate\Http\Request $request - * @param \App\Invoice $invoice + * @param \Illuminate\Http\Request $request + * @param \App\Invoice $invoice * @return \Illuminate\Http\Response */ public function update(Request $request, Invoice $invoice) @@ -77,7 +77,7 @@ class InvoiceController extends Controller /** * Remove the specified resource from storage. * - * @param \App\Invoice $invoice + * @param \App\Invoice $invoice * @return \Illuminate\Http\Response */ public function destroy(Invoice $invoice) diff --git a/app/Http/Controllers/Shop/OrderController.php b/app/Http/Controllers/Shop/OrderController.php index 33a0410a..acc72888 100644 --- a/app/Http/Controllers/Shop/OrderController.php +++ b/app/Http/Controllers/Shop/OrderController.php @@ -32,7 +32,7 @@ class OrderController extends Controller /** * Store a newly created resource in storage. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -43,7 +43,7 @@ class OrderController extends Controller /** * Display the specified resource. * - * @param \App\Order $order + * @param \App\Order $order * @return \Illuminate\Http\Response */ public function show(Order $order) @@ -54,7 +54,7 @@ class OrderController extends Controller /** * Show the form for editing the specified resource. * - * @param \App\Order $order + * @param \App\Order $order * @return \Illuminate\Http\Response */ public function edit(Order $order) @@ -65,8 +65,8 @@ class OrderController extends Controller /** * Update the specified resource in storage. * - * @param \Illuminate\Http\Request $request - * @param \App\Order $order + * @param \Illuminate\Http\Request $request + * @param \App\Order $order * @return \Illuminate\Http\Response */ public function update(Request $request, Order $order) @@ -77,7 +77,7 @@ class OrderController extends Controller /** * Remove the specified resource from storage. * - * @param \App\Order $order + * @param \App\Order $order * @return \Illuminate\Http\Response */ public function destroy(Order $order) diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 704089a7..aeb9d809 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -9,7 +9,7 @@ class Authenticate extends Middleware /** * Get the path the user should be redirected to when they are not authenticated. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return string|null */ protected function redirectTo($request) diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 2395ddcc..c0760081 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -11,9 +11,9 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * @return mixed */ public function handle($request, Closure $next, $guard = null) diff --git a/app/Imports/CustomersImport.php b/app/Imports/CustomersImport.php index 9c04ddbe..61a5812c 100644 --- a/app/Imports/CustomersImport.php +++ b/app/Imports/CustomersImport.php @@ -14,7 +14,8 @@ class CustomersImport implements ToModel, WithHeadingRow $row['cp'] = (string) $row['cp']; $row['mobile'] = '0' . (string) $row['mobile']; dump($row); - return new Client([ + return new Client( + [ 'civilite' => $row['civilite'], 'name' => $row['nom'], 'firstname' => $row['prenom'], @@ -24,6 +25,7 @@ class CustomersImport implements ToModel, WithHeadingRow 'mobile' => $row['mobile'], 'email' => $row['email'], 'phone' => $row['telephone'], - ]); + ] + ); } } diff --git a/app/Install.php b/app/Install.php index cf585659..ebbaed82 100644 --- a/app/Install.php +++ b/app/Install.php @@ -12,7 +12,7 @@ class Install ->artisan('key:generate', ['--force' => true]) ->artisan('migrate', ['--force' => true]) ->artisan('storage:link') - // ->dispatch(new MakeCronTask) + // ->dispatch(new MakeCronTask) ->external('npm', 'install', '--production') ->external('npm', 'run', 'production') ->artisan('route:cache') diff --git a/app/Menu/Botanic.php b/app/Menu/Botanic.php index a2227468..c183e8ac 100644 --- a/app/Menu/Botanic.php +++ b/app/Menu/Botanic.php @@ -14,14 +14,13 @@ class Botanic ->activeIfRoute('botanic') ->order(4); - $menu->addTo('botanic', 'Familles', [ 'route' => 'Botanic.Admin.Families.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Botanic.Admin.Families.*'])->order(1); - $menu->addTo('botanic', 'Genres', [ 'route' => 'Botanic.Admin.Genres.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Botanic.Admin.Genres.*'])->order(2); - $menu->addTo('botanic', 'Espèces', [ 'route' => 'Botanic.Admin.Species.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Botanic.Admin.Species.*'])->order(3); - $menu->addTo('botanic', 'Variétés', [ 'route' => 'Botanic.Admin.Varieties.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Botanic.Admin.Varieties.*'])->order(4); - + $menu->addTo('botanic', 'Familles', [ 'route' => 'Admin.Botanic.Families.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Botanic.Families.*'])->order(1); + $menu->addTo('botanic', 'Genres', [ 'route' => 'Admin.Botanic.Genres.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Botanic.Genres.*'])->order(2); + $menu->addTo('botanic', 'Espèces', [ 'route' => 'Admin.Botanic.Species.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Botanic.Species.*'])->order(3); + $menu->addTo('botanic', 'Variétés', [ 'route' => 'Admin.Botanic.Varieties.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Botanic.Varieties.*'])->order(4); } } diff --git a/app/Menu/Customers.php b/app/Menu/Customers.php index b107321d..c1c83231 100644 --- a/app/Menu/Customers.php +++ b/app/Menu/Customers.php @@ -13,9 +13,10 @@ class Customers ->activeIfRoute('customers') ->order(3); - $menu->addTo('customers', 'Clients', [ 'route' => 'Shop.Admin.Customers.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Customers.*'])->order(1); - + $menu->addTo('customers', 'Clients', [ 'route' => 'Admin.Shop.Customers.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Customers.*'])->order(1); + $menu->addTo('customers', 'Canaux de vente', [ 'route' => 'Admin.Shop.SaleChannels.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.SaleChannels.*'])->order(1); } } diff --git a/app/Menu/Orders.php b/app/Menu/Orders.php index e29615dc..a4b1a8d6 100644 --- a/app/Menu/Orders.php +++ b/app/Menu/Orders.php @@ -13,14 +13,13 @@ class Orders ->activeIfRoute('orders') ->order(1); - $menu->addTo('orders', 'Commandes', [ 'route' => 'Shop.Admin.Orders.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Orders.*'])->order(1); - $menu->addTo('orders', 'Factures', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(2); - $menu->addTo('orders', 'Avoirs', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(3); - $menu->addTo('orders', 'Bons de livraison', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(4); - + $menu->addTo('orders', 'Commandes', [ 'route' => 'Admin.Shop.Orders.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Orders.*'])->order(1); + $menu->addTo('orders', 'Factures', [ 'route' => 'Admin.Shop.Invoices.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Invoices.*'])->order(2); + $menu->addTo('orders', 'Avoirs', [ 'route' => 'Admin.Shop.Invoices.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Invoices.*'])->order(3); + $menu->addTo('orders', 'Bons de livraison', [ 'route' => 'Admin.Shop.Invoices.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Invoices.*'])->order(4); } } diff --git a/app/Menu/Shop.php b/app/Menu/Shop.php index c6f88c56..a641cbfb 100644 --- a/app/Menu/Shop.php +++ b/app/Menu/Shop.php @@ -13,39 +13,28 @@ class Shop ->activeIfRoute('shop') ->order(2); - $menu->addTo('shop', 'Articles', [ 'route' => 'Shop.Admin.Articles.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Articles.*'])->order(1); - $menu->addTo('shop', 'Rayons', [ 'route' => 'Shop.Admin.Categories.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Categories.*'])->order(2); - $menu->addTo('shop', 'Familles d\'articles', [ 'route' => 'Shop.Admin.ArticleFamilies.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.ArticleFamilies.*'])->order(3); -/* - $menu->addTo('shop', 'Attributs', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(4); -*/ - $menu->addTo('shop', 'Familles de tags', [ 'route' => 'Shop.Admin.TagGroups.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.TagGroups.*'])->order(5); - $menu->addTo('shop', 'Tags', [ 'route' => 'Shop.Admin.Tags.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Tags.*'])->order(6); + $menu->addTo('shop', 'Articles', [ 'route' => 'Admin.Shop.Articles.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Articles.*'])->order(1); + $menu->addTo('shop', 'Déclinaisons', [ 'route' => 'Admin.Shop.Variations.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Variations.*'])->order(2); + $menu->addTo('shop', 'Tarifs', [ 'route' => 'Admin.Shop.Tariffs.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Tariffs.*'])->order(3); + $menu->addTo('shop', 'Offres', [ 'route' => 'Admin.Shop.Offers.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Offers.*'])->order(4); -/* - $menu->addTo('shop', 'Réductions', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(8); - $menu->addTo('shop', 'Stock', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(9); - */ - $menu->addTo('shop', 'Prix génériques', [ 'route' => 'Shop.Admin.PriceGenerics.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.PriceGenerics.*'])->order(10); + $menu->addTo('shop', 'Rayons', [ 'route' => 'Admin.Shop.Categories.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Categories.*'])->order(6); - $menu->addTo('shop', 'Catégories Prix génériques', [ 'route' => 'Shop.Admin.PriceGenericCategories.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.PriceGenericCategories.*'])->order(11); + $menu->addTo('shop', 'Tags', [ 'route' => 'Admin.Shop.Tags.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Tags.*'])->order(8); - $menu->addTo('shop', 'Packages', [ 'route' => 'Shop.Admin.Packages.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Packages.*'])->order(12); + $menu->addTo('shop', 'Natures d\'articles', [ 'route' => 'Admin.Shop.ArticleNatures.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.ArticleNatures.*'])->order(9); - $menu->addTo('shop', 'Unités', [ 'route' => 'Shop.Admin.Unities.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Unities.*'])->order(14); - + $menu->addTo('shop', 'Packages', [ 'route' => 'Admin.Shop.Packages.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Packages.*'])->order(12); + $menu->addTo('shop', 'Unités', [ 'route' => 'Admin.Shop.Unities.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Admin.Shop.Unities.*'])->order(14); } } diff --git a/app/Models/Botanic/Family.php b/app/Models/Botanic/Family.php index 7f45a3d4..ee8068c5 100644 --- a/app/Models/Botanic/Family.php +++ b/app/Models/Botanic/Family.php @@ -3,18 +3,21 @@ namespace App\Models\Botanic; use Illuminate\Database\Eloquent\Model; -use \Staudenmeir\EloquentHasManyDeep\HasRelationships; +use Illuminate\Database\Eloquent\SoftDeletes; + +use Wildside\Userstamps\Userstamps; +use Staudenmeir\EloquentHasManyDeep\HasRelationships; class Family extends Model { - use HasRelationships; + use HasRelationships, SoftDeletes, Userstamps; protected $guarded = ['id']; protected $table = 'botanic_families'; public function genres() { - return $this->hasMany('App\Models\Botanic\Genre'); + return $this->hasMany('App\Models\Botanic\Genre'); } public function species() @@ -27,9 +30,8 @@ class Family extends Model return $this->hasManyDeep('App\Models\Botanic\Variety', ['App\Models\Botanic\Genre', 'App\Models\Botanic\Specie']); } - public function scopeByName($query,$name) + public function scopeByName($query, $name) { - return $query->where('name', $name); + return $query->where('name', $name); } - -} \ No newline at end of file +} diff --git a/app/Models/Botanic/Genre.php b/app/Models/Botanic/Genre.php index f059a6e6..8aa56a25 100644 --- a/app/Models/Botanic/Genre.php +++ b/app/Models/Botanic/Genre.php @@ -3,20 +3,24 @@ namespace App\Models\Botanic; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; +use Wildside\Userstamps\Userstamps; class Genre extends Model { + use SoftDeletes, Userstamps; + protected $guarded = ['id']; protected $table = 'botanic_genres'; public function family() { - return $this->belongsTo('App\Models\Botanic\Family'); + return $this->belongsTo('App\Models\Botanic\Family'); } public function species() { - return $this->hasMany('App\Models\Botanic\Specie'); + return $this->hasMany('App\Models\Botanic\Specie'); } public function varieties() @@ -24,9 +28,8 @@ class Genre extends Model return $this->hasManyThrough('App\Models\Botanic\Variety', 'App\Models\Botanic\Specie'); } - public function scopeByName($query,$name) + public function scopeByName($query, $name) { - return $query->where('name', $name); + return $query->where('name', $name); } - -} \ No newline at end of file +} diff --git a/app/Models/Botanic/Specie.php b/app/Models/Botanic/Specie.php index 0b1ce34e..49e5e2a2 100644 --- a/app/Models/Botanic/Specie.php +++ b/app/Models/Botanic/Specie.php @@ -3,25 +3,35 @@ namespace App\Models\Botanic; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; + +use Wildside\Userstamps\Userstamps; +use Rinvex\Tags\Traits\Taggable; class Specie extends Model { - protected $guarded = ['id']; - protected $table = 'botanic_species'; + use SoftDeletes, Taggable, UserStamps; - public function Genre() + protected $guarded = ['id']; + protected $table = 'botanic_species'; + + public function Genre() { - return $this->belongsTo('App\Models\Botanic\Genre'); + return $this->belongsTo('App\Models\Botanic\Genre'); } public function Varieties() { - return $this->hasMany('App\Models\Botanic\Variety'); + return $this->hasMany('App\Models\Botanic\Variety'); } - public function scopeByName($query,$name) + public function Articles() { - return $query->where('name', $name); + return $this->morphMany('App\Models\Shop\Article', 'product'); } -} \ No newline at end of file + public function scopeByName($query, $name) + { + return $query->where('name', $name); + } +} diff --git a/app/Models/Botanic/Variety.php b/app/Models/Botanic/Variety.php index 96608943..80eeb311 100644 --- a/app/Models/Botanic/Variety.php +++ b/app/Models/Botanic/Variety.php @@ -3,38 +3,40 @@ namespace App\Models\Botanic; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; -use Spatie\Image\Manipulations; -use Spatie\MediaLibrary\Models\Media; -use Spatie\MediaLibrary\HasMedia\HasMedia; -use Spatie\MediaLibrary\HasMedia\HasMediaTrait; +use Spatie\Image\Manipulations; + +use Spatie\MediaLibrary\HasMedia; +use Spatie\MediaLibrary\InteractsWithMedia; +use Spatie\MediaLibrary\MediaCollections\Models\Media; use Rinvex\Tags\Traits\Taggable; use Fico7489\Laravel\EloquentJoin\Traits\EloquentJoin; - +use Wildside\Userstamps\Userstamps; class Variety extends Model implements HasMedia { - use EloquentJoin, HasMediaTrait, Taggable; + use EloquentJoin, InteractsWithMedia, Taggable, SoftDeletes, UserStamps; - protected $guarded = ['id']; - protected $table = 'botanic_varieties'; + protected $guarded = ['id']; + protected $table = 'botanic_varieties'; - public function Specie() - { - return $this->belongsTo('App\Models\Botanic\Specie'); - } + public function Specie() + { + return $this->belongsTo('App\Models\Botanic\Specie'); + } - public function Articles() - { - return $this->morphMany('App\Models\Shop\Article','product'); - } + public function Articles() + { + return $this->morphMany('App\Models\Shop\Article', 'product'); + } - public function registerMediaConversions(Media $media = null) - { - $this->addMediaConversion('thumb')->fit(Manipulations::FIT_CROP, 32, 32); - $this->addMediaConversion('mini')->fit(Manipulations::FIT_CROP, 96, 96); - $this->addMediaConversion('preview')->fit(Manipulations::FIT_CROP, 160, 160); - $this->addMediaConversion('normal')->fit(Manipulations::FIT_CROP, 480, 480); - $this->addMediaConversion('zoom')->fit(Manipulations::FIT_CROP, 1200, 1200)->withResponsiveImages(); - } -} \ No newline at end of file + public function registerMediaConversions(Media $media = null) : void + { + $this->addMediaConversion('thumb')->fit(Manipulations::FIT_CROP, 32, 32); + $this->addMediaConversion('mini')->fit(Manipulations::FIT_CROP, 96, 96); + $this->addMediaConversion('preview')->fit(Manipulations::FIT_CROP, 160, 160); + $this->addMediaConversion('normal')->fit(Manipulations::FIT_CROP, 480, 480); + // $this->addMediaConversion('zoom')->fit(Manipulations::FIT_CROP, 1200, 1200)->withResponsiveImages(); + } +} diff --git a/app/Models/Core/App/Application.php b/app/Models/Core/App/Application.php index f885dd48..c26127e1 100644 --- a/app/Models/Core/App/Application.php +++ b/app/Models/Core/App/Application.php @@ -1,5 +1,4 @@ hasMany('App\Models\Core\App\ApplicationPage'); + return $this->hasMany(\App\Models\Core\App\ApplicationPage::class); } public function modules() { - return $this->hasMany('App\Models\Core\App\ApplicationModule'); + return $this->hasMany(\App\Models\Core\App\ApplicationModule::class); } public function scopeActive($query) diff --git a/app/Models/Core/App/ApplicationClient.php b/app/Models/Core/App/ApplicationClient.php new file mode 100644 index 00000000..7f5e39af --- /dev/null +++ b/app/Models/Core/App/ApplicationClient.php @@ -0,0 +1,47 @@ +belongsTo(\App\Models\Core\App\Application::class); + } + + public function client() + { + return $this->belongsTo('App\Models\Partner\Client'); + } + + public function scopeActive($query) + { + return $query->where('active', 1); + } + + public function scopeByApplication($query, $id) + { + return $query->where('application_id', $id); + } + + public function scopeByClient($query, $id) + { + return $query->where('client_id', $id); + } + + public function scopeBySlug($query, $slug) + { + return $query->whereHas( + 'application', function ($query) use ($slug) { + $query->bySlug($slug); + } + ); + } +} diff --git a/app/Models/Core/App/ApplicationModule.php b/app/Models/Core/App/ApplicationModule.php index f938e4e1..62679dd9 100644 --- a/app/Models/Core/App/ApplicationModule.php +++ b/app/Models/Core/App/ApplicationModule.php @@ -1,5 +1,4 @@ belongsTo('App\Models\Core\App\Application'); + return $this->belongsTo(\App\Models\Core\App\Application::class); } public function permissions() { - return $this->hasMany('App\Auth\Permission'); + return $this->hasMany(\App\Models\Core\Auth\Permission::class); } public function scopeActive($query) diff --git a/app/Models/Core/App/ApplicationPage.php b/app/Models/Core/App/ApplicationPage.php index 965bf6fe..bbe374c9 100644 --- a/app/Models/Core/App/ApplicationPage.php +++ b/app/Models/Core/App/ApplicationPage.php @@ -1,18 +1,18 @@ belongsTo('App\Models\Core\App'); + return $this->belongsTo(\App\Models\Core\App\Application::class); } public function scopeActive($query) diff --git a/app/Models/Core/Auth/PasswordReset.php b/app/Models/Core/Auth/PasswordReset.php new file mode 100644 index 00000000..c93be624 --- /dev/null +++ b/app/Models/Core/Auth/PasswordReset.php @@ -0,0 +1,20 @@ +where('token', $token); + } + + public function scopeByEmail($query, $email) + { + return $query->where('email', $email); + } +} diff --git a/app/Models/Core/Auth/PasswordSecurity.php b/app/Models/Core/Auth/PasswordSecurity.php new file mode 100644 index 00000000..69a3d853 --- /dev/null +++ b/app/Models/Core/Auth/PasswordSecurity.php @@ -0,0 +1,23 @@ +belongsTo('App\Models\Core\Auth\User'); + } +} diff --git a/app/Models/Core/Auth/Permission.php b/app/Models/Core/Auth/Permission.php index 7ab2d197..ad3873b2 100644 --- a/app/Models/Core/Auth/Permission.php +++ b/app/Models/Core/Auth/Permission.php @@ -2,48 +2,20 @@ namespace App\Models\Core\Auth; -use Laratrust\Models\LaratrustPermission; +use Sebastienheyd\Boilerplate\Models\Permission as parentPermission; -/** - * - * @property int $id - * @property string $name - * @property string $display_name - * @property string $description - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Role[] $roles - * - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereCreatedAt($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereDescription($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereDisplayName($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereId($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereName($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereUpdatedAt($value) - * @mixin \Eloquent - */ - -class Permission extends LaratrustPermission +class Permission extends parentPermission { protected $connection = 'mysql'; - + protected $guarded = ['id']; + public function application() { - return $this->belongsTo('App\Models\Core\App\Application'); + return $this->belongsTo(\App\Models\Core\App\Application::class)->withDefault(['name' => '']); } public function application_module() { - return $this->belongsTo('App\Models\Core\App\ApplicationModule'); - } - - public function getDisplayNameAttribute($value) - { - return __($value); - } - - public function getDescriptionAttribute($value) - { - return __($value); + return $this->belongsTo(\App\Models\Core\App\ApplicationModule::class)->withDefault(['name' => '']); } } diff --git a/app/Models/Core/Auth/PermissionCategory.php b/app/Models/Core/Auth/PermissionCategory.php index 33122eb0..e7c7829e 100644 --- a/app/Models/Core/Auth/PermissionCategory.php +++ b/app/Models/Core/Auth/PermissionCategory.php @@ -2,34 +2,8 @@ namespace App\Models\Core\Auth; -/** - * - * - * @property int $id - * @property string $name - * @property string $display_name - * @property string $description - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Role[] $roles - * - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereCreatedAt($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereDescription($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereDisplayName($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereId($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereName($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Permission whereUpdatedAt($value) - * @mixin \Eloquent - */ -class PermissionCategory extends Models -{ - public function getDisplayNameAttribute($value) - { - return __($value); - } +use Sebastienheyd\Boilerplate\Models\permissionCategory as parentPermissionCategory; - public function getDescriptionAttribute($value) - { - return __($value); - } +class PermissionCategory extends parentPermissionCategory +{ } diff --git a/app/Models/Core/Auth/PermissionRole.php b/app/Models/Core/Auth/PermissionRole.php index f723ecb8..75a4845b 100644 --- a/app/Models/Core/Auth/PermissionRole.php +++ b/app/Models/Core/Auth/PermissionRole.php @@ -10,12 +10,12 @@ class PermissionRole extends Model public function permission() { - return $this->belongsTo('App\Models\Core\Auth\Permission'); + return $this->belongsTo(\App\Models\Core\Auth\Permission::class); } public function role() { - return $this->belongsTo('App\Models\Core\Auth\Role'); + return $this->belongsTo(\App\Models\Core\Auth\Role::class); } public function scopeByPermission($query, $id) diff --git a/app/Models/Core/Auth/PermissionUser.php b/app/Models/Core/Auth/PermissionUser.php index 81dbf2c1..7bb1a18f 100644 --- a/app/Models/Core/Auth/PermissionUser.php +++ b/app/Models/Core/Auth/PermissionUser.php @@ -10,17 +10,17 @@ class PermissionUser extends Model public function permission() { - return $this->belongsTo('App\Models\Core\Auth\Permission'); + return $this->belongsTo(\App\Models\Core\Auth\Permission::class); } public function user() { - return $this->belongsTo('App\Models\Core\Auth\User'); + return $this->belongsTo(\App\Models\Core\Auth\User::class); } public function team() { - return $this->belongsTo('App\Models\Core\Auth\Team'); + return $this->belongsTo(\App\Models\Core\Auth\Team::class); } public function scopeByUser($query, $id) diff --git a/app/Models/Core/Auth/Role.php b/app/Models/Core/Auth/Role.php index e5c61c08..5abe020c 100644 --- a/app/Models/Core/Auth/Role.php +++ b/app/Models/Core/Auth/Role.php @@ -2,44 +2,9 @@ namespace App\Models\Core\Auth; -use Laratrust\Models\LaratrustRole; +use Sebastienheyd\Boilerplate\Models\Role as parentRole; -/** - * - * @property int $id - * @property string $name - * @property string $display_name - * @property string $description - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Permission[] $permissions - * - * @method static \Illuminate\Database\Query\Builder|\App\Models\Role whereCreatedAt($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Role whereDescription($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Role whereDisplayName($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Role whereId($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Role whereName($value) - * @method static \Illuminate\Database\Query\Builder|\App\Models\Role whereUpdatedAt($value) - * @mixin \Eloquent - */ - -class Role extends LaratrustRole +class Role extends parentRole { protected $connection = 'mysql'; - protected $guarded = ['id']; - - public function getDisplayNameAttribute($value) - { - return __($value); - } - - public function getDescriptionAttribute($value) - { - return __($value); - } - - public function getNbUsers() - { - return User::whereRoleIs($this->name)->count(); - } } diff --git a/app/Models/Core/Auth/RoleUser.php b/app/Models/Core/Auth/RoleUser.php index df2ded0c..8912eb66 100644 --- a/app/Models/Core/Auth/RoleUser.php +++ b/app/Models/Core/Auth/RoleUser.php @@ -1,5 +1,4 @@ belongsTo('App\Models\Core\Auth\User'); + return $this->belongsTo(\App\Models\Core\Auth\User::class); } public function team() { - return $this->belongsTo('App\Models\Core\Auth\Team'); + return $this->belongsTo(\App\Models\Core\Auth\Team::class); } public function scopeByUser($query, $id) diff --git a/app/Models/Core/Auth/Team.php b/app/Models/Core/Auth/Team.php index 3b54f849..4933fb7f 100644 --- a/app/Models/Core/Auth/Team.php +++ b/app/Models/Core/Auth/Team.php @@ -15,12 +15,11 @@ class Team extends LaratrustTeam public function users() { - return $this->hasMany('App\Models\Core\Auth\User'); + return $this->hasMany(\App\Models\Core\Auth\User::class); } public function scopeActive($query) { return $query->where('active', 1); } - } diff --git a/app/Models/Core/Auth/TeamUser.php b/app/Models/Core/Auth/TeamUser.php index 91d8539b..62130150 100644 --- a/app/Models/Core/Auth/TeamUser.php +++ b/app/Models/Core/Auth/TeamUser.php @@ -11,12 +11,12 @@ class TeamUser extends Model public function user() { - return $this->belongsTo('App\Models\Core\Auth\User'); + return $this->belongsTo(\App\Models\Core\Auth\User::class); } public function team() { - return $this->belongsTo('App\Models\Core\Auth\Team'); + return $this->belongsTo(\App\Models\Core\Auth\Team::class); } public function scopeByUser($query, $id) diff --git a/app/Models/Core/Auth/User.php b/app/Models/Core/Auth/User.php index 9c1f58ec..a9ea95c0 100644 --- a/app/Models/Core/Auth/User.php +++ b/app/Models/Core/Auth/User.php @@ -5,65 +5,21 @@ namespace App\Models\Core\Auth; use Carbon\Carbon; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\SoftDeletes; -use Illuminate\Foundation\Auth\User as Authenticatable; -use Illuminate\Notifications\Notifiable; use Yadahan\AuthenticationLog\AuthenticationLogable; -use Laratrust\Traits\LaratrustUserTrait; -use Mpociot\Teamwork\Traits\UserHasTeams; -use Sebastienheyd\Boilerplate\Notifications\NewUser as NewUserNotification; -use Sebastienheyd\Boilerplate\Notifications\ResetPassword as ResetPasswordNotification; +use HighIdeas\UsersOnline\Traits\UsersOnlineTrait; +use Sebastienheyd\Boilerplate\Models\User as parentUser; -/** - * Sebastienheyd\Boilerplate\Models\User. - * - * @property int $id - * @property bool $active - * @property string $first_name - * @property string $last_name - * @property string $email - * @property string $password - * @property string $remember_token - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property string $deleted_at - * @property string $last_login - * @property-read string|false $avatar_path - * @property-read string $avatar_url - * @property-read mixed $name - * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications - * @property-read \Illuminate\Database\Eloquent\Collection|\Sebastienheyd\Boilerplate\Models\Permission[] $permissions - * @property-read \Illuminate\Database\Eloquent\Collection|\Sebastienheyd\Boilerplate\Models\Role[] $roles - * - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereActive($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereCreatedAt($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereDeletedAt($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereEmail($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereFirstName($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereId($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereLastLogin($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereLastName($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User wherePassword($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereRememberToken($value) - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereRoleIs($role = '') - * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereUpdatedAt($value) - * @mixin \Eloquent - */ - - -class User extends Authenticatable +class User extends parentUser { - use Notifiable; - use LaratrustUserTrait; - use SoftDeletes; - use UserHasTeams; - use AuthenticationLogable; - + // use UserHasTeams; + use AuthenticationLogable, SoftDeletes, UsersOnlineTrait; + /** * The attributes that are mass assignable. * * @var array */ - protected $fillable = ['active', 'last_name', 'first_name', 'email', 'password', 'remember_token', 'last_login']; + protected $fillable = ['active', 'last_name', 'first_name', 'username', 'email', 'password', 'remember_token', 'last_login']; protected $hidden = ['password', 'remember_token']; @@ -77,16 +33,23 @@ class User extends Authenticatable 'email_verified_at' => 'datetime', ]; + public function passwordSecurity() + { + return $this->hasOne('App\Models\Core\Auth\PasswordSecurity'); + } + public function teams() { - return $this->hasManyThrough('App\Models\Core\Auth\Team', 'App\Models\Core\Auth\TeamUser', 'user_id', 'id', 'id', 'team_id'); + return $this->hasManyThrough(\App\Models\Core\Auth\Team::class, \App\Models\Core\Auth\TeamUser::class, 'user_id', 'id', 'id', 'team_id'); } public function scopeByTeam($query, $id) { - return $query->whereHas('teams', function ($query) use ($id) { - $query->where('id', $id); - }); + return $query->whereHas( + 'teams', function ($query) use ($id) { + $query->where('id', $id); + } + ); } public function scopeByUniqueTeam($query) @@ -98,128 +61,4 @@ class User extends Authenticatable { return $query->where('active', 1); } - - /** - * Send the password reset notification. - * - * @param string $token - * - * @return void - */ - public function sendPasswordResetNotification($token) - { - $this->notify(new ResetPasswordNotification($token)); - } - - /** - * Send notification when a new user is created. - * - * @param string $token - */ - public function sendNewUserNotification($token) - { - $this->notify(new NewUserNotification($token, $this)); - } - - /** - * Return last name in uppercase by default. - * - * @param $value - * - * @return string - */ - public function getLastNameAttribute($value) - { - return mb_strtoupper($value); - } - - /** - * Return first name with first char of every word in uppercase. - * - * @param $value - * - * @return string - */ - public function getFirstNameAttribute($value) - { - return mb_convert_case($value, MB_CASE_TITLE); - } - - /** - * Return a concatenation of first name and last_name if field name does not exists. - * - * @param $value - * - * @return string - */ - public function getNameAttribute($value) - { - if (!empty($value)) { - return $value; - } - - return $this->first_name.' '.$this->last_name; - } - - /** - * Return last login date formatted. - * - * @param string $format - * @param string $default - * - * @return mixed|string - */ - public function getLastLogin($format = 'YYYY-MM-DD HH:mm:ss', $default = '') - { - if ($this->last_login === null) { - return $default; - } - - return Carbon::createFromTimeString($this->last_login)->isoFormat($format); - } - - /** - * Return role list as a string. - * - * @return string - */ - public function getRolesList() - { - $res = []; - foreach ($this->roles as $role) { - $res[] = __($role->display_name); - } - if (empty($res)) { - return '-'; - } - - return implode(', ', $res); - } - - /** - * Check if current user has an avatar. - * - * @return string|false - */ - public function getAvatarPathAttribute() - { - return public_path('images/avatars/'.md5($this->id.$this->email).'.jpg'); - } - - /** - * Return current user avatar uri. - * - * @return string - */ - public function getAvatarUrlAttribute() - { - if (is_file($this->avatar_path)) { - $ts = filemtime($this->avatar_path); - - return asset('images/avatars/'.md5($this->id.$this->email).'.jpg?t='.$ts); - } - - return asset('/assets/vendor/boilerplate/images/default-user.png'); - } - } diff --git a/app/Models/Core/Auth/UserClient.php b/app/Models/Core/Auth/UserClient.php new file mode 100644 index 00000000..b20589ab --- /dev/null +++ b/app/Models/Core/Auth/UserClient.php @@ -0,0 +1,33 @@ +belongsTo('App\Models\Partner\Client'); + } + + public function user() + { + return $this->belongsTo('App\Models\User'); + } + + public function scopeByClient($query, $id) + { + return $query->where('client_id', $id); + } + + public function scopeByUser($query, $id) + { + return $query->where('user_id', $id); + } +} diff --git a/app/Models/Core/Auth/UserStatus.php b/app/Models/Core/Auth/UserStatus.php new file mode 100644 index 00000000..55de889c --- /dev/null +++ b/app/Models/Core/Auth/UserStatus.php @@ -0,0 +1,32 @@ +where('name', $name); + } + + public function scopeByTranslated($query, $translated) + { + return $query->where('translated', $translated); + } + + public function scopeByNegociator($query) + { + return $query->where('negociator', '>', 0); + } + + public function scopeActive($query) + { + return $query->where('active', 1); + } +} diff --git a/app/Models/Core/Auth/UserStatusTeam.php b/app/Models/Core/Auth/UserStatusTeam.php new file mode 100644 index 00000000..a3129771 --- /dev/null +++ b/app/Models/Core/Auth/UserStatusTeam.php @@ -0,0 +1,32 @@ +belongsTo(\App\Models\Core\Auth\UserStatus::class); + } + + public function team() + { + return $this->belongsTo(\App\Models\Core\Auth\Team::class); + } + + public function scopeByUserStatus($query, $id) + { + return $query->where('user_status_id', $id); + } + + public function scopeByTeam($query, $id) + { + return $query->where('team_id', $id); + } +} diff --git a/app/Models/Core/Media.php b/app/Models/Core/Media.php index 466e47a8..f773f7a4 100644 --- a/app/Models/Core/Media.php +++ b/app/Models/Core/Media.php @@ -8,5 +8,4 @@ use Illuminate\Database\Eloquent\SoftDeletes; class Media extends Model { protected $table = 'media'; - } diff --git a/app/Models/Shop/Article.php b/app/Models/Shop/Article.php index d27cc922..782764cb 100644 --- a/app/Models/Shop/Article.php +++ b/app/Models/Shop/Article.php @@ -3,80 +3,81 @@ namespace App\Models\Shop; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; use Spatie\Image\Manipulations; -use Spatie\MediaLibrary\Models\Media; -use Spatie\MediaLibrary\HasMedia\HasMedia; -use Spatie\MediaLibrary\HasMedia\HasMediaTrait; + +use Spatie\MediaLibrary\HasMedia; +use Spatie\MediaLibrary\InteractsWithMedia; +use Spatie\MediaLibrary\MediaCollections\Models\Media; use Rinvex\Categories\Traits\Categorizable; use Rinvex\Tags\Traits\Taggable; use Fico7489\Laravel\EloquentJoin\Traits\EloquentJoin; +use Wildside\Userstamps\Userstamps; class Article extends Model implements HasMedia { - use Categorizable, EloquentJoin, HasMediaTrait, Taggable; + use Categorizable, EloquentJoin, InteractsWithMedia, Taggable, SoftDeletes, UserStamps; - protected $guarded = ['id']; - protected $table = 'shop_articles'; + protected $guarded = ['id']; + protected $table = 'shop_articles'; - public function article_family() - { - return $this->belongsTo('App\Models\Shop\ArticleFamily'); - } + public function article_nature() + { + return $this->belongsTo('App\Models\Shop\ArticleNature'); + } - public function images() - { - return $this->hasMany('App\Models\Core\Media','model_id')->where('model_type','App\Models\Shop\Article'); - } + public function images() + { + return $this->hasMany('App\Models\Core\Media', 'model_id')->where('model_type', 'App\Models\Shop\Article'); + } - public function image() - { - return $this->hasOne('App\Models\Core\Media','model_id')->where('model_type','App\Models\Shop\Article'); - } + public function image() + { + return $this->hasOne('App\Models\Core\Media', 'model_id')->where('model_type', 'App\Models\Shop\Article'); + } - public function inventories() - { - return $this->hasMany('App\Models\Shop\Inventory'); - } + public function inventories() + { + return $this->hasMany('App\Models\Shop\Inventory'); + } - public function invoiceItems() - { - return $this->hasMany('App\Models\Shop\InvoiceItem'); - } + public function invoiceItems() + { + return $this->hasMany('App\Models\Shop\InvoiceItem'); + } - public function prices() - { - return $this->hasMany('App\Models\Shop\Price'); - } + public function prices() + { + return $this->hasMany('App\Models\Shop\Price'); + } - public function product() - { - return $this->morphTo(); - } + public function product() + { + return $this->morphTo(); + } - public function scopeByArticle($query, $id) - { - return $query->where('shop_articles.id',$id); - } + public function scopeByArticle($query, $id) + { + return $query->where('shop_articles.id', $id); + } - public function scopeByCategory($query, $category_id) - { + public function scopeByCategory($query, $category_id) + { + } - } + public function scopeByFamily($query, $id) + { + return $query->where('shop_articles.article_family_id', $id); + } - public function scopeByFamily($query, $id) - { - return $query->where('shop_articles.article_family_id',$id); - } - - public function registerMediaConversions(Media $media = null) - { - $this->addMediaConversion('thumb')->fit(Manipulations::FIT_CROP, 32, 32); - $this->addMediaConversion('mini')->fit(Manipulations::FIT_CROP, 96, 96); - $this->addMediaConversion('preview')->fit(Manipulations::FIT_CROP, 160, 160); - $this->addMediaConversion('normal')->fit(Manipulations::FIT_CROP, 480, 480); - $this->addMediaConversion('zoom')->fit(Manipulations::FIT_CROP, 1200, 1200)->withResponsiveImages(); - } - -} \ No newline at end of file + public function registerMediaConversions(Media $media = null) : void + { + $this->addMediaConversion('thumb')->fit(Manipulations::FIT_CROP, 32, 32); + $this->addMediaConversion('mini')->fit(Manipulations::FIT_CROP, 96, 96); + $this->addMediaConversion('preview')->fit(Manipulations::FIT_CROP, 160, 160); + $this->addMediaConversion('normal')->fit(Manipulations::FIT_CROP, 480, 480); + $this->addMediaConversion('zoom')->fit(Manipulations::FIT_CROP, 1200, 1200)->withResponsiveImages(); + } +} diff --git a/app/Models/Shop/ArticleComponent.php b/app/Models/Shop/ArticleComponent.php deleted file mode 100644 index 7f457ff6..00000000 --- a/app/Models/Shop/ArticleComponent.php +++ /dev/null @@ -1,17 +0,0 @@ -belongsTo('App\Models\Shop\Article'); - } - -} \ No newline at end of file diff --git a/app/Models/Shop/ArticleFamily.php b/app/Models/Shop/ArticleFamily.php deleted file mode 100644 index d259a0ff..00000000 --- a/app/Models/Shop/ArticleFamily.php +++ /dev/null @@ -1,29 +0,0 @@ -hasMany('App\Models\Shop\Article'); - } - - public function prices() - { - return $this->hasMany('App\Models\Shop\Price'); - } - - public function packages() - { - return $this->hasMany('App\Models\Shop\Package'); - } -} \ No newline at end of file diff --git a/app/Models/Shop/ArticleNature.php b/app/Models/Shop/ArticleNature.php new file mode 100644 index 00000000..5d086206 --- /dev/null +++ b/app/Models/Shop/ArticleNature.php @@ -0,0 +1,22 @@ +hasMany('App\Models\Shop\Article'); + } +} diff --git a/app/Models/Shop/ArticlePrice.php b/app/Models/Shop/ArticlePrice.php index f078e8d6..b82d549c 100644 --- a/app/Models/Shop/ArticlePrice.php +++ b/app/Models/Shop/ArticlePrice.php @@ -7,28 +7,28 @@ use Znck\Eloquent\Traits\BelongsToThrough; class ArticlePrice extends Model { - use BelongsToThrough; + use BelongsToThrough; - protected $guarded = ['id']; - protected $table = 'shop_article_prices'; + protected $guarded = ['id']; + protected $table = 'shop_article_prices'; - public function price() - { - return $this->hasOne('App\Models\Price'); - } + public function price() + { + return $this->hasOne('App\Models\Price'); + } - public function article_family() - { - return $this->belongsTo('App\Models\ArticleFamily'); - } + public function article_family() + { + return $this->belongsTo('App\Models\ArticleNature'); + } - public function scopeByQuantity($query, $quantity) - { - return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first(); - } + public function scopeByQuantity($query, $quantity) + { + return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first(); + } - public function scopeByFamily($query, $id) + public function scopeByFamily($query, $id) { return $query->where('article_family_value_id', $id); - } -} \ No newline at end of file + } +} diff --git a/app/Models/Shop/Basket.php b/app/Models/Shop/Basket.php new file mode 100644 index 00000000..9ade8f02 --- /dev/null +++ b/app/Models/Shop/Basket.php @@ -0,0 +1,24 @@ +morphedByMany('App\Models\Shop\Article', 'categorizable'); + } +} diff --git a/app/Models/Shop/Category.php b/app/Models/Shop/Category.php index 054fb977..4252bdc3 100644 --- a/app/Models/Shop/Category.php +++ b/app/Models/Shop/Category.php @@ -3,8 +3,11 @@ namespace App\Models\Shop; use Illuminate\Database\Eloquent\Model; -use Spatie\MediaLibrary\HasMedia\HasMedia; -use Spatie\MediaLibrary\HasMedia\HasMediaTrait; + +use Spatie\MediaLibrary\HasMedia; +use Spatie\MediaLibrary\InteractsWithMedia; +use Spatie\MediaLibrary\MediaCollections\Models\Media; + // use Rinvex\Categories\Traits\Categorizable; use Rinvex\Tags\Traits\Taggable; // use Conner\Tagging\Taggable; @@ -12,14 +15,13 @@ use Fico7489\Laravel\EloquentJoin\Traits\EloquentJoin; class Category extends Model { - use Taggable, HasMediaTrait; + use InteractsWithMedia, Taggable; protected $guarded = ['id']; - protected $table = 'shop_categories'; + protected $table = 'shop_categories'; public function Articles() { return $this->morphedByMany('App\Models\Shop\Article', 'categorizable'); } - -} \ No newline at end of file +} diff --git a/app/Models/Shop/Customer.php b/app/Models/Shop/Customer.php index 1b820cc4..693a6ca1 100644 --- a/app/Models/Shop/Customer.php +++ b/app/Models/Shop/Customer.php @@ -6,21 +6,21 @@ use Illuminate\Database\Eloquent\Model; class Customer extends Model { - protected $guarded = ['id']; - protected $table = 'shop_customers'; - - public function Invoices() - { - return $this->hasMany('App\Models\Shop\Invoice'); - } + protected $guarded = ['id']; + protected $table = 'shop_customers'; + + public function Invoices() + { + return $this->hasMany('App\Models\Shop\Invoice'); + } - public function Orders() - { - return $this->hasMany('App\Models\Shop\Order'); - } + public function Orders() + { + return $this->hasMany('App\Models\Shop\Order'); + } - public function User() - { - return $this->belongsTo('App\User'); - } -} \ No newline at end of file + public function User() + { + return $this->belongsTo('App\User'); + } +} diff --git a/app/Models/Shop/CustomerAddress.php b/app/Models/Shop/CustomerAddress.php index eea8762a..e872923d 100644 --- a/app/Models/Shop/CustomerAddress.php +++ b/app/Models/Shop/CustomerAddress.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class CustomerAddress extends Model { - protected $guarded = ['id']; + protected $guarded = ['id']; public function Customer() { @@ -17,5 +17,4 @@ class CustomerAddress extends Model { return $this->hasMany('App\Models\Shop\Order'); } - -} \ No newline at end of file +} diff --git a/app/Models/Shop/DistributionChannel.php b/app/Models/Shop/DistributionChannel.php new file mode 100644 index 00000000..42fd5399 --- /dev/null +++ b/app/Models/Shop/DistributionChannel.php @@ -0,0 +1,19 @@ +hasMany('App\Models\Shop\TariffGeneric'); + } +} diff --git a/app/Models/Shop/Invoice.php b/app/Models/Shop/Invoice.php index e48881cf..64c83796 100644 --- a/app/Models/Shop/Invoice.php +++ b/app/Models/Shop/Invoice.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class Invoice extends Model { - protected $guarded = ['id']; + protected $guarded = ['id']; /** * @return \Illuminate\Database\Eloquent\Relations\HasMany @@ -23,4 +23,4 @@ class Invoice extends Model { return $this->belongsTo('App\Models\Shop\Customer'); } -} \ No newline at end of file +} diff --git a/app/Models/Shop/InvoiceItem.php b/app/Models/Shop/InvoiceItem.php index feb425d9..d0cba56b 100644 --- a/app/Models/Shop/InvoiceItem.php +++ b/app/Models/Shop/InvoiceItem.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class InvoiceItem extends Model { - protected $guarded = ['id']; + protected $guarded = ['id']; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo @@ -23,4 +23,4 @@ class InvoiceItem extends Model { return $this->belongsTo('App\Models\Shop\Invoice'); } -} \ No newline at end of file +} diff --git a/app/Models/Shop/Merchandise.php b/app/Models/Shop/Merchandise.php new file mode 100644 index 00000000..795bcd7d --- /dev/null +++ b/app/Models/Shop/Merchandise.php @@ -0,0 +1,20 @@ +morphMany('App\Models\Shop\Article', 'product'); + } +} diff --git a/app/Models/Shop/Offer.php b/app/Models/Shop/Offer.php new file mode 100644 index 00000000..e26cf4cd --- /dev/null +++ b/app/Models/Shop/Offer.php @@ -0,0 +1,26 @@ +belongsTo('App\Models\Shop\Article'); + } + + public function variation() + { + return $this->belongsTo('App\Models\Shop\Variation'); + } + + public function tariff() + { + return $this->belongsTo('App\Models\Shop\Tariff'); + } +} diff --git a/app/Models/Shop/Order.php b/app/Models/Shop/Order.php index 209169f9..dbf0fefe 100644 --- a/app/Models/Shop/Order.php +++ b/app/Models/Shop/Order.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class Order extends Model { - protected $guarded = ['id']; + protected $guarded = ['id']; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo @@ -23,4 +23,4 @@ class Order extends Model { return $this->hasMany('App\Models\Shop\OrderPayment'); } -} \ No newline at end of file +} diff --git a/app/Models/Shop/OrderPayment.php b/app/Models/Shop/OrderPayment.php index 4232c8f1..ed009fac 100644 --- a/app/Models/Shop/OrderPayment.php +++ b/app/Models/Shop/OrderPayment.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class OrderPayment extends Model { - protected $guarded = ['id']; + protected $guarded = ['id']; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo @@ -15,6 +15,4 @@ class OrderPayment extends Model { return $this->belongsTo('App\Models\Shop\Order'); } - - } diff --git a/app/Models/Shop/Package.php b/app/Models/Shop/Package.php index 83055df8..bf2d6429 100644 --- a/app/Models/Shop/Package.php +++ b/app/Models/Shop/Package.php @@ -6,21 +6,21 @@ use Illuminate\Database\Eloquent\Model; class Package extends Model { - protected $guarded = ['id']; - protected $table = 'shop_packages'; + protected $guarded = ['id']; + protected $table = 'shop_packages'; - public function article_family() - { - return $this->belongsTo('App\Models\Shop\ArticleFamily'); - } + public function article_family() + { + return $this->belongsTo('App\Models\Shop\ArticleNature'); + } - public function unities() - { - return $this->hasMany('App\Models\Shop\Unity'); - } + public function unities() + { + return $this->hasMany('App\Models\Shop\Unity'); + } - public function scopeByArticleFamily($query, $id) - { - return $query->where('article_family_id', $id); - } + public function scopeByArticleNature($query, $id) + { + return $query->where('article_family_id', $id); + } } diff --git a/app/Models/Shop/Price.php b/app/Models/Shop/Price.php index bfda0056..7476c1ea 100644 --- a/app/Models/Shop/Price.php +++ b/app/Models/Shop/Price.php @@ -2,54 +2,33 @@ namespace App\Models\Shop; -use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Model; use Staudenmeir\EloquentHasManyDeep\HasRelationships; class Price extends Model { - use HasRelationships; + use HasRelationships; - protected $guarded = ['id']; - protected $table = 'shop_prices'; + protected $guarded = ['id']; + protected $table = 'shop_prices'; - public function article() - { - return $this->belongsTo('App\Models\Shop\Article'); - } + public function article() + { + return $this->belongsTo('App\Models\Shop\Article'); + } - public function article_family() - { - return $this->belongsTo('App\Models\Shop\ArticleFamily'); - } + public function article_family() + { + return $this->belongsTo('App\Models\Shop\ArticleNature'); + } - public function generic() - { - return $this->belongsTo('App\Models\Shop\PriceGeneric', 'price_generic_id'); - } + public function scopeByArticle($query, $id) + { + return $query->where('article_id', $id); + } - public function generic_prices() - { - - } - - public function scopeByArticle($query, $id) - { - return $query->where('article_id', $id); - } - - public function scopeByArticleFamily($query, $id) - { - return $query->where('article_family_id', $id); - } - - public function scopeGeneric($query) - { - return $query->whereNotNull('price_generic_id'); - } - - public function scopeNotGeneric($query) - { - return $query->whereNull('price_generic_id'); - } - -} \ No newline at end of file + public function scopeByArticleNature($query, $id) + { + return $query->where('article_family_id', $id); + } +} diff --git a/app/Models/Shop/PriceGeneric.php b/app/Models/Shop/PriceGeneric.php deleted file mode 100644 index 82a96dfa..00000000 --- a/app/Models/Shop/PriceGeneric.php +++ /dev/null @@ -1,40 +0,0 @@ -hasOne('App\Models\Shop\PriceGenericCategory','id','category_id'); - } - - public function prices() - { - return $this->hasMany('App\Models\Shop\PriceGenericValue','price_generic_id')->whereNotNull('price_generic_id'); - } - - public function priceByUnit() - { - return $this->hasOne('App\Models\Shop\PriceGenericValue')->orderBy('quantity','asc'); - } - - public function articles() - { - return $this->hasManyThrough('App\Models\Shop\Article','App\Models\Shop\Price'); - } - - public function scopeByCategory($query, $id) - { - return $query->where('category_id', $id); - } - -} \ No newline at end of file diff --git a/app/Models/Shop/PriceGenericCategory.php b/app/Models/Shop/PriceGenericCategory.php index afce5505..dcb3c501 100644 --- a/app/Models/Shop/PriceGenericCategory.php +++ b/app/Models/Shop/PriceGenericCategory.php @@ -6,18 +6,16 @@ use Illuminate\Database\Eloquent\Model; class PriceGenericCategory extends Model { - - protected $guarded = ['id']; + protected $guarded = ['id']; protected $table = 'shop_price_generic_categories'; public function article_family() { - return $this->belongsTo('App\Models\Shop\ArticleFamily'); + return $this->belongsTo('App\Models\Shop\ArticleNature'); } public function price_generics() { - return $this->hasMany('App\Models\Shop\PriceGeneric','category_id'); + return $this->hasMany('App\Models\Shop\PriceGeneric', 'category_id'); } - -} \ No newline at end of file +} diff --git a/app/Models/Shop/PriceGenericValue.php b/app/Models/Shop/PriceGenericValue.php deleted file mode 100644 index c922ddd4..00000000 --- a/app/Models/Shop/PriceGenericValue.php +++ /dev/null @@ -1,30 +0,0 @@ -belongsTo('App\Models\Shop\PriceGeneric'); - } - - public function scopeByPriceGeneric($query, $id) - { - return $query->where('price_generic_id', $id); - } - - public function scopeByQuantity($query, $quantity) - { - return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first(); - } - -} \ No newline at end of file diff --git a/app/Models/Shop/PriceList.php b/app/Models/Shop/PriceList.php new file mode 100644 index 00000000..df1eaaee --- /dev/null +++ b/app/Models/Shop/PriceList.php @@ -0,0 +1,29 @@ +belongsTo('App\Models\Shop\Tariff'); + } + + public function sale_channel() + { + return $this->belongsTo('App\Models\Shop\SaleChannel'); + } + + public function price_list_values() + { + return $this->hasMany('App\Models\Shop\PriceListValue'); + } +} diff --git a/app/Models/Shop/PriceListValue.php b/app/Models/Shop/PriceListValue.php new file mode 100644 index 00000000..24ea4bad --- /dev/null +++ b/app/Models/Shop/PriceListValue.php @@ -0,0 +1,32 @@ +belongsTo('App\Models\Shop\PriceList'); + } + + public function scopeByPriceList($query, $id) + { + return $query->where('price_list_id', $id); + } + + public function scopeByQuantity($query, $quantity) + { + return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first(); + } +} diff --git a/app/Models/Shop/SaleChannel.php b/app/Models/Shop/SaleChannel.php new file mode 100644 index 00000000..24d55b79 --- /dev/null +++ b/app/Models/Shop/SaleChannel.php @@ -0,0 +1,11 @@ +hasMany('App\Models\Shop\Article'); + } + + public function prices() + { + return $this->hasMany('App\Models\Shop\Price'); + } + + public function packages() + { + return $this->hasMany('App\Models\Shop\Package'); + } +} diff --git a/app/Models/Shop/Tag.php b/app/Models/Shop/Tag.php index e69a78a4..8cd7d86f 100644 --- a/app/Models/Shop/Tag.php +++ b/app/Models/Shop/Tag.php @@ -6,21 +6,20 @@ use Illuminate\Database\Eloquent\Model; class Tag extends Model { - protected $guarded = ['id']; + protected $guarded = ['id']; - public function group() - { - return $this->hasOne('App\Models\Shop\TagGroup','id','tag_group_id'); - } + public function group() + { + return $this->hasOne('App\Models\Shop\TagGroup', 'id', 'tag_group_id'); + } - public function scopeByGroup($query, $id) - { - return $query->where('tag_group_id', $id); - } - - public function getNameAttribute($value) - { - return json_decode($value)->fr; - } + public function scopeByGroup($query, $id) + { + return $query->where('tag_group_id', $id); + } + public function getNameAttribute($value) + { + return json_decode($value)->fr; + } } diff --git a/app/Models/Shop/TagGroup.php b/app/Models/Shop/TagGroup.php index 31070d6a..06444720 100644 --- a/app/Models/Shop/TagGroup.php +++ b/app/Models/Shop/TagGroup.php @@ -6,17 +6,17 @@ use Illuminate\Database\Eloquent\Model; class TagGroup extends Model { - protected $guarded = ['id']; - protected $table = 'tag_groups'; - public $timestamps = false; + protected $guarded = ['id']; + protected $table = 'tag_groups'; + public $timestamps = false; - public function tags() - { - return $this->hasMany('App\Models\Shop\Tag'); - } + public function tags() + { + return $this->hasMany('App\Models\Shop\Tag'); + } - public function article_family() - { - return $this->belongsTo('App\Models\Shop\ArticleFamily'); - } + public function article_family() + { + return $this->belongsTo('App\Models\Shop\ArticleNature'); + } } diff --git a/app/Models/Shop/Tariff.php b/app/Models/Shop/Tariff.php new file mode 100644 index 00000000..4205038d --- /dev/null +++ b/app/Models/Shop/Tariff.php @@ -0,0 +1,30 @@ +belongsTo('App\Models\Shop\SaleChannel'); + } + + public function tariff_unity() + { + return $this->belongsTo('App\Models\Shop\TariffUnity'); + } + + public function price_lists() + { + return $this->hasMany('App\Models\Shop\PriceList'); + } +} diff --git a/app/Models/Shop/TariffUnity.php b/app/Models/Shop/TariffUnity.php new file mode 100644 index 00000000..93ade489 --- /dev/null +++ b/app/Models/Shop/TariffUnity.php @@ -0,0 +1,16 @@ +hasMany('App\Models\Shop\Tariff'); + } +} diff --git a/app/Models/Shop/Tax.php b/app/Models/Shop/Tax.php index 4f3a333a..6df7755e 100644 --- a/app/Models/Shop/Tax.php +++ b/app/Models/Shop/Tax.php @@ -6,12 +6,11 @@ use Illuminate\Database\Eloquent\Model; class Tax extends Model { - protected $guarded = ['id']; + protected $guarded = ['id']; protected $table = 'shop_taxes'; public function price() { - return $this->hasMany('App\Models\Shop\ArticlePrice','id','tax_id'); + return $this->hasMany('App\Models\Shop\ArticlePrice', 'id', 'tax_id'); } - } diff --git a/app/Models/Shop/Unity.php b/app/Models/Shop/Unity.php index f11a7493..543806b5 100644 --- a/app/Models/Shop/Unity.php +++ b/app/Models/Shop/Unity.php @@ -9,38 +9,41 @@ use Znck\Eloquent\Traits\BelongsToThrough; class Unity extends Model { - use BelongsToThrough, softDeletes; + use BelongsToThrough, softDeletes; - protected $guarded = ['id']; - protected $table = 'shop_unities'; + protected $guarded = ['id']; + protected $table = 'shop_unities'; - public function package() - { - return $this->belongsTo('App\Models\Shop\Package'); - } + public function package() + { + return $this->belongsTo('App\Models\Shop\Package'); + } - public function article_family() - { - return $this->belongsToThrough('App\Models\Shop\ArticleFamily', 'App\Models\Shop\Package', null, '', ['App\Models\Shop\ArticleFamily' => 'article_family_id', 'App\Models\Shop\Package' => 'package_id']); - } + public function article_family() + { + return $this->belongsToThrough('App\Models\Shop\ArticleNature', 'App\Models\Shop\Package', null, '', ['App\Models\Shop\ArticleNature' => 'article_family_id', 'App\Models\Shop\Package' => 'package_id']); + } - public function scopeByPackage($query, $id) - { - return $query->where('package_id', $id); - } + public function scopeByPackage($query, $id) + { + return $query->where('package_id', $id); + } - public function scopeByArticleFamily($query, $id) - { - return $query->whereHas('package', function ($query) use ($id) { - $query->byArticleFamily($id); - }); - } - - public function scopeActive($query, $active = 1) - { - return $query->whereHas('third_party', function ($query) use ($active) { - $query->active($active); - }); - } + public function scopeByArticleNature($query, $id) + { + return $query->whereHas( + 'package', function ($query) use ($id) { + $query->byArticleNature($id); + } + ); + } + public function scopeActive($query, $active = 1) + { + return $query->whereHas( + 'third_party', function ($query) use ($active) { + $query->active($active); + } + ); + } } diff --git a/app/Models/Shop/Variation.php b/app/Models/Shop/Variation.php new file mode 100644 index 00000000..93fe7982 --- /dev/null +++ b/app/Models/Shop/Variation.php @@ -0,0 +1,21 @@ +belongsTo('App\Models\Shop\Package'); + } + + public function unity() + { + return $this->belongsTo('App\Models\Shop\Unity'); + } +} diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 395c518b..9529056e 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -16,6 +16,6 @@ class BroadcastServiceProvider extends ServiceProvider { Broadcast::routes(); - require base_path('routes/channels.php'); + include base_path('routes/channels.php'); } } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 527eee34..540d17b4 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -59,8 +59,8 @@ class RouteServiceProvider extends ServiceProvider protected function mapWebRoutes() { Route::middleware('web') - ->namespace($this->namespace) - ->group(base_path('routes/web.php')); + ->namespace($this->namespace) + ->group(base_path('routes/web.php')); } /** @@ -73,8 +73,8 @@ class RouteServiceProvider extends ServiceProvider protected function mapApiRoutes() { Route::prefix('api') - ->middleware('api') - ->namespace($this->namespace) - ->group(base_path('routes/api.php')); + ->middleware('api') + ->namespace($this->namespace) + ->group(base_path('routes/api.php')); } } diff --git a/app/Repositories/Botanic/Families.php b/app/Repositories/Botanic/Families.php index 9b6a3e79..0303b340 100644 --- a/app/Repositories/Botanic/Families.php +++ b/app/Repositories/Botanic/Families.php @@ -7,61 +7,61 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; use Yajra\DataTables\DataTables; -use Maatwebsite\Excel\Facades\Excel; +use Maatwebsite\Excel\Facades\Excel; use App\Models\Botanic\Family; use App\Exports\Botanic\FamiliesExport; class Families { + public static function getDatatable() + { + $model = Family::orderBy('name'); + return Datatables::of($model)->make(true); + } - public static function getDatatable() - { - $model = Family::orderBy('name'); - return Datatables::of($model)->make(true); - } + public static function getOptions() + { + return Family::get()->SortBy('name')->pluck('name', 'id')->toArray(); + } - public static function getOptions() - { - return Family::get()->SortBy('name')->pluck('name','id')->toArray(); - } + public static function getAll() + { + return Family::orderBy('name', 'asc')->get(); + } - public static function getAll() - { - return Family::orderBy('name','asc')->get(); - } + public static function get($id) + { + return Family::findOrFail($id); + } - public static function get($id) - { - return Family::findOrFail($id); - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data, $id) : self::create($data); + return $item->id; + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data, $id) : self::create($data); - return $item->id; - } + public static function create($data) + { + return Family::create($data); + } - public static function create($data) - { - return Family::create($data); - } + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } - public static function update($data, $id = false) - { - $id = $id ? $id : $data['id']; - return self::get($id)->update($data); - } - - public static function destroy($id) - { - return Family::destroy($id); - } - - public static function exportExcel() - { - return Excel::download(new FamiliesExport, 'families.xlsx'); - } + public static function destroy($id) + { + return Family::destroy($id); + } + public static function exportExcel() + { + return Excel::download(new FamiliesExport, 'families.xlsx'); + } } diff --git a/app/Repositories/Botanic/Genres.php b/app/Repositories/Botanic/Genres.php index 39a773b0..78d8d470 100644 --- a/app/Repositories/Botanic/Genres.php +++ b/app/Repositories/Botanic/Genres.php @@ -7,60 +7,59 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; use Yajra\DataTables\DataTables; -use Maatwebsite\Excel\Facades\Excel; +use Maatwebsite\Excel\Facades\Excel; use App\Models\Botanic\Genre; use App\Exports\Botanic\GenresExport; class Genres { + public static function getDatatable() + { + $model = Genre::orderBy('name'); + return Datatables::of($model)->make(true); + } - public static function getDatatable() - { - $model = Genre::orderBy('name'); - return Datatables::of($model)->make(true); - } + public static function getOptions() + { + return Genre::get()->SortBy('name')->pluck('name', 'id')->toArray(); + } - public static function getOptions() - { - return Genre::get()->SortBy('name')->pluck('name','id')->toArray(); - } + public static function getAll() + { + return Genre::orderBy('name', 'asc')->get(); + } - public static function getAll() - { - return Genre::orderBy('name','asc')->get(); - } + public static function get($id) + { + return Genre::find($id); + } - public static function get($id) - { - return Genre::find($id); - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data, $id) : self::create($data); + return $item->id; + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data, $id) : self::create($data); - return $item->id; - } + public static function create($data) + { + return Genre::create($data); + } - public static function create($data) - { - return Genre::create($data); - } + public static function update($data, $id = false) + { + $id = isset($data['id']) ? $data['id'] : false; + return self::get($id)->update($data); + } - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - return self::get($id)->update($data); - } + public static function destroy($id) + { + return Genre::destroy($id); + } - public static function destroy($id) - { - return Genre::destroy($id); - } - - public static function exportExcel() - { - return Excel::download(new GenresExport, 'genres.xlsx'); - } + public static function exportExcel() + { + return Excel::download(new GenresExport, 'genres.xlsx'); + } } diff --git a/app/Repositories/Botanic/Species.php b/app/Repositories/Botanic/Species.php index 3e142ab8..b24ae7de 100644 --- a/app/Repositories/Botanic/Species.php +++ b/app/Repositories/Botanic/Species.php @@ -7,14 +7,13 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; use Yajra\DataTables\DataTables; -use Maatwebsite\Excel\Facades\Excel; +use Maatwebsite\Excel\Facades\Excel; use App\Models\Botanic\Specie; use App\Exports\Botanic\SpeciesExport; class Species { - public static function getDatatable() { $model = Specie::orderBy('name'); @@ -23,23 +22,33 @@ class Species public static function getOptions() { - return Specie::get()->SortBy('name')->pluck('name','id')->toArray(); + return Specie::get()->SortBy('name')->pluck('name', 'id')->toArray(); } public static function getAll() { - return Specie::orderBy('name','asc')->get(); + return Specie::orderBy('name', 'asc')->get(); + } + + public static function getDescription($id) + { + return self::get($id)->description; + } + + public static function getTags($id) + { + return self::get($id)->tags->toArray(); } public static function get($id) { - return Specie::find($id); + return Specie::findOrFail($id); } public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data, $id) : self::create($data); + $item = $id ? self::update($data, $id) : self::create($data); return $item->id; } @@ -50,7 +59,7 @@ class Species public static function update($data, $id = false) { - $id = $id ? $id : $data['id']; + $id = $id ? $id : $data['id']; $model = self::get($id); $ret = $model->update($data); return $model; diff --git a/app/Repositories/Botanic/Varieties.php b/app/Repositories/Botanic/Varieties.php index f9d708f5..1916ff8e 100644 --- a/app/Repositories/Botanic/Varieties.php +++ b/app/Repositories/Botanic/Varieties.php @@ -13,106 +13,114 @@ use App\Exports\Botanic\VarietiesExport; class Varieties { + public static function getOptions() + { + return Variety::orderBy('name')->get()->pluck('name', 'id')->toArray(); + } - public static function getOptions() - { - return Variety::orderBy('name')->get()->pluck('name','id')->toArray(); - } + public static function getOptionsWithSpecie() + { + $varieties = Variety::with('specie')->get(); + $data = []; + foreach ($varieties as $variety) { + $data[$variety->id] = (isset($variety->specie->name) ? $variety->specie->name . ' ' : '') . $variety->name; + } + asort($data, SORT_NATURAL | SORT_FLAG_CASE); + return $data; + } - public static function getOptionsWithSpecie() - { - $varieties = Variety::with('specie')->get(); - $data = []; - foreach ($varieties as $variety) { - $data[$variety->id] = (isset($variety->specie->name) ? $variety->specie->name . ' ' : '') . $variety->name; - } - asort($data, SORT_NATURAL | SORT_FLAG_CASE); - return $data; - } + public static function getAll() + { + return Variety::orderBy('name', 'asc')->get(); + } - public static function getAll() - { - return Variety::orderBy('name','asc')->get(); - } + public static function getDescription($id) + { + return self::get($id)->description; + } - public static function get($id) - { - return Variety::findOrFail($id); - } + public static function getTags($id) + { + return self::get($id)->tags; + } - public static function getFull($id) - { - $variety = self::get($id); - $data = $variety->toArray(); - $data['tags'] = self::getTagsByVariety($variety); - return $data; - } + public static function get($id) + { + return Variety::findOrFail($id); + } - public static function getTagsByVariety($variety) - { - return Tag::getTagsByModel($variety); - } + public static function getFull($id) + { + $variety = self::get($id); + $data = $variety->toArray(); + $data['tags'] = self::getTagsByVariety($variety); + return $data; + } + + public static function getTagsByVariety($variety) + { + return Tag::getTagsByModel($variety); + } - public static function storeFull($data) - { - $images = isset($data['images']) ? $data['images'] : false; - $tags = isset($data['tags']) ? $data['tags'] : false; - unset($data['images']); - unset($data['tags']); - $variety = self::store($data); - self::storeImages($variety, $images); - self::storeTags($variety, $tags); - return $variety; - } + public static function storeFull($data) + { + $images = isset($data['images']) ? $data['images'] : false; + $tags = isset($data['tags']) ? $data['tags'] : false; + unset($data['images']); + unset($data['tags']); + $variety = self::store($data); + self::storeImages($variety, $images); + self::storeTags($variety, $tags); + return $variety; + } - public static function store($data) - { - return isset($data['id']) ? self::update($data) : self::create($data); - } + public static function store($data) + { + return isset($data['id']) ? self::update($data) : self::create($data); + } - public static function create($data) - { - return Variety::create($data); - } + public static function create($data) + { + return Variety::create($data); + } - public static function update($data, $id = false) - { - $id = $id ? $id : $data['id']; - $variety = self::get($id); - $ret = $variety->update($data); - return $variety; - } + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $variety = self::get($id); + $ret = $variety->update($data); + return $variety; + } - public static function destroy($id) - { - return Variety::destroy($id); - } + public static function destroy($id) + { + return Variety::destroy($id); + } - public static function storeTags($variety, $tags) - { - return Tag::storeTags($variety, $tags); - } + public static function storeTags($variety, $tags) + { + return Tag::storeTags($variety, $tags); + } - public static function storeImages($variety, $files) - { - return Media::storeImages($variety, $files); - } + public static function storeImages($variety, $files) + { + return Media::storeImages($variety, $files); + } - public static function getImages($id) - { - return Media::getImages(self::get($id)); - } + public static function getImages($id) + { + return Media::getImages(self::get($id)); + } - public static function deleteImage($id, $index) - { - return Media::deleteImage(self::get($id), $index); - } - - public static function exportExcel() - { - return Excel::download(new VarietiesExport, 'varieties.xlsx'); - } + public static function deleteImage($id, $index) + { + return Media::deleteImage(self::get($id), $index); + } + public static function exportExcel() + { + return Excel::download(new VarietiesExport, 'varieties.xlsx'); + } } diff --git a/app/Repositories/Config.php b/app/Repositories/Config.php index 3786b00b..e8bddbbf 100644 --- a/app/Repositories/Config.php +++ b/app/Repositories/Config.php @@ -2,67 +2,23 @@ namespace App\Repositories; -use Session; -use Illuminate\Support\Facades\DB; -use App\Repositories\Core\Cache; +use App\Repositories\Core\Auth\Users; class Config { public static function init() { - $data = SuiteParameter::init(); - $data += Client::init(); - $data += Language::init(); - return $data; + $data['user'] = self::getUser(); + return ['init' => $data]; } - public static function initHeader($options = false, $appOptions = false, $clientOptions = false, $adminOptions = false) + public static function getUser() { - - $partner_path = Partners::getPublicPath(); - - // $css_client = Clients::getPublicPath('css/client.css'); - $css_client = $partner_path . '/css/client.css'; - - if (!$clientOptions) { - $clientOptions = ['css' => [$css_client]]; - } - - $layout = new Layout(); - $data = $layout->init($options, $appOptions, $clientOptions, $adminOptions); - if (Users::getUser()) { - $data['user'] = Users::getInfo(); - $data['user']['lang'] = Session::get('locale'); + $data = Users::getInfo(); } else { - Session::put('locale', 'fr'); + $data = false; } - - if (Clients::isClient()) { - $data['isClient'] = true; - $data['client'] = Clients::getInfo(); - $data['apps'] = Clients::getApplications(); - } else { - $data['isClient'] = false; - $data['client']['publicPath'] = $partner_path; - $data['apps'] = Applications::getVisibles(); - } - $data['client']['partner']['publicPath'] = $partner_path; - - // $layout->publish('tenant_path', $data['client']['publicPath']); - $data['global']['tenant_path'] = $data['client']['publicPath']; - $data['global']['roles'] = Users::getRoles(); - $data['global']['permissions'] = Users::getPermissions(); - $data['app'] = Applications::getCurrent(); - return $data; } - - public static function getCacheVersions() - { - $data = Cache::getFilesVersion('assets/apps/ContractDrive/js', 'js'); - // $data += Cache::getFilesVersion('assets/apps/ContractDrive/css','css'); - return $data; - } - } diff --git a/app/Repositories/Core/App/ApplicationClients.php b/app/Repositories/Core/App/ApplicationClients.php new file mode 100644 index 00000000..7c614df2 --- /dev/null +++ b/app/Repositories/Core/App/ApplicationClients.php @@ -0,0 +1,91 @@ +count(); + } + + public static function associateApplications($client_id, $applications) + { + $client_name = Clients::getName($client_id); + foreach ($applications as $key => $application_id) { + $application = Applications::get($application_id); + if ($application) { + self::associateApplication($client_id, $application_id); + } + } + return true; + } + + public static function associateApplication($client_id, $application_id) + { + return ApplicationClient::create(['client_id' => $client_id, 'application_id' => $application_id, 'active' => true ]); + } + + public static function dissociateApplications($client_id, $applications) + { + $client_name = \App\Repositories\Clients::getName($client_id); + foreach ($applications as $key => $application_id) { + self::dissociateApplication($client_id, $application_id); + } + return true; + } + + public static function dissociateApplication($client_id, $application_id) + { + return ApplicationClient::byClient($client_id)->byApplication($application_id)->delete(); + } + + public static function getByClient($id) + { + return ApplicationClient::byClient($id)->get()->toArray(); + } + + public static function getByApplication($id) + { + return ApplicationClient::byApplication($id)->get()->toArray(); + } + + public static function getClientsByApplication($id) + { + return ApplicationClient::byApplication($id)->get()->pluck('client_id')->toArray(); + } + + public static function getApplicationsByClient($id) + { + return ApplicationClient::byClient($id)->get()->pluck('application_id')->toArray(); + } + + public static function isActiveByName($name) + { + return (!Clients::isClient()) ? true : ApplicationClient::bySlug($name)->byClient(Clients::getId())->first()->active ?? false; + } +} diff --git a/app/Repositories/Core/App/ApplicationModules.php b/app/Repositories/Core/App/ApplicationModules.php new file mode 100644 index 00000000..e907d0bc --- /dev/null +++ b/app/Repositories/Core/App/ApplicationModules.php @@ -0,0 +1,56 @@ +toArray(); + } + + public static function getOptions() + { + return ApplicationModule::pluck('name', 'id')->toArray(); + } + + public static function edit($id) + { + return self::get($id)->toArray(); + } + + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + return $id ? self::update($data, $id) : self::create($data); + } + + public static function create($data) + { + return ApplicationModule::create($data); + } + + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + return self::get($id)->update($data); + } + + public static function destroy($id) + { + return ApplicationModule::destroy($id); + } + + public static function getName($id) + { + return self::get($id)->name; + } + + public static function get($id) + { + return ApplicationModule::findOrFail($id); + } +} diff --git a/app/Repositories/Core/App/ApplicationPages.php b/app/Repositories/Core/App/ApplicationPages.php index eb6c3a89..445348b9 100644 --- a/app/Repositories/Core/App/ApplicationPages.php +++ b/app/Repositories/Core/App/ApplicationPages.php @@ -1,11 +1,8 @@ toArray(); + } + public static function getOptions() + { + return Application::pluck('name', 'id')->toArray(); + } + + public static function edit($id) + { + return self::get($id)->toArray(); + } + + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + return $id ? self::update($data, $id) : self::create($data); + } + + public static function create($data) + { + return Application::create($data); + } + + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + return self::get($id)->update($data); + } + + public static function destroy($id) + { + return Application::destroy($id); + } + + public static function getName($id) + { + return self::get($id)->name; + } + public static function get($id) { - return Application::findOrFail($id)->toArray(); + return Application::findOrFail($id); } public static function getCurrent() diff --git a/app/Repositories/Core/Auth/NewUser.php b/app/Repositories/Core/Auth/NewUser.php index 7dc1bc73..db379125 100644 --- a/app/Repositories/Core/Auth/NewUser.php +++ b/app/Repositories/Core/Auth/NewUser.php @@ -37,16 +37,24 @@ class NewUser extends Notification ->markdown('notifications.email') ->greeting(__('notifications.greeting', ['firstname' => $notifiable->first_name])) ->subject(__('notifications.newuser.subject', ['name' => config('app.name')])) - ->line(__('notifications.newuser.intro', [ - 'name' => $currentUser->first_name.' '.$currentUser->last_name, - ])) + ->line( + __( + 'notifications.newuser.intro', [ + 'name' => $currentUser->first_name.' '.$currentUser->last_name, + ] + ) + ) ->action( __('notifications.newuser.button'), route('users.firstlogin', $notifiable->remember_token) ) - ->salutation(__('notifications.salutation', [ - 'name' => $currentUser->first_name.' '.$currentUser->last_name, - ])) + ->salutation( + __( + 'notifications.salutation', [ + 'name' => $currentUser->first_name.' '.$currentUser->last_name, + ] + ) + ) ->line(__('notifications.newuser.outro')); } diff --git a/app/Repositories/Core/Auth/PasswordSecurities.php b/app/Repositories/Core/Auth/PasswordSecurities.php new file mode 100644 index 00000000..a33f44e3 --- /dev/null +++ b/app/Repositories/Core/Auth/PasswordSecurities.php @@ -0,0 +1,20 @@ + $user_id, + 'password_expiry_days' => $delay, + 'password_updated_at' => Carbon::now(), + ] + ); + } +} diff --git a/app/Repositories/Core/Auth/Passwords.php b/app/Repositories/Core/Auth/Passwords.php new file mode 100644 index 00000000..7056ad6e --- /dev/null +++ b/app/Repositories/Core/Auth/Passwords.php @@ -0,0 +1,36 @@ +setMinLength(5); + $validator->setMinLowerCaseLetters(2); + $validator->setMinUpperCaseLetters(1); + $validator->setMinNumbers(1); + $validator->setMinSymbols(3); + + if ($validator->isValid($password)) { + printf('password %s is valid' . PHP_EOL, $password); + } else { + printf('password %s is invalid' . PHP_EOL, $password); + var_dump($validator->getErrors()); + } + } +} diff --git a/app/Repositories/Core/Auth/Permissions.php b/app/Repositories/Core/Auth/Permissions.php index d4155eea..398d5519 100644 --- a/app/Repositories/Core/Auth/Permissions.php +++ b/app/Repositories/Core/Auth/Permissions.php @@ -1,5 +1,4 @@ update($data); + return self::get($data['id'])->update($data); } public static function count() diff --git a/app/Repositories/Core/Auth/ResetPassword.php b/app/Repositories/Core/Auth/ResetPassword.php index 763d1691..06daa6ce 100644 --- a/app/Repositories/Core/Auth/ResetPassword.php +++ b/app/Repositories/Core/Auth/ResetPassword.php @@ -13,7 +13,7 @@ class ResetPassword extends \Illuminate\Auth\Notifications\ResetPassword * * @return \Illuminate\Notifications\Messages\MailMessage */ -/* + /* public function toMail($notifiable) { return (new MailMessage()) @@ -27,5 +27,5 @@ class ResetPassword extends \Illuminate\Auth\Notifications\ResetPassword ) ->line(__('notifications.resetpassword.outro')); } -*/ + */ } diff --git a/app/Repositories/Core/Auth/Roles.php b/app/Repositories/Core/Auth/Roles.php index 57687bf7..f696f781 100644 --- a/app/Repositories/Core/Auth/Roles.php +++ b/app/Repositories/Core/Auth/Roles.php @@ -1,6 +1,6 @@ hasRole('admin')) ? Role::whereNotIn('name', ['admin'])->get() : Role::all(); + return $data->pluck('name', 'id')->toArray(); } - // ajoute une forme juridique - public static function insert($input) + public static function store($input) { - $permissions = array_keys($input['permissions']); - $name = $input['name']; - $translated = $input['translated']; - self::setTranslation($name, $translated); - $role = Role::create(['name' => $name, 'display_name' => $name, 'translated' => $translated, 'description' => '', 'active' => true]); + return (isset($input['id']) && $input['id']) ? self::update($input) : self::create($input); + } + + public static function create($data) + { + $permissions = array_keys($data['permissions']); + unset($data['permissions']); + $data['active'] = true; + $role = Role::create($data); $role->attachPermissions($permissions); return $role; } @@ -40,11 +40,8 @@ class Roles { $id = ($id) ? $id : $input['id']; $permissions = array_keys($input['permissions']); - $name = $input['name']; - $translated = $input['translated']; - self::setTranslation($name, $translated); - $role = Role::find($id); - $role->update(['name' => $name, 'translated' => $translated]); + $role = self::get($id); + $role->update(['name' => $input['name']]); $role->syncPermissions($permissions); return $role; } @@ -52,8 +49,6 @@ class Roles // supprime une forme juridique public static function delete($id) { - $old = self::select_by_id($id); - self::deleteTranslation($old->translated); return Role::destroy($id); } @@ -69,21 +64,10 @@ class Roles return Role::count(); } - // récupère toutes les infos sur les formes juridiques - public static function select_all() - { - return Role::all()->toArray(); - } - - public static function select_by_id($id) - { - return Role::find($id)->toArray(); - } - public static function getWithPermissions($id) { - $role = Role::find($id)->toArray(); - $role['permissions'] = Role::find($id)->permissions->pluck('id')->toArray(); + $role = self::get($id)->toArray(); + $role['permissions'] = self::get($id)->permissions->pluck('id')->toArray(); return $role; } @@ -99,7 +83,7 @@ class Roles public static function get($id) { - return Role::find($id); + return Role::findOrFail($id); } public static function getTable($id) @@ -126,22 +110,6 @@ class Roles public static function getOptions() { - return Role::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray(); - } - - public static function setTranslation($name, $translated) - { - $lang = Translate::getLang(); - $appli = 1; // ContractDrive - $client = 1; // Client - Translations::setTranslation($name, $translated, $lang, $appli, $client); - } - - public static function deleteTranslation($translated) - { - $lang = Translate::getLang(); - $appli = 1; // ContractDrive - $client = 1; // Client - Translations::deleteTranslation($translated, $lang, $appli, $client); + return Role::orderBy('name', 'asc')->pluck('name', 'id')->toArray(); } } diff --git a/app/Repositories/Core/Auth/Teams.php b/app/Repositories/Core/Auth/Teams.php index 85b197b0..c2f245a8 100644 --- a/app/Repositories/Core/Auth/Teams.php +++ b/app/Repositories/Core/Auth/Teams.php @@ -1,15 +1,16 @@ pluck('name', 'id'); + return Team::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray(); + } + + public static function getInfo($id) + { + return Team::find($id); + } + + public static function select_all() + { + return self::getAll()->toArray(); + } + + public static function select_by_id($id) + { + return Team::find($id)->toArray(); + } + + public static function getAll() + { + return Team::orderBy('name', 'asc')->get(); + } + + public static function getByName($name) + { + return Team::where('name', $name)->first(); } public static function get($id) @@ -66,15 +92,31 @@ class Teams } } - // ajoute une équipe/service/direction + public static function store($data) + { + if (isset($data['id']) && $data['id']) { + return self::update($data); + } + return self::create($data); + } + public static function create($data) { return Team::create($data); } - // met à jour les informations d'une équipe/service/direction public static function update($data) { return Team::find($data['id'])->update($data); } + + public static function count() + { + return Team::count(); + } + + public static function toggle_active($id, $active) + { + return Team::find($id)->update(['active' => $active]); + } } diff --git a/app/Repositories/Core/Auth/UserClients.php b/app/Repositories/Core/Auth/UserClients.php new file mode 100644 index 00000000..b0c87225 --- /dev/null +++ b/app/Repositories/Core/Auth/UserClients.php @@ -0,0 +1,158 @@ +toArray(); + $clients_list = is_array($clients_list) ? $clients_list : array(); + + if (is_array($clients_existing)) { + $clients_new = array_diff($clients_list, $clients_existing); + $clients_to_delete = array_diff($clients_existing, $clients_list); + } else { + $clients_new = $clients_list; + $clients_to_delete = $clients_existing; + } + + $history_element_infos = (!empty($clients_new)) ? self::associateClients($user_id, $clients_new) : false; + $history_element_infos2 = (!empty($clients_to_delete)) ? self::dissociateClients($user_id, $clients_to_delete) : false; + + // $history_element = $old_translated_name['name']; + // $history_element_id = $documentation_category_id; + // Histories::insert(190, $history_element_id, $history_element); + + $data['nb'] = self::countByUser($user_id); + + return $data; + } + + public static function countByUser($id) + { + return UserClient::byUser($id)->count(); + } + + public static function associateClients($user_id, $clients) + { + $history = ""; + foreach ($clients as $key => $client_id) { + $client = Clients::select_by_id($client_id); + if ($client) { + self::associate_client($user_id, $client_id); + $history .= $client['name'] . "| "; + } + } + return $history; + } + + public static function associate_client($user_id, $client_id) + { + self::copyUser($user_id, $client_id); + return UserClient::create(['user_id' => $user_id, 'client_id' => $client_id]); + } + + public static function changePasswordsByUser($user_id, $password) + { + try { + $username = User::find($user_id)->username; + $connection = app(Connection::class); + $clients = self::getClientsByUser($user_id); + foreach ($clients as $client_id) { + Clients::switchClient($client_id); + $client_user = User::on($connection->tenantName())->withTrashed()->where('username', $username)->first(); + if ($client_user) { + $client_user->update(['password' => $password]); + } + } + } catch (Exception $e) { + } + // Partners::switchPartner(); + } + + public static function copyUser($user_id, $client_id) + { + $connection = app(Connection::class); + $user = User::on($connection->systemName())->find($user_id); + $password = $user->password; + Clients::switchClient($client_id); + $client_user = User::on($connection->tenantName())->withTrashed()->where('username', $user->username)->first(); + if (!$client_user) { + $user = $user->toArray(); + $user['password'] = $password; + unset($user['id']); + unset($user['created_at']); + $client_user = User::on($connection->tenantName())->create($user); + $client_user->attachRole('superadministrator'); + } else { + if ($client_user->trashed()) { + $client_user->restore(); + } + $client_user->attachRole('superadministrator'); + } + // TODO Copy avatar + // + // dump($client_user->toArray()); + // exit; + // $client_user = User::on($connection->tenantName())->firstOrCreate(['username' => $user->username], $user->toArray()); + Partners::switchPartner(); + } + + public static function dissociateClients($user_id, $clients) + { + $history = ""; + foreach ($clients as $key => $client_id) { + self::dissociate_client($user_id, $client_id); + $history .= $client['name'] . "| "; + } + return $history; + } + + public static function dissociate_client($user_id, $client_id) + { + self::deleteUser($user_id, $client_id); + return UserClient::byUser($user_id)->byClient($client_id)->delete(); + } + + public static function deleteUser($user_id, $client_id) + { + $connection = app(Connection::class); + $user = User::on($connection->systemName())->find($user_id); + Clients::switchClient($client_id); + $user = User::on($connection->tenantName())->where('username', $user->username)->get(); + $user->detachRole('superadministrator'); + $user->delete(); + Partners::switchPartner(); + } + + public static function delete_associate_clients($id) + { + return UserClient::byUser($id)->delete(); + } + + public static function select_clients_by_id($id) + { + return UserClient::byUser($id)->get()->pluck('client_id')->toArray(); + } + + public static function getClientsByUser($id) + { + return UserClient::byUser($id)->get()->pluck('client_id'); + } + + public static function getUsersByClient($id) + { + return UserClient::byClient($id)->get()->pluck('user_id'); + } +} diff --git a/app/Repositories/Core/Auth/UserStatusTeams.php b/app/Repositories/Core/Auth/UserStatusTeams.php new file mode 100644 index 00000000..895eaa22 --- /dev/null +++ b/app/Repositories/Core/Auth/UserStatusTeams.php @@ -0,0 +1,26 @@ +delete(); + } + + // associe une équipe avec un statut utilisateur + public function insert_team($user_status_id, $team_id) + { + return UserStatusTeam::create(['team_id' => $team_id, 'user_status_id' => $user_status_id]); + } + + // récupère les équipes d'un statut utilisateur donné + public function select_teams_by_id($id) + { + return UserStatusTeam::select('team_id')->byUserStatus($id)->get(); + } +} diff --git a/app/Repositories/Core/Auth/UserStatuses.php b/app/Repositories/Core/Auth/UserStatuses.php new file mode 100644 index 00000000..775c06c0 --- /dev/null +++ b/app/Repositories/Core/Auth/UserStatuses.php @@ -0,0 +1,100 @@ + $name, 'translated' => $translated, 'negociator' => $negociator]); + } + + // reset le négociateur parmi les statuts + public static function reset_negociator_status() + { + return UserStatus::update(['negociator' => null]); + } + + // récupère toutes les infos sur les statuts utilisateur + public static function select_all() + { + return UserStatus::all()->toArray(); + } + + // récupère les infos pour un statut utilisateur donné + public static function select_by_id($id) + { + return UserStatus::find($id)->toArray(); + } + + // récupère les infos pour un statut utilisateur donné + public static function select_by_name($name) + { + return UserStatus::byName($name)->first()->toArray(); + } + + // récupère les infos du statut considéré comme négociant d'un contrat + public static function select_by_negociator() + { + $status = UserStatus::byNegociator()->first(); + return $status ? $status->toArray() : null; + } + + // met à jour le statut actif/inactif d'un statut utilisateur + public static function toggle_active($id, $active) + { + return UserStatus::find($id)->update(['active' => $active]); + } + + // met à jour les informations d'un statut utilisateur + public static function update($id, $name, $translated, $negociator) + { + return UserStatus::find($id)->update(['id' => $id, 'name' => $name, 'translated' => $translated, 'negociator' => $negociator]); + } + + // met à jour les informations d'un statut utilisateur + public static function update_negociator($id, $negociator) + { + return UserStatus::find($id)->update(['negociator' => $negociator]); + } + + public static function getAllUserStatuses($input) + { + $data = []; + $statuses = self::select_all(); + foreach ($statuses as $status) { + if ($status['active'] <= 0) { + continue; + } + $item = array(); + $item['id'] = $status['id']; + $item['name'] = \App\Repositories\Translate::translateClient($status['translated']); + array_push($data, $item); + } + $data = \App\Repositories\Functions::array_orderby($data, 'name', SORT_ASC); + return $data; + } + + public static function getOptions() + { + return UserStatus::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray(); + } + + public static function getNegociatorsOptions() + { + } +} diff --git a/app/Repositories/Core/Auth/Users.php b/app/Repositories/Core/Auth/Users.php index 8d408642..1823f4df 100644 --- a/app/Repositories/Core/Auth/Users.php +++ b/app/Repositories/Core/Auth/Users.php @@ -5,11 +5,17 @@ namespace App\Repositories\Core\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Str; + +use Hyn\Tenancy\Database\Connection; use Laratrust\Traits\LaratrustUserTrait; use App\Models\Core\Auth\User; use App\Models\Core\Auth\RoleUser; +use App\Repositories\Clients; +use App\Repositories\Partners; + class Users { use LaratrustUserTrait; @@ -20,54 +26,79 @@ class Users } public static function getInfo($id = false) - { - return self::getWithDetail($id); - } - - public static function getWithDetail($id = false) { $id = $id ? $id : self::getId(); - return User::where('id', $id)->with(['user_detail'])->first(); + if (!$id) { + return false; + } + $user = self::get($id); + $data = $user->toArray(); + $data['name'] = $user->name; + $data['avatar'] = self::getAvatar($id); + $data['last_login'] = $user->previousLoginAt(); + // $data['roles'] = self::getRoles(); + // $data['permissions'] = self::getPermissions(); + $data['roles'] = $user->roles->pluck('id')->toArray(); + $data['permissions'] = $user->allPermissions()->pluck('id')->toArray(); + return $data; } - public static function getEmailsByRole($role) { - return User::select('id','email')->whereRoleIs($role)->get()->toArray(); - } - - public static function getIdsByRole($role) { - return User::select('id')->whereRoleIs($role)->get()->pluck('id')->toArray(); - } - - public static function getListByRole($role) + public static function store($data) { - return self::selectOptions()->orderBy('nom', 'asc')->whereRoleIs($role)->get(); + $id = isset($data['id']) ? $data['id'] : false; + + if (!empty($data['password'])) { + $data['password'] = Hash::make($data['password']); + } else { + if ($id) { + unset($data['password']); + } else { + $data['password'] = Hash::make(Str::random(8)); + } + } + $data['remember_token'] = Str::random(32); + $data['active'] = true; + + $user = $id ? self::update($data, $id) : self::create($data); + + if (isset($data['roles'])) { + $user->roles()->sync(array_keys($data['roles'])); + } + // $user->sendNewUserNotification($data['remember_token'], Auth::user()); + + return $user; } - public static function getOptions() + public static function create($data) { - return self::selectOptions()->get(); + $data['password'] = $data['password'] ? Hash::make($data['password']) : Hash::make(Str::random(8)); + return User::create($data); } - public static function selectOptions() + public static function update($data, $id = false) { - return User::select('id', DB::raw("concat(last_name,' ',first_name) as nom")); - } - - public static function hasRole($role) - { - $user = self::get(); - return $user ? $user->hasRole($role) : false; - } - - public static function getId() - { - return self::getUser()->id; + $id = $id ? $id : $data['id']; + $user = self::get($id); + $ret = $user->update($data); + return $user; } public static function get($id = false) { $id = $id ? $id : self::getId(); - return User::find($id); + return User::findOrFail($id); + } + + public static function getId() + { + $user = self::getUser(); + return $user ? $user->id : false; + } + + public static function getName() + { + $user = self::getUser(); + return $user->first_name . ' ' . $user->last_name; } public static function getUser() @@ -80,12 +111,71 @@ class Users return Auth::check(); } + public static function getOptions() + { + return User::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray(); + } + public static function delete($id) { - $t = RoleUser::byUser($id)->delete(); + $ret = RoleUser::byUser($id)->delete(); return User::destroy($id); } + public static function getListByRole($role) + { + return self::selectOptions()->orderBy('name', 'asc')->whereRoleIs($role)->get(); + } + + public static function hasRole($role, $user = false) + { + $user = $user ? $user : self::getUser(); + return $user ? $user->hasRole($role) : false; + } + + public static function hasPermission($permission, $user = false) + { + if (self::isAdmin()) { + return true; + } + $user = $user ? $user : self::getUser(); + $permissions = self::getPermissions($user); + return $user ? self::checkPermission($permissions, $permission) : false; + // TODO why is posing problem ??? + // return $user ? $user->hasPermission($permission) : false; + } + + public static function checkPermission($permissions, $permission) + { + if (!strpos($permission, '*')) { + return in_array($permission, $permissions); + } + $permission = str_replace('*', '', $permission); + foreach ($permissions as $item) { + if (stripos($item, $permission) !== false) { + return true; + } + } + return false; + } + + public static function getRoles($user = false) + { + $user = $user ? $user : self::getUser(); + return $user ? $user->roles->pluck('name')->toArray() : false; + } + + public static function getRolesToEdit() + { + return Roles::getListByRights(); + } + + public static function getPermissions($user = false) + { + $user = $user ? $user : self::getUser(); + return $user ? $user->allPermissions()->pluck('name')->toArray() : false; + } + public static function getByTeam($id) { return User::byTeam($id)->get(); @@ -101,36 +191,86 @@ class Users return User::byTeam($id)->byUniqueTeam()->delete(); } - // récupère les champs de la table - public static function get_field_table() + public static function getAvatar($user_id) { - return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable()); + $avatar = self::get($user_id)->avatar; + if (!$avatar) { + return '/assets/img/no-avatar.png'; + } + $path = Clients::isClient() ? Clients::getPublicPath('/images/avatars/') : Partners::getPublicPath('/images/avatars/'); + return $path . $avatar; } - // ajoute un utilisateur - public static function insert($data) + public static function selectOptions() { - return User::create($data); + return User::select('id', DB::raw("concat(last_name,' ',first_name) as name")); } - // récupère tous les utilisateurs - public static function select_all() + public static function count() { - return User::all()->toArray(); + return User::count(); + } + + // récupère tous les utilisateurs pour un statut donné + public static function select_all_by_status_id($status_id) + { + return User::byStatus($status_id); + } + + // récupère toutes les informations d'un utilisateur pour un id donné + public static function select_by_id($user_id) + { + return User::with('status')->find($user_id)->toArray(); + } + + // récupère toutes les informations d'un utilisateur pour un nom donné + public static function select_by_name($name) + { + return User::byName($name)->first()->toArray(); + } + + // récupère les utilisateurs actifs d'un statut, d'une équipe et d'une entité donnés + public static function select_by_status_and_team_and_entity($status_id, $team_id, $third_party_id) + { + return User::active()->byStatus($status_id)->byTeam($team_id)->byThirdParty($third_party_id)->get()->toArray(); + } + + // récupère toutes les informations nécessaires d'un utilisateur pour un id donné + public static function select_datas_by_id($user_id) + { + return User::with('status')->find($user_id)->toArray(); + } + + // met à jour le statut actif/inactif d'un utilisateur + public static function toggle_active($id, $active) + { + return self::get($id)->update(['active' => $active]); + } + + public static function uploadAvatar($request) + { + $targetDir = 'uploads'; + $file = $request->file('avatar_file'); + $data = \App\Repositories\Core\Upload::getData($file); + $file_uploaded = \App\Repositories\Core\Upload::store($file, $targetDir); + $tab = pathinfo($file_uploaded); + $response['name'] = $tab['basename']; + return $response; } - // met à jour les informations d'un utilisateur - public static function update(Request $request) + // met à jour l'avatar d'un utilisateur + public static function update_avatar($id, $avatar) { - return User::find($data['id'])->update($data); + return User::find($id)->update(['avatar' => $avatar]); } // met à jour le mot de passe d'un utilisateur public static function update_password($id, $password) { - $user = User::find($id); - $user->password = Hash::make($password); - return $user->save(); + $password = Hash::make($password); + UserClients::changePasswordsByUser($id, $password); + $connection = app(Connection::class); + return User::on($connection->systemName())->find($id)->update(['password' => $password]); } } diff --git a/app/Repositories/Core/DataTable.php b/app/Repositories/Core/DataTable.php index 1967fa27..b6e2e0fc 100644 --- a/app/Repositories/Core/DataTable.php +++ b/app/Repositories/Core/DataTable.php @@ -194,13 +194,15 @@ class DataTable if (is_array($hasfilters)) { foreach ($hasfilters as $hasfilter) { if (!empty($hasfilter['search'])) { - $elements = $elements->whereHas($hasfilter['controller'], function ($query) use ($hasfilter) { - if ($hasfilter['like']) { - $query->where($hasfilter['field'], 'like', '%' . $hasfilter['search'] . '%'); - } else { - $query->where($hasfilter['field'], '=', $hasfilter['search']); + $elements = $elements->whereHas( + $hasfilter['controller'], function ($query) use ($hasfilter) { + if ($hasfilter['like']) { + $query->where($hasfilter['field'], 'like', '%' . $hasfilter['search'] . '%'); + } else { + $query->where($hasfilter['field'], '=', $hasfilter['search']); + } } - }); + ); } } } @@ -217,9 +219,11 @@ class DataTable 'field' => $tab[1], 'search' => $search, ]; - $elements = $elements->whereHas($searchField['controller'], function ($query) use ($searchField) { - $query->where($searchField['field'], 'like', '%' . $searchField['search'] . '%'); - }); + $elements = $elements->whereHas( + $searchField['controller'], function ($query) use ($searchField) { + $query->where($searchField['field'], 'like', '%' . $searchField['search'] . '%'); + } + ); } else { $elements = $elements->where($searchcol, 'like', "%$search%"); } diff --git a/app/Repositories/Core/Database.php b/app/Repositories/Core/Database.php index e4a62ca1..e39c1186 100644 --- a/app/Repositories/Core/Database.php +++ b/app/Repositories/Core/Database.php @@ -13,18 +13,18 @@ class Database $data = self::getTableFields($model); foreach ($data as $item) { switch ($item['type']) { - case 'integer': - $form .= Form::number($item['name']); - break; - case 'string': - $form .= Form::number($item['name']); - break; - case 'date': - $form .= Form::date($item['name']); - break; - case 'boolean': - $form .= Form::checkbox($item['name']); - break; + case 'integer': + $form .= Form::number($item['name']); + break; + case 'string': + $form .= Form::number($item['name']); + break; + case 'date': + $form .= Form::date($item['name']); + break; + case 'boolean': + $form .= Form::checkbox($item['name']); + break; } } return $form; diff --git a/app/Repositories/Core/DateCalculation.php b/app/Repositories/Core/DateCalculation.php new file mode 100644 index 00000000..e44b8cfe --- /dev/null +++ b/app/Repositories/Core/DateCalculation.php @@ -0,0 +1,77 @@ +lessThan(Carbon::now()); + } + + public static function isFuture($date, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->greaterThan(Carbon::now()); + } + + public static function isAfter($date1, $date2) + { + return Carbon::createFromFormat(self::getFormat($format), $date1)->greaterThan(Carbon::createFromFormat(self::getFormat($format), $date2)); + } + + public static function isBefore($date1, $date2) + { + return Carbon::createFromFormat(self::getFormat($format), $date1)->lessThan(Carbon::createFromFormat(self::getFormat($format), $date2)); + } + + public static function addYear($date, $nb = 1, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->addYears($nb)->format(self::getFormat($format)); + } + + public static function subYear($date, $nb = 1, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->subYears($nb)->format(self::getFormat($format)); + } + + public static function addMonth($date, $nb = 1, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->addMonths($nb)->format(self::getFormat($format)); + } + + public static function subMonth($date, $nb = 1, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->subMonths($nb)->format(self::getFormat($format)); + } + + public static function addWeek($date, $nb = 1, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->addWeeks($nb)->format(self::getFormat($format)); + } + + public static function subWeek($date, $nb = 1, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->subWeeks($nb)->format(self::getFormat($format)); + } + + public static function addDay($date, $nb = 1, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->addDays($nb)->format(self::getFormat($format)); + } + + public static function subDay($date, $nb = 1, $format = false) + { + return Carbon::createFromFormat(self::getFormat($format), $date)->subDays($nb)->format(self::getFormat($format)); + } + + public static function getFormat($format = false) + { + return $format ? $format : DateTime::getLocaleFormatDate(); + } +} diff --git a/app/Repositories/Core/DateHelper.php b/app/Repositories/Core/DateHelper.php index 9f80e1ad..db89a6c1 100644 --- a/app/Repositories/Core/DateHelper.php +++ b/app/Repositories/Core/DateHelper.php @@ -31,16 +31,16 @@ class DateHelper { $quarter = Carbon::now()->quarter; switch ($quarter) { - case 1: - case 2: - $date = Carbon::now()->startOfYear(); - break; - case 3: - $date = Carbon::now()->startOfQuarter(); - break; - case 4: - $date = Carbon::now()->subMonth(3)->startOfQuarter(); - break; + case 1: + case 2: + $date = Carbon::now()->startOfYear(); + break; + case 3: + $date = Carbon::now()->startOfQuarter(); + break; + case 4: + $date = Carbon::now()->subMonth(3)->startOfQuarter(); + break; } return $date; } diff --git a/app/Repositories/Core/DateRange.php b/app/Repositories/Core/DateRange.php index 0321aaa3..ea48664e 100644 --- a/app/Repositories/Core/DateRange.php +++ b/app/Repositories/Core/DateRange.php @@ -12,162 +12,160 @@ use function League\Period\interval_after; class DateRange { + public static function getPeriodsLastMonthWithLabels($nb, $with_actual = true) + { + $periods = DateRange::PeriodsToCarbon(DateRange::getPeriodsLastMonth($nb, $with_actual)); + $labels = DateRange::getMonthNames($periods); + foreach ($labels as $label) { + $data[$label] = $periods; + } + return $data; + } - public static function getPeriodsLastMonthWithLabels($nb, $with_actual = true) - { - $periods = DateRange::PeriodsToCarbon(DateRange::getPeriodsLastMonth($nb, $with_actual)); - $labels = DateRange::getMonthNames($periods); - foreach ($labels as $label) { - $data[$label] = $periods; - } - return $data; - } + public static function getAllMonthNames() + { + return self::getMonthNames(self::PeriodsToCarbon(self::getPeriodsLastMonth(12))); + } - public static function getAllMonthNames() - { - return self::getMonthNames(self::PeriodsToCarbon(self::getPeriodsLastMonth(12))); - } + public static function getPeriodsLastMonth($nb = 1, $with_actual = true) + { + $end = $with_actual ? Carbon::now()->endOfMonth() : self::lastMonth(); + $begin = ($nb == 1) ? $end->copy()->startOfMonth() : $end->copy()->startOfMonth()->subMonth($nb-1); + $t = self::getPeriodsbyMonth($begin, $end); + return self::getPeriodsbyMonth($begin, $end); + } - public static function getPeriodsLastMonth($nb = 1, $with_actual = true) - { - $end = $with_actual ? Carbon::now()->endOfMonth() : self::lastMonth(); - $begin = ($nb == 1) ? $end->copy()->startOfMonth() : $end->copy()->startOfMonth()->subMonth($nb-1); - $t = self::getPeriodsbyMonth($begin, $end); - return self::getPeriodsbyMonth($begin, $end); - } + public static function getMonthNamesByPeriods($periods) + { + $months = []; + foreach ($periods as $period) { + $date = self::DatePointToCarbon($period->getStartDate()); + $months[] = DateTime::getMonthName($date); + } + return $months; + } - public static function getMonthNamesByPeriods($periods) - { - $months = []; - foreach ($periods as $period) { - $date = self::DatePointToCarbon($period->getStartDate()); - $months[] = DateTime::getMonthName($date); - } - return $months; - } + public static function getMonthNames($periods) + { + $months = []; + foreach ($periods as $period) { + $months[] = DateTime::getMonthName($period['start']); + } + return $months; + } - public static function getMonthNames($periods) - { - $months = []; - foreach ($periods as $period) { - $months[] = DateTime::getMonthName($period['start']); - } - return $months; - } + public static function getPeriodsLastWeek($nb = 1, $with_actual = true) + { + $end = $with_actual ? Carbon::now()->endOfWeek() : self::lastWeek(); + $begin = $end->copy()->subWeek($nb); + return static::getPeriodsbyWeek($begin, $end); + } - public static function getPeriodsLastWeek($nb = 1, $with_actual = true) - { - $end = $with_actual ? Carbon::now()->endOfWeek() : self::lastWeek(); - $begin = $end->copy()->subWeek($nb); - return static::getPeriodsbyWeek($begin, $end); - } + public static function getPeriodsLastDay($nb = 1, $with_actual = true) + { + $end = $with_actual ? Carbon::now()->endOfDay() : static::lastDay(); + $begin = $end->copy()->subDay($nb); + return static::getPeriodsbyDay($begin, $end); + } - public static function getPeriodsLastDay($nb = 1, $with_actual = true) - { - $end = $with_actual ? Carbon::now()->endOfDay() : static::lastDay(); - $begin = $end->copy()->subDay($nb); - return static::getPeriodsbyDay($begin, $end); - } + public static function byDay() + { + return [Carbon::now()->startOfDay(), Carbon::now()->endOfDay()]; + } - public static function byDay() - { - return [Carbon::now()->startOfDay(), Carbon::now()->endOfDay()]; - } + public static function byWeek() + { + return [Carbon::now()->startOfWeek(), Carbon::now()->endOfWeek()]; + } - public static function byWeek() - { - return [Carbon::now()->startOfWeek(), Carbon::now()->endOfWeek()]; - } + public static function byMonth() + { + return [Carbon::now()->startOfMonth(), Carbon::now()->endOfMonth()]; + } - public static function byMonth() - { - return [Carbon::now()->startOfMonth(), Carbon::now()->endOfMonth()]; - } + public static function byQuarter() + { + return [Carbon::now()->startOfQuarter(), Carbon::now()->endOfQuarter()]; + } - public static function byQuarter() - { - return [Carbon::now()->startOfQuarter(), Carbon::now()->endOfQuarter()]; - } + public static function bySemester() + { + $quarter = Carbon::now()->quarter; + switch ($quarter) { + case 1: + case 2: + $date = Carbon::now()->startOfYear(); + break; + case 3: + $date = Carbon::now()->startOfQuarter(); + break; + case 4: + $date = Carbon::now()->subMonth(3)->startOfQuarter(); + break; + } + return [$date, $date->addMonth(6)]; + } - public static function bySemester() - { - $quarter = Carbon::now()->quarter; - switch ($quarter) { - case 1: - case 2: - $date = Carbon::now()->startOfYear(); - break; - case 3: - $date = Carbon::now()->startOfQuarter(); - break; - case 4: - $date = Carbon::now()->subMonth(3)->startOfQuarter(); - break; - } - return [$date, $date->addMonth(6)]; - } + public static function byYear() + { + return [Carbon::now()->startOfYear(), Carbon::now()->endOfYear()]; + } - public static function byYear() - { - return [Carbon::now()->startOfYear(), Carbon::now()->endOfYear()]; - } + public static function lastMonth() + { + return Carbon::now()->subMonth()->startOfMonth(); + } - public static function lastMonth() - { - return Carbon::now()->subMonth()->startOfMonth(); - } + public static function lastWeek() + { + return Carbon::now()->subWeek()->startOfWeek(); + } - public static function lastWeek() - { - return Carbon::now()->subWeek()->startOfWeek(); - } + public static function lastDay() + { + return Carbon::now()->subDay()->startOfDay(); + } - public static function lastDay() - { - return Carbon::now()->subDay()->startOfDay(); - } + public static function getPeriodsbyMonth($begin, $end, $interval = 1) + { + return self::getPeriods($begin, $end, "$interval MONTH"); + } - public static function getPeriodsbyMonth($begin, $end, $interval = 1) - { - return self::getPeriods($begin, $end, "$interval MONTH"); - } + public static function getPeriodsbyWeek($begin, $end, $interval = 1) + { + return self::getPeriods($begin, $end, "$interval WEEK"); + } - public static function getPeriodsbyWeek($begin, $end, $interval = 1) - { - return self::getPeriods($begin, $end, "$interval WEEK"); - } + public static function getPeriodsbyDay($begin, $end, $interval = 1) + { + return self::getPeriods($begin, $end, "$interval DAY"); + } - public static function getPeriodsbyDay($begin, $end, $interval = 1) - { - return self::getPeriods($begin, $end, "$interval DAY"); - } + public static function getPeriods($begin, $end, $duration, $interval = 1) + { + $period = new Period($begin, $end); + foreach ($period->getDatePeriod($duration) as $day) { + $daterange[] = interval_after($day, $duration); + } + return $daterange; + } - public static function getPeriods($begin, $end, $duration, $interval = 1) - { - $period = new Period($begin, $end); - foreach ($period->getDatePeriod($duration) as $day) { - $daterange[] = interval_after($day, $duration); - } - return $daterange; - } + public static function PeriodsToCarbon($periods) + { + $data = []; + foreach ($periods as $period) { + $data[] = self::PeriodToCarbon($period); + } + return $data; + } - public static function PeriodsToCarbon($periods) - { - $data = []; - foreach ($periods as $period) { - $data[] = self::PeriodToCarbon($period); - } - return $data; - } - - public static function PeriodToCarbon($period) - { - return ['start' => self::DatePointToCarbon($period->getStartDate()), 'end' => self::DatePointToCarbon($period->getEndDate())]; - } - - public static function DatePointToCarbon($date) - { - return Carbon::createFromFormat('Y-m-d H:i:s', $date->format('Y-m-d H:i:s')); - } + public static function PeriodToCarbon($period) + { + return ['start' => self::DatePointToCarbon($period->getStartDate()), 'end' => self::DatePointToCarbon($period->getEndDate())]; + } + public static function DatePointToCarbon($date) + { + return Carbon::createFromFormat('Y-m-d H:i:s', $date->format('Y-m-d H:i:s')); + } } diff --git a/app/Repositories/Core/DateTime.php b/app/Repositories/Core/DateTime.php index b34fe2a6..5580341b 100644 --- a/app/Repositories/Core/DateTime.php +++ b/app/Repositories/Core/DateTime.php @@ -10,138 +10,138 @@ use App\Repositories\Languages; class DateTime { - public static function getMonthName($date, $short = true) - { - return $short ? self::getUltraShortMonthName($date) : $date->monthName; - } + public static function getMonthName($date, $short = true) + { + return $short ? self::getUltraShortMonthName($date) : $date->monthName; + } - public static function getShortMonthName($date) - { - return $date->shortMonthName; - } + public static function getShortMonthName($date) + { + return $date->shortMonthName; + } - public static function getUltraShortMonthName($date) - { - return strtoupper(Str::ascii(mb_substr($date->shortMonthName,0,3))); - } + public static function getUltraShortMonthName($date) + { + return strtoupper(Str::ascii(mb_substr($date->shortMonthName, 0, 3))); + } - public static function getDayName($date, $short = true) - { - return $short ? $date->shortDayName : $date->dayName; - } + public static function getDayName($date, $short = true) + { + return $short ? $date->shortDayName : $date->dayName; + } - public static function DatetoLocale($date = null) - { - $format = self::getLocaleFormatDate(); - if (!is_null($date) && !empty($date)) { - $date = Carbon::parse($date)->format($format); - } elseif ($date == 'now') { - $date = Carbon::now()->format($format); - } - return $date; - } + public static function DatetoLocale($date = null) + { + $format = self::getLocaleFormatDate(); + if (!is_null($date) && !empty($date)) { + $date = Carbon::parse($date)->format($format); + } elseif ($date == 'now') { + $date = Carbon::now()->format($format); + } + return $date; + } - public static function DatetimeToLocale($date = null) - { - $format = self::getLocaleFormatDatetime(); - if (!is_null($date) && !empty($date)) { - $date = Carbon::parse($date)->format($format); - } elseif ($date == 'now') { - $date = Carbon::now()->format($format); - } - return $date; - } + public static function DatetimeToLocale($date = null) + { + $format = self::getLocaleFormatDatetime(); + if (!is_null($date) && !empty($date)) { + $date = Carbon::parse($date)->format($format); + } elseif ($date == 'now') { + $date = Carbon::now()->format($format); + } + return $date; + } - public static function getDateTime() - { - return self::DatetimeToLocale(date('Y-m-d H:i:s')); - } + public static function getDateTime() + { + return self::DatetimeToLocale(date('Y-m-d H:i:s')); + } - public static function getDate() - { - return self::DateToLocale(date('Y-m-d')); - } + public static function getDate() + { + return self::DateToLocale(date('Y-m-d')); + } - public static function getLang() - { - return session('locale') ? session('locale') : 'fr'; - } + public static function getLang() + { + return session('locale') ? session('locale') : 'fr'; + } - public static function convert($date) - { - $format = self::getLocaleFormatDate(); - return !empty($date) ? Carbon::createFromFormat($format, $date)->isoFormat('Y-MM-DD') : null; - } + public static function convert($date) + { + $format = self::getLocaleFormatDate(); + return !empty($date) ? Carbon::createFromFormat($format, $date)->isoFormat('Y-MM-DD') : null; + } - public static function convertTime($date) - { - $format = self::getLocaleFormatDatetime(); - return !empty($date) ? Carbon::createFromFormat($format, $date)->isoFormat('Y-MM-DD HH:mm:ss') : null; - } + public static function convertTime($date) + { + $format = self::getLocaleFormatDatetime(); + return !empty($date) ? Carbon::createFromFormat($format, $date)->isoFormat('Y-MM-DD HH:mm:ss') : null; + } - public static function toFr($date) - { - return !empty($date) ? Carbon::parse($date)->isoFormat('DD/MM/Y') : null; - } + public static function toFr($date) + { + return !empty($date) ? Carbon::parse($date)->isoFormat('DD/MM/Y') : null; + } - public static function toFrTime($date) - { - return !empty($date) ? Carbon::parse($date)->isoFormat('DD/MM/Y HH:mm:ss') : null; - } + public static function toFrTime($date) + { + return !empty($date) ? Carbon::parse($date)->isoFormat('DD/MM/Y HH:mm:ss') : null; + } - public static function getYearFromDate($date) - { - // return date_format(DateTime::convert($signature_date), 'Y'); - $date = DateTime::convert($date); - $date = date_create($date); - return date_format($date, 'Y'); - } + public static function getYearFromDate($date) + { + // return date_format(DateTime::convert($signature_date), 'Y'); + $date = DateTime::convert($date); + $date = date_create($date); + return date_format($date, 'Y'); + } - public static function getLocaleFormatDate() - { - $locale = self::getLang(); - switch ($locale) { - case 'fr': - case 'en': - $format = 'd/m/Y'; - break; - default: - $format = 'Y-m-d'; - } - return $format; - } + public static function getLocaleFormatDate() + { + $locale = self::getLang(); + switch ($locale) { + case 'fr': + case 'en': + $format = 'd/m/Y'; + break; + default: + $format = 'Y-m-d'; + } + return $format; + } - public static function getLocaleFormatDatetime() - { - $locale = self::getLang(); - switch ($locale) { - case 'fr': - case 'en': - $format = 'd/m/Y H:i:s'; - break; - default: - $format = 'Y-m-d H:i:s'; - } - return $format; - } + public static function getLocaleFormatDatetime() + { + $locale = self::getLang(); + switch ($locale) { + case 'fr': + case 'en': + $format = 'd/m/Y H:i:s'; + break; + default: + $format = 'Y-m-d H:i:s'; + } + return $format; + } - public static function getLocaleDateFull($date) - { - return Carbon::parse($date)->isoFormat('LLLL'); - } + public static function getLocaleDateFull($date) + { + return Carbon::parse($date)->isoFormat('LLLL'); + } - public static function getLocaleDateFullShort($date) - { - return Carbon::parse($date)->isoFormat('lll'); - } + public static function getLocaleDateFullShort($date) + { + return Carbon::parse($date)->isoFormat('lll'); + } - public static function getLocaleHour($date) - { - return Carbon::parse($date)->isoFormat(''); - } + public static function getLocaleHour($date) + { + return Carbon::parse($date)->isoFormat(''); + } - public static function relativeTime() - { - } + public static function relativeTime() + { + } } diff --git a/app/Repositories/Core/Debug.php b/app/Repositories/Core/Debug.php index 6ebdd22f..17281af5 100644 --- a/app/Repositories/Core/Debug.php +++ b/app/Repositories/Core/Debug.php @@ -96,6 +96,7 @@ class Debug /** * dump un message uniquement si debug est true + * * @param string $msg [description] * @return [type] [description] */ @@ -108,6 +109,7 @@ class Debug /** * force la sortie d'un dump, sans passer par la debugbar ou test si debug est true + * * @param string $msg [description] * @return [type] [description] */ @@ -118,6 +120,7 @@ class Debug /** * dump un message suivant le handler de sortie prévu (log, debugbar, cli, ...) + * * @param [type] $msg [description] * @param boolean $force si true, force la sortie en output direct * @return [type] [description] diff --git a/app/Repositories/Core/File.php b/app/Repositories/Core/File.php new file mode 100644 index 00000000..1fea4338 --- /dev/null +++ b/app/Repositories/Core/File.php @@ -0,0 +1,73 @@ +setFile($file)->getFileType(); + } catch (MimeDetectorException $e) { + die('An error occured while trying to load the given file.'); + } + } +} diff --git a/app/Repositories/Core/HelperDate.php b/app/Repositories/Core/HelperDate.php new file mode 100644 index 00000000..3a5a1c43 --- /dev/null +++ b/app/Repositories/Core/HelperDate.php @@ -0,0 +1,77 @@ +format($format); + + return $date; + } + + public static function fromLocale($d) + { + return self::frenchDate($d); + } + + public static function toLocale($d) + { + return self::toFrenchDate($d); + } + + public static function frenchDate($d) + { + if (!$d) { + return null; + } + return Carbon::createFromFormat('d/m/Y', $d)->format('Y-m-d'); + } + + public static function frenchDates($data, $fields) + { + foreach ($fields as $field) { + if (isset($data[$field]) && $data[$field]) { + $data[$field] = static::frenchDate($data[$field]); + } + } + return $data; + } + + public static function toFrenchDate($d) + { + if ($d && $d != '0000-00-00') { + return Carbon::createFromFormat('Y-m-d', $d)->format('d/m/Y'); + } + return $d; + } + + public static function toFrenchDates($data, $fields) + { + foreach ($fields as $field) { + if (isset($data[$field]) && $data[$field]) { + $data[$field] = static::toFrenchDate($data[$field]); + } + } + return $data; + } +} diff --git a/app/Repositories/Core/Mailer.php b/app/Repositories/Core/Mailer.php index 2ff68bb7..6a31ef7c 100644 --- a/app/Repositories/Core/Mailer.php +++ b/app/Repositories/Core/Mailer.php @@ -7,20 +7,19 @@ use Illuminate\Support\Facades\DB; class Mailer { - public static function getTemplates() { // $mailables = MailEclipse::getMailables(); // DB::rollBack(); // dump($mailables); -/* - $mailables = (null !== $mailables) ? $mailables->sortBy('name') : collect([]); - foreach ($mailables as $mailable) - { - $templates[] = $mailable['name']; - } + /* + $mailables = (null !== $mailables) ? $mailables->sortBy('name') : collect([]); + foreach ($mailables as $mailable) + { + $templates[] = $mailable['name']; + } -*/ + */ $templates = ['EventInscription','EventSaveTheDate','MatinalesBadge','MatinalesThanks','MatinalesReplays']; return $templates; } diff --git a/app/Repositories/Core/Media.php b/app/Repositories/Core/Media.php index bd4ab67e..222a22d1 100644 --- a/app/Repositories/Core/Media.php +++ b/app/Repositories/Core/Media.php @@ -4,53 +4,52 @@ namespace App\Repositories\Core; class Media { + public static function getImages($model) + { + if (!$model) { + return false; + } + $model->getMedia(); + foreach ($model->media as $key => $media) { + $model->media[$key]['url'] = $media->getUrl(); + } + return $model->media; + } - public static function getImages($model) { - if ($model) { - $model->getMedia(); - foreach ($model->media as $key => $media) { - $model->media[$key]['url'] = $media->getUrl(); - } - return $model->media; - } else { - return false; - } - } + public static function storeImages($model, $files) + { + if ($files) { + foreach ($files as $file) { + self::storeImage($model, $file); + } + } + } - public static function storeImages($model, $files) - { - if ($files) { - foreach ($files as $file) { - self::storeImage($model, $file); - } - } - } + public static function storeImage($model, $file) + { + return $model->addMedia($file)->toMediaCollection('images'); + } - public static function storeImage($model, $file) - { - return $model->addMedia($file)->toMediaCollection('images'); - } - - public static function deleteImage($model, $index) - { - $model->getMedia(); - $ret = $model->media[$index]->delete(); - return "1"; - } - - public static function getThumbSrc($image) - { - if (!$image) { - return null; - } - $id = $image['id']; - $images = json_decode($image['responsive_images'], true); - $urls = $images['medialibrary_original']['urls']; - - $img = $urls[count($urls)-1]; - $src = "storage/$id/responsive-images/$img"; - return $src; - } + public static function deleteImage($model, $index) + { + $model->getMedia(); + $ret = $model->media[$index]->delete(); + return "1"; + } + public static function getThumbSrc($image) + { + if (!$image) { + return null; + } + $id = $image['id']; + $images = json_decode($image['responsive_images'], true); + /* + $urls = $images['medialibrary_original']['urls']; + $img = $urls[count($urls)-1]; + $src = "storage/$id/responsive-images/$img"; + */ + return $src ?? null; + } } diff --git a/app/Repositories/Core/Menu/Builder.php b/app/Repositories/Core/Menu/Builder.php index fef5a477..70130341 100644 --- a/app/Repositories/Core/Menu/Builder.php +++ b/app/Repositories/Core/Menu/Builder.php @@ -53,7 +53,6 @@ class Builder extends LavaryMenuBuilder if ($currentUser && $currentUser->ability($ability, $permission)) { $this->items->push($item); } - } else { $this->items->push($item); } @@ -64,8 +63,8 @@ class Builder extends LavaryMenuBuilder /** * Add an item to a existing menu item as a submenu item. * - * @param $id Id of the menu item to attach to - * @param $title Title of the sub item + * @param $id Id of the menu item to attach to + * @param $title Title of the sub item * @param string $options * * @return Lavary\Menu\Item diff --git a/app/Repositories/Core/Menu/Logs.php b/app/Repositories/Core/Menu/Logs.php index b80834f7..36cbee13 100644 --- a/app/Repositories/Core/Menu/Logs.php +++ b/app/Repositories/Core/Menu/Logs.php @@ -12,15 +12,19 @@ class Logs ->id('logs') ->order(1100); - $menu->addTo('logs', __('boilerplate::logs.menu.stats'), [ + $menu->addTo( + 'logs', __('boilerplate::logs.menu.stats'), [ 'route' => 'boilerplate.logs.dashboard', - 'permission' => 'logs', ]) + 'permission' => 'logs', ] + ) ->order(1110) ->activeIfRoute('boilerplate.logs.dashboard'); - $menu->addTo('logs', __('boilerplate::logs.menu.reports'), [ + $menu->addTo( + 'logs', __('boilerplate::logs.menu.reports'), [ 'route' => 'boilerplate.logs.list', - 'permission' => 'logs', ]) + 'permission' => 'logs', ] + ) ->order(1120) ->activeIfRoute(['boilerplate.logs.list', 'boilerplate.logs.show', 'boilerplate.logs.filter']); } diff --git a/app/Repositories/Core/Menu/Users.php b/app/Repositories/Core/Menu/Users.php index 7210c80d..1352151d 100644 --- a/app/Repositories/Core/Menu/Users.php +++ b/app/Repositories/Core/Menu/Users.php @@ -12,19 +12,25 @@ class Users ->id('access') ->order(1000); - $menu->addTo('access', __('boilerplate::users.list.title'), [ + $menu->addTo( + 'access', __('boilerplate::users.list.title'), [ 'route' => 'boilerplate.users.index', - 'permission' => 'users_crud', ]) + 'permission' => 'users_crud', ] + ) ->activeIfRoute(['boilerplate.users.index', 'boilerplate.users.edit']); - $menu->addTo('access', __('boilerplate::users.create.title'), [ + $menu->addTo( + 'access', __('boilerplate::users.create.title'), [ 'route' => 'boilerplate.users.create', - 'permission' => 'users_crud', ]) + 'permission' => 'users_crud', ] + ) ->activeIfRoute('boilerplate.users.create'); - $menu->addTo('access', __('boilerplate::layout.role_management'), [ + $menu->addTo( + 'access', __('boilerplate::layout.role_management'), [ 'route' => 'boilerplate.roles.index', - 'permission' => 'roles_crud', ]) + 'permission' => 'roles_crud', ] + ) ->activeIfRoute('boilerplate.roles.*'); $menu->addTo('access', __('boilerplate::users.profile.title'), ['route' => 'boilerplate.user.profile']) diff --git a/app/Repositories/Core/Stat.php b/app/Repositories/Core/Stat.php index 49b2ae93..9c9b30b1 100644 --- a/app/Repositories/Core/Stat.php +++ b/app/Repositories/Core/Stat.php @@ -6,32 +6,17 @@ class Stat { public static $is_debug = false; public static $force_output = true; - private static $_instance; - private function __construct() + public static function getNewByPeriod($model, $start, $end) { + return $model->whereBetween('created_at', [$start, $end])->count(); } - public static function getInstance() + public static function getTotalAtDate($model, $end) { - if (is_null(self::$_instance)) { - self::$_instance = new self(); - } - return self::$_instance; + return $model->where('created_at', '<', $end)->count(); } - public static function push($range, $var) - { - $tab = (is_array($var)) ? $var : array(); - foreach ($range as $item) { - $begin = date_timestamp_get($item['begin']); - $end = date_timestamp_get($item['end']); - $tab[] = ['begin' => $begin, 'end' => $end, 'count' => $item['count']]; - } - return $tab; - } - - /* fonctions de rendus */ @@ -148,16 +133,16 @@ class Stat $end = Carbon::now(); $begin = Carbon::now()->subMonth(1); switch ($period) { - case 'days': - $periods = DateRange::getPeriodsbyDay($begin, $end); - break; - case 'months': - $periods = DateRange::getPeriodsbyMonth($begin, $end); - break; - case 'weeks': - $periods = DateRange::getPeriodsbyWeek($begin, $end); - break; - default: + case 'days': + $periods = DateRange::getPeriodsbyDay($begin, $end); + break; + case 'months': + $periods = DateRange::getPeriodsbyMonth($begin, $end); + break; + case 'weeks': + $periods = DateRange::getPeriodsbyWeek($begin, $end); + break; + default: } return ($periods); } diff --git a/app/Repositories/Core/Storage.php b/app/Repositories/Core/Storage.php new file mode 100644 index 00000000..d4d7cfbf --- /dev/null +++ b/app/Repositories/Core/Storage.php @@ -0,0 +1,98 @@ +has($dir); + } + + public static function checkFile($file) + { + return Storage2::exists($file); + } + + public static function createDir($dir) + { + Storage2::makeDirectory($dir); + return true; + } + + public static function deleteDir($dir) + { + Storage2::deleteDirectory($dir); + return true; + } + + public static function deleteFile($file) + { + Storage2::delete($file); + return true; + } + + public static function secureDeleteFile($file) + { + $process = new Process(['srm', $file]); + $process->run(); + + if (!$process->isSuccessful()) { + throw new ProcessFailedException($process); + } + } + + public static function createFile($file, $content) + { + Storage2::put($file, $content); + } + + public static function getFile($file) + { + return Storage2::get($file); + } + + public static function getFilesize($file) + { + return Storage2::size($file); + } + + public static function getUrlFile($file) + { + return Storage2::url($file); + } + + public static function download($file, $name = false, $headers = false) + { + return Storage2::download($file, $name, $headers); + } + + public static function getPublicPath($file = false) + { + return public_path($file); + } + + public static function getFileType($file) + { + $file = self::getStoragePath() . $file; + return File::getFileType($file); + } + + public static function getStoragePath($file = false) + { + return storage_path($file); + } +} diff --git a/app/Repositories/Core/Tag.php b/app/Repositories/Core/Tag.php index 6c4c1457..65f48b60 100644 --- a/app/Repositories/Core/Tag.php +++ b/app/Repositories/Core/Tag.php @@ -4,22 +4,23 @@ namespace App\Repositories\Core; class Tag { + public static function getTagsByModel($model) + { + $tags = $model->tags; + return $tags ? $tags->pluck('id')->toArray() : null; + } - public static function getTagsByModel($model) - { - $tags = $model->tags; - return $tags ? $tags->pluck('id')->toArray() : null; - } - - public static function storeTags($model, $tags) - { - if ($tags) { - $tags = collect($tags)->transform(function ($item, $key) { - return (int) $item; - })->toArray(); - return $model->syncTags($tags, true); - } else return false; - } - - + public static function storeTags($model, $tags) + { + if ($tags) { + $tags = collect($tags)->transform( + function ($item, $key) { + return (int) $item; + } + )->toArray(); + return $model->syncTags($tags, true); + } else { + return false; + } + } } diff --git a/app/Repositories/Core/Upload.php b/app/Repositories/Core/Upload.php index 57653781..b8c11f60 100644 --- a/app/Repositories/Core/Upload.php +++ b/app/Repositories/Core/Upload.php @@ -8,157 +8,156 @@ use Intervention\Image\Facades\Image as Image; class Upload { - public static function getData($file) - { - $data['filename'] = $file->getClientOriginalName(); - $data['filetype'] = $file->getClientOriginalExtension(); - $data['filesize'] = $file->getSize(); - $data['mime'] = $file->getMimeType(); - return $data; - } + public static function getData($file) + { + $data['filename'] = $file->getClientOriginalName(); + $data['filetype'] = $file->getClientOriginalExtension(); + $data['filesize'] = $file->getSize(); + $data['mime'] = $file->getMimeType(); + return $data; + } - public static function getUuid($file, $data) - { - $data = (is_array($data)) ? (object) $data : $data; - $pos = strrpos($file, '/'); - $uuid = substr($file, $pos+1); - $uuid = pathinfo($uuid, PATHINFO_FILENAME); - // $uuid = str_replace('.' . strtolower($data->filetype), '', $uuid); - // $uuid = str_replace('.' . $data->filetype, '', $uuid); - return $uuid; - } + public static function getUuid($file, $data) + { + $data = (is_array($data)) ? (object) $data : $data; + $pos = strrpos($file, '/'); + $uuid = substr($file, $pos+1); + $uuid = pathinfo($uuid, PATHINFO_FILENAME); + // $uuid = str_replace('.' . strtolower($data->filetype), '', $uuid); + // $uuid = str_replace('.' . $data->filetype, '', $uuid); + return $uuid; + } - public static function storeByVar($var, $path, $public = false) - { - // check if filename exists - // store - // Storage::disk('local')->put('file.txt', 'Contents'); - // $path = Storage::putFile('avatars', $request->file('avatar')); - // $path = $request->file('avatar')->storeAs('avatars',$request->user()->id,'s3'); - // $path = $request->file('avatar')->storePublicly('avatars', 's3'); - return $request->has($var) ? basename($request->file($var)->store($path)) : false; - } + public static function storeByVar($var, $path, $public = false) + { + // check if filename exists + // store + // Storage::disk('local')->put('file.txt', 'Contents'); + // $path = Storage::putFile('avatars', $request->file('avatar')); + // $path = $request->file('avatar')->storeAs('avatars',$request->user()->id,'s3'); + // $path = $request->file('avatar')->storePublicly('avatars', 's3'); + return $request->has($var) ? basename($request->file($var)->store($path)) : false; + } - public static function store($file, $path) - { - return Storage::putFile($path, $file); - // return $file->store($filepath); - } + public static function store($file, $path) + { + return Storage::putFile($path, $file); + // return $file->store($filepath); + } - public static function storePublic($file, $filepath) - { - return Storage::putFile($filepath, $file, 'public'); - // $filepath = 'public/' . $filepath; - // return $file->store($filepath); - } + public static function storePublic($file, $filepath) + { + return Storage::putFile($filepath, $file, 'public'); + // $filepath = 'public/' . $filepath; + // return $file->store($filepath); + } - public static function createThumb($file, $size, $sub = false) - { - $thumb = self::getThumbPath($file, $sub); - $filename = self::getPublicPath($file); - return Image::make($filename)->orientate()->widen($size)->save($thumb); - } + public static function createThumb($file, $size, $sub = false) + { + $thumb = self::getThumbPath($file, $sub); + $filename = self::getPublicPath($file); + return Image::make($filename)->orientate()->widen($size)->save($thumb); + } - /* - public static function getPath($file) { - return 'public/' . self::getFilename($file); - } - */ - - public static function getPublicPath($file) - { - return storage_path('app/public/' . self::getFilename($file)); - } + /* + public static function getPath($file) { + return 'public/' . self::getFilename($file); + } + */ + + public static function getPublicPath($file) + { + return storage_path('app/public/' . self::getFilename($file)); + } - public static function getPrivatePath($file) - { - return storage_path('app/' . self::getFilename($file)); - } + public static function getPrivatePath($file) + { + return storage_path('app/' . self::getFilename($file)); + } - public static function getSrc($file) - { - return '/storage/' . self::getFilename($file); - } + public static function getSrc($file) + { + return '/storage/' . self::getFilename($file); + } - public static function getThumbPath($file) - { - return storage_path('app/public/' . self::getThumbFilename($file)); - } + public static function getThumbPath($file) + { + return storage_path('app/public/' . self::getThumbFilename($file)); + } - public static function getThumbSrc($file) - { - return '/storage/' . self::getThumbFilename($file); - } + public static function getThumbSrc($file) + { + return '/storage/' . self::getThumbFilename($file); + } - public static function getFilename($file) - { - $file = (is_array($file)) ? (object) $file : $file; - return $file->filepath . '/' . self::getName($file); - } + public static function getFilename($file) + { + $file = (is_array($file)) ? (object) $file : $file; + return $file->filepath . '/' . self::getName($file); + } - public static function getThumbFilename($file, $sub = false) - { - $sub = $sub ? $sub : 'thumbs/'; - $file = (is_array($file)) ? (object) $file : $file; - return $file->filepath . '/' . $sub . self::getName($file); - } + public static function getThumbFilename($file, $sub = false) + { + $sub = $sub ? $sub : 'thumbs/'; + $file = (is_array($file)) ? (object) $file : $file; + return $file->filepath . '/' . $sub . self::getName($file); + } - public static function getName($file) - { - $file = (is_array($file)) ? (object) $file : $file; - return $file->uuid . '.' . strtolower($file->filetype); - } + public static function getName($file) + { + $file = (is_array($file)) ? (object) $file : $file; + return $file->uuid . '.' . strtolower($file->filetype); + } - /** - * [fix problem path with Storage on Windows] - * @param [type] $path [description] - * @return [type] [description] - */ - public static function fix($path) - { - if (self::isWindows()) { - return str_replace('/', '\\', $path); - } else { - return $path; - } - } + /** + * [fix problem path with Storage on Windows] + * + * @param [type] $path [description] + * @return [type] [description] + */ + public static function fix($path) + { + if (!self::isWindows()) { + return $path; + } + return str_replace('/', '\\', $path); + } - public static function move($source, $dest) - { - if (Storage::exists($dest)) { - self::delete($dest); - } - return Storage::move($source, $dest); // transfère et renomme le fichier du dossier temporaire au dossier du client - } + public static function move($source, $dest) + { + if (Storage::exists($dest)) { + self::delete($dest); + } + return Storage::move($source, $dest); // transfère et renomme le fichier du dossier temporaire au dossier du client + } - public static function delete($file) - { - // Storage::delete($file); - // return unlink($file); - return Storage::delete($file); - } + public static function delete($file) + { + // Storage::delete($file); + // return unlink($file); + return Storage::delete($file); + } - public static function deleteFile($path) - { - if (Storage::exists($path)) { - return Storage::delete($path); - } else { - return false; - } - } + public static function deleteFile($path) + { + if (!Storage::exists($path)) { + return false; + } + return Storage::delete($path); + } - public static function deleteRecursive($path) - { - rmdir_recursive($targetDir); - } + public static function deleteRecursive($path) + { + rmdir_recursive($targetDir); + } - public function make_dir($path, $permissions = 0777) - { - return is_dir($path) || mkdir($path, $permissions, true); - } - - public static function isWindows() - { - return (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); - } + public function make_dir($path, $permissions = 0777) + { + return is_dir($path) || mkdir($path, $permissions, true); + } + + public static function isWindows() + { + return (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); + } } diff --git a/app/Repositories/Core/User/Basket.php b/app/Repositories/Core/User/Basket.php index 359f6986..ced1f73b 100644 --- a/app/Repositories/Core/User/Basket.php +++ b/app/Repositories/Core/User/Basket.php @@ -4,60 +4,59 @@ namespace App\Repositories\Core\User; class Basket { + public static function first($key) + { + $data = self::get($key); + return array_shift($data); + } - public static function first($key) - { - $data = self::get($key); - return array_shift($data); - } + public static function last($key) + { + $data = self::get($key); + return $data ? array_pop($data) : false; + } - public static function last($key) - { - $data = self::get($key); - return $data ? array_pop($data) : false; - } + public static function set($key, $data) + { + return session([$key => $data]); + } - public static function set($key, $data) - { - return session([$key => $data]); - } + public static function get($key) + { + return session($key); + } - public static function get($key) - { - return session($key); - } + public static function add($key, $value) + { + $data = self::isExist($key) ? self::get($key) : []; + if (array_search($value, $data) === false) { + array_push($data, $value); + self::set($key, $data); + } + return count($data); + } - public static function add($key, $value) - { - $data = self::isExist($key) ? self::get($key) : []; - if (array_search($value, $data) === false) { - array_push($data, $value); - self::set($key, $data); - } - return count($data); - } + public static function remove($key, $value) + { + $data = self::get($key); + if (($index = array_search($value, $data)) !== false) { + unset($data[$index]); + } + return self::set($key, $data); + } - public static function remove($key, $value) - { - $data = self::get($key); - if (($index = array_search($value, $data)) !== false) { - unset($data[$index]); - } - return self::set($key, $data); - } + public static function isExist($key) + { + return session()->has($key); + } - public static function isExist($key) - { - return session()->has($key); - } + public static function reset($key) + { + return session()->forget($key); + } - public static function reset($key) - { - return session()->forget($key); - } - - public static function resetAll() - { - return session()->flush(); - } + public static function resetAll() + { + return session()->flush(); + } } diff --git a/app/Repositories/Core/User/Notifications/NewUser.php b/app/Repositories/Core/User/Notifications/NewUser.php index 7dc1bc73..db379125 100644 --- a/app/Repositories/Core/User/Notifications/NewUser.php +++ b/app/Repositories/Core/User/Notifications/NewUser.php @@ -37,16 +37,24 @@ class NewUser extends Notification ->markdown('notifications.email') ->greeting(__('notifications.greeting', ['firstname' => $notifiable->first_name])) ->subject(__('notifications.newuser.subject', ['name' => config('app.name')])) - ->line(__('notifications.newuser.intro', [ - 'name' => $currentUser->first_name.' '.$currentUser->last_name, - ])) + ->line( + __( + 'notifications.newuser.intro', [ + 'name' => $currentUser->first_name.' '.$currentUser->last_name, + ] + ) + ) ->action( __('notifications.newuser.button'), route('users.firstlogin', $notifiable->remember_token) ) - ->salutation(__('notifications.salutation', [ - 'name' => $currentUser->first_name.' '.$currentUser->last_name, - ])) + ->salutation( + __( + 'notifications.salutation', [ + 'name' => $currentUser->first_name.' '.$currentUser->last_name, + ] + ) + ) ->line(__('notifications.newuser.outro')); } diff --git a/app/Repositories/Core/User/Notifications/ResetPassword.php b/app/Repositories/Core/User/Notifications/ResetPassword.php index 763d1691..06daa6ce 100644 --- a/app/Repositories/Core/User/Notifications/ResetPassword.php +++ b/app/Repositories/Core/User/Notifications/ResetPassword.php @@ -13,7 +13,7 @@ class ResetPassword extends \Illuminate\Auth\Notifications\ResetPassword * * @return \Illuminate\Notifications\Messages\MailMessage */ -/* + /* public function toMail($notifiable) { return (new MailMessage()) @@ -27,5 +27,5 @@ class ResetPassword extends \Illuminate\Auth\Notifications\ResetPassword ) ->line(__('notifications.resetpassword.outro')); } -*/ + */ } diff --git a/app/Repositories/Core/User/PasswordResets.php b/app/Repositories/Core/User/PasswordResets.php index 9c397b1f..a76b9239 100644 --- a/app/Repositories/Core/User/PasswordResets.php +++ b/app/Repositories/Core/User/PasswordResets.php @@ -6,7 +6,6 @@ use App\Models\Core\Auth\PasswordReset; class PasswordResets { - public static function getTokenByEmail($email) { return PasswordReset::byEmail($email)->first(); diff --git a/app/Repositories/Core/User/ShopCart.php b/app/Repositories/Core/User/ShopCart.php new file mode 100644 index 00000000..1b207d12 --- /dev/null +++ b/app/Repositories/Core/User/ShopCart.php @@ -0,0 +1,18 @@ +add($data); + } + + public static function get() + { + return \Cart::session(Users::getId()); + } +} diff --git a/app/Repositories/Shop/ArticleComponents.php b/app/Repositories/Shop/ArticleComponents.php index 4c53b6c2..56bb20c6 100644 --- a/app/Repositories/Shop/ArticleComponents.php +++ b/app/Repositories/Shop/ArticleComponents.php @@ -12,7 +12,6 @@ use App\Models\Shop\ArticleComponent; class ArticleComponents { - public static function getDatatable() { $model = ArticleComponent::orderBy('name'); @@ -21,7 +20,7 @@ class ArticleComponents public static function getAll() { - return ArticleComponent::orderBy('name','asc')->get(); + return ArticleComponent::orderBy('name', 'asc')->get(); } public static function get($id) @@ -32,7 +31,7 @@ class ArticleComponents public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data) : self::create($data); + $item = $id ? self::update($data) : self::create($data); return $item->id; } @@ -50,5 +49,4 @@ class ArticleComponents { return ArticleComponent::destroy($id); } - } diff --git a/app/Repositories/Shop/ArticleFamilies.php b/app/Repositories/Shop/ArticleNatures.php similarity index 56% rename from app/Repositories/Shop/ArticleFamilies.php rename to app/Repositories/Shop/ArticleNatures.php index c17fb817..ec807cfc 100644 --- a/app/Repositories/Shop/ArticleFamilies.php +++ b/app/Repositories/Shop/ArticleNatures.php @@ -2,44 +2,35 @@ namespace App\Repositories\Shop; -use Yajra\DataTables\DataTables; +use App\Models\Shop\ArticleNature; -use App\Models\Shop\ArticleFamily; - -class ArticleFamilies +class ArticleNatures { - - public static function getDatatable() - { - $model = ArticleFamily::orderBy('name'); - return Datatables::of($model)->make(true); - } - public static function getOptions() { - return ArticleFamily::get()->pluck('name','id')->toArray(); + return ArticleNature::get()->pluck('name', 'id')->toArray(); } public static function getAll() { - return ArticleFamily::orderBy('name','asc')->get(); + return ArticleNature::orderBy('name', 'asc')->get(); } public static function get($id) { - return ArticleFamily::find($id); + return ArticleNature::find($id); } public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data, $id) : self::create($data); + $item = $id ? self::update($data, $id) : self::create($data); return $item->id; } public static function create($data) { - return ArticleFamily::create($data); + return ArticleNature::create($data); } public static function update($data, $id = false) @@ -50,7 +41,6 @@ class ArticleFamilies public static function destroy($id) { - return ArticleFamily::destroy($id); + return ArticleNature::destroy($id); } - } diff --git a/app/Repositories/Shop/ArticlePrices.php b/app/Repositories/Shop/ArticlePrices.php index fa484019..662ad79b 100644 --- a/app/Repositories/Shop/ArticlePrices.php +++ b/app/Repositories/Shop/ArticlePrices.php @@ -12,87 +12,85 @@ use App\Models\Shop\ArticlePrice; class ArticlePrices { + public static function getByArticle($id) + { + return ArticlePrice::byArticle($id)->get(); + } - public static function getByArticle($id) - { - return ArticlePrice::byArticle($id)->get(); - } + public static function getByArticleWithAttribute($id) + { + return ArticlePrice::with('article_attribute.attribute_value')->byArticle($id)->get(); + } - public static function getByArticleWithAttribute($id) - { - return ArticlePrice::with('article_attribute.attribute_value')->byArticle($id)->get(); - } + public static function getDatatable() + { + $model = ArticlePrice::orderBy('name'); + return Datatables::of($model)->make(true); + } - public static function getDatatable() - { - $model = ArticlePrice::orderBy('name'); - return Datatables::of($model)->make(true); - } + public static function getAll() + { + return ArticlePrice::orderBy('name', 'asc')->get(); + } - public static function getAll() - { - return ArticlePrice::orderBy('name','asc')->get(); - } + public static function get($id) + { + return ArticlePrice::find($id); + } - public static function get($id) - { - return ArticlePrice::find($id); - } + public static function storePrices($article_id, $prices) + { + // dump($article_id); + // dump($prices); + // exit; + if ($prices) { + foreach ($prices as $key => $price) { + $price['article_attribute']['article_attribute_value_id'] = $price['attribute']['attribute_value_id']; + $prices[$key]['article_attribute_id'] = ArticleAttributes::storeAttribute($article_id, $price['article_attribute']); - public static function storePrices($article_id, $prices) - { - // dump($article_id); - // dump($prices); - // exit; - if ($prices) { - foreach ($prices as $key => $price) { - $price['article_attribute']['article_attribute_value_id'] = $price['attribute']['attribute_value_id']; - $prices[$key]['article_attribute_id'] = ArticleAttributes::storeAttribute($article_id, $price['article_attribute']); + unset($prices[$key]['article_attribute']); + unset($prices[$key]['attribute']); + self::store($prices[$key]); + } + } else { + return false; + } + } - unset($prices[$key]['article_attribute']); - unset($prices[$key]['attribute']); - self::store($prices[$key]); - } - } else { - return false; - } - } + public static function store($data) + { + $attributes = isset($data['attributes']) ? $data['attributes'] : false; + unset($data['attributes']); + + $id = isset($data['id']) ? $data['id'] : false; + $price = $id ? self::update($data) : self::create($data); + + $ret = $attributes ? self::storeAttributes($price->id, $attributes) : false; + + return $price->id; + } - public static function store($data) - { - $attributes = isset($data['attributes']) ? $data['attributes'] : false; - unset($data['attributes']); - - $id = isset($data['id']) ? $data['id'] : false; - $price = $id ? self::update($data) : self::create($data); - - $ret = $attributes ? self::storeAttributes($price->id, $attributes) : false; - - return $price->id; - } - - public static function storeAttributes($article_price_id,$attributes) - { - return ArticleAttributes::storeAttribute($article_price_id, $attributes); - } + public static function storeAttributes($article_price_id, $attributes) + { + return ArticleAttributes::storeAttribute($article_price_id, $attributes); + } - public static function create($data) - { - return ArticlePrice::create($data); - } + public static function create($data) + { + return ArticlePrice::create($data); + } - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - $article = ArticlePrice::find($id); - $article->update($data); - return $article; - } - - public static function destroy($id) - { - return ArticlePrice::destroy($id); - } + public static function update($data, $id = false) + { + $id = isset($data['id']) ? $data['id'] : false; + $article = ArticlePrice::find($id); + $article->update($data); + return $article; + } + public static function destroy($id) + { + return ArticlePrice::destroy($id); + } } diff --git a/app/Repositories/Shop/Articles.php b/app/Repositories/Shop/Articles.php index a68cf3be..a6c3c0ca 100644 --- a/app/Repositories/Shop/Articles.php +++ b/app/Repositories/Shop/Articles.php @@ -12,149 +12,178 @@ use App\Models\Shop\Article; class Articles { + public static function autocomplete($str) + { + $data = Article::where('name', 'LIKE', "%${str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id'); + $export = []; + foreach ($data as $key => $name) { + $export[] = ['value' => $key, 'text' => $name]; + } + return $export; + } - public static function getAll() - { - return Article::orderBy('name','asc')->get(); - } + public static function getAll() + { + return Article::orderBy('name', 'asc')->get(); + } - public static function getFull($id) - { - $article = Article::with('product.tags')->findOrFail($id); - $data['article'] = $article->toArray(); - $data['article']['categories'] = self::getCategoriesByArticle($article); - $data['article']['tags'] = self::getTagsByArticle($article); - $data['article']['prices'] = self::getPricesByArticle($article); - self::getMeta($data); - return $data; - } + public static function getFull($id) + { + $article = Article::with('product.tags')->findOrFail($id); + $data['article'] = $article->toArray(); + $data['article']['inherited'] = self::getInherited($id); + // dump($data); + // exit; + $data['article']['categories'] = self::getCategoriesByArticle($article); + $data['article']['tags'] = self::getTagsByArticle($article); + // $data['article']['prices'] = self::getPricesByArticle($article); + self::getMeta($data); + return $data; + } - public static function getMeta(&$data = []) - { - $data['products'] = ( ($data['article']['product_type'] ?? false) == 'App\Models\Botanic\Variety') ? Varieties::getOptionsWithSpecie() : Species::getOptions(); - $data['categories_options'] = Categories::getOptions(); - $data['price_generics'] = PriceGenericCategories::getOptionsWithChildrens(); - $data['families_options'] = ArticleFamilies::getOptions(); - $data['taxes_options'] = Taxes::getOptions(); - $data['packages'] = ($data['article']['article_family_id'] ?? false) ? Packages::getSelectByFamily($data['article']['article_family_id']) : []; - $data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : []; - $data['tags_list'] = TagGroups::getTreeTags(); - $data['models_options'] = ['App\Models\Botanic\Specie' => 'Espèces', 'App\Models\Botanic\Variety' => 'Variétés']; - return $data; - } + public static function getInherited($id) + { + $article = Article::with('product.tags')->findOrFail($id); + $product_type = $article->product_type; + switch ($product_type) { + case 'App\Models\Botanic\Variety': + $data[] = ['name' => 'Espèces', 'description' => Species::getDescription($article->product->specie_id), 'tags' => Species::getTags($article->product->specie_id)]; + $data[] = ['name' => 'Variétés', 'description' => $article->product->description, 'tags' => $article->product->tags->toArray()]; + break; + case 'App\Models\Botanic\Specie': + $data[] = ['name' => 'Espèces', 'description' => $article->product->description, 'tags' => $article->product->tags->toArray()]; + break; + case 'App\Models\Shop\Merchandise': + $data[] = ['name' => 'Marchandise', 'description' => $article->product->description, 'tags' => $article->product->tags->toArray()]; + break; + } + return $data; + } - public static function getByCategory($category_id) - { - return Article::with(['prices','product','image'])->get(); - } + public static function getMeta(&$data = []) + { + $data['products'] = (($data['article']['product_type'] ?? false) == 'App\Models\Botanic\Variety') ? Varieties::getOptionsWithSpecie() : Species::getOptions(); + $data['categories_options'] = Categories::getOptions(); + $data['natures_options'] = ArticleNatures::getOptions(); + $data['packages'] = ($data['article']['article_family_id'] ?? false) ? Packages::getSelectByFamily($data['article']['article_family_id']) : []; + $data['tags_list'] = TagGroups::getTreeTags(); + $data['models_options'] = ['App\Models\Botanic\Specie' => 'Espèces', 'App\Models\Botanic\Variety' => 'Variétés']; + return $data; + } - public static function getCategoriesByArticle($article) - { - return $article->categories->pluck('id')->toArray(); - } + public static function getByCategory($category_id) + { + return Article::byCategory($category_id)->with(['prices','product','image'])->get(); + } - public static function getTagsByArticle($article) - { - return $article->tags->pluck('id')->toArray(); - } + public static function getCategoriesByArticle($article) + { + return $article->categories->pluck('id')->toArray(); + } - public static function getPricesByArticle($article) - { - return Prices::getByArticle($article->id); - } + public static function getTagsByArticle($article) + { + return $article->tags->pluck('id')->toArray(); + } - public static function get($id) - { - return Article::find($id); - } + public static function getPricesByArticle($article) + { + return Prices::getByArticle($article->id); + } - public static function storeFull($data) - { - $images = isset($data['images']) ? $data['images'] : false; - $categories = isset($data['categories']) ? $data['categories'] : false; - $tags = isset($data['tags']) ? $data['tags'] : false; - $prices = isset($data['prices']) ? $data['prices'] : false; - unset($data['images']); - unset($data['categories']); - unset($data['tags']); - unset($data['prices']); - $article = self::store($data); - self::storeImages($article, $images); - self::storeCategories($article, $categories); - self::storeTags($article, $tags); - self::storePrices($article, $prices); - return $article->id; - } + public static function get($id) + { + return Article::find($id); + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - return $id ? self::update($data, $id) : self::create($data); - } + public static function storeFull($data) + { + $images = isset($data['images']) ? $data['images'] : false; + $categories = isset($data['categories']) ? $data['categories'] : false; + $tags = isset($data['tags']) ? $data['tags'] : false; + $prices = isset($data['prices']) ? $data['prices'] : false; + unset($data['images']); + unset($data['categories']); + unset($data['tags']); + unset($data['prices']); + $article = self::store($data); + self::storeImages($article, $images); + self::storeCategories($article, $categories); + self::storeTags($article, $tags); + self::storePrices($article, $prices); + return $article->id; + } - public static function create($data) - { - return Article::create($data); - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + return $id ? self::update($data, $id) : self::create($data); + } - public static function update($data, $id = false) - { - $id = $id ? $id : $data['id']; - $article = self::get($id); - $ret = $article->update($data); - return $article; - } + public static function create($data) + { + return Article::create($data); + } - public static function destroy($id) - { - return Article::destroy($id); - } + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $article = self::get($id); + $ret = $article->update($data); + return $article; + } - public static function storeCategories($article, $categories) - { - if ($categories) { - $categories = collect($categories)->transform(function ($item, $key) { - return (int) $item; - })->toArray(); - return $article->syncCategories($categories, true); - } else { - return false; - } - } + public static function destroy($id) + { + return Article::destroy($id); + } - public static function storeTags($article, $tags) - { - return Tag::storeTags($article, $tags); - } + public static function storeCategories($article, $categories) + { + if ($categories) { + $categories = collect($categories)->transform( + function ($item, $key) { + return (int) $item; + } + )->toArray(); + return $article->syncCategories($categories, true); + } else { + return false; + } + } - public static function storePrices($article, $prices) - { - return ArticlePrices::storePrices($article->id, $prices); - } + public static function storeTags($article, $tags) + { + return Tag::storeTags($article, $tags); + } - public static function storeImages($article, $files) - { - return Media::storeImages($article, $files); - } + public static function storePrices($article, $prices) + { + return ArticlePrices::storePrices($article->id, $prices); + } - public static function storeImage($article, $file) - { - return Media::storeImage($article, $file); - } + public static function storeImages($article, $files) + { + return Media::storeImages($article, $files); + } - public static function getImages($id) - { - return Media::getImages(self::get($id)); - } + public static function storeImage($article, $file) + { + return Media::storeImage($article, $file); + } - public static function getThumbSrc($image) - { - return Media::getThumbSrc($image); - } + public static function getImages($id) + { + return Media::getImages(self::get($id)); + } - public static function deleteImage($id, $index) - { - return Media::deleteImage(self::get($id), $index); - } + public static function getThumbSrc($image) + { + return Media::getThumbSrc($image); + } + public static function deleteImage($id, $index) + { + return Media::deleteImage(self::get($id), $index); + } } diff --git a/app/Repositories/Shop/Categories.php b/app/Repositories/Shop/Categories.php index 47985913..08d5d162 100644 --- a/app/Repositories/Shop/Categories.php +++ b/app/Repositories/Shop/Categories.php @@ -8,7 +8,6 @@ use App\Models\Shop\Category; class Categories { - public static function getDatatable() { $model = Category::orderBy('name'); @@ -17,7 +16,7 @@ class Categories public static function getAll() { - return Category::orderBy('name','asc')->get(); + return Category::orderBy('name', 'asc')->get(); } public static function get($id) @@ -32,15 +31,15 @@ class Categories public static function getOptions() { - return Category::get()->pluck('name','category_id')->toArray(); + return Category::get()->pluck('name', 'category_id')->toArray(); } public static function storeFull($data) { $images = isset($data['images']) ? $data['images'] : false; -// $tags = isset($data['tags']) ? $data['tags'] : false; + // $tags = isset($data['tags']) ? $data['tags'] : false; unset($data['images']); -// unset($data['tags']); + // unset($data['tags']); $category = self::store($data); self::storeImages($category, $images); // self::storeTags($category, $tags); @@ -50,23 +49,27 @@ class Categories public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; - return $id ? self::update($data, $id) : self::create($data); + return $id ? self::update($data, $id) : self::create($data); } public static function storeTags($category, $tags) { if ($tags) { - $tags = collect($tags)->transform(function ($item, $key) { - return (int) $item; - })->toArray(); + $tags = collect($tags)->transform( + function ($item, $key) { + return (int) $item; + } + )->toArray(); return $category->syncTags($tags, true); - } else return false; + } else { + return false; + } } public static function storeImages($category, $files) { if ($files) { - foreach ($files as $file) { + foreach ($files as $file) { self::storeImage($category, $file); } } @@ -117,7 +120,7 @@ class Categories $id = $id ? $id : $data['id']; $category = Category::find($id); $ret = $category->update($data); - CategoryTrees::update($data, $category->category_id); + CategoryTrees::update($data, $category->category_id); return $category; } @@ -132,5 +135,4 @@ class Categories { return app('rinvex.categories.category')->find(1); } - } diff --git a/app/Repositories/Shop/CategoryTrees.php b/app/Repositories/Shop/CategoryTrees.php index 9460afca..88a97517 100644 --- a/app/Repositories/Shop/CategoryTrees.php +++ b/app/Repositories/Shop/CategoryTrees.php @@ -8,15 +8,14 @@ class CategoryTrees { public static function getTree() { - $categories = app('rinvex.categories.category')->orderBy('_lft','asc')->get()->toTree()->toArray(); + $categories = app('rinvex.categories.category')->orderBy('_lft', 'asc')->get()->toTree()->toArray(); return self::getChildren($categories[0]['children']); - } + } public static function getChildren($data) { $tree = []; - foreach ($data as $item) - { + foreach ($data as $item) { $leaf = []; $leaf['name'] = $item['name']; $leaf['id'] = $item['id']; @@ -35,14 +34,14 @@ class CategoryTrees $category_target = self::getNode($target_id); switch ($type) { - case 'after': - dump("$node_id After $target_id"); - $category->afterNode($category_target); - break; - case 'inside': - dump("$node_id inside $target_id"); - $category_target->appendNode($category); - break; + case 'after': + dump("$node_id After $target_id"); + $category->afterNode($category_target); + break; + case 'inside': + dump("$node_id inside $target_id"); + $category_target->appendNode($category); + break; } $category->save(); return "1"; @@ -77,5 +76,4 @@ class CategoryTrees { return app('rinvex.categories.category')->find($id); } - } diff --git a/app/Repositories/Shop/Customers.php b/app/Repositories/Shop/Customers.php index 63ee6c49..9ef794ef 100644 --- a/app/Repositories/Shop/Customers.php +++ b/app/Repositories/Shop/Customers.php @@ -6,48 +6,46 @@ use App\Models\Shop\Customer; class Customers { + public static function getOptions() + { + return Customer::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } - public static function getOptions() - { - return Customer::orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + public static function getOptionsByPackage($package_id) + { + return Customer::byPackage($package_id)->orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } - public static function getOptionsByPackage($package_id) - { - return Customer::byPackage($package_id)->orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + public static function getAll() + { + return Customer::orderBy('value', 'asc')->get(); + } - public static function getAll() - { - return Customer::orderBy('value','asc')->get(); - } + public static function get($id) + { + return Customer::find($id); + } - public static function get($id) - { - return Customer::find($id); - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data, $id) : self::create($data); + return $item->id; + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data, $id) : self::create($data); - return $item->id; - } + public static function create($data) + { + return Customer::create($data); + } - public static function create($data) - { - return Customer::create($data); - } - - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - return Customer::find($id)->update($data); - } - - public static function destroy($id) - { - return Customer::destroy($id); - } + public static function update($data, $id = false) + { + $id = isset($data['id']) ? $data['id'] : false; + return Customer::find($id)->update($data); + } + public static function destroy($id) + { + return Customer::destroy($id); + } } diff --git a/app/Repositories/Shop/Invoices.php b/app/Repositories/Shop/Invoices.php index 08eb7ee8..5bc94351 100644 --- a/app/Repositories/Shop/Invoices.php +++ b/app/Repositories/Shop/Invoices.php @@ -6,48 +6,46 @@ use App\Models\Shop\Invoice; class Invoices { + public static function getOptions() + { + return Invoice::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } - public static function getOptions() - { - return Invoice::orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + public static function getOptionsByPackage($package_id) + { + return Invoice::byPackage($package_id)->orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } - public static function getOptionsByPackage($package_id) - { - return Invoice::byPackage($package_id)->orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + public static function getAll() + { + return Invoice::orderBy('value', 'asc')->get(); + } - public static function getAll() - { - return Invoice::orderBy('value','asc')->get(); - } + public static function get($id) + { + return Invoice::find($id); + } - public static function get($id) - { - return Invoice::find($id); - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data, $id) : self::create($data); + return $item->id; + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data, $id) : self::create($data); - return $item->id; - } + public static function create($data) + { + return Invoice::create($data); + } - public static function create($data) - { - return Invoice::create($data); - } - - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - return self::get($id)->update($data); - } - - public static function destroy($id) - { - return Invoice::destroy($id); - } + public static function update($data, $id = false) + { + $id = isset($data['id']) ? $data['id'] : false; + return self::get($id)->update($data); + } + public static function destroy($id) + { + return Invoice::destroy($id); + } } diff --git a/app/Repositories/Shop/Orders.php b/app/Repositories/Shop/Orders.php index d432a70c..70f9eb30 100644 --- a/app/Repositories/Shop/Orders.php +++ b/app/Repositories/Shop/Orders.php @@ -6,48 +6,48 @@ use App\Models\Shop\Order; class Orders { + public static function getOptions() + { + return Order::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } - public static function getOptions() - { - return Order::orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + public static function getOptionsByPackage($package_id) + { + return Order::byPackage($package_id)->orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } - public static function getOptionsByPackage($package_id) - { - return Order::byPackage($package_id)->orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + public static function getAll() + { + return Order::orderBy('value', 'asc')->get(); + } - public static function getAll() - { - return Order::orderBy('value','asc')->get(); - } + public static function get($id) + { + return Order::findOrFail($id); + } - public static function get($id) - { - return Order::findOrFail($id); - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data, $id) : self::create($data); + return $item->id; + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data, $id) : self::create($data); - return $item->id; - } + public static function create($data) + { + return Order::create($data); + } - public static function create($data) - { - return Order::create($data); - } - - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - return self::get($id)->update($data); - } - - public static function destroy($id) - { - return Order::destroy($id); - } + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } + public static function destroy($id) + { + return Order::destroy($id); + } } diff --git a/app/Repositories/Shop/Packages.php b/app/Repositories/Shop/Packages.php index 5d773b98..670b68eb 100644 --- a/app/Repositories/Shop/Packages.php +++ b/app/Repositories/Shop/Packages.php @@ -2,62 +2,54 @@ namespace App\Repositories\Shop; -use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Facades\DB; -use Illuminate\Support\Str; - -use Yajra\DataTables\DataTables; - use App\Models\Shop\Package; class Packages { - public static function getDatatable() - { - return Datatables::of($model)->make(true); - } + public static function getOptions() + { + return Package::orderBy('value', 'asc')->pluck('value', 'id')->toArray(); + } - public static function getOptions() - { - return Package::orderBy('value','asc')->pluck('value','id')->toArray(); - } + public static function getAll() + { + return Package::orderBy('value', 'asc')->get(); + } - public static function getSelectByFamily($family_id) - { - return Package::orderBy('value','asc')->byArticleFamily($family_id)->pluck('value','id')->toArray(); - } + public static function getName($id) + { + return self::get($id)->value; + } - public static function getAll() - { - return Package::orderBy('value','asc')->get(); - } + public static function get($id) + { + return Package::find($id); + } - public static function get($id) - { - return Package::find($id); - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data) : self::create($data); + return $item->id; + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data) : self::create($data); - return $item->id; - } + public static function create($data) + { + return Package::create($data); + } - public static function create($data) - { - return Package::create($data); - } + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } - public static function update($data) - { - return Package::find($id)->update($data); - } - - public static function destroy($id) - { - return Package::destroy($id); - } + public static function destroy($id) + { + return Package::destroy($id); + } } diff --git a/app/Repositories/Shop/PriceGenericCategories.php b/app/Repositories/Shop/PriceGenericCategories.php deleted file mode 100644 index 5f23bf24..00000000 --- a/app/Repositories/Shop/PriceGenericCategories.php +++ /dev/null @@ -1,76 +0,0 @@ -make(true); - } - - public static function getAll() - { - return PriceGenericCategory::orderBy('name','asc')->get(); - } - - public static function get($id) - { - return PriceGenericCategory::find($id); - } - - public static function getOptions() - { - return PriceGenericCategory::get()->pluck('name','id')->toArray(); - } - - public static function getOptionsWithChildrens() - { - $prices = PriceGenericCategory::with('price_generics')->get(); - $data = []; - foreach ($prices as $key => $price) - { - $data[$key]['label'] = $price->name; - foreach($price->price_generics as $generic) - { - $data[$key]['options'][$generic->id] = $generic->name; - } - } - return $data; - } - - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $category = $id ? self::update($data) : self::create($data); - return $category->id; - } - - public static function create($data) - { - return PriceGenericCategory::create($data); - } - - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - $category = PriceGenericCategory::find($id); - $category->update($data); - return $category; - } - - public static function destroy($id) - { - return PriceGenericCategory::destroy($id); - } - -} diff --git a/app/Repositories/Shop/PriceGenericValues.php b/app/Repositories/Shop/PriceGenericValues.php deleted file mode 100644 index 0dd27f93..00000000 --- a/app/Repositories/Shop/PriceGenericValues.php +++ /dev/null @@ -1,70 +0,0 @@ -get(); - } - - public static function getDatatable() - { - $model = PriceGenericValue::orderBy('name'); - return Datatables::of($model)->make(true); - } - - public static function getAll() - { - return PriceGenericValue::orderBy('name','asc')->get(); - } - - public static function get($id) - { - return PriceGenericValue::find($id); - } - - public static function storePrices($generic_id, $values) - { - foreach ($values as $value) - { - $value['price_generic_id'] = $generic_id; - self::store($value); - } - } - - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $price = $id ? self::update($data) : self::create($data); - return $price->id; - } - - public static function create($data) - { - return PriceGenericValue::create($data); - } - - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - $article = PriceGenericValue::find($id); - $article->update($data); - return $article; - } - - public static function destroy($id) - { - return PriceGenericValue::destroy($id); - } - -} diff --git a/app/Repositories/Shop/PriceGenerics.php b/app/Repositories/Shop/PriceGenerics.php deleted file mode 100644 index 95db1b3a..00000000 --- a/app/Repositories/Shop/PriceGenerics.php +++ /dev/null @@ -1,82 +0,0 @@ -get(); - } - - public static function getByArticleWithValues($id) - { - return PriceGeneric::with('values')->byArticle($id)->get(); - } - - public static function getDatatable() - { - $model = PriceGeneric::orderBy('name'); - return Datatables::of($model)->make(true); - } - - public static function getOptions() - { - $model = PriceGeneric::with('category')->get()->toArray(); - dump($model); - exit; - } - - public static function getAll() - { - return PriceGeneric::orderBy('name','asc')->get(); - } - - public static function get($id) - { - return PriceGeneric::find($id); - } - - public static function getFull($id) - { - return PriceGeneric::with(['category','prices'])->find($id); - } - - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $prices = isset($data['prices']) ? $data['prices'] : false; - unset($data['prices']); - $generic = $id ? self::update($data) : self::create($data); - PriceGenericValues::storePrices($generic->id, $prices); - return $generic->id; - } - - public static function create($data) - { - return PriceGeneric::create($data); - } - - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - $generic = PriceGeneric::find($id); - $generic->update($data); - return $generic; - } - - public static function destroy($id) - { - return PriceGeneric::destroy($id); - } - -} diff --git a/app/Repositories/Shop/PriceListValues.php b/app/Repositories/Shop/PriceListValues.php new file mode 100644 index 00000000..0fe3a1ab --- /dev/null +++ b/app/Repositories/Shop/PriceListValues.php @@ -0,0 +1,67 @@ +get(); + } + + public static function getDatatable() + { + $model = PriceListValue::orderBy('name'); + return Datatables::of($model)->make(true); + } + + public static function getAll() + { + return PriceListValue::orderBy('name', 'asc')->get(); + } + + public static function get($id) + { + return PriceListValue::find($id); + } + + public static function storePrices($generic_id, $values) + { + foreach ($values as $value) { + $value['price_generic_id'] = $generic_id; + self::store($value); + } + } + + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $price = $id ? self::update($data) : self::create($data); + return $price->id; + } + + public static function create($data) + { + return PriceListValue::create($data); + } + + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } + + public static function destroy($id) + { + return PriceListValue::destroy($id); + } +} diff --git a/app/Repositories/Shop/PriceLists.php b/app/Repositories/Shop/PriceLists.php new file mode 100644 index 00000000..70715629 --- /dev/null +++ b/app/Repositories/Shop/PriceLists.php @@ -0,0 +1,70 @@ +get(); + } + + public static function getByArticleWithValues($id) + { + return PriceList::with('values')->byArticle($id)->get(); + } + + public static function getOptions() + { + return PriceList::with('prices')->get()->toArray(); + } + + public static function getAll() + { + return PriceList::orderBy('name', 'asc')->get(); + } + + public static function get($id) + { + return PriceList::find($id); + } + + public static function getFull($id) + { + return PriceList::with(['price_list_values'])->find($id); + } + + public static function store($data) + { + $id = $data['id'] ?? false; + $price_list_values = $data['price_list_values'] ?? false; + unset($data['price_list_values']); + $price_list = $id ? self::update($data) : self::create($data); + PriceListValues::storePrices($price_list->id, $price_list_values); + return $price_list; + } + + public static function create($data) + { + return PriceList::create($data); + } + + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } + + public static function destroy($id) + { + return PriceList::destroy($id); + } +} diff --git a/app/Repositories/Shop/Prices.php b/app/Repositories/Shop/Prices.php index 113aecd1..249162ca 100644 --- a/app/Repositories/Shop/Prices.php +++ b/app/Repositories/Shop/Prices.php @@ -13,50 +13,51 @@ use App\Models\Shop\Price; class Prices { + public static function getByArticle($id) + { + $data['prices'] = Price::byArticle($id)->notGeneric()->get()->toArray(); + $data['generics'] = Price::byArticle($id)->generic()->with(['generic.prices','generic.category'])->get()->toArray(); + return $data; + } - public static function getByArticle($id) - { - $data['prices'] = Price::byArticle($id)->notGeneric()->get()->toArray(); - $data['generics'] = Price::byArticle($id)->generic()->with(['generic.prices','generic.category'])->get()->toArray(); - return $data; - } + public static function getDatatable() + { + $model = Price::orderBy('name'); + return Datatables::of($model)->make(true); + } - public static function getDatatable() - { - $model = Price::orderBy('name'); - return Datatables::of($model)->make(true); - } + public static function getAll() + { + return Price::orderBy('name', 'asc')->get(); + } - public static function getAll() - { - return Price::orderBy('name','asc')->get(); - } + public static function get($id) + { + return Price::find($id); + } - public static function get($id) - { - return Price::find($id); - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data) : self::create($data); + return $item->id; + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data) : self::create($data); - return $item->id; - } + public static function create($data) + { + return Price::create($data); + } - public static function create($data) - { - return Price::create($data); - } - - public static function update($data) - { - return Price::find($id)->update($data); - } - - public static function destroy($id) - { - return Price::destroy($id); - } + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } + public static function destroy($id) + { + return Price::destroy($id); + } } diff --git a/app/Repositories/Shop/SaleChannels.php b/app/Repositories/Shop/SaleChannels.php new file mode 100644 index 00000000..c58a6b4f --- /dev/null +++ b/app/Repositories/Shop/SaleChannels.php @@ -0,0 +1,48 @@ +pluck('name', 'id')->toArray(); + } + + public static function getAll() + { + return SaleChannel::orderBy('name', 'asc')->get(); + } + + public static function get($id) + { + return SaleChannel::findOrFail($id); + } + + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data) : self::create($data); + return $item->id; + } + + public static function create($data) + { + return SaleChannel::create($data); + } + + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } + + public static function destroy($id) + { + return SaleChannel::destroy($id); + } +} diff --git a/app/Repositories/Shop/TagGroups.php b/app/Repositories/Shop/TagGroups.php index c1a82bce..a3343438 100644 --- a/app/Repositories/Shop/TagGroups.php +++ b/app/Repositories/Shop/TagGroups.php @@ -8,7 +8,6 @@ use App\Models\Shop\TagGroup; class TagGroups { - public static function getDatatable() { $model = TagGroup::query(); @@ -17,8 +16,8 @@ class TagGroups public static function getOptions() { - return TagGroup::get()->SortBy('name')->pluck('name','id')->toArray(); - } + return TagGroup::get()->SortBy('name')->pluck('name', 'id')->toArray(); + } public static function getTreeTags() { @@ -39,7 +38,7 @@ class TagGroups public static function getAll() { - return TagGroup::orderBy('name','asc')->get(); + return TagGroup::orderBy('name', 'asc')->get(); } public static function get($id) @@ -50,7 +49,7 @@ class TagGroups public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data) : self::create($data); + $item = $id ? self::update($data) : self::create($data); return $item->id; } @@ -68,5 +67,4 @@ class TagGroups { return TagGroup::destroy($id); } - } diff --git a/app/Repositories/Shop/Tags.php b/app/Repositories/Shop/Tags.php index 190c6507..a8b5c054 100644 --- a/app/Repositories/Shop/Tags.php +++ b/app/Repositories/Shop/Tags.php @@ -12,7 +12,6 @@ use App\Models\Shop\Tag; class Tags { - public static function getDatatable() { $model = Tag::orderBy('name'); @@ -21,12 +20,12 @@ class Tags public static function getOptions() { - return Tag::get()->pluck('name','id')->toArray(); - } + return Tag::get()->pluck('name', 'id')->toArray(); + } public static function getAll() { - return Tag::orderBy('order','asc')->get(); + return Tag::orderBy('order', 'asc')->get(); } public static function get($id) @@ -37,7 +36,7 @@ class Tags public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data) : self::create($data); + $item = $id ? self::update($data) : self::create($data); return $item->id; } diff --git a/app/Repositories/Shop/TariffUnities.php b/app/Repositories/Shop/TariffUnities.php new file mode 100644 index 00000000..bf82b30c --- /dev/null +++ b/app/Repositories/Shop/TariffUnities.php @@ -0,0 +1,48 @@ +pluck('value', 'id')->toArray(); + } + + public static function getAll() + { + return TariffUnity::orderBy('name', 'asc')->get(); + } + + public static function get($id) + { + return TariffUnity::find($id); + } + + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data, $id) : self::create($data); + return $item->id; + } + + public static function create($data) + { + return TariffUnity::create($data); + } + + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } + + public static function destroy($id) + { + return TariffUnity::destroy($id); + } +} diff --git a/app/Repositories/Shop/Tariffs.php b/app/Repositories/Shop/Tariffs.php new file mode 100644 index 00000000..c0598102 --- /dev/null +++ b/app/Repositories/Shop/Tariffs.php @@ -0,0 +1,63 @@ +orderBy('name')->limit(30)->get()->pluck('name', 'id'); + $export = []; + foreach ($data as $key => $name) { + $export[] = ['value' => $key, 'text' => $name]; + } + return $export; + } + + public static function getOptions() + { + return Tariff::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray(); + } + + public static function getStatuses() + { + return ['Actif','Suspendu','Invisible','Obsolete']; + } + + public static function getAll() + { + return Tariff::orderBy('name', 'asc')->get(); + } + + public static function get($id) + { + return Tariff::find($id); + } + + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data, $id) : self::create($data); + return $item->id; + } + + public static function create($data) + { + return Tariff::create($data); + } + + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } + + public static function destroy($id) + { + return Tariff::destroy($id); + } +} diff --git a/app/Repositories/Shop/Taxes.php b/app/Repositories/Shop/Taxes.php index 38eb48ab..c0d66e6f 100644 --- a/app/Repositories/Shop/Taxes.php +++ b/app/Repositories/Shop/Taxes.php @@ -12,7 +12,6 @@ use App\Models\Shop\Tax; class Taxes { - public static function getDatatable() { return Datatables::of($model)->make(true); @@ -20,12 +19,12 @@ class Taxes public static function getOptions() { - return Tax::orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + return Tax::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } public static function getAll() { - return Tax::orderBy('value','asc')->get(); + return Tax::orderBy('value', 'asc')->get(); } public static function get($id) @@ -36,7 +35,7 @@ class Taxes public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data) : self::create($data); + $item = $id ? self::update($data) : self::create($data); return $item->id; } @@ -45,14 +44,16 @@ class Taxes return Tax::create($data); } - public static function update($data) + public static function update($data, $id = false) { - return Tax::find($id)->update($data); + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; } public static function destroy($id) { return Tax::destroy($id); } - } diff --git a/app/Repositories/Shop/Unities.php b/app/Repositories/Shop/Unities.php index 5ea0891a..e1c21d83 100644 --- a/app/Repositories/Shop/Unities.php +++ b/app/Repositories/Shop/Unities.php @@ -6,48 +6,53 @@ use App\Models\Shop\Unity; class Unities { + public static function getOptions() + { + return Unity::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } - public static function getOptions() - { - return Unity::orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + public static function getOptionsByPackage($package_id) + { + return Unity::byPackage($package_id)->orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + } - public static function getOptionsByPackage($package_id) - { - return Unity::byPackage($package_id)->orderBy('value','asc')->get()->pluck('value','id')->toArray(); - } + public static function getAll() + { + return Unity::orderBy('value', 'asc')->get(); + } - public static function getAll() - { - return Unity::orderBy('value','asc')->get(); - } + public static function getName($id) + { + return self::get($id)->value; + } - public static function get($id) - { - return Unity::find($id); - } + public static function get($id) + { + return Unity::find($id); + } - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data, $id) : self::create($data); - return $item->id; - } + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data, $id) : self::create($data); + return $item->id; + } - public static function create($data) - { - return Unity::create($data); - } + public static function create($data) + { + return Unity::create($data); + } - public static function update($data, $id = false) - { - $id = isset($data['id']) ? $data['id'] : false; - return Unity::find($id)->update($data); - } - - public static function destroy($id) - { - return Unity::destroy($id); - } + public static function update($data, $id = false) + { + $id = $id ? $id : $data['id']; + $item = self::get($id); + $item->update($data); + return $item; + } + public static function destroy($id) + { + return Unity::destroy($id); + } } diff --git a/app/Repositories/Shop/Variations.php b/app/Repositories/Shop/Variations.php new file mode 100644 index 00000000..2e9f6c67 --- /dev/null +++ b/app/Repositories/Shop/Variations.php @@ -0,0 +1,85 @@ +orderBy('name')->limit(30)->get()->pluck('name', 'id'); + $export = []; + foreach ($data as $key => $name) { + $export[] = ['value' => $key, 'text' => $name]; + } + return $export; + } + + public static function getOptions() + { + $variations = Variation::with(['package','unity'])->get(); + foreach ($variations as $variation) { + $data[$variation->id] = self::getName($variation); + } + natsort($data); + return $data; + } + + public static function getNameByID($id) + { + return self::getName(sef::getFull($id)); + } + + public static function getName($variation) + { + return $variation->package->value . ' ' . $variation->quantity . ' ' . $variation->unity->value; + } + + public static function buildName($data) + { + return Packages::getName($data['package_id']) . ' ' . $data['quantity'] . ' ' . Unities::getName($data['unity_id']); + } + + public static function getAll() + { + return Variation::orderBy('value', 'asc')->get(); + } + + public static function getFull($id) + { + return Variation::with(['package','unity'])->findOrFail($id); + } + + public static function get($id) + { + return Variation::findOrFail($id); + } + + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data) : self::create($data); + return $item->id; + } + + public static function create($data) + { + $data['name'] = self::buildName($data); + return Variation::create($data); + } + + public static function update($data, $id = false) + { + $id = isset($data['id']) ? $data['id'] : false; + $variation = self::get($id); + $data['name'] = self::buildName($data); + $variation->update($data); + return $variation; + } + + public static function destroy($id) + { + return Variation::destroy($id); + } +} diff --git a/app/User.php b/app/User.php index ee927fd7..d8c46aec 100644 --- a/app/User.php +++ b/app/User.php @@ -16,17 +16,17 @@ use Sebastienheyd\Boilerplate\Notifications\ResetPassword as ResetPasswordNotifi /** * Sebastienheyd\Boilerplate\Models\User. * - * @property int $id - * @property bool $active - * @property string $first_name - * @property string $last_name - * @property string $email - * @property string $password - * @property string $remember_token - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property string $deleted_at - * @property string $last_login + * @property int $id + * @property bool $active + * @property string $first_name + * @property string $last_name + * @property string $email + * @property string $password + * @property string $remember_token + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property string $deleted_at + * @property string $last_login * @property-read string|false $avatar_path * @property-read string $avatar_url * @property-read mixed $name @@ -46,7 +46,7 @@ use Sebastienheyd\Boilerplate\Notifications\ResetPassword as ResetPasswordNotifi * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereRememberToken($value) * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereRoleIs($role = '') * @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereUpdatedAt($value) - * @mixin \Eloquent + * @mixin \Eloquent */ @@ -84,9 +84,11 @@ class User extends Authenticatable public function scopeByTeam($query, $id) { - return $query->whereHas('teams', function ($query) use ($id) { - $query->where('id', $id); - }); + return $query->whereHas( + 'teams', function ($query) use ($id) { + $query->where('id', $id); + } + ); } public function scopeByUniqueTeam($query) @@ -221,5 +223,4 @@ class User extends Authenticatable return asset('/assets/vendor/boilerplate/images/default-user.png'); } - } diff --git a/build/Admin/Auth/permissions.js b/build/Admin/Auth/permissions.js deleted file mode 100644 index 04e3b879..00000000 --- a/build/Admin/Auth/permissions.js +++ /dev/null @@ -1,44 +0,0 @@ -var elements = { - handle: "permissions", - model: "permission", - route: "Stack.Admin.Permission", - route_api: "Stack.Admin.API.Permission", - table_selector: "#permissions_datatable", - exist: "the_permission_already_exists", - added: "permission_has_been_added", - modified: "permission_has_been_modified", - deleted: "permission_has_been_deleted" -}; - -var columnsdef = [ -]; - -var columns = [ - { - data: "display_name", - render: function (data) { - return data; - } - }, - { - data: "id", - render: function ( data, type, row ) { - var name = eval('client_translate.getText.' + row.translated); - return '
'+ - ''+ - ''+ - ''+ - '
'; - } - } -]; -console.log(columnsdef); -var permissions = handleAdmin; - -$(document).ready(function() { - permissions.selectAll(); - $(elements.table_selector).on('draw.dt', function () { - handleTable(); - } ); -} ); - diff --git a/build/Admin/Auth/roles.js b/build/Admin/Auth/roles.js deleted file mode 100644 index 9ac6535b..00000000 --- a/build/Admin/Auth/roles.js +++ /dev/null @@ -1,50 +0,0 @@ -var elements = { - handle: "roles", - model: "role", - route: "Stack.Admin.Role", - route_api: "Stack.Admin.API.Role", - table_selector: "#roles_datatable", - exist: "the_role_already_exists", - added: "role_has_been_added", - modified: "role_has_been_modified", - deleted: "role_has_been_deleted" -}; - -var columnsdef = [ -]; - - -var columns = [ - { - "data": "translated", - "render": function ( data, type, full, meta ) { - if (data) - { - return admin_content.get_translated_names(data); - } else { - return data; - } - } - }, - { - data: "id", - render: function ( data, type, row, meta ) { - var name = eval('client_translate.getText.' + row.translated); - return '
'+ - ''+ - ''+ - '
'; - } - } -]; - -var roles = handleAdmin; - -$(document).ready(function() { - roles.selectAll(); - $(elements.table_selector).on('draw.dt', function () { - handleTable(); - initIcheck(); - } ); -} ); - diff --git a/build/Admin/Auth/teams.js b/build/Admin/Auth/teams.js deleted file mode 100644 index 69f685d1..00000000 --- a/build/Admin/Auth/teams.js +++ /dev/null @@ -1,51 +0,0 @@ -var elements = { - handle: "teams", - model: "team", - route: "Stack.Admin.Team", - route_api: "Stack.Admin.API.Team", - table_selector: "#teams_datatable", - exist: "the_team_already_exists", - added: "team_has_been_added", - modified: "team_has_been_modified", - deleted: "team_has_been_deleted" -}; - -var columnsdef = [ -]; - -var columns = [ - { - data: "active", - className: 'text-center', - "render": function ( data, type, row, meta ) { - var checked = data ? "checked" : ""; - tpl = '
'; - return tpl; - } - }, - { - data: "translated", - render: function ( data, type, full, meta ) { - return admin_content.get_translated_names(data); - } - }, - { - data: "id", - render: function ( data, type, row ) { - var name = eval('client_translate.getText.' + row.translated); - return '
'+ - ''+ - ''+ - '
'; - } - } -]; - -var teams = handleAdmin; - -$(document).ready(function() { - teams.selectAll(); - $(elements.table_selector).on('draw.dt', function () { - handleTable(); - } ); -} ); diff --git a/build/Admin/Auth/users.js b/build/Admin/Auth/users.js deleted file mode 100644 index 049f0154..00000000 --- a/build/Admin/Auth/users.js +++ /dev/null @@ -1,347 +0,0 @@ -var elements = { - handle: "users", - model: "user", - route: "Stack.Admin.User", - route_api: "Stack.Admin.API.User", - table_selector: "#users_datatable", - exist: "the_user_type_already_exists", - added: "user_has_been_added", - modified: "user_has_been_modified", - deleted: "user_has_been_deleted" -}; - -var columnsdef = [ - { orderable: false, targets: [0, 6] }, - { responsivePriority: 1, targets: [0, 1, 6] } -]; - -var columns = [ - { - data: "active", - searchable: false, - className: 'text-center', - render: function ( data, type, row, meta ) { - var checked = data ? "checked" : ""; - tpl = '
'; - return tpl; - } - }, - { - data: "name", - render: function ( data, type, row, meta ) { - return '  ' + data; - } - }, - { data: "username" }, - { data: "email" }, - { data: "phone" }, - { - data: "roles", - searchable: false, - render: function ( data, type, row, meta ) { - if (data) { - tpl = ''; - for (var k in data){ - if (data.hasOwnProperty(k)) { - tpl += data[k]['name'] + ' '; - } - } - return tpl; - } else { - return ''; - } - } - }, - { - data: "id", - render: function ( data, type, row ) { - var name = row.name; - tpl = '
'; - tpl += ''; - if (hasPermission('users_client')) { - tpl += ''; - } - if (hasPermission('users_update')) { - tpl += ''; - } - if (hasPermission('users_delete')) { - tpl += ''; - } - tpl += '
'; - return tpl; - } - } -]; - -var users = handleAdmin; - -var users_addon = { - avatar: null, - upload_avatar: false, - upload_input: null, - passwordButtonsClick: function() { - $('.password-btn').off('click').on('click', function() { - var id = $(this).parent().data('id'); - var name = $(this).parent().data('name'); - users.passwordUser(id, name); - }); - }, - avatarButtonsClick: function() { - $('#users_datatable .avatar-user-btn').off('click').on('click', function() { - var id = $(this).parent().data('id'); - var name = $(this).parent().data('name'); - users.avatarUser(id, name); - }); - }, - generatePassword: function(elt) { - $.ajax({ - type: "POST", - dataType: "json", - url: laroute.route("Stack.Admin.API.User.generateUserPassword"), - success: function(response) { - elt.val(response.pwd); - }, - error: function() { - admin_content.alertError(); - } - }); - }, - initAvatarUploader: function() { - users.upload_input = $("#avatar_file").filer({ - showThumbs: true, - addMore: true, - allowDuplicates: false, - limit: 1, - maxSize: 5, - extensions: [ 'jpg' ], - uploadFile: { - url: laroute.route("Stack.Admin.API.User.uploadAvatar"), - data: { "extension": 'jpg' }, - type: 'POST', - enctype: 'multipart/form-data', - synchron: true, - success: function(data, itemEl, listEl, boxEl, newInputEl, inputEl, id){ - var parent = itemEl.find(".jFiler-jProgressBar").parent(), - new_file_name = JSON.parse(data), - filerKit = inputEl.prop("jFiler"); - - filerKit.files_list[id].name = new_file_name; - - itemEl.find(".jFiler-jProgressBar").fadeOut("slow", function(){ - $("
Success
").hide().appendTo(parent).fadeIn("slow"); - }); - - $("#avatar_file_hidden").val(new_file_name); - }, - error: function(el){ - var parent = el.find(".jFiler-jProgressBar").parent(); - el.find(".jFiler-jProgressBar").fadeOut("slow", function(){ - $("
Error
").hide().appendTo(parent).fadeIn("slow"); - }); - }, - statusCode: null, - onProgress: null, - onComplete: null - }, - files: null, - clipBoardPaste: true, - excludeName: null, - beforeRender: null, - afterRender: null, - beforeShow: null, - beforeSelect: null, - onSelect: null, - afterShow: null, - onRemove: function(itemEl, file, id, listEl, boxEl, newInputEl, inputEl){ - var filerKit = inputEl.prop("jFiler"), - file_name = filerKit.files_list[id].name; - - $.post(laroute.route('Stack.Admin.API.User.removeAvatar'), {file: file_name}); - }, - onEmpty: null, - options: null, - dialogs: { - alert: function(text) { - $.alert({ - title: translate.getText.informations, - type: 'red', - content: text, - }); - }, - confirm: function (text, callback) { - $.confirm({ - title: translate.getText.informations, - type: 'red', - content: text, - buttons: { - confirm: { - text: translate.getText.confirm, - btnClass: 'btn-danger', - action: function(){ - callback() - } - }, - cancel: { - text: translate.getText.cancel - } - } - }); - } - }, - captions: { - button: translate.getText.choose_file, - feedback: "", - feedback2: translate.getText.selected_files, - removeConfirmation: translate.getText.are_you_sure_you_want_to_remove_this_file, - errors: { - filesLimit: translate.getText.file_number_authorized + ": {{fi-limit}}", - filesType: translate.getText.file_extension_authorized + ": .{{fi-extensions}}", - filesSize: translate.getText.file_max_size_authorized + ": {{fi-maxSize}} MB." - } - } - }); - }, - avatarUser: function(id, name) { - $.confirm({ - title: translate.getText.avatar, - columnClass: 'small', - content: function () { - var self = this; - return $.ajax({ - type: "POST", - dataType: "json", - url: laroute.route("Stack.Admin.API.User.getAvatar"), - data: { 'id': id }, - }).done(function (response) { - - if (response.error == -1) { - header.logout(); - } else if (response.avatar == "") { - self.setContent('
'+name+'

'); - users.upload_avatar = true; - } else { - self.setContent('
'+name+'


'); - users.upload_avatar = false; - } - - }).fail(function(){ - self.setContent(translate.getText.an_error_occured); - }); - }, - typeAnimated: true, - onContentReady: function() { - $("#delete_avatar").off('click').on('click', function(){ - $("#avatar_upload").html(''); - users.upload_avatar = true; - users.initAvatarUploader(); - }); - - if (users.upload_avatar) { - users.initAvatarUploader(); - } - }, - type: 'blue', - buttons: { - confirm: { - text: translate.getText.validate, - btnClass: 'btn-blue', - action: function(){ - if($('#novation_select').val() == '') { - admin_content.alertCustomError('please_select_third_party'); - } else { - var datas = {}; - datas['ujcaid'] = id; - datas["ujcafile"] = $('#avatar_file_hidden').val(); - - $.ajax({ - type: "POST", - dataType: "json", - url: laroute.route("Stack.Admin.API.User.updateAvatar"), - data: datas, - success: function(response) { - if (response.error == -1) { - header.logout(); - } else if(response.error == -6) { - admin_content.alertNotFound(); - } - }, - error: function() { - admin_content.alertError(); - } - }); - } - } - }, - cancel: { - text: translate.getText.cancel - } - } - }); - }, - passwordUser: function(id, name) { - - $.confirm({ - title: translate.getText.change_password, - columnClass: 'small', - content: '
'+name+'
', - typeAnimated: true, - type: 'dark', - animation: 'RotateXR', - onContentReady: function() { - $("#user_password_regenerate").off('click').on('click', function(){ - event.preventDefault(); - users.generatePassword($("#update_password")); - }); - }, - buttons: { - confirm: { - text: translate.getText.confirm, - btnClass: 'btn-dark', - action: function() { - if ($("#update_password").val() == "") { - return false; - } else { - var datas = {}; - datas['id'] = id; - datas['password'] = $("#update_password").val(); - - $.ajax({ - type: "POST", - dataType: "json", - url: laroute.route("Stack.Admin.API.User.updatePassword"), - data: datas, - success: function(response) { - if (response.error == -1) { - header.logout(); - } else if(response.error == -6) { - admin_content.alertNotFound(); - } else if(response.error == -7) { - admin_content.alertCustomError('the_password_must_have_at_least_six_characters'); - } - }, - error: function() { - admin_content.alertError(); - } - }); - } - } - }, - cancel: { - text: translate.getText.cancel - } - } - }); - }, -}; - -users = {...users, ...users_addon }; - -$(document).ready(function() { - users.selectAll(); - $(elements.table_selector).on('draw.dt', function () { - handleTable(); - initIcheck(); - users.passwordButtonsClick(); - users.avatarButtonsClick(); - } ); -} ); diff --git a/build/Shop/admin/customer.js b/build/Shop/admin/customer.js deleted file mode 100644 index 101139b6..00000000 --- a/build/Shop/admin/customer.js +++ /dev/null @@ -1,105 +0,0 @@ -var columns = [ - { - data: "type_contact_statut_id", - render: function (data, type, row) { - if (row.type_contact_statut_id) { - tpl = row.type_contact_statut.nom; - } else { - tpl = ''; - } - return tpl; - } - }, - { - data: "name", - }, - { - data: "firstname", - }, - { - data: "mobile", - render: function (data, type, row) { - tpl = ''; - if (row.mobile) { - tpl += 'Mobile : ' + row.mobile + '
'; - } - if (row.tel_perso) { - tpl += 'Domicile : ' + row.phone + '
'; - } - if (row.tel_pro) { - tpl += 'Pro : ' + row.phone_pro; - } - return tpl; - } - }, - { - data: "email", - render: function (data) { - return data; - } - }, - { - data: "zipcode", - render: function (data, type, row) { - return data; - } - }, - { - data: "city", - render: function (data) { - return data; - } - }, - { - data: "id", - orderable: false, - render: function (data, type, row) { - tpl = " "; - tpl += " "; - return tpl; - } - }, -]; - -var model = "contact"; -var route = "Contacts"; - -var options = { - // order: [[ 2, 'asc' ]], - fixedColumns: { leftColumns: 1, rightColumns: 1 }, - // fixedColumns: false, - // columnDefs: columnDefs, - columns: columns, -} - -var globals = []; -globals['handlers'] = []; - - -function populate() { - -} - - -$(document).ready(function() { - - var Table = getDataTables(options,route,model); - - $(".search-input-text").off().on("change keyup", function(e) { - Table.column( $(this).parent().index()+':visible' ).search( this.value ).draw(); - }) - - - $.ajaxSetup({ - headers: { - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') - } - }); - - tpl = '   Création d\'un contact'; - $('div.col-md-4.add').html(tpl); - - - initModalAdmin(route,model,Table.ajax.reload,populate,Table); - -}); \ No newline at end of file diff --git a/build/css/main.css b/build/css/main.css index f9634a40..ac4b812f 100644 --- a/build/css/main.css +++ b/build/css/main.css @@ -1,4 +1,55 @@ ul .jqtree_common { list-style: none; padding-left: 0; +} + +.select2 { + width: 100%; +} + +.select2-selection__choice, .select2-selection__choice__remove { + background-color: rgba(0,163,203, 1)!important; + color: #FFF!important; +} + +.select2-container--default .select2-selection--single { + border: 1px solid #ced4da; + padding: .46875rem .75rem; + height: calc(2.25rem + 2px); +} + + +.select2-container--default .select2-selection--single { + border: 1px solid #ced4da; + padding: .46875rem .75rem; + height: calc(2.25rem + 2px); +} + +.select2-container--default .select2-selection--single .select2-selection__arrow { + height: 31px!important; + right: 6px; +} + +.navbar-green, .bg-green { + background-color: #527C39!important; +} + +.green { + color: #527C39!important; +} + +.sidebar-dark-green, .bg-dark-green { + background-color: #344F16!important; +} + +.dark-green { + color: #344F16!important; +} + +.bg-yellow { + background-color: #F2B90F!important; +} + +.yellow { + color: #F2B90F!important; } \ No newline at end of file diff --git a/build/js/include/boilerplate.js b/build/js/include/boilerplate.js new file mode 100644 index 00000000..741c8d6f --- /dev/null +++ b/build/js/include/boilerplate.js @@ -0,0 +1,49 @@ +$('.sidebar-toggle').on('click', function (event) { + event.preventDefault(); + if (Boolean(sessionStorage.getItem('sidebar-toggle-collapsed'))) { + sessionStorage.setItem('sidebar-toggle-collapsed', ''); + } else { + sessionStorage.setItem('sidebar-toggle-collapsed', '1'); + } +}); + +$(function () { + + $(document).tooltip({ + container: 'body', + selector: '[data-toggle="tooltip"]', + delay: { "show": 500, "hide": 100 }, + html: true, + trigger: 'hover', + }) + + setInterval(function () { + var timestamp = Math.round(+new Date() / 1000); + if (Math.round(+new Date() / 1000) === (session.expire - 10)) { + session.expire = timestamp + session.lifetime; + $.ajax({ + url: session.keepalive, + type: 'post', + data: {id: session.id} + }) + } + }, 1000) +}); + +$('.logout').click(function (e) { + e.preventDefault(); + if (bootbox.confirm($(this).attr('data-question'), function (e) { + if (e === false) { + return; + } + $('#logout-form').submit(); + })) { + } +}); + +(function () { + if (Boolean(sessionStorage.getItem('sidebar-toggle-collapsed'))) { + var body = document.getElementsByTagName('body')[0]; + body.className = body.className + ' sidebar-collapse'; + } +})(); diff --git a/build/js/include/core/helpers.js b/build/js/include/core/helpers.js new file mode 100644 index 00000000..51623a19 --- /dev/null +++ b/build/js/include/core/helpers.js @@ -0,0 +1,21 @@ +// Array Helpers +const countOccurrences = arr => arr.reduce((prev, curr) => (prev[curr] = ++prev[curr] || 1, prev), {}); +const isEmpty = arr => !(Array.isArray(arr) && arr.length > 0 && arr.filter(el => el === undefined).length > 0) +const isEqual = (a, b) => JSON.stringify(a.sort()) === JSON.stringify(b.sort()); +const countBy = (arr, prop) => arr.reduce((prev, curr) => (prev[curr[prop]] = ++prev[curr[prop]] || 1, prev), {}); +const transpose = matrix => matrix[0].map((col, i) => matrix.map(row => row[i])); + +// Dom Helpers +const insertAfter = (ele, anotherEle) => anotherEle.parentNode.insertBefore(ele, anotherEle.nextSibling); +const insertBefore = (ele, anotherEle) => anotherEle.parentNode.insertBefore(ele, anotherEle); +const insertHtmlAfter = (html, ele) => ele.insertAdjacentHTML('afterend', html); +const insertHtmlBefore = (html, ele) => ele.insertAdjacentHTML('beforebegin', html); + +const goTo = url => location.href = url; +const replace = (ele, newEle) => ele.parentNode.replaceChild(newEle, ele); +const toNumbers = arr => arr.map(Number); +const wait = async (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)); + +const capitalize = str => `${str.charAt(0).toUpperCase()}${str.slice(1)}`; +const slugify = string => string.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]+/g, ''); +const isNumeric = str => !/[^0-9]/.test(str); diff --git a/build/js/include/fancytree.js b/build/js/include/fancytree.js new file mode 100644 index 00000000..82d629e0 --- /dev/null +++ b/build/js/include/fancytree.js @@ -0,0 +1,94 @@ +var glyph_opts = { + preset: "bootstrap3", + map: { + } +}; + +function initFancyTree(selector) { + $(selector).fancytree({ + extensions: ["dnd5", "edit", "glyph", "wide"], + checkbox: true, + selectMode: 3, + dnd5: { + dragStart: function(node, data) { + return true; + }, + dragEnter: function(node, data) { + return true; + }, + dragDrop: function(node, data) { + data.otherNode.copyTo(node, data.hitMode); + } + }, + glyph: glyph_opts, + // source: {url: "ajax-tree-taxonomy.json", debugDelay: 1000}, + source: { + url: "ajax-tree-products.json", + debugDelay: 1000 + }, + // toggleEffect: { effect: "drop", options: {direction: "left"}, duration: 400 }, + wide: { + iconWidth: "1em", // Adjust this if @fancy-icon-width != "16px" + iconSpacing: "0.5em", // Adjust this if @fancy-icon-spacing != "3px" + labelSpacing: "0.1em", // Adjust this if padding between icon and label != "3px" + levelOfs: "1.5em" // Adjust this if ul padding != "16px" + }, + + icon: function(event, data) { + // if( data.node.isFolder() ) { + // return "glyphicon glyphicon-book"; + // } + }, + lazyLoad: function(event, data) { + data.result = { + url: "ajax-sub2.json", + debugDelay: 1000 + }; + } + }); +} + +function initFancyTreeTable(selector) { + $(selector).fancytree({ + extensions: ["dnd5", "edit", "glyph", "table"], + checkbox: true, + dnd5: { + dragStart: function(node, data) { + return true; + }, + dragEnter: function(node, data) { + return true; + }, + dragDrop: function(node, data) { + data.otherNode.copyTo(node, data.hitMode); + } + }, + glyph: glyph_opts, + source: { + url: "ajax-tree-taxonomy.json", + debugDelay: 1000 + }, + table: { + checkboxColumnIdx: 1, + nodeColumnIdx: 2 + }, + activate: function(event, data) { + }, + lazyLoad: function(event, data) { + data.result = { + url: "ajax-sub2.json", + debugDelay: 1000 + }; + }, + renderColumns: function(event, data) { + var node = data.node, + $tdList = $(node.tr).find(">td"); + $tdList.eq(0).text(node.getIndexHier()); + $tdList.eq(3).text(!!node.folder); + } + }); +} + +$(function() { + +}); diff --git a/build/js/include/file.js b/build/js/include/file.js new file mode 100644 index 00000000..9e96f54b --- /dev/null +++ b/build/js/include/file.js @@ -0,0 +1,409 @@ +var fileManager = { + selected: [], // stocke les fichiers déjà enregistrés + currentSelected: [], // stocke les fichiers en cours + toRemove: [], + callback: null, // indique la fonction à exécuter pour le renvoi des fichiers sélectionnées à la validation de la sélection + subFolder: '0', // indique le sous-répertoire dans lequel les fichiers seront uploadés + forSubcontract: false, // indique si on upload des fichiers pour les contrats ou sous-contrats + js_confirm: null, // la jquery confirm + parent: null, + + init: function(title, chosen, category, callback, forSubcontract, parent, novation) { + this.selected = ( typeof(chosen) != 'undefined' ) ? chosen : []; + this.currentSelected = []; + this.callback = ( typeof(callback) != 'undefined' ) ? callback : null; + this.forSubcontract = ( typeof(forSubcontract) != 'undefined' ) ? forSubcontract : null; + this.category = category; // stocke le sous-répertoire d'upload + this.subFolder = category; // stocke le sous-répertoire d'upload + this.parent = parent; + this.novation = ( typeof(novation) != 'undefined' ) ? true : false; + this.js_confirm = this.renderModal(title); + }, + initAddFile: function() { + var that = this; + $('#add_files').off('click').on('click', function() { + var index = objectLength(that.currentSelected); + console.log('add_files'); + console.log(index); + if (index > 1) { + var isValid = that.checkValidity(index - 1); + } else { + var isValid = true; + } + + if (isValid) { + var infos = { + pdfFile: {}, + docFile: {}, + title: '', + effective_date: '', + }; + that.newFile(infos); + that.updateImportedFilesMessage(objectLength(that.currentSelected)); + } + }); + }, + checkValidity: function(index) { + // console.log('checkValidity'); + // console.log(index); + + var selector = '#uploader_files_' + index + ' form'; + // console.log(selector); + var form = $(selector); + // console.log(form); + var fields = selector + ' input,' + selector + ' textarea,' + selector + ' select'; + // console.log(selector); + var validity = true; + + var pdfFile = this.currentSelected[index].pdfFile; + // console.log(typeof(pdfFile)); + + if (typeof(pdfFile.name) == 'undefined') { + console.log("Pas de fichier"); + $(selector + '[name="import_pdf_form"] .contract-file-upload').addClass('error'); + validity = false; + } else { + $(selector + '[name="import_pdf_form"] .contract-file-upload').removeClass('error'); + } + + $(fields).filter('[required]').each(function(i, required){ + // console.log(required); + if ($(required).val() == '') { + if ($(required).hasClass('chosen-select')) { + $(required).siblings('.chosen-container').addClass('form-control error pt-0'); + } else { + $(required).addClass('error'); + } + // console.log('validity false'); + // console.log(required); + validity = false; + } else { + if ($(required).hasClass('chosen-select')) { + $(required).siblings('.chosen-container').removeClass('form-control error pt-0'); + } else { + $(required).removeClass('error'); + } + } + }); + return validity; + + }, + initDeleteRow: function(selector) { + var that = this; + $(selector + ' button.contract-del-btn').off('click').on('click', function() { + var index = $(this).data('index'); + // TODO effacer currenselect[index] et mettre dans elements à deleter + that.removeRow(index); + that.updateImportedFilesMessage(objectLength(currentSelected)); + }); + }, + initDeleteFile: function(selector, selector2) { + // console.log(this, selector, selector2); + var that = this; + $(selector2 + ' .imported_files ul.jFiler-items-list li a.file-del-btn').off('click').on('click', function() { + that.removeFile(this, selector, selector2); + }); + }, + renderModal: function(title) { + var that = this; + var confirm = $.confirm({ + title: title, + columnClass: 'col-md-9', + content: function() { + var content = '\ +
\ +
\ +
'+translate.getText.no_imported_files+'
\ +
\ +
\ + '; + return content; + }, + onContentReady: function() { + if ( objectLength(that.selected) > 0 ) { + $.each(that.selected, function(i, elem) { + that.newFile(that.selected[i]); + }); + } + that.initAddFile(); + that.updateImportedFilesMessage(objectLength(that.currentSelected)); + + }, + type: 'orange', + theme: 'theme2', + typeAnimated: true, + buttons: { + validate: { + text: '' + translate.getText.validate, + btnClass: 'btn-green', + action: function() { + var isValid = true; + $.each(that.currentSelected, function(i, elem) { + var selector = '#uploader_files_' + i; + isValid = isValid && that.checkValidity(i); + // vérifie qu'il y ait bien un fichier PDF d'uploadé + /* + $(selector + ' .contract-file-upload').removeClass('error'); + if ( typeof(that.currentSelected[i].pdfFile.name) === 'undefined' ) { + $(selector + ' .contract-file-upload').addClass('error'); + } + */ + }); + + if (!isValid) { + return false; + } else { + // retourne les fichiers sélectionnés en appelant la fonction de retour des paramètres + that.returnSelection(); + } + } + }, + close: { + text: ''+translate.getText.cancel, + btnClass: 'btn-red', + action: function() { } + } + } + }); + return confirm; + }, + renderUploader: function(index, file, selector, uploadRoute, extensions, chooseText) { + console.log("renderUploader"); + console.log(selector); + var that = this; + console.log(that); + renderUploaderFiler(index, file, selector, uploadRoute, extensions, chooseText, that); + }, + newFile: function(file) { + console.log('newFile'); + console.log(file); + // empile les contrats sélectionnés + this.currentSelected.push(file); + // charge le contrat sélectionné + this.newUploader(file); + initChosen(); + initValidator(); + }, + newUploader: function(file) { + console.log('new uploader'); + console.log(file); + var that = this; + console.log(that.novation); + // var index = getIndexOf(this.currentSelected, file.id); + var count = objectLength(this.currentSelected); + var index = count - 1; + var path = '/assets/apps/ContractDrive/templates/'; + if (that.novation) { + var third_parties = null; + $.ajax({ + async: false, + method: "POST", + dataType: "json", + url: laroute.route("Stack.API.ThirdParty.getThirdParties"), + data: { third_party_type: 'counterpart' } + }).done(function(response) { + third_parties = response.listing; + }); + } else { + var third_parties = null; + } + // console.log(third_parties); + var extra = ((that.category == 3) && (count == 1)) ? false : true; + var data = { + index: index, + count: count, + id: (typeof(file.id) !== 'undefined') ? file.id : null, + translate: translate, + novation: that.novation, + extra: extra, + category: that.category, + third_parties: third_parties + }; + var content = getTemplate(path + 'files-uploader.html', data); + + $('#files_selection').append(content); + var selector = '#uploader_files_' + index; + + this.initDeleteRow(selector); + + // initialise les file uploader + this.parent.initFilesUploader(file, index); + this.renderFiles(file, selector); + + // désaffiche le titre et la date de signature pour le 1er fichier de catégorie "contrat" à upload + if ( that.subFolder == '3' && index == 0 && !(that.forSubcontract) ) { + $(selector + ' form[name="import_file_infos_form"]').hide(); + } + + var picker = getDaterangePicker(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_date"]'); + + $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_date"]').next('span.add-on').off('click').on('click', function() { + $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_date"]').trigger('click'); + }); + + // sur changement de date + /* + $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_date"]').on('apply.daterangepicker', function(ev, picker) { + $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_effective_date"]').val(picker.startDate.format(dateRangePickerLanguage.format)); + }); + */ + }, + createFile: function(item, index, file) { + //console.log(that.currentSelected); + if (file.extension == 'pdf') { + this.currentSelected[index].pdfFile = file; + this.currentSelected[index].pdfFile.isNew = true; + } else { + this.currentSelected[index].docFile = file; + this.currentSelected[index].docFile.isNew = true; + } + // enregistre le fichier dans les fichiers uploadés en cours + $(item).find('.jFiler-item-others').html('\ + '+translate.getText.type+': '+strtoupper(file.extension)+'\ +
\ + '); + $(item).find('.jFiler-item-icon i').removeClass('icon-jfi-file-o').removeClass('jfi-file-ext-docx').addClass('icon-file-uploaded '+strtolower(file.extension)); + this.addFileInfo(index); + }, + addFileInfo: function(index) { + console.log('addFileInfo'); + console.log(index); + if (typeof(index) != 'undefined') { + var selector = '#uploader_files_' + index; + this.currentSelected[index].title = $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_title"]').val(); + var effective_date = $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_date"]').val(); + console.log('effective_date'); + console.log(effective_date); + this.currentSelected[index].effective_date = effective_date; + var third_party_id = $(selector + ' form[name="import_file_infos_form"] select[name="third_party_out"]').val(); + if (typeof(third_party_id) != 'undefined') { + this.currentSelected[index].novation = {}; + this.currentSelected[index].novation.third_party_id = third_party_id; + this.currentSelected[index].novation.name = $(selector + ' form[name="import_file_infos_form"] select[name="third_party_out"] option:selected').text(); + } + console.log(this.currentSelected[index]); + } + }, + removeRow: function(index) { + console.log('remove row'); + console.log(index); + $('#uploader_files_' + index).remove(); + this.toRemove.push(this.currentSelected[index]); + this.currentSelected.splice(index, 1); + console.log(this.currentSelected); + console.log(this.toRemove); + this.reIndex(); + }, + removeFile: function(item, selector, selector2) { + var id = $(item).data('id'); + console.log(id); + console.log(item); + console.log(selector); + console.log(selector2); + // $(item).parent().parent().parent().parent().parent().parent().parent().remove(); + // file.docFile = {}; + //console.log(filesEdit.currentSelected); + $(selector + ' .contract-file-upload').show(); + $(selector2).hide(); + }, + reIndex: function() { + console.log("reindex"); + // refixe les numéros des tableaux + var that = this; + $.each(that.currentSelected, function(i, elem) { + // var sel = '#uploader_files_' + i; + var sel = '.files-list:eq( '+i+' )'; + console.log(sel); + $(sel + ' .file-count').html(parseInt(i+1)); + $(sel).attr('id', '#uploader_files_' + i); + // désaffiche la titre et la date de signature pour le 1er fichier de catégorie "contrat" à upload + if ( that.subFolder == '3' && i == 0 && that.forSubcontract == false ) { + $(sel + ' form[name="import_file_infos_form"]').hide(); + } + }); + }, + renderFiles: function(file, selector) { + console.log('renderFiles'); + console.log(file, selector); + var that = this; + // restaure le fichier PDF + if ( typeof(file.pdfFile) !== 'undefined' ) { + this.renderFile(file.pdfFile, 'pdf', selector + ' form[name="import_pdf_form"]', selector + ' form[name="already_imported_pdf_form"]'); + } + + // restaure le fichier DOC/DOCX + if (typeof(file.docFile) !== 'undefined') { + this.renderFile(file.docFile, 'doc', selector + ' form[name="import_doc_form"]', selector + ' form[name="already_imported_doc_form"]'); + } + + // restaure la date + if (( typeof(file.effective_date) !== 'undefined' ) && (file.effective_date != '')) { + $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_date"]').val(file.effective_date); + // var date_range_start = moment(file.effectiveDate, dateRangePickerLanguage.format).format(translate.getText.date_format_moment); + // var date_range_start = file.effective_date; + // $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_date"]').data('daterangepicker').setStartDate(date_range_start); + } + + // restaure le titre + if ( typeof(file.title) !== 'undefined' ) { + $(selector + ' form[name="import_file_infos_form"] input[name="import_file_infos_title"]').val(file.title); + } + + if ( (typeof(file.novation) !== 'undefined') && (file.novation != null) ) { + console.log(file.novation.third_party_id); + $(selector + ' form[name="import_file_infos_form"] select[name="third_party_out"]').val(file.novation.third_party_id).trigger("chosen:updated"); + } + + $(selector + ' form[name="import_file_infos_form"] input').change(function() { + index = $(this).data('index'); + that.addFileInfo(index); + }); + + $(selector + ' form[name="import_file_infos_form"] select').change(function() { + index = $(this).data('index'); + that.addFileInfo(index); + }); + + }, + renderFile: function(file, type, selector, selector2) { + // console.log('renderFile'); + // console.log(file, selector, selector2); + var that = this; + var path = '/assets/apps/ContractDrive/templates/'; + if (typeof(file.name) !== 'undefined') { + console.log('deja uploadé'); + $(selector + ' .contract-file-upload').hide(); + var data = {'file' : file, 'translate' : translate}; + var content = getTemplate(path + 'files-row.html', data); + $(selector2 + ' .imported_files ul.jFiler-items-list').append(content); + $(selector2).show(); + } + + this.initDeleteFile(selector, selector2); + }, + activeJConfirmButtons: function(inOut) { + if ( inOut ) { + this.js_confirm.buttons.close.enable(); + this.js_confirm.buttons.validate.enable(); + } else { + this.js_confirm.buttons.close.disable(); + this.js_confirm.buttons.validate.disable(); + } + }, + updateImportedFilesMessage: function(tot) { + if ( tot > 0 ) { + $('#no_imported_files').hide(); + } else { + $('#no_imported_files').show(); + } + }, + returnSelection: function() { + this.parent.selected = this.currentSelected; + this.parent.toRemove = this.toRemove; + if ( this.callback != null ) { + console.log(this.callback); + eval(this.callback); + } + } + +} \ No newline at end of file diff --git a/build/js/include/plugins/datatables_lang/de.json b/build/js/include/plugins/datatables_lang/de.json new file mode 100644 index 00000000..33ecfdbd --- /dev/null +++ b/build/js/include/plugins/datatables_lang/de.json @@ -0,0 +1,41 @@ +{ + "sEmptyTable": "Keine Daten in der Tabelle vorhanden", + "sInfo": "_START_ bis _END_ von _TOTAL_ Einträgen", + "sInfoEmpty": "Keine Daten vorhanden", + "sInfoFiltered": "(gefiltert von _MAX_ Einträgen)", + "sInfoPostFix": "", + "sInfoThousands": ".", + "sLengthMenu": "_MENU_ Einträge anzeigen", + "sLoadingRecords": "Wird geladen ..", + "sProcessing": "Bitte warten ..", + "sSearch": "Suchen", + "sZeroRecords": "Keine Einträge vorhanden", + "oPaginate": { + "sFirst": "Erste", + "sPrevious": "Zurück", + "sNext": "Nächste", + "sLast": "Letzte" + }, + "oAria": { + "sSortAscending": ": aktivieren, um Spalte aufsteigend zu sortieren", + "sSortDescending": ": aktivieren, um Spalte absteigend zu sortieren" + }, + "select": { + "rows": { + "_": "%d Zeilen ausgewählt", + "0": "", + "1": "1 Zeile ausgewählt" + } + }, + "buttons": { + "print": "Drucken", + "colvis": "Spalten", + "copy": "Kopieren", + "copyTitle": "In Zwischenablage kopieren", + "copyKeys": "Taste ctrl oder \u2318 + C um Tabelle
in Zwischenspeicher zu kopieren.

Um abzubrechen die Nachricht anklicken oder Escape drücken.", + "copySuccess": { + "_": "%d Zeilen kopiert", + "1": "1 Zeile kopiert" + } + } +} diff --git a/build/js/include/plugins/datatables_lang/en.json b/build/js/include/plugins/datatables_lang/en.json new file mode 100644 index 00000000..ddc11ae4 --- /dev/null +++ b/build/js/include/plugins/datatables_lang/en.json @@ -0,0 +1,23 @@ +{ + "sEmptyTable": "No data available in table", + "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries", + "sInfoEmpty": "Showing 0 to 0 of 0 entries", + "sInfoFiltered": "(filtered from _MAX_ total entries)", + "sInfoPostFix": "", + "sInfoThousands": ",", + "sLengthMenu": "Show _MENU_ entries", + "sLoadingRecords": "Loading...", + "sProcessing": "Processing...", + "sSearch": "Search:", + "sZeroRecords": "No matching records found", + "oPaginate": { + "sFirst": "First", + "sLast": "Last", + "sNext": "Next", + "sPrevious": "Previous" + }, + "oAria": { + "sSortAscending": ": activate to sort column ascending", + "sSortDescending": ": activate to sort column descending" + } +} \ No newline at end of file diff --git a/build/js/include/plugins/datatables_lang/fr.json b/build/js/include/plugins/datatables_lang/fr.json new file mode 100644 index 00000000..211b2274 --- /dev/null +++ b/build/js/include/plugins/datatables_lang/fr.json @@ -0,0 +1,29 @@ +{ + "sProcessing": "Traitement en cours...", + "sSearch": "Rechercher :", + "sLengthMenu": "Afficher _MENU_ éléments", + "sInfo": "Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments", + "sInfoEmpty": "Affichage de l'élément 0 à 0 sur 0 élément", + "sInfoFiltered": "(filtré de _MAX_ éléments au total)", + "sInfoPostFix": "", + "sLoadingRecords": "Chargement en cours...", + "sZeroRecords": "Aucun élément à afficher", + "sEmptyTable": "Aucune donnée disponible dans le tableau", + "oPaginate": { + "sFirst": "Premier", + "sPrevious": "Précédent", + "sNext": "Suivant", + "sLast": "Dernier" + }, + "oAria": { + "sSortAscending": ": activer pour trier la colonne par ordre croissant", + "sSortDescending": ": activer pour trier la colonne par ordre décroissant" + }, + "select": { + "rows": { + "_": "%d lignes sélectionnées", + "0": "Aucune ligne sélectionnée", + "1": "1 ligne sélectionnée" + } + } +} diff --git a/build/js/include/plugins/datatables_lang/it.json b/build/js/include/plugins/datatables_lang/it.json new file mode 100644 index 00000000..d3640e78 --- /dev/null +++ b/build/js/include/plugins/datatables_lang/it.json @@ -0,0 +1,23 @@ +{ + "sEmptyTable": "Nessun dato presente nella tabella", + "sInfo": "Vista da _START_ a _END_ di _TOTAL_ elementi", + "sInfoEmpty": "Vista da 0 a 0 di 0 elementi", + "sInfoFiltered": "(filtrati da _MAX_ elementi totali)", + "sInfoPostFix": "", + "sInfoThousands": ".", + "sLengthMenu": "Visualizza _MENU_ elementi", + "sLoadingRecords": "Caricamento...", + "sProcessing": "Elaborazione...", + "sSearch": "Cerca:", + "sZeroRecords": "La ricerca non ha portato alcun risultato.", + "oPaginate": { + "sFirst": "Inizio", + "sPrevious": "Precedente", + "sNext": "Successivo", + "sLast": "Fine" + }, + "oAria": { + "sSortAscending": ": attiva per ordinare la colonna in ordine crescente", + "sSortDescending": ": attiva per ordinare la colonna in ordine decrescente" + } +} \ No newline at end of file diff --git a/build/js/include/plugins/datatables_lang/jp.json b/build/js/include/plugins/datatables_lang/jp.json new file mode 100644 index 00000000..1e52091c --- /dev/null +++ b/build/js/include/plugins/datatables_lang/jp.json @@ -0,0 +1,23 @@ +{ + "sEmptyTable": "テーブルにデータがありません", + "sInfo": " _TOTAL_ 件中 _START_ から _END_ まで表示", + "sInfoEmpty": " 0 件中 0 から 0 まで表示", + "sInfoFiltered": "(全 _MAX_ 件より抽出)", + "sInfoPostFix": "", + "sInfoThousands": ",", + "sLengthMenu": "_MENU_ 件表示", + "sLoadingRecords": "読み込み中...", + "sProcessing": "処理中...", + "sSearch": "検索:", + "sZeroRecords": "一致するレコードがありません", + "oPaginate": { + "sFirst": "先頭", + "sLast": "最終", + "sNext": "次", + "sPrevious": "前" + }, + "oAria": { + "sSortAscending": ": 列を昇順に並べ替えるにはアクティブにする", + "sSortDescending": ": 列を降順に並べ替えるにはアクティブにする" + } +} diff --git a/build/js/include/plugins/datatables_lang/sp.json b/build/js/include/plugins/datatables_lang/sp.json new file mode 100644 index 00000000..53f80974 --- /dev/null +++ b/build/js/include/plugins/datatables_lang/sp.json @@ -0,0 +1,28 @@ +{ + "sProcessing": "Procesando...", + "sLengthMenu": "Mostrar _MENU_ registros", + "sZeroRecords": "No se encontraron resultados", + "sEmptyTable": "Ningún dato disponible en esta tabla =(", + "sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros", + "sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros", + "sInfoFiltered": "(filtrado de un total de _MAX_ registros)", + "sInfoPostFix": "", + "sSearch": "Buscar:", + "sUrl": "", + "sInfoThousands": ",", + "sLoadingRecords": "Cargando...", + "oPaginate": { + "sFirst": "Primero", + "sLast": "Último", + "sNext": "Siguiente", + "sPrevious": "Anterior" + }, + "oAria": { + "sSortAscending": ": Activar para ordenar la columna de manera ascendente", + "sSortDescending": ": Activar para ordenar la columna de manera descendente" + }, + "buttons": { + "copy": "Copiar", + "colvis": "Visibilidad" + } +} diff --git a/build/js/include/uploader.js b/build/js/include/uploader.js new file mode 100644 index 00000000..e8c37eb3 --- /dev/null +++ b/build/js/include/uploader.js @@ -0,0 +1,109 @@ +function renderUploaderFiler(index, the_file, selector, uploadRoute, extensions, chooseText, that) { + $(selector + ' input[name="files[]"]').filer({ + showThumbs: true, + addMore: true, + allowDuplicates: false, + limit: 1, + maxSize: null, + changeInput: '
\ +
\ +
\ + \ +
\ +
\ +

'+chooseText+'

\ +
\ +
\ +
', + extensions: extensions, + uploadFile: { + url: laroute.route(uploadRoute), + data: { + action: 'upload', + extensions: extensions, + sub_folder: that.subFolder + }, + type: 'POST', + enctype: 'multipart/form-data', + synchron: true, + beforeSend: function() { + that.activeJConfirmButtons(false); + $(selector + ' .contract-file-upload').hide(); + }, + success: function(data, itemEl, listEl, boxEl, newInputEl, inputEl, id) { + // console.log('upload'); + // console.log(data); + // console.log(id); + // var index = getIndexOf(that.currentSelected, the_file.id); + // var parent = itemEl.find(".jFiler-jProgressBar").parent(); + var new_file_name = JSON.parse(data); + var filerKit = inputEl.prop("jFiler"); + filerKit.files_list[id].name = new_file_name; + itemEl.find(".jFiler-jProgressBar").fadeOut("slow"); + that.createFile(itemEl, index, new_file_name); + }, + error: function(el) { + el.find(".jFiler-jProgressBar").fadeOut("slow"); + el.find('.jFiler-item-others').html('\ + '+translate.getText.type+': '+strtoupper(new_file_name.extension)+'\ +
\ + '); + }, + statusCode: null, + onProgress: null, + onComplete: function() { + that.activeJConfirmButtons(true); + } + }, + files: null, + clipBoardPaste: true, + excludeName: null, + beforeRender: null, + afterRender: null, + beforeShow: null, + beforeSelect: null, + onSelect: null, + afterShow: null, + onRemove: function(itemEl, file, id, listEl, boxEl, newInputEl, inputEl) { + var index = getIndexOf(that.currentSelected, the_file.id); + that.currentSelected[index].pdfFile = {}; + $(selector + ' .contract-file-upload').show(); + }, + onEmpty: null, + options: null, + dialogs: { + alert: function(text) { + $.dialog({ title: translate.getText.warning, content: text }); + }, + confirm: function (text, callback) { + $.confirm({ + title: translate.getText.warning, + content: text, + buttons: { + confirm: { + text: translate.getText.confirm, + btnClass: 'btn-danger', + action: function() { + callback() + } + }, + cancel: { + text: translate.getText.cancel + } + } + }); + } + }, + captions: { + button: translate.getText.choose_files, + feedback: "", + feedback2: translate.getText.selected_files, + removeConfirmation: translate.getText.are_you_sure_you_want_to_remove_this_file, + errors: { + filesLimit: translate.getText.file_number_authorized+": {{fi-limit}}", + filesType: translate.getText.file_extension_authorized+": .{{fi-extensions}}", + filesSize: translate.getText.file_max_size_authorized+": {{fi-maxSize}} MB." + } + } + }); +} \ No newline at end of file diff --git a/composer.json b/composer.json index d08416de..6c444542 100644 --- a/composer.json +++ b/composer.json @@ -36,6 +36,7 @@ "geo6/geocoder-php-addok-provider": "^1.1", "gzero/eloquent-tree": "^3.1", "hassankhan/config": "^2.1", + "highideas/laravel-users-online": "^3.0", "intervention/image": "^2.5", "intervention/imagecache": "^2.4", "jasonlewis/expressive-date": "^1.0", @@ -71,8 +72,6 @@ "rutorika/sortable": "^8.0", "santigarcor/laratrust": "^6.0", "sebastienheyd/boilerplate": "^7.5", - "sebastienheyd/boilerplate-email-editor": "^8.0", - "sebastienheyd/boilerplate-media-manager": "^7.1", "sensiolabs/security-checker": "^6.0", "sheub/ban-france-provider": "^1.0@dev", "smajohusic/laravel-mail-logger": "^1.0", @@ -89,6 +88,7 @@ "unicodeveloper/laravel-password": "^1.0", "voku/stringy": "^6.2", "watson/rememberable": "^5.0", + "wildside/userstamps": "^2.1", "yadahan/laravel-authentication-log": "^1.2", "yajra/laravel-datatables": "^1.5" }, diff --git a/config/boilerplate/app.php b/config/boilerplate/app.php index 4c6ed021..056f6494 100644 --- a/config/boilerplate/app.php +++ b/config/boilerplate/app.php @@ -8,8 +8,10 @@ return [ 'domain' => '', // Redirect to this route after login - 'redirectTo' => 'boilerplate.dashboard', + 'redirectTo' => 'home', // Backend locale 'locale' => config('app.locale'), + + 'logs' => false, ]; diff --git a/config/boilerplate/auth.php b/config/boilerplate/auth.php index 7128a28e..08442b9e 100644 --- a/config/boilerplate/auth.php +++ b/config/boilerplate/auth.php @@ -2,11 +2,11 @@ return [ 'register' => false, // Allow to register new users on backend login page - 'register_role' => 'backend_user', // Given role to new users (except the first one who is admin) + 'register_role' => 'operator', // Given role to new users (except the first one who is admin) 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => Sebastienheyd\Boilerplate\Models\User::class, + 'model' => App\Models\Core\Auth\User::class, 'table' => 'users', ], ], diff --git a/config/boilerplate/laratrust.php b/config/boilerplate/laratrust.php index c668b3a5..d10ea08c 100644 --- a/config/boilerplate/laratrust.php +++ b/config/boilerplate/laratrust.php @@ -1,7 +1,7 @@ Sebastienheyd\Boilerplate\Models\User::class, - 'role' => Sebastienheyd\Boilerplate\Models\Role::class, - 'permission' => Sebastienheyd\Boilerplate\Models\Permission::class, + 'user' => App\Models\Core\Auth\User::class, + 'role' => App\Models\Core\Auth\Role::class, + 'permission' => App\Models\Core\Auth\Permission::class, ]; diff --git a/config/boilerplate/locale.php b/config/boilerplate/locale.php new file mode 100644 index 00000000..17eab3e4 --- /dev/null +++ b/config/boilerplate/locale.php @@ -0,0 +1,15 @@ + config('app.locale'), + 'switch' => false, + 'allowed' => ['en', 'es', 'fa', 'fr', 'it', 'tr'], + 'languages' => [ + 'en' => ['label' => 'English', 'datatable' => 'English'], + 'es' => ['label' => 'Español', 'datatable' => 'Spanish'], + 'fa' => ['label' => 'فارسی', 'datatable' => 'Persian'], + 'fr' => ['label' => 'Français', 'datatable' => 'French'], + 'it' => ['label' => 'Italiano', 'datatable' => 'Italian'], + 'tr' => ['label' => 'Türkçe', 'datatable' => 'Turkish'], + ], +]; diff --git a/config/boilerplate/menu.php b/config/boilerplate/menu.php index 76b54dc1..ae274828 100644 --- a/config/boilerplate/menu.php +++ b/config/boilerplate/menu.php @@ -1,6 +1,6 @@ \Sebastienheyd\Boilerplate\Controllers\DashboardController::class, // Dashboard controller to use - 'providers' => [], // Additional menu items providers + 'dashboard' => \App\Http\Controllers\Admin\HomeController::class, // Dashboard controller to use + 'providers' => [], // Additional menu items providers ]; diff --git a/config/boilerplate/theme.php b/config/boilerplate/theme.php index d1cd441f..26859e22 100644 --- a/config/boilerplate/theme.php +++ b/config/boilerplate/theme.php @@ -1,6 +1,6 @@ 'light', 'border' => true, 'user' => [ - 'visible' => false, - 'shadow' => 0, + 'visible' => true, + 'shadow' => 2, ], ], 'sidebar' => [ @@ -27,20 +27,20 @@ return [ 'brand' => [ 'bg' => 'gray-dark', 'logo' => [ - 'bg' => 'blue', - 'icon' => '', - 'text' => 'BOilerplate', + 'bg' => '', + 'icon' => '', + 'text' => 'Jardinenvie', 'shadow' => 2, ], ], 'user' => [ - 'visible' => true, + 'visible' => false, 'shadow' => 2, ], ], 'footer' => [ 'visible' => true, - 'vendorname' => 'Boilerplate', + 'vendorname' => 'Jardinenvie', 'vendorlink' => '', ], 'card' => [ diff --git a/config/boilerplate/themes/green.php b/config/boilerplate/themes/green.php new file mode 100644 index 00000000..fd7c7965 --- /dev/null +++ b/config/boilerplate/themes/green.php @@ -0,0 +1,50 @@ + [ + 'bg' => 'green', + 'type' => 'dark', + 'border' => true, + 'user' => [ + 'visible' => true, + 'shadow' => 0, + ], + ], + 'sidebar' => [ + 'type' => 'dark', + 'shadow' => 0, + 'border' => true, + 'compact' => false, + 'links' => [ + 'bg' => 'green', + 'shadow' => 0, + ], + 'brand' => [ + 'bg' => 'green', + 'logo' => [ + 'bg' => 'green', + 'icon' => '', + 'text' => 'JardinEnvie', + 'shadow' => 2, + ], + ], + 'user' => [ + 'visible' => false, + 'shadow' => 2, + ], + ], + 'footer' => [ + 'visible' => true, + 'vendorname' => 'JardinEnvie', + 'vendorlink' => '', + ], + 'card' => [ + 'outline' => true, + 'default_color' => 'green', + ], +]; diff --git a/config/medialibrary.php b/config/medialibrary.php deleted file mode 100644 index a8957028..00000000 --- a/config/medialibrary.php +++ /dev/null @@ -1,156 +0,0 @@ - env('MEDIA_DISK', 'public'), - - /* - * The maximum file size of an item in bytes. - * Adding a larger file will result in an exception. - */ - 'max_file_size' => 1024 * 1024 * 10, - - /* - * This queue will be used to generate derived and responsive images. - * Leave empty to use the default queue. - */ - 'queue_name' => '', - - /* - * The fully qualified class name of the media model. - */ - 'media_model' => Spatie\MediaLibrary\Models\Media::class, - - 's3' => [ - /* - * The domain that should be prepended when generating urls. - */ - 'domain' => 'https://'.env('AWS_BUCKET').'.s3.amazonaws.com', - ], - - 'remote' => [ - /* - * Any extra headers that should be included when uploading media to - * a remote disk. Even though supported headers may vary between - * different drivers, a sensible default has been provided. - * - * Supported by S3: CacheControl, Expires, StorageClass, - * ServerSideEncryption, Metadata, ACL, ContentEncoding - */ - 'extra_headers' => [ - 'CacheControl' => 'max-age=604800', - ], - ], - - 'responsive_images' => [ - - /* - * This class is responsible for calculating the target widths of the responsive - * images. By default we optimize for filesize and create variations that each are 20% - * smaller than the previous one. More info in the documentation. - * - * https://docs.spatie.be/laravel-medialibrary/v7/advanced-usage/generating-responsive-images - */ - 'width_calculator' => Spatie\MediaLibrary\ResponsiveImages\WidthCalculator\FileSizeOptimizedWidthCalculator::class, - - /* - * By default rendering media to a responsive image will add some javascript and a tiny placeholder. - * This ensures that the browser can already determine the correct layout. - */ - 'use_tiny_placeholders' => true, - - /* - * This class will generate the tiny placeholder used for progressive image loading. By default - * the medialibrary will use a tiny blurred jpg image. - */ - 'tiny_placeholder_generator' => Spatie\MediaLibrary\ResponsiveImages\TinyPlaceholderGenerator\Blurred::class, - ], - - /* - * When urls to files get generated, this class will be called. Leave empty - * if your files are stored locally above the site root or on s3. - */ - 'url_generator' => null, - - /* - * Whether to activate versioning when urls to files get generated. - * When activated, this attaches a ?v=xx query string to the URL. - */ - 'version_urls' => false, - - /* - * The class that contains the strategy for determining a media file's path. - */ - 'path_generator' => null, - - /* - * Medialibrary will try to optimize all converted images by removing - * metadata and applying a little bit of compression. These are - * the optimizers that will be used by default. - */ - 'image_optimizers' => [ - Spatie\ImageOptimizer\Optimizers\Jpegoptim::class => [ - '--strip-all', // this strips out all text information such as comments and EXIF data - '--all-progressive', // this will make sure the resulting image is a progressive one - ], - Spatie\ImageOptimizer\Optimizers\Pngquant::class => [ - '--force', // required parameter for this package - ], - Spatie\ImageOptimizer\Optimizers\Optipng::class => [ - '-i0', // this will result in a non-interlaced, progressive scanned image - '-o2', // this set the optimization level to two (multiple IDAT compression trials) - '-quiet', // required parameter for this package - ], - Spatie\ImageOptimizer\Optimizers\Svgo::class => [ - '--disable=cleanupIDs', // disabling because it is known to cause troubles - ], - Spatie\ImageOptimizer\Optimizers\Gifsicle::class => [ - '-b', // required parameter for this package - '-O3', // this produces the slowest but best results - ], - ], - - /* - * These generators will be used to create an image of media files. - */ - 'image_generators' => [ - Spatie\MediaLibrary\ImageGenerators\FileTypes\Image::class, - Spatie\MediaLibrary\ImageGenerators\FileTypes\Webp::class, - Spatie\MediaLibrary\ImageGenerators\FileTypes\Pdf::class, - Spatie\MediaLibrary\ImageGenerators\FileTypes\Svg::class, - Spatie\MediaLibrary\ImageGenerators\FileTypes\Video::class, - ], - - /* - * The engine that should perform the image conversions. - * Should be either `gd` or `imagick`. - */ - 'image_driver' => env('IMAGE_DRIVER', 'gd'), - - /* - * FFMPEG & FFProbe binaries paths, only used if you try to generate video - * thumbnails and have installed the php-ffmpeg/php-ffmpeg composer - * dependency. - */ - 'ffmpeg_path' => env('FFMPEG_PATH', '/usr/bin/ffmpeg'), - 'ffprobe_path' => env('FFPROBE_PATH', '/usr/bin/ffprobe'), - - /* - * The path where to store temporary files while performing image conversions. - * If set to null, storage_path('medialibrary/temp') will be used. - */ - 'temporary_directory_path' => null, - - /* - * Here you can override the class names of the jobs used by this package. Make sure - * your custom jobs extend the ones provided by the package. - */ - 'jobs' => [ - 'perform_conversions' => Spatie\MediaLibrary\Jobs\PerformConversions::class, - 'generate_responsive_images' => Spatie\MediaLibrary\Jobs\GenerateResponsiveImages::class, - ], -]; diff --git a/database/migrations/2021_05_21_001707_create_comments_table.php b/database/migrations/2021_05_21_001707_create_comments_table.php deleted file mode 100644 index bd3dd7ef..00000000 --- a/database/migrations/2021_05_21_001707_create_comments_table.php +++ /dev/null @@ -1,31 +0,0 @@ -increments('id'); - $table->morphs('commentable'); - $table->text('comment'); - $table->boolean('is_approved')->default(false); - $table->unsignedBigInteger('user_id')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - */ - public function down() - { - Schema::dropIfExists('comments'); - } -} \ No newline at end of file diff --git a/database/migrations/2021_05_21_001707_create_activity_log_table.php b/database/migrations/2021_06_05_192053_create_activity_log_table.php similarity index 100% rename from database/migrations/2021_05_21_001707_create_activity_log_table.php rename to database/migrations/2021_06_05_192053_create_activity_log_table.php diff --git a/database/migrations/2021_04_08_142711_create_comments_table.php b/database/migrations/2021_06_05_192053_create_comments_table.php similarity index 100% rename from database/migrations/2021_04_08_142711_create_comments_table.php rename to database/migrations/2021_06_05_192053_create_comments_table.php diff --git a/database/migrations/2021_05_21_001707_teamwork_setup_tables.php b/database/migrations/2021_06_05_192053_teamwork_setup_tables.php similarity index 100% rename from database/migrations/2021_05_21_001707_teamwork_setup_tables.php rename to database/migrations/2021_06_05_192053_teamwork_setup_tables.php diff --git a/database/migrations/2021_05_21_001707_create_media_table.php b/database/migrations/2021_07_25_182012_create_media_table.php similarity index 100% rename from database/migrations/2021_05_21_001707_create_media_table.php rename to database/migrations/2021_07_25_182012_create_media_table.php diff --git a/package.json b/package.json index 2b7d030e..341424cf 100644 --- a/package.json +++ b/package.json @@ -1,148 +1,163 @@ { + "name": "FGDigital", + "version": "2.0.0", "private": true, "scripts": { "dev": "npm run development", - "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", + "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "npm run development -- --watch", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", - "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" + "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { - "axios": "^0.19", - "bootstrap": "^4.4.1", + "axios": "^0.21", + "bootstrap": "^4.6", "cross-env": "^7.0", + "laravel-mix": "^6.0.25", + "lodash": "^4.17.20", + "popper.js": "^1.12", + "resolve-url-loader": "^4.0.0", + "sass": "^1.26.9", + "sass-loader": "^12.1.0", + "vue-template-compiler": "^2.6.11" + }, + "dependencies": { + "@claviska/jquery-minicolors": "^2.3.4", + "@fortawesome/fontawesome-free": "^5.14.0", + "@highcharts/map-collection": "^1.1.3", + "X-editable": "^1.5.1", + "admin-lte": "^3.1.0", + "amcharts": "^3.14.5", + "animate.css": "^4.1.0", + "apexcharts": "^3.20.0", + "bootbox": "^5.5.2", + "bootpag": "^1.0.7", + "bootstrap-autocomplete": "^2.3.7", + "bootstrap-chosen": "^1.4.2", + "bootstrap-datepicker": "^1.8.0", + "bootstrap-fileinput": "^5.1.1", + "bootstrap-maxlength": "^1.10.0", + "bootstrap-milestones": "^1.1.0", + "bootstrap-sweetalert": "^1.0.1", + "bootstrap-tabdrop": "^0.1.0", + "bootstrap-validate": "^2.2.0", + "bootstrap-validator": "^0.11.9", + "bootstrap4-duallistbox": "^4.0.2", + "bootstrap4-toggle": "^3.6.1", + "chart.js": "^3.3.2", + "datatables.net-bs4": "1.10.18", + "datatables.net-buttons-bs4": "^1.7.1", + "datatables.net-colreorder-bs4": "^1.5.4", + "datatables.net-editor-bs4": "^2.0.3", + "datatables.net-fixedcolumns-bs4": "3.3.3", + "datatables.net-fixedheader-bs4": "^3.1.9", + "datatables.net-keytable-bs4": "^2.6.2", + "datatables.net-plugins": "^1.10.19", + "datatables.net-responsive-bs4": "^2.2.9", + "datatables.net-rowgroup-bs4": "^1.1.3", + "datatables.net-rowreorder-bs4": "^1.2.8", + "datatables.net-scroller-bs4": "^2.0.4", + "datatables.net-searchbuilder-bs4": "^1.1.0", + "datatables.net-searchpanes-bs4": "^1.3.0", + "datatables.net-select-bs4": "1.3.3", + "daterangepicker": "^3.0.5", + "dropzone": "^5.5.1", + "easy-pie-chart": "^2.1.7", + "echarts": "^5.1.2", + "es6-promise": "^4.2.8", + "flag-icon-css": "^3.5.0", + "font-awesome": "^4.7.0", + "formBuilder": "^3.2.3", + "formiojs": "^4.11.2", "grunt": "^1.0.4", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-concat": "^1.0.1", "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-cssmin": "^3.0.0", - "grunt-contrib-handlebars": "^1.0.0", - "grunt-contrib-uglify": "^4.0.1", + "grunt-contrib-cssmin": "^4.0.0", + "grunt-contrib-handlebars": "^3.0.0", + "grunt-contrib-uglify": "^5.0.1", "grunt-contrib-watch": "^1.1.0", - "grunt-eslint": "^22.0.0", + "grunt-eslint": "^23.0.0", "grunt-webstandards": "^0.1.1", - "jquery": "^3.3.1", - "laravel-mix": "^5.0.1", - "lodash": "^4.17.13", - "popper.js": "^1.12", - "resolve-url-loader": "^3.1.0", - "sass": "^1.15.2", - "sass-loader": "^8.0.0", - "vue-template-compiler": "^2.6.11" - }, - "dependencies": { - "@activix/bootstrap-datetimepicker": "^2.0.7", - "@ciar4n/izmir": "^1.0.0", - "@claviska/jquery-minicolors": "^2.3.4", - "admin-lte": "^3.0.2", - "animate.css": "^3.7.0", - "bootbox": "^5.3.4", - "bootstrap-chosen": "^1.4.2", - "bootstrap-datepicker": "^1.8.0", - "bootstrap-fileinput": "^5.0.8", - "bootstrap-multiselect": "^0.9.13", - "bootstrap-slider": "^10.6.2", - "bootstrap-sweetalert": "^1.0.1", - "bootstrap-tabdrop": "^0.1.0", - "bootstrap-validate": "^2.1.3", - "bootstrap-validator": "^0.11.9", - "bootstrap4-toggle": "^3.6.1", - "chart.js": "^2.8.0", - "datatables": "^1.10.18", - "datatables.net": "^1.10.20", - "datatables.net-bs4": "^1.10.20", - "datatables.net-buttons": "^1.5.6", - "datatables.net-buttons-bs4": "^1.6.1", - "datatables.net-colreorder": "^1.5.1", - "datatables.net-colreorder-bs4": "^1.5.1", - "datatables.net-fixedcolumns": "^3.2.6", - "datatables.net-fixedcolumns-bs4": "^3.2.6", - "datatables.net-fixedheader": "^3.1.5", - "datatables.net-fixedheader-bs4": "^3.1.5", - "datatables.net-keytable": "^2.5.0", - "datatables.net-keytable-bs4": "^2.5.0", - "datatables.net-plugins": "^1.10.19", - "datatables.net-responsive": "^2.2.3", - "datatables.net-rowgroup": "^1.1.2", - "datatables.net-rowgroup-bs4": "^1.1.2", - "datatables.net-rowreorder": "^1.2.7", - "datatables.net-rowreorder-bs4": "^1.2.7", - "datatables.net-scroller": "^2.0.0", - "datatables.net-scroller-bs4": "^2.0.0", - "datatables.net-searchpanes": "^1.1.0", - "datatables.net-select": "^1.3.0", - "datatables.net-select-bs4": "^1.3.0", - "daterangepicker": "^3.0.5", - "drmonty-datatables-plugins": "^1.10.12", - "dropzone": "^5.5.1", - "easy-pie-chart": "^2.1.7", - "es6-promise": "^4.2.8", - "font-awesome": "^4.7.0", - "formBuilder": "^3.2.3", - "fullcalendar": "^5.7", "handlebars": "^4.1.1", "handlebars-layouts": "^3.1.4", - "hover.css": "^2.3.2", + "highcharts": "^9.1.2", + "highcharts-export-server": "^2.1.0", "icheck": "^1.0.2", - "iconate": "*", - "imagehover.css": "^2.0.0", - "imports-loader": "^0.8.0", + "icheck-bootstrap": "^3.0.1", "input-switch": "^1.1.0", - "inputmask": "^4.0.8", - "ionicons": "^5.0.1", - "isotope-layout": "^3.0.6", + "inputmask": "^5.0.3", "izimodal": "^1.5.1", - "jQuery-QueryBuilder": "^2.5.2", - "jqtree": "^1.4.12", - "jquery": "^3.5.1", + "jq-bootstrap-validation": "^1.3.8", + "jquery": "3.5.1", "jquery-confirm": "^3.3.4", + "jquery-file-download": "^1.4.6", "jquery-form": "^4.2.2", "jquery-jeditable": "^2.0.13", "jquery-json": "^2.6.0", - "jquery-migrate": "^3.1.0", + "jquery-migrate": "^3.3.1", "jquery-placeholder": "^2.3.1", - "jquery-serializejson": "^2.9.0", + "jquery-serializejson": "^3.2.0", "jquery-slidePanel": "^0.3.5", "jquery-slimscroll": "^1.3.8", + "jquery-throttle-debounce": "^1.0.0", "jquery-ui": "^1.12.1", "jquery-validation": "^1.19.0", - "jquery.are-you-sure": "^1.9.0", "jquery.cookie": "^1.4.1", "jquery.documentsize": "^1.2.5", - "jquery.fancytree": "^2.35.0", + "jquery.fancytree": "^2.36.1", "jquery.filer": "^1.3.0", "jquery.nicescroll": "^3.7.6", "jquery.quicksearch": "^2.4.0", "jquery.uniform": "^4.3.0", + "jqvmap": "^1.5.1", "jscroll": "^2.4.1", - "jszip": "^3.2.2", - "moment": "^2.24.0", + "jszip": "^3.6.0", + "laravel-echo": "^1.8.1", + "modernizr": "^3.11.3", + "moment": "^2.27.0", "morris.js": "^0.5.0", "mousetrap": "^1.6.3", "multiselect": "^0.9.12", - "nestable": "*", - "numeral": "^2.0.6", + "nestable2": "^1.6.0", + "owp.glyphicons": "^1.1.0", + "pace-js": "^1.0.2", "packery": "^2.1.2", - "pdfmake": "^0.1.57", + "pdfjs": "^2.4.2", + "pdfmake": "^0.1.71", + "pdfobject": "^2.2.4", + "peity": "^3.3.0", "philter": "^1.5.0", + "postcss": "^8.3.5", + "print-js": "^1.6.0", "promise-polyfill": "^8.1.3", - "pwstrength-bootstrap": "^3.0.3", + "puppeteer": "^10.0.0", + "pusher-js": "^7.0.0", + "pwstrength-bootstrap": "^3.0.9", "raphael": "^2.2.8", - "screenfull": "^4.2.0", + "screenfull": "^5.1.0", "select2": "^4.0.13", "selectize": "^0.12.6", + "simple-peer": "^9.9.3", + "sizzle": "^2.3.6", + "slick-carousel": "^1.8.1", "slidebars": "^2.0.2", - "summernote": "^0.8.12", + "socket.io-client": "^4.1.2", + "summernote": "^0.8.11", + "svg-country-flags": "^1.2.9", "swag": "^0.7.0", - "sweetalert2": "^8.16.1", - "tabler-icons": "^1.5.0", + "sweetalert2": "^11.0.18", "tablesort": "^5.1.0", - "textillate": "^0.4.1", + "tempusdominus-bootstrap-4": "^5.1.2", + "tinymce": "^5.8.0", "tooltipster": "^4.2.6", "underscore": "^1.9.2", + "vue-resource": "^1.5.1", + "waves": "^0.1.1", "wew.js": "^1.0.1", + "wow.js": "^1.2.2", "x-editable": "^1.5.1" } } diff --git a/resources/lang/fr/shop.php b/resources/lang/fr/shop.php index 8c305340..1667b28d 100644 --- a/resources/lang/fr/shop.php +++ b/resources/lang/fr/shop.php @@ -20,6 +20,7 @@ return [ ], 'articles' => [ 'title' => 'Articles', + 'name' => 'Article', 'description' => 'Gérer les articles', 'add' => 'Ajouter un article', 'edit' => 'Editer un article', @@ -30,17 +31,18 @@ return [ 'successdel' => 'L\'article a été correctement effacé', 'confirmdelete' => 'Confirmez-vous la suppression de l\'article ?', ], - 'article_families' => [ - 'title' => 'Familles d\'articles', - 'description' => 'Gérer les familles d\'articles', - 'add' => 'Ajouter une famille d\'articles', - 'edit' => 'Editer une famille d\'articles', - 'del' => 'Effacer une famille d\'articles', - 'list' => 'Liste des familles d\'articles', - 'successadd' => 'La famille d\'articles été correctement ajoutée', - 'successmod' => 'La famille d\'articles a été correctement modifiée', - 'successdel' => 'La famille d\'articles a été correctement effacée', - 'confirmdelete' => 'Confirmez-vous la suppression de la famille d\'articles ?', + 'article_natures' => [ + 'title' => 'Natures d\'articles', + 'name' => 'Nature d\'articles', + 'description' => 'Gérer les natures d\'articles', + 'add' => 'Ajouter une nature d\'articles', + 'edit' => 'Editer une nature d\'articles', + 'del' => 'Effacer une nature d\'articles', + 'list' => 'Liste des natures d\'articles', + 'successadd' => 'La nature d\'articles été correctement ajoutée', + 'successmod' => 'La nature d\'articles a été correctement modifiée', + 'successdel' => 'La nature d\'articles a été correctement effacée', + 'confirmdelete' => 'Confirmez-vous la suppression de la nature d\'articles ?', ], 'article_attribute_families' => [ 'title' => 'Familles d\'attributs', @@ -80,6 +82,7 @@ return [ ], 'tags' => [ 'title' => 'Tags', + 'name' => 'Tag', 'description' => 'Gérer les tags', 'add' => 'Ajouter un tag', 'edit' => 'Editer un tag', @@ -92,6 +95,7 @@ return [ ], 'customers' => [ 'title' => "Clients", + 'name' => 'Client', 'description' => 'Gérer les clients', 'add' => 'Ajouter un client', 'edit' => 'Editer un client', @@ -102,4 +106,68 @@ return [ 'successdel' => 'Le client a été correctement effacé', 'confirmdelete' => 'Confirmez-vous la suppression du client ?', ], + 'tariffs' => [ + 'title' => 'Tarifs', + 'name' => 'Tarif', + 'description' => 'Gérer les tarifs', + 'add' => 'Ajouter un tarif', + 'edit' => 'Editer un tarif', + 'del' => 'Effacer un tarif', + 'list' => 'Liste des tarifs', + 'successadd' => 'Le tarif été correctement ajouté', + 'successmod' => 'Le tarif a été correctement modifié', + 'successdel' => 'Le tarif a été correctement effacé', + 'confirmdelete' => 'Confirmez-vous la suppression du tarif ?', + ], + 'prices' => [ + 'title' => 'Prix', + 'description' => 'Gérer les prix', + 'add' => 'Ajouter un prix', + 'edit' => 'Editer un prix', + 'del' => 'Effacer un prix', + 'list' => 'Liste des prix', + 'successadd' => 'Le prix été correctement ajouté', + 'successmod' => 'Le prix a été correctement modifié', + 'successdel' => 'Le prix a été correctement effacé', + 'confirmdelete' => 'Confirmez-vous la suppression du prix ?', + ], + 'shelves' => [ + 'title' => 'Rayons', + 'name' => 'Rayon', + 'description' => 'Gérer les rayons', + 'add' => 'Ajouter un rayon', + 'edit' => 'Editer un rayon', + 'del' => 'Effacer un rayon', + 'list' => 'Liste des rayons', + 'successadd' => 'Le rayon a été correctement ajouté', + 'successmod' => 'Le rayon a été correctement modifié', + 'successdel' => 'Le rayon a été correctement effacé', + 'confirmdelete' => 'Confirmez-vous la suppression du rayon ?', + ], + 'offers' => [ + 'title' => 'Offres', + 'name' => 'Offre', + 'description' => 'Gérer les offres', + 'add' => 'Ajouter une offre', + 'edit' => 'Editer une offre', + 'del' => 'Effacer une offre', + 'list' => 'Liste des offres', + 'successadd' => 'L\'offre a été correctement ajoutée', + 'successmod' => 'L\'offre a été correctement modifiée', + 'successdel' => 'L\'offre a été correctement effacée', + 'confirmdelete' => 'Confirmez-vous la suppression de l\'offre ?', + ], + 'variations' => [ + 'title' => 'Déclinaisons', + 'name' => 'Déclinaison', + 'description' => 'Gérer les déclinaisons', + 'add' => 'Ajouter une déclinaison', + 'edit' => 'Editer une déclinaison', + 'del' => 'Effacer une déclinaison', + 'list' => 'Liste des déclinaisons', + 'successadd' => 'La déclinaison a été correctement ajoutée', + 'successmod' => 'La déclinaison a été correctement modifiée', + 'successdel' => 'La déclinaison a été correctement effacée', + 'confirmdelete' => 'Confirmez-vous la suppression de la déclinaison ?', + ], ]; diff --git a/resources/lang/fr/system.php b/resources/lang/fr/system.php new file mode 100644 index 00000000..9c9d35b5 --- /dev/null +++ b/resources/lang/fr/system.php @@ -0,0 +1,6 @@ + 'Annuler', + 'save' => 'Sauver', +]; diff --git a/resources/views/Botanic/Admin/Genres/form.blade.php b/resources/views/Botanic/Admin/Genres/form.blade.php deleted file mode 100644 index b50c1ab6..00000000 --- a/resources/views/Botanic/Admin/Genres/form.blade.php +++ /dev/null @@ -1,27 +0,0 @@ -
-
- {{ Form::label('name', 'Nom') }} - @include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true]) - - {{ Form::label('alias', 'Alias') }} - @include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null, 'required' => true]) - - {{ Form::label('latin', 'Nom latin') }} - @include('components.input', ['name' => 'latin', 'value' => isset($latin) ? $latin : null, 'required' => true]) - - {{ Form::label('description', 'Description') }} - @include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false]) - - {{ Form::label('family', 'Famille') }} - @include('components.select', ['name' => 'family_id', 'list' => $families, 'value' => isset($family_id) ? $family_id : null, 'required' => false]) - -
-
- -
-
-
- @include('components.button-save') -
-
-
diff --git a/resources/views/Botanic/Admin/Species/edit.blade.php b/resources/views/Botanic/Admin/Species/edit.blade.php deleted file mode 100644 index ef272e66..00000000 --- a/resources/views/Botanic/Admin/Species/edit.blade.php +++ /dev/null @@ -1,27 +0,0 @@ -@extends('layout.index', [ - 'title' => __('Botanic.species.title'), - 'subtitle' => __('Botanic.species.edit'), - 'breadcrumb' => [__('Botanic.species.title'), __('Botanic.species.list')] -]) - -@include('boilerplate::load.fileinput') -@include('boilerplate::load.select2') - -@section('content') - - {{ Form::open(['route' => 'Botanic.Admin.Species.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} - - - @include('Botanic.Admin.Species.form') - - - -@endsection - -@push('js') - -@endpush \ No newline at end of file diff --git a/resources/views/Botanic/Admin/Species/form.blade.php b/resources/views/Botanic/Admin/Species/form.blade.php deleted file mode 100644 index f6caae2a..00000000 --- a/resources/views/Botanic/Admin/Species/form.blade.php +++ /dev/null @@ -1,57 +0,0 @@ -@include('boilerplate::load.fileinput') -@include('boilerplate::load.select2') -@include('boilerplate::load.tinymce') - -
-
-
-
- {{ Form::label('name', 'Nom') }} - @include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true]) -
-
- {{ Form::label('latin', 'Nom latin') }} - @include('components.input', ['name' => 'latin', 'value' => isset($latin) ? $latin : null, 'required' => true]) -
-
- -
-
- {{ Form::label('genre', 'Genre') }} - @include('components.select', ['name' => 'genre_id', 'list' => $genres, 'value' => isset($genre_id) ? $genre_id : null, 'class' => 'select2 form-control', 'required' => false]) -
-
- {{ Form::label('alias', 'Alias') }} - @include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null]) -
-
- - - {{ Form::label('description', 'Description') }} - @include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false]) - -
- -
- {{ Form::label('photo', 'Photos') }} - @include('components.file', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true]) -
-
- -
-
-
- @include('components.button-save') -
-
-
- - -@push('js') - -@endpush \ No newline at end of file diff --git a/resources/views/Botanic/Admin/Varieties/form.blade.php b/resources/views/Botanic/Admin/Varieties/form.blade.php deleted file mode 100644 index 6ecab2ad..00000000 --- a/resources/views/Botanic/Admin/Varieties/form.blade.php +++ /dev/null @@ -1,42 +0,0 @@ -@include('boilerplate::load.fileinput') -@include('boilerplate::load.select2') -@include('boilerplate::load.tinymce') - -
-
-
-
- {{ Form::label('name', 'Nom') }} - @include('components.input', ['name' => 'name', 'value' => $name ?? null, 'required' => true]) -
-
- {{ Form::label('genre', 'Espèce') }} - @include('components.select', ['name' => 'specie_id', 'list' => $species, 'value' => $specie_id ?? null, 'class' => 'select2 form-control', 'required' => false]) -
-
- - {{ Form::label('tags', 'Tags') }} - @include('components.select-tree', ['name' => 'tags[]', 'list' => $tags_list, 'values' => $tags ?? null, 'class' => 'select2 form-control', 'multiple' => true]) - - - {{ Form::label('description', 'Description') }} - @include('components.textarea', ['name' => 'description', 'value' => $description ?? null, 'class' => 'editor', 'rows' => 5, 'required' => false]) - -
- -
- @include('components.uploader.widget', ['load_url' => route('Botanic.Admin.Varieties.getImages', ['id' => $id ?? false]), 'delete_url' => route('Botanic.Admin.Varieties.deleteImage'), 'name' => 'images']) -
- -
- -@include('components.save') - -@push('js') - -@endpush \ No newline at end of file diff --git a/resources/views/Shop/Admin/ArticleFamilies/create.blade.php b/resources/views/Shop/Admin/ArticleFamilies/create.blade.php deleted file mode 100644 index d381a410..00000000 --- a/resources/views/Shop/Admin/ArticleFamilies/create.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -@extends('layout.index', [ - 'title' => __('article_families.title'), - 'subtitle' => __('article_families.create.title'), - 'breadcrumb' => [__('article_families.title'), __('article_families.create.title')] -]) - -@include('boilerplate::load.fileinput') - -@section('content') - - {{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.store', 'id' => 'article-family-form', 'autocomplete' => 'off', 'files' => true]) }} - @include('Shop.Admin.ArticleFamilies.form') - - -@endsection diff --git a/resources/views/Shop/Admin/ArticleFamilies/edit.blade.php b/resources/views/Shop/Admin/ArticleFamilies/edit.blade.php deleted file mode 100644 index efcc0d09..00000000 --- a/resources/views/Shop/Admin/ArticleFamilies/edit.blade.php +++ /dev/null @@ -1,16 +0,0 @@ -@extends('layout.index', [ - 'title' => 'Famille d\'articles', - 'subtitle' => 'Edition d\'une famille d\'article', - 'breadcrumb' => ['Articles'] -]) - -@include('boilerplate::load.fileinput') - -@section('content') - - {{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.update', 'id' => 'article-family-form', 'autocomplete' => 'off', 'files' => true]) }} - - @include('Shop.Admin.ArticleFamilies.form') - - -@endsection diff --git a/resources/views/Shop/Admin/ArticleFamilies/list.blade.php b/resources/views/Shop/Admin/ArticleFamilies/list.blade.php deleted file mode 100644 index 1abd6938..00000000 --- a/resources/views/Shop/Admin/ArticleFamilies/list.blade.php +++ /dev/null @@ -1,9 +0,0 @@ -@extends('layout.index', [ - 'title' => __('Shop.article_families.title'), - 'subtitle' => __('Shop.article_families.list'), - 'breadcrumb' => [__('Shop.article_families.title')] -]) - -@section('content') - @include('components.datatable', ['route' => route('Shop.Admin.ArticleFamilies.index'), 'model' => 'article_families']) -@endsection diff --git a/resources/views/Shop/Admin/Articles/edit.blade.php b/resources/views/Shop/Admin/Articles/edit.blade.php deleted file mode 100644 index 362668be..00000000 --- a/resources/views/Shop/Admin/Articles/edit.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -@extends('layout.index', [ - 'title' => 'Articles', - 'subtitle' => 'Edition d\'un article', - 'breadcrumb' => ['Articles'] -]) - -@section('content') - - {{ Form::open(['route' => 'Shop.Admin.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }} - - - @include('Shop.Admin.Articles.form') - - -@endsection diff --git a/resources/views/Shop/Admin/Articles/partials/prices.blade.php b/resources/views/Shop/Admin/Articles/partials/prices.blade.php deleted file mode 100644 index 2f5943d9..00000000 --- a/resources/views/Shop/Admin/Articles/partials/prices.blade.php +++ /dev/null @@ -1,2 +0,0 @@ -@include('Shop.Admin.Articles.partials.prices.prices', ['prices' => $article['prices']['prices'] ?? null]) -@include('Shop.Admin.Articles.partials.generic_prices.generic_prices', ['generics' => $article['prices']['generics'] ?? null]) diff --git a/resources/views/Shop/Admin/Articles/partials/product/description.blade.php b/resources/views/Shop/Admin/Articles/partials/product/description.blade.php deleted file mode 100644 index a69076ef..00000000 --- a/resources/views/Shop/Admin/Articles/partials/product/description.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@if (!empty($article['product']['description'])) - @component('components.layout.box-collapse', ['id' => 'product_description', 'title' => 'Description produit']) - {{ $article['product']['description'] }} - @endcomponent -@endif \ No newline at end of file diff --git a/resources/views/Shop/Admin/Articles/partials/product/images.blade.php b/resources/views/Shop/Admin/Articles/partials/product/images.blade.php deleted file mode 100644 index 3ed5bf1a..00000000 --- a/resources/views/Shop/Admin/Articles/partials/product/images.blade.php +++ /dev/null @@ -1 +0,0 @@ -@include('components.uploader.widget', ['load_url' => route('Botanic.Admin.Varieties.getImages', ['id' => $article['product_id'] ?? false, 'can_edit' => 0]), 'name' => 'product_images', 'title' => 'Photos produits', 'prefix' => 'product_', 'can_edit' => false, 'collapsed' => true ]) diff --git a/resources/views/Shop/Admin/Categories/list.blade.php b/resources/views/Shop/Admin/Categories/list.blade.php deleted file mode 100644 index b8e0976f..00000000 --- a/resources/views/Shop/Admin/Categories/list.blade.php +++ /dev/null @@ -1,21 +0,0 @@ -@extends('layout.index', [ - 'title' => __('Shop.categories.title'), - 'subtitle' => __('Shop.categories.list'), - 'breadcrumb' => [__('Shop.categories.title')] -]) - -@section('content') - -
-
- @component('components.card') - @include('components.datatable', ['route' => route('Shop.Admin.Categories.index'), 'model' => 'categories']) - @endcomponent -
-
- @include('Shop.Admin.Categories.partials.tree') -
-
- -@endsection - diff --git a/resources/views/Shop/Admin/Dashboard/_partials/report.blade.php b/resources/views/Shop/Admin/Dashboard/_partials/report.blade.php deleted file mode 100644 index e9889c70..00000000 --- a/resources/views/Shop/Admin/Dashboard/_partials/report.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -
- -
- @include('Shop.Admin.Dashboard._partials.salesByPeriod') -
- -
- @include('Shop.Admin.Dashboard._partials.stock') -
- -
- - -
-
- @include('Shop.Admin.Dashboard._partials.latestOrders') -
- -
- @include('Shop.Admin.Dashboard._partials.ordersByTypes') -
- -
\ No newline at end of file diff --git a/resources/views/Shop/Admin/Packages/form.blade.php b/resources/views/Shop/Admin/Packages/form.blade.php deleted file mode 100644 index 300625f8..00000000 --- a/resources/views/Shop/Admin/Packages/form.blade.php +++ /dev/null @@ -1,18 +0,0 @@ -
-
- {{ Form::label('name', 'Famille') }} - @include('components.select', ['name' => 'article_family_id', 'value' => $package['article_family_id'] ?? null, 'list' => $families, 'required' => false, 'with_empty' => '']) - - {{ Form::label('name', 'Valeur') }} - @include('components.input', ['name' => 'value', 'value' => $package['value'] ?? null, 'required' => true]) - -
-
- -
-
-
- @include('components.button-save') -
-
-
diff --git a/resources/views/Shop/Admin/PriceGenericCategories/create.blade.php b/resources/views/Shop/Admin/PriceGenericCategories/create.blade.php deleted file mode 100644 index 7d5a4812..00000000 --- a/resources/views/Shop/Admin/PriceGenericCategories/create.blade.php +++ /dev/null @@ -1,13 +0,0 @@ -@extends('layout.index', [ - 'title' => __('price_generic_categories.title'), - 'subtitle' => __('price_generic_categories.create.title'), - 'breadcrumb' => [__('price_generic_categories.title'), __('price_generic_categories.create.title')] -]) - -@section('content') - - {{ Form::open(['route' => 'Shop.Admin.PriceGenericCategories.store', 'id' => 'price-generic-category-form', 'autocomplete' => 'off']) }} - @include('Shop.Admin.PriceGenericCategories.form') - - -@endsection diff --git a/resources/views/Shop/Admin/PriceGenericCategories/edit.blade.php b/resources/views/Shop/Admin/PriceGenericCategories/edit.blade.php deleted file mode 100644 index d204e351..00000000 --- a/resources/views/Shop/Admin/PriceGenericCategories/edit.blade.php +++ /dev/null @@ -1,14 +0,0 @@ -@extends('layout.index', [ - 'title' => __('price_generic_categories.title'), - 'subtitle' => __('price_generic_categories.edit.title'), - 'breadcrumb' => [__('price_generic_categories.title'), __('price_generic_categories.edit.title')] -]) - -@section('content') - - {{ Form::open(['route' => 'Shop.Admin.PriceGenericCategories.store', 'id' => 'price-generic-category-form', 'autocomplete' => 'off']) }} - - @include('Shop.Admin.PriceGenericCategories.form') - - -@endsection diff --git a/resources/views/Shop/Admin/PriceGenericCategories/form.blade.php b/resources/views/Shop/Admin/PriceGenericCategories/form.blade.php deleted file mode 100644 index fc27cc47..00000000 --- a/resources/views/Shop/Admin/PriceGenericCategories/form.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -
-
- {{ Form::label('name', 'Famille d\'articles') }} - @include('components.select', ['name' => 'article_family_id', 'list' => $families,'value' => $generic_category['article_family_id'] ?? null, 'required' => true]) -
-
- -
-
- {{ Form::label('name', 'Nom') }} - @include('components.input', ['name' => 'name', 'value' => $generic_category['name'] ?? null, 'required' => true]) -
-
- -@include('components.save') diff --git a/resources/views/Shop/Admin/PriceGenericCategories/list.blade.php b/resources/views/Shop/Admin/PriceGenericCategories/list.blade.php deleted file mode 100644 index 7b175ee6..00000000 --- a/resources/views/Shop/Admin/PriceGenericCategories/list.blade.php +++ /dev/null @@ -1,13 +0,0 @@ -@extends('layout.index', [ - 'title' => __('price_generic_categories.title'), - 'subtitle' => __('price_generic_categories.list.title'), - 'breadcrumb' => [__('price_generic_categories.title')] -]) -@section('content') - @include('components.datatable', ['route' => route('Shop.Admin.PriceGenericCategories.index'), 'model' => 'price_generic_categories', 'with_filters' => true]) - - @component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-price_generic_categories-filters']) - @include('Shop.Admin.PriceGenericCategories.partials.filters') - @endcomponent - -@endsection diff --git a/resources/views/Shop/Admin/PriceGenerics/partials/filters.blade.php b/resources/views/Shop/Admin/PriceGenerics/partials/filters.blade.php deleted file mode 100644 index c4fd3bab..00000000 --- a/resources/views/Shop/Admin/PriceGenerics/partials/filters.blade.php +++ /dev/null @@ -1,8 +0,0 @@ -
-
- -
- @include('components.select', ['name' => 'category_id', 'list' => (isset($categories)) ? $categories : [], 'value' => (isset($filters['category_id'])) ? $filters['category_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' ']) -
-
-
diff --git a/resources/views/Botanic/Admin/Families/create.blade.php b/resources/views/admin/Botanic/Families/create.blade.php similarity index 76% rename from resources/views/Botanic/Admin/Families/create.blade.php rename to resources/views/admin/Botanic/Families/create.blade.php index 065702ba..e79124d0 100644 --- a/resources/views/Botanic/Admin/Families/create.blade.php +++ b/resources/views/admin/Botanic/Families/create.blade.php @@ -8,8 +8,8 @@ @section('content') - {{ Form::open(['route' => 'Botanic.Admin.Families.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} - @include('Botanic.Admin.Families.form') + {{ Form::open(['route' => 'Admin.Botanic.Families.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} + @include('Admin.Botanic.Families.form') @endsection diff --git a/resources/views/Botanic/Admin/Families/edit.blade.php b/resources/views/admin/Botanic/Families/edit.blade.php similarity index 73% rename from resources/views/Botanic/Admin/Families/edit.blade.php rename to resources/views/admin/Botanic/Families/edit.blade.php index 7fc6ad71..6650cea3 100644 --- a/resources/views/Botanic/Admin/Families/edit.blade.php +++ b/resources/views/admin/Botanic/Families/edit.blade.php @@ -6,10 +6,10 @@ @section('content') - {{ Form::open(['route' => 'Botanic.Admin.Families.store', 'id' => 'form', 'autocomplete' => 'off']) }} + {{ Form::open(['route' => 'Admin.Botanic.Families.store', 'id' => 'form', 'autocomplete' => 'off']) }} - @include('Botanic.Admin.Families.form') + @include('Admin.Botanic.Families.form') diff --git a/resources/views/Botanic/Admin/Families/form.blade.php b/resources/views/admin/Botanic/Families/form.blade.php similarity index 60% rename from resources/views/Botanic/Admin/Families/form.blade.php rename to resources/views/admin/Botanic/Families/form.blade.php index 6710434e..4edadc10 100644 --- a/resources/views/Botanic/Admin/Families/form.blade.php +++ b/resources/views/admin/Botanic/Families/form.blade.php @@ -1,22 +1,24 @@ -@include('boilerplate::load.tinymce') - -
+
-
+
{{ Form::label('name', 'Nom') }} @include('components.input', ['name' => 'name', 'value' => (isset($family['name'])) ? $family['name'] : null, 'required' => true])
{{ Form::label('alias', 'Alias') }} - @include('components.input', ['name' => 'alias', 'value' => (isset($family['alias'])) ? $family['alias'] : null, 'required' => true]) + @include('components.input', ['name' => 'alias', 'value' => (isset($family['alias'])) ? $family['alias'] : null])
- {{ Form::label('latin', 'Nom latin') }} - @include('components.input', ['name' => 'latin', 'value' => (isset($family['latin'])) ? $family['latin'] : null, 'required' => true]) - -
+
+
+ {{ Form::label('latin', 'Nom latin') }} + @include('components.input', ['name' => 'latin', 'value' => (isset($family['latin'])) ? $family['latin'] : null, 'required' => true]) +
+
+ +
{{ Form::label('description', 'Description') }} @include('components.textarea', ['name' => 'description', 'value' => isset($family['description']) ? $family['description'] : null, 'class' => 'editor', 'required' => true]) @@ -28,10 +30,12 @@ @include('components.save') +@include('load.form.editor') + @push('js') - + @endpush \ No newline at end of file diff --git a/resources/views/Botanic/Admin/Families/list.blade.php b/resources/views/admin/Botanic/Families/list.blade.php similarity index 68% rename from resources/views/Botanic/Admin/Families/list.blade.php rename to resources/views/admin/Botanic/Families/list.blade.php index dfdeb3a5..f4473d13 100644 --- a/resources/views/Botanic/Admin/Families/list.blade.php +++ b/resources/views/admin/Botanic/Families/list.blade.php @@ -6,6 +6,6 @@ @section('content') @component('components.card') - @include('components.datatable', ['route' => route('Botanic.Admin.Families.index'), 'model' => 'families']) + @include('components.datatable', ['route' => route('Admin.Botanic.Families.index'), 'model' => 'families']) @endcomponent @endsection \ No newline at end of file diff --git a/resources/views/Botanic/Admin/Families/show.blade.php b/resources/views/admin/Botanic/Families/show.blade.php similarity index 100% rename from resources/views/Botanic/Admin/Families/show.blade.php rename to resources/views/admin/Botanic/Families/show.blade.php diff --git a/resources/views/Botanic/Admin/Genres/create.blade.php b/resources/views/admin/Botanic/Genres/create.blade.php similarity index 71% rename from resources/views/Botanic/Admin/Genres/create.blade.php rename to resources/views/admin/Botanic/Genres/create.blade.php index 7181a3c9..ded401c4 100644 --- a/resources/views/Botanic/Admin/Genres/create.blade.php +++ b/resources/views/admin/Botanic/Genres/create.blade.php @@ -6,8 +6,8 @@ @section('content') - {{ Form::open(['route' => 'Botanic.Admin.Genres.store', 'id' => 'form', 'autocomplete' => 'off']) }} - @include('Botanic.Admin.Genres.form') + {{ Form::open(['route' => 'Admin.Botanic.Genres.store', 'id' => 'form', 'autocomplete' => 'off']) }} + @include('Admin.Botanic.Genres.form') @endsection diff --git a/resources/views/Botanic/Admin/Genres/edit.blade.php b/resources/views/admin/Botanic/Genres/edit.blade.php similarity index 58% rename from resources/views/Botanic/Admin/Genres/edit.blade.php rename to resources/views/admin/Botanic/Genres/edit.blade.php index a0a2c3de..ca6716df 100644 --- a/resources/views/Botanic/Admin/Genres/edit.blade.php +++ b/resources/views/admin/Botanic/Genres/edit.blade.php @@ -6,10 +6,10 @@ @section('content') - {{ Form::open(['route' => 'Botanic.Admin.Genres.store', 'id' => 'form', 'autocomplete' => 'off']) }} - + {{ Form::open(['route' => 'Admin.Botanic.Genres.store', 'id' => 'form', 'autocomplete' => 'off']) }} + - @include('Botanic.Admin.Genres.form') + @include('Admin.Botanic.Genres.form') diff --git a/resources/views/admin/Botanic/Genres/form.blade.php b/resources/views/admin/Botanic/Genres/form.blade.php new file mode 100644 index 00000000..8bafd6f0 --- /dev/null +++ b/resources/views/admin/Botanic/Genres/form.blade.php @@ -0,0 +1,43 @@ +
+
+ +
+
+ {{ Form::label('name', 'Nom') }} + @include('components.input', ['name' => 'name', 'value' => $genre['name'] ?? null, 'required' => true]) +
+
+ +
+
+ {{ Form::label('family', 'Famille') }} + @include('components.select', ['name' => 'family_id', 'list' => $families, 'value' => $genre['family_id'] ?? null, 'required' => false]) +
+
+ + +
+
+ {{ Form::label('alias', 'Alias') }} + @include('components.input', ['name' => 'alias', 'value' => $genre['alias'] ?? null, 'required' => false]) +
+
+ +
+
+ {{ Form::label('latin', 'Nom latin') }} + @include('components.input', ['name' => 'latin', 'value' => $genre['latin'] ?? null, 'required' => false]) +
+
+ +
+
+ {{ Form::label('description', 'Description') }} + @include('components.textarea', ['name' => 'description', 'value' => $genre['description'] ?? null, 'class' => 'editor', 'required' => false]) +
+
+ +
+
+ +@include('components.save') \ No newline at end of file diff --git a/resources/views/Botanic/Admin/Genres/list.blade.php b/resources/views/admin/Botanic/Genres/list.blade.php similarity index 69% rename from resources/views/Botanic/Admin/Genres/list.blade.php rename to resources/views/admin/Botanic/Genres/list.blade.php index 85fd8a58..7474e9bf 100644 --- a/resources/views/Botanic/Admin/Genres/list.blade.php +++ b/resources/views/admin/Botanic/Genres/list.blade.php @@ -6,7 +6,7 @@ @section('content') @component('components.card') - @include('components.datatable', ['route' => route('Botanic.Admin.Genres.index'), 'model' => 'genres']) + @include('components.datatable', ['route' => route('Admin.Botanic.Genres.index'), 'model' => 'genres']) @endcomponent @endsection diff --git a/resources/views/Botanic/Admin/Genres/show.blade.php b/resources/views/admin/Botanic/Genres/show.blade.php similarity index 100% rename from resources/views/Botanic/Admin/Genres/show.blade.php rename to resources/views/admin/Botanic/Genres/show.blade.php diff --git a/resources/views/Botanic/Admin/Species/create.blade.php b/resources/views/admin/Botanic/Species/create.blade.php similarity index 73% rename from resources/views/Botanic/Admin/Species/create.blade.php rename to resources/views/admin/Botanic/Species/create.blade.php index 346f53de..2528a538 100644 --- a/resources/views/Botanic/Admin/Species/create.blade.php +++ b/resources/views/admin/Botanic/Species/create.blade.php @@ -6,8 +6,8 @@ @section('content') - {{ Form::open(['route' => 'Botanic.Admin.Species.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} - @include('Botanic.Admin.Species.form') + {{ Form::open(['route' => 'Admin.Botanic.Species.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} + @include('Admin.Botanic.Species.form') @endsection diff --git a/resources/views/admin/Botanic/Species/edit.blade.php b/resources/views/admin/Botanic/Species/edit.blade.php new file mode 100644 index 00000000..d67fe89b --- /dev/null +++ b/resources/views/admin/Botanic/Species/edit.blade.php @@ -0,0 +1,14 @@ +@extends('layout.index', [ + 'title' => __('Botanic.species.title'), + 'subtitle' => __('Botanic.species.edit'), + 'breadcrumb' => [__('Botanic.species.title'), __('Botanic.species.list')] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Botanic.Species.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} + + @include('Admin.Botanic.Species.form') + + +@endsection diff --git a/resources/views/admin/Botanic/Species/form.blade.php b/resources/views/admin/Botanic/Species/form.blade.php new file mode 100644 index 00000000..d8b3fa8f --- /dev/null +++ b/resources/views/admin/Botanic/Species/form.blade.php @@ -0,0 +1,56 @@ +@include('boilerplate::load.fileinput') +@include('boilerplate::load.select2') +@include('boilerplate::load.tinymce') + +
+
+
+
+ {{ Form::label('name', 'Nom') }} + @include('components.input', ['name' => 'name', 'value' => $specie['name'] ?? null, 'required' => true]) +
+
+ {{ Form::label('latin', 'Nom latin') }} + @include('components.input', ['name' => 'latin', 'value' => $specie['latin'] ?? null, 'required' => false]) +
+
+ +
+
+ {{ Form::label('genre', 'Genre') }} + @include('components.select', ['name' => 'genre_id', 'list' => $genres, 'value' => $specie['genre_id'] ?? null, 'class' => 'select2', 'with_empty' => '', 'required' => false]) +
+
+ {{ Form::label('alias', 'Alias') }} + @include('components.input', ['name' => 'alias', 'value' => $specie['alias'] ?? null]) +
+
+ +
+
+ {{ Form::label('description', 'Description') }} + @include('components.textarea', ['name' => 'description', 'value' => $specie['description'] ?? null, 'class' => 'editor', 'required' => false]) +
+
+ +
+ +
+ {{ Form::label('photo', 'Photos') }} + @include('components.file', ['name' => 'name', 'value' => $specie['name'] ?? null]) +
+
+ +@include('components.save') + +@include('load.form.upload.fileinput') +@include('load.form.select2') + +@push('js') + +@endpush \ No newline at end of file diff --git a/resources/views/Botanic/Admin/Species/list.blade.php b/resources/views/admin/Botanic/Species/list.blade.php similarity index 69% rename from resources/views/Botanic/Admin/Species/list.blade.php rename to resources/views/admin/Botanic/Species/list.blade.php index 33faae64..25b59ad9 100644 --- a/resources/views/Botanic/Admin/Species/list.blade.php +++ b/resources/views/admin/Botanic/Species/list.blade.php @@ -6,7 +6,7 @@ @section('content') @component('components.card') - @include('components.datatable', ['route' => route('Botanic.Admin.Species.index'), 'model' => 'species']) + @include('components.datatable', ['route' => route('Admin.Botanic.Species.index'), 'model' => 'species']) @endcomponent @endsection diff --git a/resources/views/Botanic/Admin/Species/show.blade.php b/resources/views/admin/Botanic/Species/show.blade.php similarity index 100% rename from resources/views/Botanic/Admin/Species/show.blade.php rename to resources/views/admin/Botanic/Species/show.blade.php diff --git a/resources/views/Botanic/Admin/Varieties/create.blade.php b/resources/views/admin/Botanic/Varieties/create.blade.php similarity index 76% rename from resources/views/Botanic/Admin/Varieties/create.blade.php rename to resources/views/admin/Botanic/Varieties/create.blade.php index e86678b2..2aac8f62 100644 --- a/resources/views/Botanic/Admin/Varieties/create.blade.php +++ b/resources/views/admin/Botanic/Varieties/create.blade.php @@ -8,9 +8,9 @@ @section('content') - {{ Form::open(['route' => 'Botanic.Admin.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} + {{ Form::open(['route' => 'Admin.Botanic.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} - @include('Botanic.Admin.Varieties.form') + @include('Admin.Botanic.Varieties.form') @endsection diff --git a/resources/views/Botanic/Admin/Varieties/edit.blade.php b/resources/views/admin/Botanic/Varieties/edit.blade.php similarity index 77% rename from resources/views/Botanic/Admin/Varieties/edit.blade.php rename to resources/views/admin/Botanic/Varieties/edit.blade.php index 7903b8b7..9c8d7477 100644 --- a/resources/views/Botanic/Admin/Varieties/edit.blade.php +++ b/resources/views/admin/Botanic/Varieties/edit.blade.php @@ -6,9 +6,9 @@ @section('content') - {{ Form::open(['route' => 'Botanic.Admin.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} + {{ Form::open(['route' => 'Admin.Botanic.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }} - @include('Botanic.Admin.Varieties.form') + @include('Admin.Botanic.Varieties.form') @endsection diff --git a/resources/views/admin/Botanic/Varieties/form.blade.php b/resources/views/admin/Botanic/Varieties/form.blade.php new file mode 100644 index 00000000..38808cff --- /dev/null +++ b/resources/views/admin/Botanic/Varieties/form.blade.php @@ -0,0 +1,55 @@ +
+
+
+
+ {{ Form::label('name', 'Nom') }} + @include('components.input', ['name' => 'name', 'value' => $name ?? null, 'required' => true]) +
+
+ {{ Form::label('genre', 'Espèce') }} + @include('components.select', ['name' => 'specie_id', 'list' => $species, 'value' => $specie_id ?? null, 'class' => 'select2 form-control', 'with_empty' => '', 'required' => false]) +
+
+ +
+
+ {{ Form::label('tags', 'Tags') }} + @include('components.select-tree', ['name' => 'tags[]', 'list' => $tags_list, 'values' => $tags ?? null, 'class' => 'select2 form-control', 'multiple' => true]) +
+
+ +
+
+ {{ Form::label('description', 'Description') }} + @include('components.textarea', ['name' => 'description', 'value' => $description ?? null, 'class' => 'editor', 'rows' => 5, 'required' => false]) +
+
+ +
+ +
+ @include('components.uploader.widget', ['load_url' => route('Admin.Botanic.Varieties.getImages', ['id' => $id ?? false]), 'delete_url' => route('Admin.Botanic.Varieties.deleteImage'), 'name' => 'images']) +
+ +
+ +@include('components.save') + +@include('load.form.appender') +@include('load.form.editor') +@include('load.form.save') +@include('load.form.select2') +@include('load.layout.chevron') +@include('boilerplate::load.fileinput') +@include('boilerplate::load.tinymce') + +@push('js') + +@endpush \ No newline at end of file diff --git a/resources/views/Botanic/Admin/Varieties/list.blade.php b/resources/views/admin/Botanic/Varieties/list.blade.php similarity index 68% rename from resources/views/Botanic/Admin/Varieties/list.blade.php rename to resources/views/admin/Botanic/Varieties/list.blade.php index 8582eb20..18eab489 100644 --- a/resources/views/Botanic/Admin/Varieties/list.blade.php +++ b/resources/views/admin/Botanic/Varieties/list.blade.php @@ -6,7 +6,7 @@ @section('content') @component('components.card') - @include('components.datatable', ['route' => route('Botanic.Admin.Varieties.index'), 'model' => 'varieties']) + @include('components.datatable', ['route' => route('Admin.Botanic.Varieties.index'), 'model' => 'varieties']) @endcomponent @endsection diff --git a/resources/views/Botanic/Admin/Varieties/show.blade.php b/resources/views/admin/Botanic/Varieties/show.blade.php similarity index 100% rename from resources/views/Botanic/Admin/Varieties/show.blade.php rename to resources/views/admin/Botanic/Varieties/show.blade.php diff --git a/resources/views/admin/Core/App/Application/create.blade.php b/resources/views/admin/Core/App/Application/create.blade.php new file mode 100644 index 00000000..a1df72b6 --- /dev/null +++ b/resources/views/admin/Core/App/Application/create.blade.php @@ -0,0 +1,21 @@ +@extends('layout.index', [ + 'title' => __('countries.title'), + 'subtitle' => __('countries.add'), + 'breadcrumb' => [ + __('Country.title') => 'Admin.Country.index' + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Country.store', 'id' => 'country-form', 'autocomplete' => 'off']) }} + + @include('components.save') + + @component('components.card') + @include('admin.Country.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/App/Application/dashboard.blade.php b/resources/views/admin/Core/App/Application/dashboard.blade.php new file mode 100644 index 00000000..add932b1 --- /dev/null +++ b/resources/views/admin/Core/App/Application/dashboard.blade.php @@ -0,0 +1,12 @@ +@extends('layout.index', [ + 'title' => __('DueDiligence.distributors.title'), + 'subtitle' => __('DueDiligence.distributors.list'), + 'breadcrumb' => [__('DueDiligence.distributors.title')] +]) + +@section('content') + + @include('apps.DueDiligence.admin.Distributor.partials.dashboard') + +@endsection + diff --git a/resources/views/admin/Core/App/Application/edit.blade.php b/resources/views/admin/Core/App/Application/edit.blade.php new file mode 100644 index 00000000..36f051f5 --- /dev/null +++ b/resources/views/admin/Core/App/Application/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layout.index', [ + 'title' => __('countries.title'), + 'subtitle' => __('countries.edit'), + 'breadcrumb' => [ + __('countries.title') => 'Admin.Country.index' + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Country.store', 'id' => 'country-form', 'autocomplete' => 'off']) }} + + + + @include('components.save') + + @component('components.card') + @include('admin.Country.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/App/Application/exports/excel.blade.php b/resources/views/admin/Core/App/Application/exports/excel.blade.php new file mode 100644 index 00000000..c2ad0bcd --- /dev/null +++ b/resources/views/admin/Core/App/Application/exports/excel.blade.php @@ -0,0 +1,3 @@ + + @include('apps.DueDiligence.admin.Distributor.partials.table', ['logo2' => public_path('/storage/partner/fundglobam/images/logo.png') ]) + \ No newline at end of file diff --git a/resources/views/admin/Core/App/Application/exports/print.blade.php b/resources/views/admin/Core/App/Application/exports/print.blade.php new file mode 100644 index 00000000..fc1c0793 --- /dev/null +++ b/resources/views/admin/Core/App/Application/exports/print.blade.php @@ -0,0 +1,18 @@ + + + + + + + + + + @include('apps.DueDiligence.admin.Distributor.partials.table', ['logo' => '/storage/partner/fundglobam/images/logo.png']) + + + + + \ No newline at end of file diff --git a/resources/views/admin/Core/App/Application/form.blade.php b/resources/views/admin/Core/App/Application/form.blade.php new file mode 100644 index 00000000..54b7b4f5 --- /dev/null +++ b/resources/views/admin/Core/App/Application/form.blade.php @@ -0,0 +1,31 @@ +@include('load.form.select2') + +
+
+ {{ Form::label('name', __('name')) }} + @include('components.input-translate', ['name' => 'name', 'value' => $country['name'] ?? null, 'translations' => $country->translations['name'] ?? null, 'required' => true]) +
+
+ {{ Form::label('zone', __('zone')) }} + @include('components.select', ['name' => 'zone', 'value' => $country['zone_id'] ?? null, 'list' => $zones ?? null, 'required' => true]) +
+
+ +
+
+ {{ Form::label('name', __('region')) }} + @include('components.select', ['name' => 'region', 'value' => $country['region'] ?? null, 'list' => $regions ?? null, 'required' => true]) +
+
+ {{ Form::label('nale', __('subregion')) }} + @include('components.select', ['name' => 'zone', 'value' => $country['subregion'] ?? null, 'list' => $subregions ?? null, 'required' => true]) +
+
+ +@push('js') + +@endpush \ No newline at end of file diff --git a/resources/views/admin/Core/App/Application/index.blade.php b/resources/views/admin/Core/App/Application/index.blade.php new file mode 100644 index 00000000..34e27fca --- /dev/null +++ b/resources/views/admin/Core/App/Application/index.blade.php @@ -0,0 +1,57 @@ +@extends('layout.index', [ + 'title' => __('application.title'), + 'subtitle' => __('application.list'), + 'breadcrumb' => [ + ] +]) + +@include('load.form.select2') +@include('load.form.toggle') + + +@section('content') + + + +
+ +
+ @component('components.card') + @include('admin.Core.App.Application.partials.dashboard') + @endcomponent +
+ +
+ @component('components.card') + @include('components.datatable', ['route' => route('Admin.Core.App.Application.index'), 'model' => 'applications', 'with_filters' => true, 'with_exports' => true, 'callback' => 'handleApplication();']) + @endcomponent + + @component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-applications-filters']) + @include('admin.Core.App.Application.partials.filters', ['model' => 'applications']) + @endcomponent +
+ +
+ +@endsection + +@push('js') + +@endpush diff --git a/resources/views/admin/Core/App/Application/list.blade.php b/resources/views/admin/Core/App/Application/list.blade.php new file mode 100644 index 00000000..b92dd18c --- /dev/null +++ b/resources/views/admin/Core/App/Application/list.blade.php @@ -0,0 +1,31 @@ +

{{ __('documentation_types') }}

+ +@include('components.datatable', ['route' => route('Admin.DocumentationType.index'), 'model' => 'documentation_types', 'with_filters' => true, 'with_exports' => true, 'create_callback' => 'DocumentationTypeCreate();', 'edit_callback' => 'DocumentationTypeEdit(id);']) + +@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-documentation_types-filters']) + @include('apps.admin.DocumentationType.partials.filters', ['model' => 'documentation_types']) +@endcomponent + +@push('js') + +@endpush diff --git a/resources/views/admin/Core/App/Application/modal.blade.php b/resources/views/admin/Core/App/Application/modal.blade.php new file mode 100644 index 00000000..0a2bb705 --- /dev/null +++ b/resources/views/admin/Core/App/Application/modal.blade.php @@ -0,0 +1,76 @@ +{{ Form::open(['route' => 'DueDiligence.Admin.CountryParam.store', 'id' => 'country_param-form', 'autocomplete' => 'off', 'files' => true]) }} + + + + +
+
+ +
+
+ {{ Form::label('name', __('date')) }}
+ @include('components.form.datepicker', ['name' => 'date', 'value' => $country_param['date'] ?? null]) +
+
+ {{ Form::label('name', __('ope_rrai')) }}
+ @include('components.input', ['name' => 'rrai', 'value' => $country_param['rrai'] ?? null]) +
+
+ {{ Form::label('name', __('color')) }}
+ @include('components.select', ['name' => 'index', 'list' => App\Repositories\DueDiligence\CountryParams::getRiskColors(), 'value' => $country_param['index'] ?? null, 'with_empty' => '']) +
+
+ {{ Form::label('name', __('broken_arrows')) }}
+ @include('components.input', ['name' => 'broken', 'value' => $country_param['broken'] ?? null]) +
+
+ +
+
+ {{ Form::label('name', __('comments')) }}
+ @include('components.form.editor', ['name' => 'comments', 'value' => $country_param['comments'] ?? null]) +
+
+ +
+
+ @include('components.widgets.pdfPreview',['container' => 'country_param-file']) + + {{ Form::label('name', __('file')) }}
+ @include('components.file', ['name' => 'file', 'value' => $country_param['file'] ?? null]) +
+
+ + + + diff --git a/resources/views/Shop/Admin/Articles/partials/seo.blade.php b/resources/views/admin/Core/App/Application/partials/dashboard.blade.php similarity index 100% rename from resources/views/Shop/Admin/Articles/partials/seo.blade.php rename to resources/views/admin/Core/App/Application/partials/dashboard.blade.php diff --git a/resources/views/admin/Core/App/Application/partials/filters.blade.php b/resources/views/admin/Core/App/Application/partials/filters.blade.php new file mode 100644 index 00000000..b696f04d --- /dev/null +++ b/resources/views/admin/Core/App/Application/partials/filters.blade.php @@ -0,0 +1,2 @@ +
+
diff --git a/resources/views/admin/Core/App/Application/show.blade.php b/resources/views/admin/Core/App/Application/show.blade.php new file mode 100644 index 00000000..92265776 --- /dev/null +++ b/resources/views/admin/Core/App/Application/show.blade.php @@ -0,0 +1,16 @@ +@extends('layout.index', [ + 'title' => __('DueDiligence.distributors.title'), + 'subtitle' => __('DueDiligence.distributors.show'), + 'breadcrumb' => [ + __('DueDiligence.title') => 'DueDiligence.Admin.index', + __('DueDiligence.distributors.title') => 'DueDiligence.Admin.Distributor.index' + ] +]) + +@section('content') + + @component('components.card') + @include('apps.DueDiligence.admin.Distributor.form') + @endcomponent + +@endsection diff --git a/resources/views/admin/Core/App/ApplicationModule/create.blade.php b/resources/views/admin/Core/App/ApplicationModule/create.blade.php new file mode 100644 index 00000000..d595b4f9 --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/create.blade.php @@ -0,0 +1,21 @@ +@extends('layout.index', [ + 'title' => __('application_modules.title'), + 'subtitle' => __('application_modules.add'), + 'breadcrumb' => [ + __('Country.title') => 'Admin.Core.App.ApplicationModule.index' + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.App.ApplicationModule.store', 'id' => 'application_module-form', 'autocomplete' => 'off']) }} + + @include('components.save') + + @component('components.card') + @include('admin.Core.App.ApplicationModule.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/App/ApplicationModule/dashboard.blade.php b/resources/views/admin/Core/App/ApplicationModule/dashboard.blade.php new file mode 100644 index 00000000..add932b1 --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/dashboard.blade.php @@ -0,0 +1,12 @@ +@extends('layout.index', [ + 'title' => __('DueDiligence.distributors.title'), + 'subtitle' => __('DueDiligence.distributors.list'), + 'breadcrumb' => [__('DueDiligence.distributors.title')] +]) + +@section('content') + + @include('apps.DueDiligence.admin.Distributor.partials.dashboard') + +@endsection + diff --git a/resources/views/admin/Core/App/ApplicationModule/edit.blade.php b/resources/views/admin/Core/App/ApplicationModule/edit.blade.php new file mode 100644 index 00000000..259321af --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/edit.blade.php @@ -0,0 +1,24 @@ +@extends('layout.index', [ + 'title' => __('application_modules.title'), + 'subtitle' => __('application_modules.edit'), + 'breadcrumb' => [ + __('Application_Module.title') => 'Admin.Core.App.ApplicationModule.index' + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.App.ApplicationModule.store', 'id' => 'application_module-form', 'autocomplete' => 'off']) }} + + + + @include('components.save') + + @component('components.card') + @include('admin.Core.App.ApplicationModule.form') + @endcomponent + + + +@endsection + diff --git a/resources/views/admin/Core/App/ApplicationModule/exports/excel.blade.php b/resources/views/admin/Core/App/ApplicationModule/exports/excel.blade.php new file mode 100644 index 00000000..c2ad0bcd --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/exports/excel.blade.php @@ -0,0 +1,3 @@ + + @include('apps.DueDiligence.admin.Distributor.partials.table', ['logo2' => public_path('/storage/partner/fundglobam/images/logo.png') ]) + \ No newline at end of file diff --git a/resources/views/admin/Core/App/ApplicationModule/exports/print.blade.php b/resources/views/admin/Core/App/ApplicationModule/exports/print.blade.php new file mode 100644 index 00000000..fc1c0793 --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/exports/print.blade.php @@ -0,0 +1,18 @@ + + + + + + + + + + @include('apps.DueDiligence.admin.Distributor.partials.table', ['logo' => '/storage/partner/fundglobam/images/logo.png']) + + + + + \ No newline at end of file diff --git a/resources/views/admin/Core/App/ApplicationModule/form.blade.php b/resources/views/admin/Core/App/ApplicationModule/form.blade.php new file mode 100644 index 00000000..608a469d --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/form.blade.php @@ -0,0 +1,25 @@ +
+
+ {{ Form::label('name', __('application')) }} + @include('components.select', ['name' => 'application_id', 'value' => $application_module['application_id'] ?? null, 'list' => $applications, 'required' => true, 'with_empty' => '']) +
+
+ +
+
+ {{ Form::label('name', __('name')) }} + @include('components.input-translate', ['name' => 'name', 'value' => $application_module['name'] ?? null, 'translations' => $application_module->translations['name'] ?? null, 'required' => true]) +
+
+ +@include('load.form.select2') +@include('load.form.save') + +@push('js') + +@endpush \ No newline at end of file diff --git a/resources/views/admin/Core/App/ApplicationModule/index.blade.php b/resources/views/admin/Core/App/ApplicationModule/index.blade.php new file mode 100644 index 00000000..082f9bfb --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/index.blade.php @@ -0,0 +1,57 @@ +@extends('layout.index', [ + 'title' => __('application_module.title'), + 'subtitle' => __('application_module.list'), + 'breadcrumb' => [ + ] +]) + +@include('load.form.select2') +@include('load.form.toggle') + + +@section('content') + + + +
+ +
+ @component('components.card') + @include('admin.Core.App.ApplicationModule.partials.dashboard') + @endcomponent +
+ +
+ @component('components.card') + @include('components.datatable', ['route' => route('Admin.Core.App.ApplicationModule.index'), 'model' => 'application_modules', 'with_filters' => true, 'with_exports' => true, 'callback' => 'handleApplicationModule();']) + @endcomponent + + @component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-application_modules-filters']) + @include('admin.Core.App.ApplicationModule.partials.filters', ['model' => 'applications']) + @endcomponent +
+ +
+ +@endsection + +@push('js') + +@endpush diff --git a/resources/views/admin/Core/App/ApplicationModule/list.blade.php b/resources/views/admin/Core/App/ApplicationModule/list.blade.php new file mode 100644 index 00000000..b92dd18c --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/list.blade.php @@ -0,0 +1,31 @@ +

{{ __('documentation_types') }}

+ +@include('components.datatable', ['route' => route('Admin.DocumentationType.index'), 'model' => 'documentation_types', 'with_filters' => true, 'with_exports' => true, 'create_callback' => 'DocumentationTypeCreate();', 'edit_callback' => 'DocumentationTypeEdit(id);']) + +@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-documentation_types-filters']) + @include('apps.admin.DocumentationType.partials.filters', ['model' => 'documentation_types']) +@endcomponent + +@push('js') + +@endpush diff --git a/resources/views/admin/Core/App/ApplicationModule/modal.blade.php b/resources/views/admin/Core/App/ApplicationModule/modal.blade.php new file mode 100644 index 00000000..0a2bb705 --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/modal.blade.php @@ -0,0 +1,76 @@ +{{ Form::open(['route' => 'DueDiligence.Admin.CountryParam.store', 'id' => 'country_param-form', 'autocomplete' => 'off', 'files' => true]) }} + + + + +
+
+ +
+
+ {{ Form::label('name', __('date')) }}
+ @include('components.form.datepicker', ['name' => 'date', 'value' => $country_param['date'] ?? null]) +
+
+ {{ Form::label('name', __('ope_rrai')) }}
+ @include('components.input', ['name' => 'rrai', 'value' => $country_param['rrai'] ?? null]) +
+
+ {{ Form::label('name', __('color')) }}
+ @include('components.select', ['name' => 'index', 'list' => App\Repositories\DueDiligence\CountryParams::getRiskColors(), 'value' => $country_param['index'] ?? null, 'with_empty' => '']) +
+
+ {{ Form::label('name', __('broken_arrows')) }}
+ @include('components.input', ['name' => 'broken', 'value' => $country_param['broken'] ?? null]) +
+
+ +
+
+ {{ Form::label('name', __('comments')) }}
+ @include('components.form.editor', ['name' => 'comments', 'value' => $country_param['comments'] ?? null]) +
+
+ +
+
+ @include('components.widgets.pdfPreview',['container' => 'country_param-file']) + + {{ Form::label('name', __('file')) }}
+ @include('components.file', ['name' => 'file', 'value' => $country_param['file'] ?? null]) +
+
+ + + + diff --git a/resources/views/Shop/Admin/Articles/partials/shipping.blade.php b/resources/views/admin/Core/App/ApplicationModule/partials/dashboard.blade.php similarity index 100% rename from resources/views/Shop/Admin/Articles/partials/shipping.blade.php rename to resources/views/admin/Core/App/ApplicationModule/partials/dashboard.blade.php diff --git a/resources/views/admin/Core/App/ApplicationModule/partials/filters.blade.php b/resources/views/admin/Core/App/ApplicationModule/partials/filters.blade.php new file mode 100644 index 00000000..b696f04d --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/partials/filters.blade.php @@ -0,0 +1,2 @@ +
+
diff --git a/resources/views/admin/Core/App/ApplicationModule/show.blade.php b/resources/views/admin/Core/App/ApplicationModule/show.blade.php new file mode 100644 index 00000000..92265776 --- /dev/null +++ b/resources/views/admin/Core/App/ApplicationModule/show.blade.php @@ -0,0 +1,16 @@ +@extends('layout.index', [ + 'title' => __('DueDiligence.distributors.title'), + 'subtitle' => __('DueDiligence.distributors.show'), + 'breadcrumb' => [ + __('DueDiligence.title') => 'DueDiligence.Admin.index', + __('DueDiligence.distributors.title') => 'DueDiligence.Admin.Distributor.index' + ] +]) + +@section('content') + + @component('components.card') + @include('apps.DueDiligence.admin.Distributor.form') + @endcomponent + +@endsection diff --git a/resources/views/admin/Core/Auth/Permission/create.blade.php b/resources/views/admin/Core/Auth/Permission/create.blade.php new file mode 100644 index 00000000..72e2fa36 --- /dev/null +++ b/resources/views/admin/Core/Auth/Permission/create.blade.php @@ -0,0 +1,21 @@ +@extends('layout.index', [ + 'title' => __('Admin.permission.title'), + 'subtitle' => __('Admin.permission.add'), + 'breadcrumb' => [ + __('Admin.permission.title') => 'Admin.Core.Auth.Permission.index', + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.Auth.Permission.store', 'id' => 'form', 'autocomplete' => 'off']) }} + + @include('components.save') + + @component('components.card') + @include('admin.Core.Auth.Permission.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/Auth/Permission/edit.blade.php b/resources/views/admin/Core/Auth/Permission/edit.blade.php new file mode 100644 index 00000000..b239c86d --- /dev/null +++ b/resources/views/admin/Core/Auth/Permission/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layout.index', [ + 'title' => __('Admin.permission.title'), + 'subtitle' => __('Admin.permission.add'), + 'breadcrumb' => [ + __('Admin.permission.title') => 'Admin.Core.Auth.Permission.index', + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.Auth.Permission.store', 'id' => 'form', 'autocomplete' => 'off']) }} + + + + @include('components.save') + + @component('components.card') + @include('admin.Core.Auth.Permission.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/Auth/Permission/form.blade.php b/resources/views/admin/Core/Auth/Permission/form.blade.php new file mode 100644 index 00000000..71e413bc --- /dev/null +++ b/resources/views/admin/Core/Auth/Permission/form.blade.php @@ -0,0 +1,25 @@ +
+
+ + @include('components.select', ['name' => 'application_module_id', 'value' => $permission['application_module_id'] ?? null, 'list' => $application_modules ?? null]) +
+
+ +
+
+ + @include('components.input', ['name' => 'name', 'value' => $permission['name'] ?? null]) +
+
+ +@if (isset($roles) && count($roles)) + @include('admin.Core.Auth.User.roles') +@endif + +@include('load.form.save') + +@push('js') + +@endpush \ No newline at end of file diff --git a/resources/views/admin/Core/Auth/Permission/index.blade.php b/resources/views/admin/Core/Auth/Permission/index.blade.php new file mode 100644 index 00000000..608adbf3 --- /dev/null +++ b/resources/views/admin/Core/Auth/Permission/index.blade.php @@ -0,0 +1,20 @@ +@extends('layout.index', [ + 'title' => __('Permission.title'), + 'subtitle' => __('Permission.list'), + 'breadcrumb' => [ + __('Permission.title') => 'Admin.Core.Auth.Permission.index', + ] +]) + +@include('load.form.select2') + +@section('content') + @component('components.card') + @include('components.datatable', ['route' => route('Admin.Core.Auth.Permission.index'), 'model' => 'permissions']) + @endcomponent + + @component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-filters']) + @include('admin.Core.Auth.Permission.partials.filters') + @endcomponent + +@endsection diff --git a/resources/views/admin/Core/Auth/Permission/manage.blade.php b/resources/views/admin/Core/Auth/Permission/manage.blade.php new file mode 100644 index 00000000..1b539baa --- /dev/null +++ b/resources/views/admin/Core/Auth/Permission/manage.blade.php @@ -0,0 +1,55 @@ +
{{ $name }}
+ +
+
+
+
+ +
+
+

{{ __('informations') }}

+

{{ __('manage_clients_for_user') }}

+
+
+
+
+ +
+
+
+

+ + + {{ __('clients') }} + + {{ count($clients_selected) }} + + +
+ +
+

+ +
+
+
+ diff --git a/resources/views/admin/Core/Auth/Permission/partials/filters.blade.php b/resources/views/admin/Core/Auth/Permission/partials/filters.blade.php new file mode 100644 index 00000000..82e46b03 --- /dev/null +++ b/resources/views/admin/Core/Auth/Permission/partials/filters.blade.php @@ -0,0 +1,3 @@ +
+ +
diff --git a/resources/views/admin/Core/Auth/Permission/show.blade.php b/resources/views/admin/Core/Auth/Permission/show.blade.php new file mode 100644 index 00000000..2fdb5490 --- /dev/null +++ b/resources/views/admin/Core/Auth/Permission/show.blade.php @@ -0,0 +1,28 @@ +@extends('layout.index', [ + 'title' => __('families.title'), + 'subtitle' => __('families.title'), + 'breadcrumb' => [__('families.title')] +]) + +@section('content') + +
+ +
+ +
+
+
+

{{ name }}

+

+

+
+ +
+
+
+
+
+
+ +@endsection diff --git a/resources/views/admin/Core/Auth/Role/create.blade.php b/resources/views/admin/Core/Auth/Role/create.blade.php new file mode 100644 index 00000000..a09b90c1 --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/create.blade.php @@ -0,0 +1,21 @@ +@extends('layout.index', [ + 'title' => __('Admin.role.title'), + 'subtitle' => __('Admin.role.add'), + 'breadcrumb' => [ + __('Admin.role.title') => 'Admin.Core.Auth.Role.index', + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.Auth.Role.store', 'id' => 'form', 'autocomplete' => 'off']) }} + + @include('components.save') + + @component('components.card') + @include('admin.Core.Auth.Role.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/Auth/Role/edit.blade.php b/resources/views/admin/Core/Auth/Role/edit.blade.php new file mode 100644 index 00000000..2751719d --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layout.index', [ + 'title' => __('Admin.role.title'), + 'subtitle' => __('Admin.role.add'), + 'breadcrumb' => [ + __('Admin.role.title') => 'Admin.Core.Auth.Role.index', + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.Auth.Role.store', 'id' => 'form', 'autocomplete' => 'off']) }} + + + + @include('components.save') + + @component('components.card') + @include('admin.Core.Auth.Role.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/Auth/Role/form.blade.php b/resources/views/admin/Core/Auth/Role/form.blade.php new file mode 100644 index 00000000..7c6f013b --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/form.blade.php @@ -0,0 +1,20 @@ +
+ +
+ +
+
+ + +
+ @include('admin.Core.Auth.Role.table-permission') +
+ +@include('load.form.save') + +@push('js') + +@endpush \ No newline at end of file diff --git a/resources/views/admin/Core/Auth/Role/index.blade.php b/resources/views/admin/Core/Auth/Role/index.blade.php new file mode 100644 index 00000000..451c555c --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/index.blade.php @@ -0,0 +1,29 @@ +@extends('layout.index', [ + 'title' => __('Role.title'), + 'subtitle' => __('Role.list'), + 'breadcrumb' => [ + __('Role.title') => 'Admin.Core.Auth.Role.index', + ] +]) + +@include('load.form.select2') + +@section('content') + @component('components.card') + @include('components.datatable', ['route' => route('Admin.Core.Auth.Role.index'), 'model' => 'roles', 'callback' => 'handleRoleActive();']) + @endcomponent + + @component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-roles-filters']) + @include('admin.Core.Auth.Role.partials.filters') + @endcomponent +@endsection + +@include('load.form.toggle') + +@push('js') + +@endpush diff --git a/resources/views/admin/Core/Auth/Role/manage.blade.php b/resources/views/admin/Core/Auth/Role/manage.blade.php new file mode 100644 index 00000000..0acb00fc --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/manage.blade.php @@ -0,0 +1,47 @@ +
{{ $role->name }}
+ +
+
+
+
+ +
+
+

{{ __('Gestion des droits') }}

+
+
+
+
+ +
+
+ +
+ + + @foreach ($permissions as $app => $modules) + +
+ + @foreach ($modules as $module = $actions) +

{{ $module }}

+
+ @foreach ($actions as $permission) + + + @endforeach +
+ @endforeach + +
+ @endforeach +
+
+
+ diff --git a/resources/views/admin/Core/Auth/Role/partials/filters.blade.php b/resources/views/admin/Core/Auth/Role/partials/filters.blade.php new file mode 100644 index 00000000..82e46b03 --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/partials/filters.blade.php @@ -0,0 +1,3 @@ +
+ +
diff --git a/resources/views/admin/Core/Auth/Role/row-permission.blade.php b/resources/views/admin/Core/Auth/Role/row-permission.blade.php new file mode 100644 index 00000000..c4e8737b --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/row-permission.blade.php @@ -0,0 +1,15 @@ +@if (count($module['permissions'])) + + {{ $module['name'] }} + +
+ @foreach ($module['permissions'] as $permission) +
+ + +
+ @endforeach +
+ + +@endif \ No newline at end of file diff --git a/resources/views/admin/Core/Auth/Role/show.blade.php b/resources/views/admin/Core/Auth/Role/show.blade.php new file mode 100644 index 00000000..2fdb5490 --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/show.blade.php @@ -0,0 +1,28 @@ +@extends('layout.index', [ + 'title' => __('families.title'), + 'subtitle' => __('families.title'), + 'breadcrumb' => [__('families.title')] +]) + +@section('content') + +
+ +
+ +
+
+
+

{{ name }}

+

+

+
+ +
+
+
+
+
+
+ +@endsection diff --git a/resources/views/admin/Core/Auth/Role/table-permission.blade.php b/resources/views/admin/Core/Auth/Role/table-permission.blade.php new file mode 100644 index 00000000..60f1f9a8 --- /dev/null +++ b/resources/views/admin/Core/Auth/Role/table-permission.blade.php @@ -0,0 +1,13 @@ + + + + + + + + + @foreach ($modules as $module) + @include('admin.Core.Auth.Role.row-permission') + @endforeach + +
{{ __('module') }}{{ __('actions') }}
diff --git a/resources/views/admin/Core/Auth/Team/create.blade.php b/resources/views/admin/Core/Auth/Team/create.blade.php new file mode 100644 index 00000000..b06c0a8e --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/create.blade.php @@ -0,0 +1,21 @@ +@extends('layout.index', [ + 'title' => __('Admin.user.title'), + 'subtitle' => __('Admin.user.add'), + 'breadcrumb' => [ + __('Admin.user.title') => 'Admin.Core.Auth.User.index', + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.Auth.User.store', 'id' => 'form', 'autocomplete' => 'off']) }} + + @include('components.save') + + @component('components.card') + @include('admin.Core.Auth.User.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/Auth/Team/edit.blade.php b/resources/views/admin/Core/Auth/Team/edit.blade.php new file mode 100644 index 00000000..76de896c --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layout.index', [ + 'title' => __('Admin.user.title'), + 'subtitle' => __('Admin.user.add'), + 'breadcrumb' => [ + __('Admin.user.title') => 'Admin.Core.Auth.User.index', + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.Auth.User.store', 'id' => 'form', 'autocomplete' => 'off']) }} + + + + @include('components.save') + + @component('components.card') + @include('admin.Core.Auth.User.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/Auth/Team/form.blade.php b/resources/views/admin/Core/Auth/Team/form.blade.php new file mode 100644 index 00000000..0d4831d9 --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/form.blade.php @@ -0,0 +1,65 @@ +
+
+ +
+
+ + @include('components.input', ['name' => 'last_name', 'value' => $user['last_name'] ?? '']) +
+ +
+ + @include('components.input', ['name' => 'first_name', 'value' => $user['first_name'] ?? '']) +
+
+ +
+
+ + @include('components.input', ['name' => 'username', 'value' => $user['username'] ?? '']) +
+
+ + @include('components.password', ['name' => 'password']) +
+
+ +
+
+ + @include('components.input', ['name' => 'email', 'value' => $user['email'] ?? null]) +
+ +
+ + @include('components.input', ['name' => 'phone', 'value' => $user['phone'] ?? null]) +
+
+ +
+
+ + @include('components.select', ['name' => 'third_party_id', 'list' => $third_parties ?? null, 'value' => $third_party_id ?? null, 'with_empty' => true ]) +
+
+ + @include('components.select', ['name' => 'team_id', 'list' => $teams ?? null, 'value' => $team_id ?? null, 'with_empty' => true ]) +
+
+ + @include('components.select', ['name' => 'status_id', 'list' => $statuses ?? null, 'value' => $status_id ?? null, 'with_empty' => true ]) +
+
+ +
+ +
+
+ + +
+
+
+ +@include('admin.Core.Auth.User.roles') + diff --git a/resources/views/admin/Core/Auth/Team/form.twig b/resources/views/admin/Core/Auth/Team/form.twig new file mode 100644 index 00000000..a1cef42b --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/form.twig @@ -0,0 +1,23 @@ +
{{ name }}
+ +
+ + + + {{ include('Admin.elements.datatable.form-indication') }} + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
diff --git a/resources/views/admin/Core/Auth/Team/index.blade.php b/resources/views/admin/Core/Auth/Team/index.blade.php new file mode 100644 index 00000000..f7af4d18 --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/index.blade.php @@ -0,0 +1,20 @@ +@extends('layout.index', [ + 'title' => __('Team.title'), + 'subtitle' => __('Team.list'), + 'breadcrumb' => [ + __('Team.title') => 'Admin.Core.Auth.Team.index', + ] +]) + +@include('load.form.select2') + +@section('content') + @component('components.card') + @include('components.datatable', ['route' => route('Admin.Core.Auth.Team.index'), 'model' => 'users']) + @endcomponent + + @component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-filters']) + @include('admin.Core.Auth.Team.partials.filters') + @endcomponent + +@endsection diff --git a/resources/views/admin/Core/Auth/Team/manage.blade.php b/resources/views/admin/Core/Auth/Team/manage.blade.php new file mode 100644 index 00000000..1b539baa --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/manage.blade.php @@ -0,0 +1,55 @@ +
{{ $name }}
+ +
+
+
+
+ +
+
+

{{ __('informations') }}

+

{{ __('manage_clients_for_user') }}

+
+
+
+
+ +
+
+
+

+ + + {{ __('clients') }} + + {{ count($clients_selected) }} + + +
+ +
+

+ +
+
+
+ diff --git a/resources/views/admin/Core/Auth/Team/manage.twig b/resources/views/admin/Core/Auth/Team/manage.twig new file mode 100644 index 00000000..3fe4ef8b --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/manage.twig @@ -0,0 +1,82 @@ +{% import "macros.forms" as forms %} + +
{{ team.name }}
+ +
+
+
+
+ +
+
+

{{ translate('informations') }}

+

{{ translate('select_elements_of_your_choice_to_associate_with_the_selected_team') }}

+
+
+
+
+ +
+
+
+

+ + + {{ translate('entity') }} {{ team.third_parties|length }} + +
+ +
+

+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+ +
+
+
+

+ + + {{ translate('user_statuses') }} {{ team.roles|length }} + +
+ +
+

+ +
+
+
+ diff --git a/resources/views/admin/Core/Auth/Team/partials/filters.blade.php b/resources/views/admin/Core/Auth/Team/partials/filters.blade.php new file mode 100644 index 00000000..82e46b03 --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/partials/filters.blade.php @@ -0,0 +1,3 @@ +
+ +
diff --git a/resources/views/admin/Core/Auth/Team/show.blade.php b/resources/views/admin/Core/Auth/Team/show.blade.php new file mode 100644 index 00000000..2fdb5490 --- /dev/null +++ b/resources/views/admin/Core/Auth/Team/show.blade.php @@ -0,0 +1,28 @@ +@extends('layout.index', [ + 'title' => __('families.title'), + 'subtitle' => __('families.title'), + 'breadcrumb' => [__('families.title')] +]) + +@section('content') + +
+ +
+ +
+
+
+

{{ name }}

+

+

+
+ +
+
+
+
+
+
+ +@endsection diff --git a/resources/views/admin/Core/Auth/User/create.blade.php b/resources/views/admin/Core/Auth/User/create.blade.php new file mode 100644 index 00000000..b06c0a8e --- /dev/null +++ b/resources/views/admin/Core/Auth/User/create.blade.php @@ -0,0 +1,21 @@ +@extends('layout.index', [ + 'title' => __('Admin.user.title'), + 'subtitle' => __('Admin.user.add'), + 'breadcrumb' => [ + __('Admin.user.title') => 'Admin.Core.Auth.User.index', + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.Auth.User.store', 'id' => 'form', 'autocomplete' => 'off']) }} + + @include('components.save') + + @component('components.card') + @include('admin.Core.Auth.User.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/Auth/User/edit.blade.php b/resources/views/admin/Core/Auth/User/edit.blade.php new file mode 100644 index 00000000..76de896c --- /dev/null +++ b/resources/views/admin/Core/Auth/User/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layout.index', [ + 'title' => __('Admin.user.title'), + 'subtitle' => __('Admin.user.add'), + 'breadcrumb' => [ + __('Admin.user.title') => 'Admin.Core.Auth.User.index', + ] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Core.Auth.User.store', 'id' => 'form', 'autocomplete' => 'off']) }} + + + + @include('components.save') + + @component('components.card') + @include('admin.Core.Auth.User.form') + @endcomponent + + + +@endsection diff --git a/resources/views/admin/Core/Auth/User/form.blade.php b/resources/views/admin/Core/Auth/User/form.blade.php new file mode 100644 index 00000000..0d4831d9 --- /dev/null +++ b/resources/views/admin/Core/Auth/User/form.blade.php @@ -0,0 +1,65 @@ +
+
+ +
+
+ + @include('components.input', ['name' => 'last_name', 'value' => $user['last_name'] ?? '']) +
+ +
+ + @include('components.input', ['name' => 'first_name', 'value' => $user['first_name'] ?? '']) +
+
+ +
+
+ + @include('components.input', ['name' => 'username', 'value' => $user['username'] ?? '']) +
+
+ + @include('components.password', ['name' => 'password']) +
+
+ +
+
+ + @include('components.input', ['name' => 'email', 'value' => $user['email'] ?? null]) +
+ +
+ + @include('components.input', ['name' => 'phone', 'value' => $user['phone'] ?? null]) +
+
+ +
+
+ + @include('components.select', ['name' => 'third_party_id', 'list' => $third_parties ?? null, 'value' => $third_party_id ?? null, 'with_empty' => true ]) +
+
+ + @include('components.select', ['name' => 'team_id', 'list' => $teams ?? null, 'value' => $team_id ?? null, 'with_empty' => true ]) +
+
+ + @include('components.select', ['name' => 'status_id', 'list' => $statuses ?? null, 'value' => $status_id ?? null, 'with_empty' => true ]) +
+
+ +
+ +
+
+ + +
+
+
+ +@include('admin.Core.Auth.User.roles') + diff --git a/resources/views/admin/Core/Auth/User/index.blade.php b/resources/views/admin/Core/Auth/User/index.blade.php new file mode 100644 index 00000000..d9e014ae --- /dev/null +++ b/resources/views/admin/Core/Auth/User/index.blade.php @@ -0,0 +1,57 @@ +@extends('layout.index', [ + 'title' => __('User.title'), + 'subtitle' => __('User.list'), + 'breadcrumb' => [ + __('User.title') => 'Admin.Core.Auth.User.index', + ] +]) + +@include('load.form.select2') + +@section('content') + + @component('components.card') + @include('components.datatable', ['route' => route('Admin.Core.Auth.User.index'), 'model' => 'users', 'callback' => 'handleUser();', 'create_callback' => 'UserCreate();', 'edit_callback' => 'UserEdit(id);', 'with_filters' => true]) + @endcomponent + + @component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-users-filters']) + @include('admin.Core.Auth.User.partials.filters', ['model' => 'users']) + @endcomponent + +@endsection + +@include('load.layout.chevron') +@include('load.layout.modal') +@include('load.form.toggle') +@include('load.form.upload.upload') + +@push('js') + +@endpush diff --git a/resources/views/admin/Core/Auth/User/manage.blade.php b/resources/views/admin/Core/Auth/User/manage.blade.php new file mode 100644 index 00000000..1b539baa --- /dev/null +++ b/resources/views/admin/Core/Auth/User/manage.blade.php @@ -0,0 +1,55 @@ +
{{ $name }}
+ +
+
+
+
+ +
+
+

{{ __('informations') }}

+

{{ __('manage_clients_for_user') }}

+
+
+
+
+ +
+
+
+

+ + + {{ __('clients') }} + + {{ count($clients_selected) }} + + +
+ +
+

+ +
+
+
+ diff --git a/resources/views/admin/Core/Auth/User/modal.blade.php b/resources/views/admin/Core/Auth/User/modal.blade.php new file mode 100644 index 00000000..fd889ab5 --- /dev/null +++ b/resources/views/admin/Core/Auth/User/modal.blade.php @@ -0,0 +1,61 @@ +{{ Form::open(['route' => 'Admin.Core.Auth.User.store', 'id' => 'user-form', 'autocomplete' => 'off']) }} + + + +
+
+ +
+
+ + @include('components.input', ['name' => 'last_name', 'value' => $user['last_name'] ?? '']) +
+ +
+ + @include('components.input', ['name' => 'first_name', 'value' => $user['first_name'] ?? '']) +
+
+ +
+
+ + @include('components.input', ['name' => 'username', 'value' => $user['username'] ?? '']) +
+
+ + @include('components.password', ['name' => 'password']) +
+
+ +
+
+ + @include('components.input', ['name' => 'email', 'value' => $user['email'] ?? null]) +
+ +
+ + @include('components.input', ['name' => 'phone', 'value' => $user['phone'] ?? null]) +
+
+ +
+ +
+
+ + @include('components.file', ['name' => 'avatar']) +
+
+
+ + @include('admin.Core.Auth.User.roles') + + + + diff --git a/resources/views/admin/Core/Auth/User/modalProfile.blade.php b/resources/views/admin/Core/Auth/User/modalProfile.blade.php new file mode 100644 index 00000000..c86cba66 --- /dev/null +++ b/resources/views/admin/Core/Auth/User/modalProfile.blade.php @@ -0,0 +1,59 @@ +{{ Form::open(['route' => 'Admin.Core.Auth.User.store', 'id' => 'user-form', 'autocomplete' => 'off']) }} + + + +
+
+ +
+
+ + @include('components.input', ['name' => 'last_name', 'value' => $user['last_name'] ?? '']) +
+ +
+ + @include('components.input', ['name' => 'first_name', 'value' => $user['first_name'] ?? '']) +
+
+ +
+
+ + @include('components.input', ['name' => 'username', 'value' => $user['username'] ?? '']) +
+
+ + @include('components.password', ['name' => 'password']) +
+
+ +
+
+ + @include('components.input', ['name' => 'email', 'value' => $user['email'] ?? null]) +
+ +
+ + @include('components.input', ['name' => 'phone', 'value' => $user['phone'] ?? null]) +
+
+ +
+ +
+
+ + @include('components.file', ['name' => 'avatar']) +
+
+
+ + + + diff --git a/resources/views/admin/Core/Auth/User/partials/filters.blade.php b/resources/views/admin/Core/Auth/User/partials/filters.blade.php new file mode 100644 index 00000000..9caff2e9 --- /dev/null +++ b/resources/views/admin/Core/Auth/User/partials/filters.blade.php @@ -0,0 +1,3 @@ +
+ +
diff --git a/resources/views/admin/Core/Auth/User/partials/identifier.blade.php b/resources/views/admin/Core/Auth/User/partials/identifier.blade.php new file mode 100644 index 00000000..b3424235 --- /dev/null +++ b/resources/views/admin/Core/Auth/User/partials/identifier.blade.php @@ -0,0 +1,7 @@ + + + diff --git a/resources/views/admin/Core/Auth/User/partials/roles.blade.php b/resources/views/admin/Core/Auth/User/partials/roles.blade.php new file mode 100644 index 00000000..5297f5d4 --- /dev/null +++ b/resources/views/admin/Core/Auth/User/partials/roles.blade.php @@ -0,0 +1,3 @@ +@foreach ($roles as $role) + {{ $role->name }} +@endforeach \ No newline at end of file diff --git a/resources/views/admin/Core/Auth/User/roles.blade.php b/resources/views/admin/Core/Auth/User/roles.blade.php new file mode 100644 index 00000000..005ecbc9 --- /dev/null +++ b/resources/views/admin/Core/Auth/User/roles.blade.php @@ -0,0 +1,19 @@ +@if (App\Repositories\Core\Auth\Users::hasPermission('users_crud_*')) + + @component('components.layout.box-collapse', ['title' => __('roles'), 'id' => 'form-roles']) +
+
+ @foreach ($roles as $id => $role) +
+ @if (App\Repositories\Core\Auth\Users::hasPermission('users_crud_' . $role)) +
+ + +
+ @endif +
+ @endforeach +
+
+ @endcomponent +@endif diff --git a/resources/views/admin/Core/Auth/User/show.blade.php b/resources/views/admin/Core/Auth/User/show.blade.php new file mode 100644 index 00000000..2fdb5490 --- /dev/null +++ b/resources/views/admin/Core/Auth/User/show.blade.php @@ -0,0 +1,28 @@ +@extends('layout.index', [ + 'title' => __('families.title'), + 'subtitle' => __('families.title'), + 'breadcrumb' => [__('families.title')] +]) + +@section('content') + +
+ +
+ +
+
+
+

{{ name }}

+

+

+
+ +
+
+
+
+
+
+ +@endsection diff --git a/resources/views/admin/Shop/ArticleNatures/create.blade.php b/resources/views/admin/Shop/ArticleNatures/create.blade.php new file mode 100644 index 00000000..2d7c732b --- /dev/null +++ b/resources/views/admin/Shop/ArticleNatures/create.blade.php @@ -0,0 +1,15 @@ +@extends('layout.index', [ + 'title' => __('article_natures.title'), + 'subtitle' => __('article_natures.add'), + 'breadcrumb' => [__('article_natures.title'), __('article_natures.add')] +]) + +@include('boilerplate::load.fileinput') + +@section('content') + + {{ Form::open(['route' => 'Admin.Shop.ArticleNatures.store', 'id' => 'article-nature-form', 'autocomplete' => 'off', 'files' => true]) }} + @include('Admin.Shop.ArticleNatures.form') + + +@endsection diff --git a/resources/views/admin/Shop/ArticleNatures/edit.blade.php b/resources/views/admin/Shop/ArticleNatures/edit.blade.php new file mode 100644 index 00000000..131795dc --- /dev/null +++ b/resources/views/admin/Shop/ArticleNatures/edit.blade.php @@ -0,0 +1,16 @@ +@extends('layout.index', [ + 'title' => __('article_natures.title'), + 'subtitle' => __('article_natures.edit'), + 'breadcrumb' => [__('article_natures.title'), __('article_natures.edit')] +]) + +@include('boilerplate::load.fileinput') + +@section('content') + + {{ Form::open(['route' => 'Admin.Shop.ArticleNatures.update', 'id' => 'article-nature-form', 'autocomplete' => 'off', 'files' => true]) }} + + @include('Admin.Shop.ArticleNatures.form') + + +@endsection diff --git a/resources/views/Shop/Admin/ArticleFamilies/form.blade.php b/resources/views/admin/Shop/ArticleNatures/form.blade.php similarity index 59% rename from resources/views/Shop/Admin/ArticleFamilies/form.blade.php rename to resources/views/admin/Shop/ArticleNatures/form.blade.php index d6f1723e..98097bb1 100644 --- a/resources/views/Shop/Admin/ArticleFamilies/form.blade.php +++ b/resources/views/admin/Shop/ArticleNatures/form.blade.php @@ -3,10 +3,10 @@
{{ Form::label('name', 'Nom') }} - @include('components.input', ['name' => 'name', 'value' => (isset($family['name'])) ? $family['name'] : null, 'required' => true]) + @include('components.input', ['name' => 'name', 'value' => $article_nature['name'] ?? null, 'required' => true]) {{ Form::label('description', 'Description') }} - @include('components.textarea', ['name' => 'description', 'value' => isset($family['description']) ? $family['description'] : null, 'class' => 'editor', 'required' => false]) + @include('components.textarea', ['name' => 'description', 'value' => $article_nature['description'] ?? null, 'class' => 'editor', 'required' => false])
diff --git a/resources/views/admin/Shop/ArticleNatures/list.blade.php b/resources/views/admin/Shop/ArticleNatures/list.blade.php new file mode 100644 index 00000000..6011f9e0 --- /dev/null +++ b/resources/views/admin/Shop/ArticleNatures/list.blade.php @@ -0,0 +1,9 @@ +@extends('layout.index', [ + 'title' => __('Shop.article_natures.title'), + 'subtitle' => __('Shop.article_natures.list'), + 'breadcrumb' => [__('Shop.article_natures.title')] +]) + +@section('content') + @include('components.datatable', ['route' => route('Admin.Shop.ArticleNatures.index'), 'model' => 'article_natures']) +@endsection diff --git a/resources/views/Shop/Admin/ArticleFamilies/show.blade.php b/resources/views/admin/Shop/ArticleNatures/show.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleFamilies/show.blade.php rename to resources/views/admin/Shop/ArticleNatures/show.blade.php diff --git a/resources/views/Shop/Admin/Articles/create.blade.php b/resources/views/admin/Shop/Articles/create.blade.php similarity index 73% rename from resources/views/Shop/Admin/Articles/create.blade.php rename to resources/views/admin/Shop/Articles/create.blade.php index cbf56444..65414d33 100644 --- a/resources/views/Shop/Admin/Articles/create.blade.php +++ b/resources/views/admin/Shop/Articles/create.blade.php @@ -6,8 +6,8 @@ @section('content') - {{ Form::open(['route' => 'Shop.Admin.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }} - @include('Shop.Admin.Articles.form') + {{ Form::open(['route' => 'Admin.Shop.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }} + @include('Admin.Shop.Articles.form') @endsection diff --git a/resources/views/admin/Shop/Articles/edit.blade.php b/resources/views/admin/Shop/Articles/edit.blade.php new file mode 100644 index 00000000..abd9ff38 --- /dev/null +++ b/resources/views/admin/Shop/Articles/edit.blade.php @@ -0,0 +1,15 @@ +@extends('layout.index', [ + 'title' => __('Shop.articles.title'), + 'subtitle' => __('Shop.articles.edit'), + 'breadcrumb' => [__('Shop.articles.title'), __('Shop.articles.edit')] +]) + +@section('content') + + {{ Form::open(['route' => 'Admin.Shop.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }} + + + @include('Admin.Shop.Articles.form') + + +@endsection diff --git a/resources/views/Shop/Admin/Articles/form.blade.php b/resources/views/admin/Shop/Articles/form.blade.php similarity index 72% rename from resources/views/Shop/Admin/Articles/form.blade.php rename to resources/views/admin/Shop/Articles/form.blade.php index e08e1a18..e48043e0 100644 --- a/resources/views/Shop/Admin/Articles/form.blade.php +++ b/resources/views/admin/Shop/Articles/form.blade.php @@ -10,9 +10,9 @@