Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Remove activity log feature (#443)
Krzysztof Pajak42356996429a
diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/AddBrandCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/AddBrandCommandHandler.csindex 58b8d9404..9a72389e4 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/AddBrandCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/AddBrandCommandHandler.cs@@ -4,10 +4,8 @@ using Grand.Api.Extensions;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Brands;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Domain.Seo;-using Grand.Infrastructure;using MediatR;namespace Grand.Api.Commands.Handlers.Catalog@@ -17,26 +15,17 @@ namespace Grand.Api.Commands.Handlers.Catalogprivate readonly IBrandService _brandService;private readonly ISlugService _slugService;private readonly ILanguageService _languageService;- private readonly ICustomerActivityService _customerActivityService;- private readonly ITranslationService _translationService;- private readonly IWorkContext _workContext;private readonly SeoSettings _seoSettings;public AddBrandCommandHandler(IBrandService brandService,ISlugService slugService,ILanguageService languageService,- ICustomerActivityService customerActivityService,- ITranslationService translationService,- IWorkContext workContext,SeoSettings seoSettings){_brandService = brandService;_slugService = slugService;_languageService = languageService;- _customerActivityService = customerActivityService;- _translationService = translationService;- _workContext = workContext;_seoSettings = seoSettings;}@@ -51,9 +40,6 @@ namespace Grand.Api.Commands.Handlers.Catalogawait _brandService.UpdateBrand(brand);await _slugService.SaveSlug(brand, request.Model.SeName, "");- //activity log- _ = _customerActivityService.InsertActivity("AddNewBrand", brand.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.AddNewBrand"), brand.Name);-return brand.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/AddCategoryCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/AddCategoryCommandHandler.csindex 69b6aebb8..186f8cd59 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/AddCategoryCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/AddCategoryCommandHandler.cs@@ -4,7 +4,6 @@ using Grand.Api.Extensions;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Categories;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Domain.Seo;using Grand.Infrastructure;@@ -17,7 +16,6 @@ namespace Grand.Api.Commands.Handlers.Catalogprivate readonly ICategoryService _categoryService;private readonly ISlugService _slugService;private readonly ILanguageService _languageService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;private readonly SeoSettings _seoSettings;@@ -26,7 +24,6 @@ namespace Grand.Api.Commands.Handlers.CatalogICategoryService categoryService,ISlugService slugService,ILanguageService languageService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext,SeoSettings seoSettings)@@ -34,7 +31,6 @@ namespace Grand.Api.Commands.Handlers.Catalog_categoryService = categoryService;_slugService = slugService;_languageService = languageService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;_seoSettings = seoSettings;@@ -52,10 +48,6 @@ namespace Grand.Api.Commands.Handlers.Catalogawait _categoryService.UpdateCategory(category);await _slugService.SaveSlug(category, request.Model.SeName, "");- //activity log- _ = _customerActivityService.InsertActivity("AddNewCategory", category.Id, _workContext.CurrentCustomer, "",- _translationService.GetResource("ActivityLog.AddNewCategory"), category.Name);-return category.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/AddCollectionCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/AddCollectionCommandHandler.csindex 291f2e6ef..3db233741 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/AddCollectionCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/AddCollectionCommandHandler.cs@@ -4,7 +4,6 @@ using Grand.Api.Extensions;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Collections;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Domain.Seo;using Grand.Infrastructure;@@ -17,7 +16,6 @@ namespace Grand.Api.Commands.Handlers.Catalogprivate readonly ICollectionService _collectionService;private readonly ISlugService _slugService;private readonly ILanguageService _languageService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;private readonly SeoSettings _seoSettings;@@ -26,7 +24,6 @@ namespace Grand.Api.Commands.Handlers.CatalogICollectionService collectionService,ISlugService slugService,ILanguageService languageService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext,SeoSettings seoSettings)@@ -34,7 +31,6 @@ namespace Grand.Api.Commands.Handlers.Catalog_collectionService = collectionService;_slugService = slugService;_languageService = languageService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;_seoSettings = seoSettings;@@ -51,11 +47,6 @@ namespace Grand.Api.Commands.Handlers.Catalogawait _collectionService.UpdateCollection(collection);await _slugService.SaveSlug(collection, request.Model.SeName, "");- //activity log- _ = _customerActivityService.InsertActivity("AddNewCollection", collection.Id,- _workContext.CurrentCustomer, "",- _translationService.GetResource("ActivityLog.AddNewCollection"), collection.Name);-return collection.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/AddProductAttributeCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/AddProductAttributeCommandHandler.csindex 1e5acc7dc..fe1e8285d 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/AddProductAttributeCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/AddProductAttributeCommandHandler.cs@@ -3,7 +3,6 @@ using Grand.Api.DTOs.Catalog;using Grand.Api.Extensions;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -12,18 +11,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class AddProductAttributeCommandHandler : IRequestHandler<AddProductAttributeCommand, ProductAttributeDto>{private readonly IProductAttributeService _productAttributeService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public AddProductAttributeCommandHandler(IProductAttributeService productAttributeService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_productAttributeService = productAttributeService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -31,13 +27,8 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic async Task<ProductAttributeDto> Handle(AddProductAttributeCommand request, CancellationToken cancellationToken){var productAttribute = request.Model.ToEntity();-await _productAttributeService.InsertProductAttribute(productAttribute);- //activity log- _ = _customerActivityService.InsertActivity("AddNewProductAttribute",- productAttribute.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.AddNewProductAttribute"), productAttribute.Name);-return productAttribute.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/AddProductCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/AddProductCommandHandler.csindex 50bc9c744..747473e03 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/AddProductCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/AddProductCommandHandler.cs@@ -4,7 +4,6 @@ using Grand.Api.Extensions;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Domain.Seo;using Grand.Infrastructure;@@ -16,7 +15,6 @@ namespace Grand.Api.Commands.Handlers.Catalog{private readonly IProductService _productService;private readonly ISlugService _slugService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly ILanguageService _languageService;private readonly IWorkContext _workContext;@@ -26,7 +24,6 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic AddProductCommandHandler(IProductService productService,ISlugService slugService,- ICustomerActivityService customerActivityService,ITranslationService translationService,ILanguageService languageService,IWorkContext workContext,@@ -34,7 +31,6 @@ namespace Grand.Api.Commands.Handlers.Catalog{_productService = productService;_slugService = slugService;- _customerActivityService = customerActivityService;_translationService = translationService;_languageService = languageService;_workContext = workContext;@@ -54,9 +50,6 @@ namespace Grand.Api.Commands.Handlers.Catalogawait _slugService.SaveSlug(product, request.Model.SeName, "");await _productService.UpdateProduct(product);- //activity log- _ = _customerActivityService.InsertActivity("AddNewProduct", product.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.AddNewProduct"), product.Name);-return product.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/AddSpecificationAttributeCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/AddSpecificationAttributeCommandHandler.csindex 9d823d18b..f50ccfb6d 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/AddSpecificationAttributeCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/AddSpecificationAttributeCommandHandler.cs@@ -3,7 +3,6 @@ using Grand.Api.DTOs.Catalog;using Grand.Api.Extensions;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -12,18 +11,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class AddSpecificationAttributeCommandHandler : IRequestHandler<AddSpecificationAttributeCommand, SpecificationAttributeDto>{private readonly ISpecificationAttributeService _specificationAttributeService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public AddSpecificationAttributeCommandHandler(ISpecificationAttributeService specificationAttributeService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_specificationAttributeService = specificationAttributeService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -33,9 +29,6 @@ namespace Grand.Api.Commands.Handlers.Catalogvar specificationAttribute = request.Model.ToEntity();await _specificationAttributeService.InsertSpecificationAttribute(specificationAttribute);- //activity log- _ = _customerActivityService.InsertActivity("AddNewSpecAttribute", specificationAttribute.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.AddNewSpecAttribute"), specificationAttribute.Name);-return specificationAttribute.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteBrandCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteBrandCommandHandler.csindex 5fa29a2a9..3dfc4e558 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteBrandCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteBrandCommandHandler.cs@@ -1,7 +1,6 @@using Grand.Api.Commands.Models.Catalog;using Grand.Business.Core.Interfaces.Catalog.Brands;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -10,18 +9,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class DeleteBrandCommandHandler : IRequestHandler<DeleteBrandCommand, bool>{private readonly IBrandService _brandService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public DeleteBrandCommandHandler(IBrandService brandService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_brandService = brandService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -32,9 +28,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (brand != null){await _brandService.DeleteBrand(brand);-- //activity log- _ = _customerActivityService.InsertActivity("DeleteBrand", brand.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.DeleteBrand"), brand.Name);}return true;}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteCategoryCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteCategoryCommandHandler.csindex a14235b20..51b1c8511 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteCategoryCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteCategoryCommandHandler.cs@@ -1,7 +1,6 @@using Grand.Api.Commands.Models.Catalog;using Grand.Business.Core.Interfaces.Catalog.Categories;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -10,18 +9,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class DeleteCategoryCommandHandler : IRequestHandler<DeleteCategoryCommand, bool>{private readonly ICategoryService _categoryService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public DeleteCategoryCommandHandler(ICategoryService categoryService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_categoryService = categoryService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -32,9 +28,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (category != null){await _categoryService.DeleteCategory(category);-- //activity log- _ = _customerActivityService.InsertActivity("DeleteCategory", category.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.DeleteCategory"), category.Name);}return true;}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteCollectionCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteCollectionCommandHandler.csindex aaf58a2f0..a0ff756a5 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteCollectionCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteCollectionCommandHandler.cs@@ -1,7 +1,6 @@using Grand.Api.Commands.Models.Catalog;using Grand.Business.Core.Interfaces.Catalog.Collections;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -10,18 +9,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class DeleteCollectionCommandHandler : IRequestHandler<DeleteCollectionCommand, bool>{private readonly ICollectionService _collectionService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public DeleteCollectionCommandHandler(ICollectionService collectionService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_collectionService = collectionService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -32,9 +28,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (collection != null){await _collectionService.DeleteCollection(collection);-- //activity log- _ = _customerActivityService.InsertActivity("DeleteCollection", collection.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.DeleteCollection"), collection.Name);}return true;}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteProductAttributeCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteProductAttributeCommandHandler.csindex de944e25c..66ce48931 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteProductAttributeCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteProductAttributeCommandHandler.cs@@ -1,7 +1,6 @@using Grand.Api.Commands.Models.Catalog;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -10,18 +9,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class DeleteProductAttributeCommandHandler : IRequestHandler<DeleteProductAttributeCommand, bool>{private readonly IProductAttributeService _productAttributeService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public DeleteProductAttributeCommandHandler(IProductAttributeService productAttributeService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_productAttributeService = productAttributeService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -32,10 +28,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (productAttribute != null){await _productAttributeService.DeleteProductAttribute(productAttribute);- //activity log- _ = _customerActivityService.InsertActivity("DeleteProductAttribute", productAttribute.Id,- _workContext.CurrentCustomer, "",- _translationService.GetResource("ActivityLog.DeleteProductAttribute"), productAttribute.Name);}return true;}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteProductCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteProductCommandHandler.csindex 7bee2faf2..81aeef821 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteProductCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteProductCommandHandler.cs@@ -1,7 +1,6 @@using Grand.Api.Commands.Models.Catalog;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -10,18 +9,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class DeleteProductCommandHandler : IRequestHandler<DeleteProductCommand, bool>{private readonly IProductService _productService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public DeleteProductCommandHandler(IProductService productService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_productService = productService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -32,11 +28,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (product != null){await _productService.DeleteProduct(product);-- //activity log- _ = _customerActivityService.InsertActivity("DeleteProduct", product.Id,- _workContext.CurrentCustomer, "",- _translationService.GetResource("ActivityLog.DeleteProduct"), product.Name);}return true;}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteSpecificationAttributeCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteSpecificationAttributeCommandHandler.csindex bd1154acd..548be3d76 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteSpecificationAttributeCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/DeleteSpecificationAttributeCommandHandler.cs@@ -1,7 +1,6 @@using Grand.Api.Commands.Models.Catalog;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -10,18 +9,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class DeleteSpecificationAttributeCommandHandler : IRequestHandler<DeleteSpecificationAttributeCommand, bool>{private readonly ISpecificationAttributeService _specificationAttributeService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public DeleteSpecificationAttributeCommandHandler(ISpecificationAttributeService specificationAttributeService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_specificationAttributeService = specificationAttributeService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -32,10 +28,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (specificationAttribute != null){await _specificationAttributeService.DeleteSpecificationAttribute(specificationAttribute);- //activity log- _ = _customerActivityService.InsertActivity("DeleteSpecAttribute", specificationAttribute.Id,- _workContext.CurrentCustomer, "",- _translationService.GetResource("ActivityLog.DeleteSpecAttribute"), specificationAttribute.Name);}return true;}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateBrandCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateBrandCommandHandler.csindex 31020240d..1ac0274af 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateBrandCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateBrandCommandHandler.cs@@ -4,7 +4,6 @@ using Grand.Api.Extensions;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Brands;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Seo;@@ -18,7 +17,6 @@ namespace Grand.Api.Commands.Handlers.Catalogprivate readonly IBrandService _brandService;private readonly ISlugService _slugService;private readonly ILanguageService _languageService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IPictureService _pictureService;private readonly IWorkContext _workContext;@@ -29,7 +27,6 @@ namespace Grand.Api.Commands.Handlers.CatalogIBrandService brandService,ISlugService slugService,ILanguageService languageService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IPictureService pictureService,IWorkContext workContext,@@ -38,7 +35,6 @@ namespace Grand.Api.Commands.Handlers.Catalog_brandService = brandService;_slugService = slugService;_languageService = languageService;- _customerActivityService = customerActivityService;_translationService = translationService;_pictureService = pictureService;_workContext = workContext;@@ -71,9 +67,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (picture != null)await _pictureService.SetSeoFilename(picture, _pictureService.GetPictureSeName(brand.Name));}- //activity log- _ = _customerActivityService.InsertActivity("EditBrand", brand.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditBrand"), brand.Name);-return brand.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCategoryCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCategoryCommandHandler.csindex d5809e578..b581b3a4c 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCategoryCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCategoryCommandHandler.cs@@ -4,7 +4,6 @@ using Grand.Api.Extensions;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Categories;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Seo;@@ -18,7 +17,6 @@ namespace Grand.Api.Commands.Handlers.Catalogprivate readonly ICategoryService _categoryService;private readonly ISlugService _slugService;private readonly ILanguageService _languageService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IPictureService _pictureService;private readonly IWorkContext _workContext;@@ -29,7 +27,6 @@ namespace Grand.Api.Commands.Handlers.CatalogICategoryService categoryService,ISlugService slugService,ILanguageService languageService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IPictureService pictureService,IWorkContext workContext,@@ -38,7 +35,6 @@ namespace Grand.Api.Commands.Handlers.Catalog_categoryService = categoryService;_slugService = slugService;_languageService = languageService;- _customerActivityService = customerActivityService;_translationService = translationService;_pictureService = pictureService;_workContext = workContext;@@ -58,7 +54,7 @@ namespace Grand.Api.Commands.Handlers.Catalogawait _slugService.SaveSlug(category, request.Model.SeName, "");await _categoryService.UpdateCategory(category);//delete an old picture (if deleted or updated)- if (!String.IsNullOrEmpty(prevPictureId) && prevPictureId != category.PictureId)+ if (!string.IsNullOrEmpty(prevPictureId) && prevPictureId != category.PictureId){var prevPicture = await _pictureService.GetPictureById(prevPictureId);if (prevPicture != null)@@ -71,8 +67,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (picture != null)await _pictureService.SetSeoFilename(picture, _pictureService.GetPictureSeName(category.Name));}- //activity log- _ = _customerActivityService.InsertActivity("EditCategory", category.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditCategory"), category.Name);return category.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCollectionCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCollectionCommandHandler.csindex 1a185c3ec..cf0c7b1da 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCollectionCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCollectionCommandHandler.cs@@ -4,7 +4,6 @@ using Grand.Api.Extensions;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Collections;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Seo;@@ -18,7 +17,6 @@ namespace Grand.Api.Commands.Handlers.Catalogprivate readonly ICollectionService _collectionService;private readonly ISlugService _slugService;private readonly ILanguageService _languageService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IPictureService _pictureService;private readonly IWorkContext _workContext;@@ -29,7 +27,6 @@ namespace Grand.Api.Commands.Handlers.CatalogICollectionService collectionService,ISlugService slugService,ILanguageService languageService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IPictureService pictureService,IWorkContext workContext,@@ -38,7 +35,6 @@ namespace Grand.Api.Commands.Handlers.Catalog_collectionService = collectionService;_slugService = slugService;_languageService = languageService;- _customerActivityService = customerActivityService;_translationService = translationService;_pictureService = pictureService;_workContext = workContext;@@ -71,9 +67,6 @@ namespace Grand.Api.Commands.Handlers.Catalogif (picture != null)await _pictureService.SetSeoFilename(picture, _pictureService.GetPictureSeName(collection.Name));}- //activity log- _ = _customerActivityService.InsertActivity("EditCollection", collection.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditCollection"), collection.Name);-return collection.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductAttributeCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductAttributeCommandHandler.csindex 221ceac7e..07510c0ab 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductAttributeCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductAttributeCommandHandler.cs@@ -3,7 +3,6 @@ using Grand.Api.DTOs.Catalog;using Grand.Api.Extensions;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -12,18 +11,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class UpdateProductAttributeCommandHandler : IRequestHandler<UpdateProductAttributeCommand, ProductAttributeDto>{private readonly IProductAttributeService _productAttributeService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public UpdateProductAttributeCommandHandler(IProductAttributeService productAttributeService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_productAttributeService = productAttributeService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -35,11 +31,6 @@ namespace Grand.Api.Commands.Handlers.CatalogproductAttribute = request.Model.ToEntity(productAttribute);await _productAttributeService.UpdateProductAttribute(productAttribute);- //activity log- _ = _customerActivityService.InsertActivity("EditProductAttribute", productAttribute.Id,- _workContext.CurrentCustomer, "",- _translationService.GetResource("ActivityLog.EditProductAttribute"), productAttribute.Name);-return productAttribute.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductCommandHandler.csindex 6b17aee64..9efdbe72c 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductCommandHandler.cs@@ -5,7 +5,6 @@ using Grand.Business.Core.Events.Catalog;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Domain.Catalog;using Grand.Domain.Seo;@@ -19,7 +18,6 @@ namespace Grand.Api.Commands.Handlers.Catalogprivate readonly IProductService _productService;private readonly IStockQuantityService _stockQuantityService;private readonly ISlugService _slugService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly ILanguageService _languageService;private readonly IOutOfStockSubscriptionService _outOfStockSubscriptionService;@@ -31,7 +29,6 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic UpdateProductCommandHandler(IProductService productService,ISlugService slugService,- ICustomerActivityService customerActivityService,ITranslationService translationService,ILanguageService languageService,IOutOfStockSubscriptionService outOfStockSubscriptionService,@@ -42,7 +39,6 @@ namespace Grand.Api.Commands.Handlers.Catalog{_productService = productService;_slugService = slugService;- _customerActivityService = customerActivityService;_translationService = translationService;_languageService = languageService;_outOfStockSubscriptionService = outOfStockSubscriptionService;@@ -77,9 +73,6 @@ namespace Grand.Api.Commands.Handlers.Catalogawait _outOfStockSubscriptionService.SendNotificationsToSubscribers(product, "");}- //activity log- _ = _customerActivityService.InsertActivity("EditProduct", product.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditProduct"), product.Name);-switch (prevPublished){//raise eventdiff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductStockCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductStockCommandHandler.csindex 58214ea8f..cf322866d 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductStockCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductStockCommandHandler.cs@@ -1,7 +1,6 @@using Grand.Api.Commands.Models.Catalog;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Domain.Catalog;using Grand.Infrastructure;using MediatR;@@ -13,7 +12,6 @@ namespace Grand.Api.Commands.Handlers.Catalogprivate readonly IProductService _productService;private readonly IInventoryManageService _inventoryManageService;private readonly IStockQuantityService _stockQuantityService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IOutOfStockSubscriptionService _outOfStockSubscriptionService;private readonly IWorkContext _workContext;@@ -22,7 +20,6 @@ namespace Grand.Api.Commands.Handlers.CatalogIProductService productService,IInventoryManageService inventoryManageService,IStockQuantityService stockQuantityService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IOutOfStockSubscriptionService outOfStockSubscriptionService,IWorkContext workContext)@@ -30,7 +27,6 @@ namespace Grand.Api.Commands.Handlers.Catalog_productService = productService;_inventoryManageService = inventoryManageService;_stockQuantityService = stockQuantityService;- _customerActivityService = customerActivityService;_translationService = translationService;_outOfStockSubscriptionService = outOfStockSubscriptionService;_workContext = workContext;@@ -80,10 +76,6 @@ namespace Grand.Api.Commands.Handlers.Catalog}}await OutOfStockNotifications(product, prevStockQuantity, prevMultiWarehouseStock);-- //activity log- _ = _customerActivityService.InsertActivity("EditProduct", product.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditProduct"), product.Name);-}return true;}diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateSpecificationAttributeCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateSpecificationAttributeCommandHandler.csindex 05264fc0a..f868b737e 100644--- a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateSpecificationAttributeCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateSpecificationAttributeCommandHandler.cs@@ -3,7 +3,6 @@ using Grand.Api.DTOs.Catalog;using Grand.Api.Extensions;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -12,18 +11,15 @@ namespace Grand.Api.Commands.Handlers.Catalogpublic class UpdateSpecificationAttributeCommandHandler : IRequestHandler<UpdateSpecificationAttributeCommand, SpecificationAttributeDto>{private readonly ISpecificationAttributeService _specificationAttributeService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public UpdateSpecificationAttributeCommandHandler(ISpecificationAttributeService specificationAttributeService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_specificationAttributeService = specificationAttributeService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -40,12 +36,6 @@ namespace Grand.Api.Commands.Handlers.Catalog}specificationAttribute = request.Model.ToEntity(specificationAttribute);await _specificationAttributeService.UpdateSpecificationAttribute(specificationAttribute);-- //activity log- _ = _customerActivityService.InsertActivity("EditSpecAttribute",- specificationAttribute.Id, _workContext.CurrentCustomer, "",- _translationService.GetResource("ActivityLog.EditSpecAttribute"), specificationAttribute.Name);-return specificationAttribute.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Customers/AddCustomerCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Customers/AddCustomerCommandHandler.csindex 86eb3f787..912375b0e 100644--- a/src/API/Grand.Api/Commands/Handlers/Customers/AddCustomerCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Customers/AddCustomerCommandHandler.cs@@ -3,7 +3,6 @@ using Grand.Api.DTOs.Customers;using Grand.Api.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Domain.Customers;using Grand.Infrastructure;@@ -15,7 +14,6 @@ namespace Grand.Api.Commands.Handlers.Customers{private readonly ICustomerService _customerService;private readonly IGroupService _groupService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IUserFieldService _userFieldsService;private readonly IWorkContext _workContext;@@ -23,14 +21,12 @@ namespace Grand.Api.Commands.Handlers.Customerspublic AddCustomerCommandHandler(ICustomerService customerService,IGroupService groupService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IUserFieldService userFieldsService,IWorkContext workContext){_customerService = customerService;_groupService = groupService;- _customerActivityService = customerActivityService;_translationService = translationService;_userFieldsService = userFieldsService;_workContext = workContext;@@ -47,9 +43,7 @@ namespace Grand.Api.Commands.Handlers.Customersawait _customerService.InsertCustomer(customer);await SaveCustomerAttributes(request.Model, customer);await SaveCustomerGroups(request.Model, customer);-- //activity log- _ = _customerActivityService.InsertActivity("AddNewCustomer", customer.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.AddNewCustomer"), customer.Id);+return customer.ToModel();}diff --git a/src/API/Grand.Api/Commands/Handlers/Customers/AddCustomerGroupCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Customers/AddCustomerGroupCommandHandler.csindex 035edf6fa..f4fcdcf03 100644--- a/src/API/Grand.Api/Commands/Handlers/Customers/AddCustomerGroupCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Customers/AddCustomerGroupCommandHandler.cs@@ -3,7 +3,6 @@ using Grand.Api.DTOs.Customers;using Grand.Api.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -12,18 +11,15 @@ namespace Grand.Api.Commands.Handlers.Customerspublic class AddCustomerGroupCommandHandler : IRequestHandler<AddCustomerGroupCommand, CustomerGroupDto>{private readonly IGroupService _groupService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public AddCustomerGroupCommandHandler(IGroupService groupService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_groupService = groupService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -33,9 +29,6 @@ namespace Grand.Api.Commands.Handlers.Customersvar customergroup = request.Model.ToEntity();await _groupService.InsertCustomerGroup(customergroup);- //activity log- _ = _customerActivityService.InsertActivity("AddNewCustomerGroup", customergroup.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.AddNewCustomerGroup"), customergroup.Name);-return customergroup.ToModel();}}diff --git a/src/API/Grand.Api/Commands/Handlers/Customers/DeleteCustomerCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Customers/DeleteCustomerCommandHandler.csindex 1df443a72..6d5fbb8d5 100644--- a/src/API/Grand.Api/Commands/Handlers/Customers/DeleteCustomerCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Customers/DeleteCustomerCommandHandler.cs@@ -1,6 +1,5 @@using Grand.Api.Commands.Models.Customers;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Infrastructure;using MediatR;@@ -10,18 +9,15 @@ namespace Grand.Api.Commands.Handlers.Customerspublic class DeleteCustomerCommandHandler : IRequestHandler<DeleteCustomerCommand, bool>{private readonly ICustomerService _customerService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public DeleteCustomerCommandHandler(ICustomerService customerService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_customerService = customerService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -32,8 +28,6 @@ namespace Grand.Api.Commands.Handlers.Customersif (customer != null){await _customerService.DeleteCustomer(customer);- //activity log- _ = _customerActivityService.InsertActivity("DeleteCustomer", customer.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.DeleteCustomer"), customer.Id);}return true;diff --git a/src/API/Grand.Api/Commands/Handlers/Customers/DeleteCustomerGroupCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Customers/DeleteCustomerGroupCommandHandler.csindex 2c45b57ec..26454e2b2 100644--- a/src/API/Grand.Api/Commands/Handlers/Customers/DeleteCustomerGroupCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Customers/DeleteCustomerGroupCommandHandler.cs@@ -1,7 +1,6 @@using Grand.Api.Commands.Models.Customers;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -10,18 +9,15 @@ namespace Grand.Api.Commands.Handlers.Customerspublic class DeleteCustomerGroupCommandHandler : IRequestHandler<DeleteCustomerGroupCommand, bool>{private readonly IGroupService _groupService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public DeleteCustomerGroupCommandHandler(IGroupService groupService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_groupService = groupService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -32,9 +28,6 @@ namespace Grand.Api.Commands.Handlers.Customersif (customerGroup != null){await _groupService.DeleteCustomerGroup(customerGroup);-- //activity log- _ = _customerActivityService.InsertActivity("DeleteCustomerGroup", customerGroup.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.DeleteCustomerGroup"), customerGroup.Name);}return true;}diff --git a/src/API/Grand.Api/Commands/Handlers/Customers/UpdateCustomerCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Customers/UpdateCustomerCommandHandler.csindex 4af527b92..e0c58c521 100644--- a/src/API/Grand.Api/Commands/Handlers/Customers/UpdateCustomerCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Customers/UpdateCustomerCommandHandler.cs@@ -3,7 +3,6 @@ using Grand.Api.DTOs.Customers;using Grand.Api.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Domain.Customers;using Grand.Infrastructure;@@ -15,7 +14,6 @@ namespace Grand.Api.Commands.Handlers.Customers{private readonly ICustomerService _customerService;private readonly IGroupService _groupService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IUserFieldService _userFieldsService;private readonly IWorkContext _workContext;@@ -23,14 +21,12 @@ namespace Grand.Api.Commands.Handlers.Customerspublic UpdateCustomerCommandHandler(ICustomerService customerService,IGroupService groupService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IUserFieldService userFieldsService,IWorkContext workContext){_customerService = customerService;_groupService = groupService;- _customerActivityService = customerActivityService;_translationService = translationService;_userFieldsService = userFieldsService;_workContext = workContext;@@ -43,10 +39,6 @@ namespace Grand.Api.Commands.Handlers.Customersawait _customerService.UpdateCustomer(customer);await SaveCustomerAttributes(request.Model, customer);await SaveCustomerGroups(request.Model, customer);-- //activity log- _ = _customerActivityService.InsertActivity("EditCustomer", customer.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditCustomer"), customer.Id);-return customer.ToModel();}diff --git a/src/API/Grand.Api/Commands/Handlers/Customers/UpdateCustomerGroupCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Customers/UpdateCustomerGroupCommandHandler.csindex 8385395af..38a921dbc 100644--- a/src/API/Grand.Api/Commands/Handlers/Customers/UpdateCustomerGroupCommandHandler.cs+++ b/src/API/Grand.Api/Commands/Handlers/Customers/UpdateCustomerGroupCommandHandler.cs@@ -3,7 +3,6 @@ using Grand.Api.DTOs.Customers;using Grand.Api.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using MediatR;@@ -12,18 +11,15 @@ namespace Grand.Api.Commands.Handlers.Customerspublic class UpdateCustomerGroupCommandHandler : IRequestHandler<UpdateCustomerGroupCommand, CustomerGroupDto>{private readonly IGroupService _groupService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;public UpdateCustomerGroupCommandHandler(IGroupService groupService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IWorkContext workContext){_groupService = groupService;- _customerActivityService = customerActivityService;_translationService = translationService;_workContext = workContext;}@@ -34,9 +30,6 @@ namespace Grand.Api.Commands.Handlers.CustomerscustomerGroup = request.Model.ToEntity(customerGroup);await _groupService.UpdateCustomerGroup(customerGroup);- //activity log- _ = _customerActivityService.InsertActivity("EditCustomerGroup", customerGroup.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditCustomerGroup"), customerGroup.Name);-return customerGroup.ToModel();}}diff --git a/src/Business/Grand.Business.Common/Services/Logging/CustomerActivityService.cs b/src/Business/Grand.Business.Common/Services/Logging/CustomerActivityService.csdeleted file mode 100644index a4ab6170a..000000000--- a/src/Business/Grand.Business.Common/Services/Logging/CustomerActivityService.cs+++ /dev/null@@ -1,527 +0,0 @@-using Grand.Business.Core.Interfaces.Common.Logging;-using Grand.Domain;-using Grand.Domain.Customers;-using Grand.Domain.Data;-using Grand.Domain.Logging;-using Grand.Infrastructure.Caching;-using Grand.Infrastructure.Caching.Constants;-using Grand.SharedKernel.Extensions;--namespace Grand.Business.Common.Services.Logging-{- /// <summary>- /// Customer activity service- /// </summary>- public class CustomerActivityService : ICustomerActivityService- {- #region Fields-- /// <summary>- /// Cache manager- /// </summary>- private readonly ICacheBase _cacheBase;- private readonly IRepository<ActivityLog> _activityLogRepository;- private readonly IRepository<ActivityLogType> _activityLogTypeRepository;-- #endregion-- #region Ctor- /// <summary>- /// Ctor- /// </summary>-- public CustomerActivityService(- ICacheBase cacheBase,- IRepository<ActivityLog> activityLogRepository,- IRepository<ActivityLogType> activityLogTypeRepository)- {- _cacheBase = cacheBase;- _activityLogRepository = activityLogRepository;- _activityLogTypeRepository = activityLogTypeRepository;- }-- #endregion-- /// <summary>- /// Gets all activity log types (to caching)- /// </summary>- /// <returns>Activity log types</returns>- protected virtual async Task<IList<ActivityLogType>> GetAllActivityTypesCached()- {- //cache- return await _cacheBase.GetAsync(CacheKey.ACTIVITYTYPE_ALL_KEY, async () => await GetAllActivityTypes());- }-- /// <summary>- /// Gets all activity log types (caching)- /// </summary>- /// <returns>Activity log types</returns>- protected virtual IList<ActivityLogType> GetAllActivityTypesCachedSync()- {- return _cacheBase.Get(CacheKey.ACTIVITYTYPE_ALL_KEY, () => ActivityLogTypes().ToList());- }-- #region Methods-- /// <summary>- /// Inserts an activity log type item- /// </summary>- /// <param name="activityLogType">Activity log type item</param>- public virtual async Task InsertActivityType(ActivityLogType activityLogType)- {- if (activityLogType == null)- throw new ArgumentNullException(nameof(activityLogType));-- await _activityLogTypeRepository.InsertAsync(activityLogType);- await _cacheBase.RemoveByPrefix(CacheKey.ACTIVITYTYPE_PATTERN_KEY);- }-- /// <summary>- /// Updates an activity log type item- /// </summary>- /// <param name="activityLogType">Activity log type item</param>- public virtual async Task UpdateActivityType(ActivityLogType activityLogType)- {- if (activityLogType == null)- throw new ArgumentNullException(nameof(activityLogType));-- await _activityLogTypeRepository.UpdateAsync(activityLogType);- await _cacheBase.RemoveByPrefix(CacheKey.ACTIVITYTYPE_PATTERN_KEY);- }-- /// <summary>- /// Deletes an activity log type item- /// </summary>- /// <param name="activityLogType">Activity log type</param>- public virtual async Task DeleteActivityType(ActivityLogType activityLogType)- {- if (activityLogType == null)- throw new ArgumentNullException(nameof(activityLogType));-- await _activityLogTypeRepository.DeleteAsync(activityLogType);- await _cacheBase.RemoveByPrefix(CacheKey.ACTIVITYTYPE_PATTERN_KEY);- }-- private IQueryable<ActivityLogType> ActivityLogTypes()- {- var query = from alt in _activityLogTypeRepository.Table- orderby alt.Name- select alt;-- return query;- }-- /// <summary>- /// Gets all activity log type items- /// </summary>- /// <returns>Activity log type items</returns>- public virtual async Task<IList<ActivityLogType>> GetAllActivityTypes()- {- return await Task.FromResult(ActivityLogTypes().ToList());- }-- /// <summary>- /// Gets an activity log type item- /// </summary>- /// <param name="activityLogTypeId">Activity log type identifier</param>- /// <returns>Activity log type item</returns>- public virtual async Task<ActivityLogType> GetActivityTypeById(string activityLogTypeId)- {- if (string.IsNullOrEmpty(activityLogTypeId))- return null;-- var key = string.Format(CacheKey.ACTIVITYTYPE_BY_KEY, activityLogTypeId);- return await _cacheBase.GetAsync(key, () => _activityLogTypeRepository.GetByIdAsync(activityLogTypeId));- }-- /// <summary>- /// Inserts an activity log item- /// </summary>- /// <param name="systemKeyword">The system keyword</param>- /// <param name="entityKeyId">Entity key ident</param>- /// <param name="customer">The customer</param>- /// <param name="ipAddress">Ip address</param>- /// <param name="comment">The activity comment</param>- /// <param name="commentParams">The activity comment parameters for string.Format() function.</param>- /// <returns>Activity log item</returns>- public virtual Task InsertActivity(string systemKeyword, string entityKeyId,- Customer customer, string ipAddress, string comment, params object[] commentParams)- {- if (customer == null)- return null;-- var activityTypes = GetAllActivityTypesCachedSync();- var activityType = activityTypes.FirstOrDefault(at => at.SystemKeyword == systemKeyword);- if (activityType is not { Enabled: true })- return null;-- comment = CommonHelper.EnsureNotNull(comment);- comment = string.Format(comment, commentParams);- comment = CommonHelper.EnsureMaximumLength(comment, 4000);-- var activity = new ActivityLog {- ActivityLogTypeId = activityType.Id,- CustomerId = customer.Id,- EntityKeyId = entityKeyId,- Comment = comment,- CreatedOnUtc = DateTime.UtcNow,- IpAddress = ipAddress- };- _activityLogRepository.InsertAsync(activity);-- return Task.CompletedTask;- }-- /// <summary>- /// Deletes an activity log item- /// </summary>- /// <param name="activityLog">Activity log type</param>- public virtual async Task DeleteActivity(ActivityLog activityLog)- {- if (activityLog == null)- throw new ArgumentNullException(nameof(activityLog));-- await _activityLogRepository.DeleteAsync(activityLog);- }-- /// <summary>- /// Gets all activity log items- /// </summary>- /// <param name="comment">Log item message text or text part; null or empty string to load all</param>- /// <param name="createdOnFrom">Log item creation from; null to load all customers</param>- /// <param name="createdOnTo">Log item creation to; null to load all customers</param>- /// <param name="customerId">Customer identifier; null to load all customers</param>- /// <param name="activityLogTypeId">Activity log type identifier</param>- /// <param name="ipAddress"></param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- public virtual async Task<IPagedList<ActivityLog>> GetAllActivities(string comment = "",- DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string customerId = "", string activityLogTypeId = "",- string ipAddress = null,- int pageIndex = 0, int pageSize = int.MaxValue)- {- var query = from p in _activityLogRepository.Table- select p;-- if (!string.IsNullOrEmpty(comment))- query = query.Where(al => al.Comment != null && al.Comment.ToLower().Contains(comment.ToLower()));- if (createdOnFrom.HasValue)- query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc);- if (createdOnTo.HasValue)- query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc);- if (!string.IsNullOrEmpty(activityLogTypeId))- query = query.Where(al => activityLogTypeId == al.ActivityLogTypeId);- if (!string.IsNullOrEmpty(customerId))- query = query.Where(al => customerId == al.CustomerId);- if (!string.IsNullOrEmpty(ipAddress))- query = query.Where(al => ipAddress == al.IpAddress);-- query = query.OrderByDescending(al => al.CreatedOnUtc);- return await PagedList<ActivityLog>.Create(query, pageIndex, pageSize);- }-- /// <summary>- /// Gets stats activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="activityLogTypeId">Activity log type identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- public virtual async Task<IPagedList<ActivityStats>> GetStatsActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string activityLogTypeId = "",- int pageIndex = 0, int pageSize = int.MaxValue)- {- var query = from p in _activityLogRepository.Table- select p;-- if (createdOnFrom.HasValue)- query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc);- if (createdOnTo.HasValue)- query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc);- if (!string.IsNullOrEmpty(activityLogTypeId))- query = query.Where(al => activityLogTypeId == al.ActivityLogTypeId);-- var gquery = query.GroupBy(key => new { key.ActivityLogTypeId, key.EntityKeyId })- .Select(g => new ActivityStats {- ActivityLogTypeId = g.Key.ActivityLogTypeId,- EntityKeyId = g.Key.EntityKeyId,- Count = g.Count()- });-- gquery = gquery.OrderByDescending(x => x.Count);-- return await PagedList<ActivityStats>.Create(gquery, pageIndex, pageSize);- }- /// <summary>- /// Gets category activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="categoryId">Category identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- public virtual async Task<IPagedList<ActivityLog>> GetCategoryActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string categoryId = "", int pageIndex = 0, int pageSize = int.MaxValue)- {- var query = from p in _activityLogRepository.Table- select p;-- if (createdOnFrom.HasValue)- query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc);- if (createdOnTo.HasValue)- query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc);-- var activityTypes = await GetAllActivityTypesCached();- var activityTypeIds = activityTypes.ToList().Where(at => GetCategorySystemKeywords().Contains(at.SystemKeyword)).Select(x => x.Id);-- query = query.Where(al => activityTypeIds.Contains(al.ActivityLogTypeId));-- query = query.Where(al => al.EntityKeyId == categoryId);- query = query.OrderByDescending(al => al.CreatedOnUtc);- return await PagedList<ActivityLog>.Create(query, pageIndex, pageSize);- }-- /// <summary>- /// Gets knowledge base category activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="categoryId">Category identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- public virtual async Task<IPagedList<ActivityLog>> GetKnowledgebaseCategoryActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string categoryId = "", int pageIndex = 0, int pageSize = int.MaxValue)- {- var query = from p in _activityLogRepository.Table- select p;-- if (createdOnFrom.HasValue)- query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc);- if (createdOnTo.HasValue)- query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc);-- var activityTypes = await GetAllActivityTypesCached();- var activityTypeIds = activityTypes.ToList().Where(at => GetKnowledgebaseCategorySystemKeywords().Contains(at.SystemKeyword)).Select(x => x.Id);-- query = query.Where(al => activityTypeIds.Contains(al.ActivityLogTypeId));-- query = query.Where(al => al.EntityKeyId == categoryId);- query = query.OrderByDescending(al => al.CreatedOnUtc);- return await PagedList<ActivityLog>.Create(query, pageIndex, pageSize);- }-- /// <summary>- /// Gets knowledge base article activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="categoryId">Category identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- public virtual async Task<IPagedList<ActivityLog>> GetKnowledgebaseArticleActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string categoryId = "", int pageIndex = 0, int pageSize = int.MaxValue)- {- var query = from p in _activityLogRepository.Table- select p;-- if (createdOnFrom.HasValue)- query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc);- if (createdOnTo.HasValue)- query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc);-- var activityTypes = await GetAllActivityTypesCached();- var activityTypeIds = activityTypes.ToList().Where(at => GetKnowledgebaseArticleSystemKeywords().Contains(at.SystemKeyword)).Select(x => x.Id);-- query = query.Where(al => activityTypeIds.Contains(al.ActivityLogTypeId));-- query = query.Where(al => al.EntityKeyId == categoryId);- query = query.OrderByDescending(al => al.CreatedOnUtc);- return await PagedList<ActivityLog>.Create(query, pageIndex, pageSize);- }- /// <summary>- /// Gets collection activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="brandId">Brand identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- public virtual async Task<IPagedList<ActivityLog>> GetBrandActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string brandId = "", int pageIndex = 0, int pageSize = int.MaxValue)- {- var query = from p in _activityLogRepository.Table- select p;-- if (createdOnFrom.HasValue)- query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc);- if (createdOnTo.HasValue)- query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc);-- var activityTypes = await GetAllActivityTypesCached();- var activityTypeIds = activityTypes.ToList().Where(at => GetBrandSystemKeywords().Contains(at.SystemKeyword)).Select(x => x.Id);-- query = query.Where(al => activityTypeIds.Contains(al.ActivityLogTypeId));-- query = query.Where(al => al.EntityKeyId == brandId);- query = query.OrderByDescending(al => al.CreatedOnUtc);- return await PagedList<ActivityLog>.Create(query, pageIndex, pageSize);- }-- /// <summary>- /// Gets collection activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="collectionId">Collection identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- public virtual async Task<IPagedList<ActivityLog>> GetCollectionActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string collectionId = "", int pageIndex = 0, int pageSize = int.MaxValue)- {- var query = from p in _activityLogRepository.Table- select p;-- if (createdOnFrom.HasValue)- query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc);- if (createdOnTo.HasValue)- query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc);-- var activityTypes = await GetAllActivityTypesCached();- var activityTypeIds = activityTypes.ToList().Where(at => GetCollectionSystemKeywords().Contains(at.SystemKeyword)).Select(x => x.Id);-- query = query.Where(al => activityTypeIds.Contains(al.ActivityLogTypeId));-- query = query.Where(al => al.EntityKeyId == collectionId);- query = query.OrderByDescending(al => al.CreatedOnUtc);- return await PagedList<ActivityLog>.Create(query, pageIndex, pageSize);- }-- /// <summary>- /// Gets product activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="productId">Product identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- public virtual async Task<IPagedList<ActivityLog>> GetProductActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string productId = "", int pageIndex = 0, int pageSize = int.MaxValue)- {- var query = from p in _activityLogRepository.Table- select p;-- if (createdOnFrom.HasValue)- query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc);- if (createdOnTo.HasValue)- query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc);-- var activityTypes = await GetAllActivityTypesCached();- var activityTypeIds = activityTypes.ToList().Where(at => GetProductSystemKeywords().Contains(at.SystemKeyword)).Select(x => x.Id);-- query = query.Where(al => activityTypeIds.Contains(al.ActivityLogTypeId));-- query = query.Where(al => al.EntityKeyId == productId);- query = query.OrderByDescending(al => al.CreatedOnUtc);- return await PagedList<ActivityLog>.Create(query, pageIndex, pageSize);- }-- /// <summary>- /// Gets an activity log item- /// </summary>- /// <param name="activityLogId">Activity log identifier</param>- /// <returns>Activity log item</returns>- public virtual Task<ActivityLog> GetActivityById(string activityLogId)- {- return _activityLogRepository.GetByIdAsync(activityLogId);- }-- /// <summary>- /// Clears activity log- /// </summary>- public virtual async Task ClearAllActivities()- {- await _activityLogRepository.ClearAsync();- }- #endregion--- #region Private methods-- private IList<string> GetCategorySystemKeywords()- {- var tokens = new List<string>- {- "PublicStore.ViewCategory",- "EditCategory",- "AddNewCategory"- };- return tokens;- }- private IList<string> GetProductSystemKeywords()- {- var tokens = new List<string>- {- "PublicStore.ViewProduct",- "EditProduct",- "AddNewProduct"- };- return tokens;- }- private IList<string> GetBrandSystemKeywords()- {- var tokens = new List<string>- {- "PublicStore.ViewBrand",- "EditBrand",- "AddNewBrand"- };- return tokens;- }-- private IList<string> GetCollectionSystemKeywords()- {- var tokens = new List<string>- {- "PublicStore.ViewCollection",- "EditCollection",- "AddNewCollection"- };- return tokens;- }-- private IList<string> GetKnowledgebaseCategorySystemKeywords()- {- var tokens = new List<string>- {- "CreateKnowledgebaseCategory",- "UpdateKnowledgebaseCategory",- "DeleteKnowledgebaseCategory"- };- return tokens;- }--- private IList<string> GetKnowledgebaseArticleSystemKeywords()- {- var tokens = new List<string>- {- "CreateKnowledgebaseArticle",- "UpdateKnowledgebaseArticle",- "DeleteKnowledgebaseArticle"- };- return tokens;- }-- #endregion- }-}diff --git a/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs b/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.csindex d3f35b2b0..bed22e751 100644--- a/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs+++ b/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs@@ -62,7 +62,6 @@ namespace Grand.Business.Common.Services.SecurityStandardPermission.ManageShippingSettings,StandardPermission.ManageCurrencies,StandardPermission.ManageMeasures,- StandardPermission.ManageActivityLog,StandardPermission.ManageAcl,StandardPermission.ManageEmailAccounts,StandardPermission.ManageStores,@@ -147,7 +146,6 @@ namespace Grand.Business.Common.Services.SecurityStandardPermission.ManageShippingSettings,StandardPermission.ManageCurrencies,StandardPermission.ManageMeasures,- StandardPermission.ManageActivityLog,StandardPermission.ManageAcl,StandardPermission.ManageEmailAccounts,StandardPermission.ManageStores,diff --git a/src/Business/Grand.Business.Common/Startup/StartupApplication.cs b/src/Business/Grand.Business.Common/Startup/StartupApplication.csindex 1df08ee29..59aac94ca 100644--- a/src/Business/Grand.Business.Common/Startup/StartupApplication.cs+++ b/src/Business/Grand.Business.Common/Startup/StartupApplication.cs@@ -3,7 +3,6 @@ using Grand.Business.Common.Services.Configuration;using Grand.Business.Common.Services.Directory;using Grand.Business.Common.Services.ExportImport;using Grand.Business.Common.Services.Localization;-using Grand.Business.Common.Services.Logging;using Grand.Business.Common.Services.Pdf;using Grand.Business.Common.Services.Security;using Grand.Business.Common.Services.Seo;@@ -13,7 +12,6 @@ using Grand.Business.Core.Interfaces.Common.Addresses;using Grand.Business.Core.Interfaces.Common.Configuration;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Pdf;using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Interfaces.Common.Seo;@@ -35,7 +33,6 @@ namespace Grand.Business.Common.StartupRegisterDirectoryService(services);RegisterConfigurationService(services);RegisterLocalizationService(services);- RegisterLoggingService(services);RegisterSecurityService(services);RegisterSeoService(services);RegisterStoresService(services);@@ -75,10 +72,6 @@ namespace Grand.Business.Common.StartupserviceCollection.AddScoped<ITranslationService, TranslationService>();serviceCollection.AddScoped<ILanguageService, LanguageService>();}- private void RegisterLoggingService(IServiceCollection serviceCollection)- {- serviceCollection.AddScoped<ICustomerActivityService, CustomerActivityService>();- }private void RegisterSecurityService(IServiceCollection serviceCollection){serviceCollection.AddScoped<IPermissionService, PermissionService>();diff --git a/src/Business/Grand.Business.Core/Commands/System/Common/DeleteActivitylogCommand.cs b/src/Business/Grand.Business.Core/Commands/System/Common/DeleteActivitylogCommand.csdeleted file mode 100644index 27719eecf..000000000--- a/src/Business/Grand.Business.Core/Commands/System/Common/DeleteActivitylogCommand.cs+++ /dev/null@@ -1,8 +0,0 @@-using MediatR;--namespace Grand.Business.Core.Commands.System.Common-{- public class DeleteActivitylogCommand : IRequest<bool>- {- }-}diff --git a/src/Business/Grand.Business.Core/Interfaces/Common/Logging/ICustomerActivityService.cs b/src/Business/Grand.Business.Core/Interfaces/Common/Logging/ICustomerActivityService.csdeleted file mode 100644index 4ecf0eec2..000000000--- a/src/Business/Grand.Business.Core/Interfaces/Common/Logging/ICustomerActivityService.cs+++ /dev/null@@ -1,177 +0,0 @@-using Grand.Domain;-using Grand.Domain.Customers;-using Grand.Domain.Logging;--namespace Grand.Business.Core.Interfaces.Common.Logging-{- /// <summary>- /// Customer activity service interface- /// </summary>- public interface ICustomerActivityService- {- /// <summary>- /// Inserts an activity log type item- /// </summary>- /// <param name="activityLogType">Activity log type item</param>- Task InsertActivityType(ActivityLogType activityLogType);-- /// <summary>- /// Updates an activity log type item- /// </summary>- /// <param name="activityLogType">Activity log type item</param>- Task UpdateActivityType(ActivityLogType activityLogType);-- /// <summary>- /// Deletes an activity log type item- /// </summary>- /// <param name="activityLogType">Activity log type</param>- Task DeleteActivityType(ActivityLogType activityLogType);-- /// <summary>- /// Gets all activity log type items- /// </summary>- /// <returns>Activity log type items</returns>- Task<IList<ActivityLogType>> GetAllActivityTypes();-- /// <summary>- /// Gets an activity log type item- /// </summary>- /// <param name="activityLogTypeId">Activity log type identifier</param>- /// <returns>Activity log type item</returns>- Task<ActivityLogType> GetActivityTypeById(string activityLogTypeId);-- /// <summary>- /// Inserts an activity log item- /// </summary>- /// <param name="systemKeyword">The system keyword</param>- /// <param name="entityKeyId">Entity key ident</param>- /// <param name="customer">The customer</param>- /// <param name="ipAddress">Ip address</param>- /// <param name="comment">The activity comment</param>- /// <param name="commentParams">The activity comment parameters for string.Format() function.</param>- /// <returns>Activity log item</returns>- Task InsertActivity(string systemKeyword, string entityKeyId,- Customer customer, string ipAddress, string comment, params object[] commentParams);--- /// <summary>- /// Deletes an activity log item- /// </summary>- /// <param name="activityLog">Activity log</param>- Task DeleteActivity(ActivityLog activityLog);-- /// <summary>- /// Gets all activity log items- /// </summary>- /// <param name="comment">Log item message text or text part; null or empty string to load all</param>- /// <param name="createdOnFrom">Log item creation from; null to load all customers</param>- /// <param name="createdOnTo">Log item creation to; null to load all customers</param>- /// <param name="customerId">Customer identifier; null to load all customers</param>- /// <param name="activityLogTypeId">Activity log type identifier</param>- /// <param name="ipAddress"></param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- Task<IPagedList<ActivityLog>> GetAllActivities(string comment = "",- DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string customerId = "", string activityLogTypeId = "",- string ipAddress = null, int pageIndex = 0, int pageSize = int.MaxValue);-- /// <summary>- /// Gets stats activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="activityLogTypeId">Activity log type identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Stats Activity log items</returns>- Task<IPagedList<ActivityStats>> GetStatsActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string activityLogTypeId = "",- int pageIndex = 0, int pageSize = int.MaxValue);-- /// <summary>- /// Gets category activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="categoryId">Category identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- Task<IPagedList<ActivityLog>> GetCategoryActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string categoryId = "", int pageIndex = 0, int pageSize = int.MaxValue);-- /// <summary>- /// Gets knowledge base category activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="categoryId">Category identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- Task<IPagedList<ActivityLog>> GetKnowledgebaseCategoryActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string categoryId = "", int pageIndex = 0, int pageSize = int.MaxValue);-- /// <summary>- /// Gets knowledge base article activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="categoryId">Category identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- Task<IPagedList<ActivityLog>> GetKnowledgebaseArticleActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string categoryId = "", int pageIndex = 0, int pageSize = int.MaxValue);-- /// <summary>- /// Gets collection activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="brandId">Brand identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- Task<IPagedList<ActivityLog>> GetBrandActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string brandId = "", int pageIndex = 0, int pageSize = int.MaxValue);-- /// <summary>- /// Gets collection activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="collectionId">Collection identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- Task<IPagedList<ActivityLog>> GetCollectionActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string collectionId = "", int pageIndex = 0, int pageSize = int.MaxValue);-- /// <summary>- /// Gets product activity log items- /// </summary>- /// <param name="createdOnFrom">Log item creation from; null to load all records</param>- /// <param name="createdOnTo">Log item creation to; null to load all records</param>- /// <param name="productId">Collection identifier</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Activity log items</returns>- Task<IPagedList<ActivityLog>> GetProductActivities(DateTime? createdOnFrom = null,- DateTime? createdOnTo = null, string productId = "", int pageIndex = 0, int pageSize = int.MaxValue);-- /// <summary>- /// Gets an activity log item- /// </summary>- /// <param name="activityLogId">Activity log identifier</param>- /// <returns>Activity log item</returns>- Task<ActivityLog> GetActivityById(string activityLogId);-- /// <summary>- /// Clears activity log- /// </summary>- Task ClearAllActivities();- }-}diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionSystemName.cs b/src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionSystemName.csindex fb7c0ba1a..bf14d95cc 100644--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionSystemName.cs+++ b/src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionSystemName.cs@@ -55,7 +55,6 @@public const string ShippingSettings = "ManageShippingSettings";public const string Currencies = "ManageCurrencies";public const string Measures = "ManageMeasures";- public const string ActivityLog = "ManageActivityLog";public const string Acl = "ManageACL";public const string EmailAccounts = "ManageEmailAccounts";public const string Stores = "ManageStores";diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionConfiguration.cs b/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionConfiguration.csindex cc3fd27d1..1fc1845ed 100644--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionConfiguration.cs+++ b/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionConfiguration.cs@@ -77,14 +77,6 @@ namespace Grand.Business.Core.Utilities.Common.SecurityPermissionActionName.Dimensions_List, PermissionActionName.Dimensions_Add, PermissionActionName.Dimensions_Edit, PermissionActionName.Dimensions_Delete}};- public static readonly Permission ManageActivityLog = new()- {- Name = "Manage Activity Log",- SystemName = PermissionSystemName.ActivityLog,- Area = "Admin area",- Category = CategoryConfiguration,- Actions = new List<string> { PermissionActionName.List, PermissionActionName.Edit, PermissionActionName.Delete }- };public static readonly Permission ManageAcl = new(){Name = "Manage ACL",diff --git a/src/Business/Grand.Business.Core/Utilities/System/StandardAdminSiteMap.cs b/src/Business/Grand.Business.Core/Utilities/System/StandardAdminSiteMap.csindex e47b1e9f6..47c1004fb 100644--- a/src/Business/Grand.Business.Core/Utilities/System/StandardAdminSiteMap.cs+++ b/src/Business/Grand.Business.Core/Utilities/System/StandardAdminSiteMap.cs@@ -220,7 +220,7 @@ namespace Grand.Business.Core.Utilities.Systemnew () {SystemName = "Customers",ResourceName = "Admin.Customers",- PermissionNames = new List<string> { PermissionSystemName.Customers, PermissionSystemName.Vendors, PermissionSystemName.VendorReviews, PermissionSystemName.ActivityLog,+ PermissionNames = new List<string> { PermissionSystemName.Customers, PermissionSystemName.Vendors, PermissionSystemName.VendorReviews,PermissionSystemName.CustomerTags, PermissionSystemName.CustomerGroups, PermissionSystemName.SalesEmployees },IconClass = "icon-users",DisplayOrder = 3,@@ -296,15 +296,6 @@ namespace Grand.Business.Core.Utilities.SystemPermissionNames = new List<string> { PermissionSystemName.AddressAttributes },DisplayOrder = 7,IconClass = "fa fa-dot-circle-o"- },- new () {- SystemName = "Activity Log",- ResourceName = "Admin.Configuration.ActivityLog",- PermissionNames = new List<string> { PermissionSystemName.ActivityLog },- ControllerName = "ActivityLog",- ActionName = "ListLogs",- DisplayOrder = 8,- IconClass = "fa fa-arrow-circle-o-right"}}},@@ -562,7 +553,7 @@ namespace Grand.Business.Core.Utilities.Systemnew () {SystemName = "Reports",ResourceName = "Admin.Reports",- PermissionNames = new List<string> { PermissionSystemName.Reports, PermissionSystemName.ActivityLog },+ PermissionNames = new List<string> { PermissionSystemName.Reports },IconClass = "icon-bar-chart",DisplayOrder = 6,ChildNodes = new List<AdminSiteMap> {@@ -612,16 +603,7 @@ namespace Grand.Business.Core.Utilities.SystemActionName = "Customer",DisplayOrder = 4,IconClass = "fa fa-dot-circle-o"- },- new () {- SystemName = "Activity Stats",- ResourceName = "Admin.Reports.ActivityLog.ActivityStats",- PermissionNames = new List<string> { PermissionSystemName.ActivityLog },- ControllerName = "ActivityLog",- ActionName = "ListStats",- DisplayOrder = 5,- IconClass = "fa fa-dot-circle-o"- }+ }}},new () {@@ -630,7 +612,7 @@ namespace Grand.Business.Core.Utilities.SystemPermissionNames = new List<string> { PermissionSystemName.Countries, PermissionSystemName.Languages, PermissionSystemName.Settings,PermissionSystemName.PaymentMethods, PermissionSystemName.ExternalAuthenticationMethods,PermissionSystemName.TaxSettings, PermissionSystemName.ShippingSettings, PermissionSystemName.Currencies, PermissionSystemName.Measures,- PermissionSystemName.ActivityLog, PermissionSystemName.Acl, PermissionSystemName.EmailAccounts, PermissionSystemName.Plugins, PermissionSystemName.Widgets, PermissionSystemName.Stores, PermissionSystemName.Maintenance },+ PermissionSystemName.Acl, PermissionSystemName.EmailAccounts, PermissionSystemName.Plugins, PermissionSystemName.Widgets, PermissionSystemName.Stores, PermissionSystemName.Maintenance },IconClass = "icon-settings",DisplayOrder = 7,ChildNodes = new List<AdminSiteMap> {@@ -902,7 +884,7 @@ namespace Grand.Business.Core.Utilities.System},new () {SystemName = "Settings",- PermissionNames = new List<string> { PermissionSystemName.Settings, PermissionSystemName.ActivityLog },+ PermissionNames = new List<string> { PermissionSystemName.Settings },ResourceName = "Admin.Settings",IconClass = "icon-wrench",DisplayOrder = 8,@@ -986,15 +968,6 @@ namespace Grand.Business.Core.Utilities.SystemActionName = "SystemSetting",DisplayOrder = 9,IconClass = "fa fa-dot-circle-o"- },- new () {- SystemName = "Activity Types",- ResourceName = "Admin.Settings.ActivityLog.ActivityLogType",- PermissionNames = new List<string> { PermissionSystemName.ActivityLog },- ControllerName = "ActivityLog",- ActionName = "ListTypes",- DisplayOrder = 10,- IconClass = "fa fa-dot-circle-o"}}},diff --git a/src/Business/Grand.Business.System/Commands/Handlers/Common/DeleteActivitylogCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Common/DeleteActivitylogCommandHandler.csdeleted file mode 100644index 2606b2712..000000000--- a/src/Business/Grand.Business.System/Commands/Handlers/Common/DeleteActivitylogCommandHandler.cs+++ /dev/null@@ -1,23 +0,0 @@-using Grand.Business.Core.Commands.System.Common;-using Grand.Domain.Data;-using Grand.Domain.Logging;-using MediatR;--namespace Grand.Business.System.Commands.Handlers.Common-{- public class DeleteActivitylogCommandHandler : IRequestHandler<DeleteActivitylogCommand, bool>- {- private readonly IRepository<ActivityLog> _repositoryActivityLog;-- public DeleteActivitylogCommandHandler(IRepository<ActivityLog> repositoryActivityLog)- {- _repositoryActivityLog = repositoryActivityLog;- }-- public async Task<bool> Handle(DeleteActivitylogCommand request, CancellationToken cancellationToken)- {- await _repositoryActivityLog.ClearAsync();- return true;- }- }-}diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataActivityLogTypes.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataActivityLogTypes.csdeleted file mode 100644index faadcdf5b..000000000--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataActivityLogTypes.cs+++ /dev/null@@ -1,568 +0,0 @@-using Grand.Domain.Logging;--namespace Grand.Business.System.Services.Installation-{- public partial class InstallationService- {- protected virtual async Task InstallActivityLogTypes()- {- var activityLogTypes = new List<ActivityLogType>- {- //admin area activities- new ActivityLogType- {- SystemKeyword = "AddNewCategory",- Enabled = true,- Name = "Add a new category"- },- new ActivityLogType- {- SystemKeyword = "AddNewCheckoutAttribute",- Enabled = true,- Name = "Add a new checkout attribute"- },- new ActivityLogType- {- SystemKeyword = "AddNewContactAttribute",- Enabled = true,- Name = "Add a new contact attribute"- },- new ActivityLogType- {- SystemKeyword = "AddNewCustomer",- Enabled = true,- Name = "Add a new customer"- },- new ActivityLogType- {- SystemKeyword = "AddNewCustomerGroup",- Enabled = true,- Name = "Add a new customer group"- },- new ActivityLogType- {- SystemKeyword = "AddNewDiscount",- Enabled = true,- Name = "Add a new discount"- },- new ActivityLogType- {- SystemKeyword = "AddNewDocument",- Enabled = false,- Name = "Add a new document"- },- new ActivityLogType- {- SystemKeyword = "AddNewDocumentType",- Enabled = false,- Name = "Add a new document type"- },- new ActivityLogType- {- SystemKeyword = "AddNewGiftVoucher",- Enabled = true,- Name = "Add a new gift voucher"- },- new ActivityLogType- {- SystemKeyword = "AddNewCollection",- Enabled = true,- Name = "Add a new collection"- },- new ActivityLogType- {- SystemKeyword = "AddNewProduct",- Enabled = true,- Name = "Add a new product"- },- new ActivityLogType- {- SystemKeyword = "AddNewProductAttribute",- Enabled = true,- Name = "Add a new product attribute"- },- new ActivityLogType- {- SystemKeyword = "AddNewSalesEmployee",- Enabled = true,- Name = "Add a sales employee"- },- new ActivityLogType- {- SystemKeyword = "AddNewSetting",- Enabled = true,- Name = "Add a new setting"- },- new ActivityLogType- {- SystemKeyword = "AddNewSpecAttribute",- Enabled = true,- Name = "Add a new specification attribute"- },- new ActivityLogType- {- SystemKeyword = "AddNewPage",- Enabled = true,- Name = "Add a new page"- },- new ActivityLogType- {- SystemKeyword = "AddNewWidget",- Enabled = true,- Name = "Add a new widget"- },- new ActivityLogType- {- SystemKeyword = "AddLoyaltyPoints",- Enabled = true,- Name = "Assign new loyalty points"- },- new ActivityLogType- {- SystemKeyword = "DeleteBid",- Enabled = true,- Name = "Delete bid"- },- new ActivityLogType- {- SystemKeyword = "DeleteCategory",- Enabled = true,- Name = "Delete category"- },- new ActivityLogType- {- SystemKeyword = "DeleteCheckoutAttribute",- Enabled = true,- Name = "Delete a checkout attribute"- },- new ActivityLogType- {- SystemKeyword = "DeleteContactAttribute",- Enabled = true,- Name = "Delete a contact attribute"- },- new ActivityLogType- {- SystemKeyword = "DeleteCustomer",- Enabled = true,- Name = "Delete a customer"- },- new ActivityLogType- {- SystemKeyword = "DeleteCustomerGroup",- Enabled = true,- Name = "Delete a customer group"- },- new ActivityLogType- {- SystemKeyword = "DeleteDiscount",- Enabled = true,- Name = "Delete a discount"- },- new ActivityLogType- {- SystemKeyword = "DeleteDocument",- Enabled = false,- Name = "Delete document"- },- new ActivityLogType- {- SystemKeyword = "DeleteDocumentType",- Enabled = false,- Name = "Delete document type"- },- new ActivityLogType- {- SystemKeyword = "DeleteGiftVoucher",- Enabled = true,- Name = "Delete a gift voucher"- },- new ActivityLogType- {- SystemKeyword = "DeleteCollection",- Enabled = true,- Name = "Delete a collection"- },- new ActivityLogType- {- SystemKeyword = "DeleteOrder",- Enabled = true,- Name = "Delete an order"- },- new ActivityLogType- {- SystemKeyword = "DeleteProduct",- Enabled = true,- Name = "Delete a product"- },- new ActivityLogType- {- SystemKeyword = "DeleteProductAttribute",- Enabled = true,- Name = "Delete a product attribute"- },- new ActivityLogType- {- SystemKeyword = "DeleteMerchandiseReturn",- Enabled = true,- Name = "Delete a merchandise return"- },- new ActivityLogType- {- SystemKeyword = "DeleteSalesEmployee",- Enabled = true,- Name = "Delete a sales employee"- },- new ActivityLogType- {- SystemKeyword = "DeleteSetting",- Enabled = true,- Name = "Delete a setting"- },- new ActivityLogType- {- SystemKeyword = "DeleteSpecAttribute",- Enabled = true,- Name = "Delete a specification attribute"- },- new ActivityLogType- {- SystemKeyword = "DeletePage",- Enabled = true,- Name = "Delete a page"- },- new ActivityLogType- {- SystemKeyword = "DeleteWidget",- Enabled = true,- Name = "Delete a widget"- },- new ActivityLogType- {- SystemKeyword = "EditCategory",- Enabled = true,- Name = "Edit category"- },- new ActivityLogType- {- SystemKeyword = "EditCheckoutAttribute",- Enabled = true,- Name = "Edit a checkout attribute"- },- new ActivityLogType- {- SystemKeyword = "EditContactAttribute",- Enabled = true,- Name = "Edit a contact attribute"- },- new ActivityLogType- {- SystemKeyword = "EditCustomer",- Enabled = true,- Name = "Edit a customer"- },- new ActivityLogType- {- SystemKeyword = "EditCustomerGroup",- Enabled = true,- Name = "Edit a customer group"- },- new ActivityLogType- {- SystemKeyword = "EditDiscount",- Enabled = true,- Name = "Edit a discount"- },- new ActivityLogType- {- SystemKeyword = "EditDocument",- Enabled = false,- Name = "Edit document"- },- new ActivityLogType- {- SystemKeyword = "EditDocumentType",- Enabled = false,- Name = "Edit document type"- },- new ActivityLogType- {- SystemKeyword = "EditGiftVoucher",- Enabled = true,- Name = "Edit a gift voucher"- },- new ActivityLogType- {- SystemKeyword = "EditCollection",- Enabled = true,- Name = "Edit a collection"- },- new ActivityLogType- {- SystemKeyword = "EditOrder",- Enabled = true,- Name = "Edit an order"- },- new ActivityLogType- {- SystemKeyword = "EditProduct",- Enabled = true,- Name = "Edit a product"- },- new ActivityLogType- {- SystemKeyword = "EditProductAttribute",- Enabled = true,- Name = "Edit a product attribute"- },- new ActivityLogType- {- SystemKeyword = "EditPromotionProviders",- Enabled = true,- Name = "Edit promotion providers"- },- new ActivityLogType- {- SystemKeyword = "EditMerchandiseReturn",- Enabled = true,- Name = "Edit a merchandise return"- },- new ActivityLogType- {- SystemKeyword = "EditSalesEmployee",- Enabled = true,- Name = "Edit a sales employee"- },- new ActivityLogType- {- SystemKeyword = "EditSettings",- Enabled = true,- Name = "Edit setting(s)"- },- new ActivityLogType- {- SystemKeyword = "EditSpecAttribute",- Enabled = true,- Name = "Edit a specification attribute"- },- new ActivityLogType- {- SystemKeyword = "EditPage",- Enabled = true,- Name = "Edit a page"- },- new ActivityLogType- {- SystemKeyword = "EditWidget",- Enabled = true,- Name = "Edit a widget"- },- //public store activities- new ActivityLogType- {- SystemKeyword = "PublicStore.Url",- Enabled = false,- Name = "Public store. Viewed Url"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.ViewCategory",- Enabled = false,- Name = "Public store. View a category"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.ViewCollection",- Enabled = false,- Name = "Public store. View a collection"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.ViewProduct",- Enabled = false,- Name = "Public store. View a product"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.ViewCourse",- Enabled = false,- Name = "Public store. View a course"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.ViewLesson",- Enabled = false,- Name = "Public store. View a lesson"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AskQuestion",- Enabled = false,- Name = "Public store. Ask a question about product"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.PlaceOrder",- Enabled = false,- Name = "Public store. Place an order"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.SendPM",- Enabled = false,- Name = "Public store. Send PM"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.ContactUs",- Enabled = false,- Name = "Public store. Use contact us form"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AddNewBid",- Enabled = false,- Name = "Public store. Add new bid"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AddToCompareList",- Enabled = false,- Name = "Public store. Add to compare list"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AddToShoppingCart",- Enabled = false,- Name = "Public store. Add to shopping cart"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AddToWishlist",- Enabled = false,- Name = "Public store. Add to wishlist"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.Login",- Enabled = false,- Name = "Public store. Login"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.Logout",- Enabled = false,- Name = "Public store. Logout"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AddProductReview",- Enabled = false,- Name = "Public store. Add product review"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AddNewsComment",- Enabled = false,- Name = "Public store. Add news comment"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AddBlogComment",- Enabled = false,- Name = "Public store. Add blog comment"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.AddArticleComment",- Enabled = false,- Name = "Public store. Add article comment"- },- new ActivityLogType- {- SystemKeyword = "PublicStore.DeleteAccount",- Enabled = false,- Name = "Public store. Delete account"- },- new ActivityLogType- {- SystemKeyword = "CustomerAdmin.SendEmail",- Enabled = true,- Name = "Send email"- },- new ActivityLogType- {- SystemKeyword = "CustomerAdmin.SendPM",- Enabled = true,- Name = "Send PM"- },- new ActivityLogType- {- SystemKeyword = "CustomerAdmin.UpdateCartCustomer",- Enabled = true,- Name = "Update shopping cart"- },- new ActivityLogType- {- SystemKeyword = "UpdateKnowledgebaseCategory",- Enabled = true,- Name = "Update knowledgebase category"- },- new ActivityLogType- {- SystemKeyword = "CreateKnowledgebaseCategory",- Enabled = true,- Name = "Create knowledgebase category"- },- new ActivityLogType- {- SystemKeyword = "DeleteKnowledgebaseCategory",- Enabled = true,- Name = "Delete knowledgebase category"- },- new ActivityLogType- {- SystemKeyword = "CreateKnowledgebaseArticle",- Enabled = true,- Name = "Create knowledgebase article"- },- new ActivityLogType- {- SystemKeyword = "UpdateKnowledgebaseArticle",- Enabled = true,- Name = "Update knowledgebase article"- },- new ActivityLogType- {- SystemKeyword = "DeleteKnowledgebaseArticle",- Enabled = true,- Name = "Delete knowledgebase category"- },- new ActivityLogType- {- SystemKeyword = "AddNewBrand",- Enabled = true,- Name = "Add a new brand"- },- new ActivityLogType- {- SystemKeyword = "EditBrand",- Enabled = true,- Name = "Edit a brand"- },- new ActivityLogType- {- SystemKeyword = "DeleteBrand",- Enabled = true,- Name = "Delete a brand"- },- new ActivityLogType {- SystemKeyword = "EditShipment",- Enabled = true,- Name = "Edit a shipment"- }- };- await _activityLogTypeRepository.InsertAsync(activityLogTypes);- }- }-}diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.csindex d0c6bdffb..df6db2e0c 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs@@ -299,7 +299,6 @@ namespace Grand.Business.System.Services.InstallationOnlineCustomerMinutes = 20,OnlineShoppingCartMinutes = 60,StoreLastVisitedPage = true,- SaveVisitedPage = false,AllowUsersToDeleteAccount = false,AllowUsersToExportData = false,TwoFactorAuthenticationEnabled = falsediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs b/src/Business/Grand.Business.System/Services/Installation/InstallationService.csindex 0864338d2..08b05c84c 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs@@ -17,7 +17,6 @@ using Grand.Domain.Discounts;using Grand.Domain.Documents;using Grand.Domain.Knowledgebase;using Grand.Domain.Localization;-using Grand.Domain.Logging;using Grand.Domain.Messages;using Grand.Domain.News;using Grand.Domain.Orders;@@ -98,8 +97,6 @@ namespace Grand.Business.System.Services.Installationprivate readonly IRepository<NewsLetterSubscription> _newslettersubscriptionRepository;private readonly IRepository<ShippingMethod> _shippingMethodRepository;private readonly IRepository<DeliveryDate> _deliveryDateRepository;- private readonly IRepository<ActivityLog> _activityLogRepository;- private readonly IRepository<ActivityLogType> _activityLogTypeRepository;private readonly IRepository<ProductTag> _productTagRepository;private readonly IRepository<ProductReview> _productReviewRepository;private readonly IRepository<ProductLayout> _productLayoutRepository;@@ -206,8 +203,6 @@ namespace Grand.Business.System.Services.InstallationIRepository<NewsLetterSubscription> newslettersubscriptionRepository,IRepository<ShippingMethod> shippingMethodRepository,IRepository<DeliveryDate> deliveryDateRepository,- IRepository<ActivityLog> activityLogRepository,- IRepository<ActivityLogType> activityLogTypeRepository,IRepository<ProductTag> productTagRepository,IRepository<ProductReview> productReviewRepository,IRepository<ProductLayout> productLayoutRepository,@@ -299,7 +294,6 @@ namespace Grand.Business.System.Services.Installation_newslettersubscriptionRepository = newslettersubscriptionRepository;_shippingMethodRepository = shippingMethodRepository;_deliveryDateRepository = deliveryDateRepository;- _activityLogTypeRepository = activityLogTypeRepository;_productTagRepository = productTagRepository;_productLayoutRepository = productLayoutRepository;_recentlyViewedProductRepository = recentlyViewedProductRepository;@@ -338,7 +332,6 @@ namespace Grand.Business.System.Services.Installation_documentTypeRepository = documentTypeRepository;_documentRepository = documentRepository;_salesRepository = salesRepository;- _activityLogRepository = activityLogRepository;_vendorReviewRepository = vendorReviewRepository;_contactAttributeRepository = contactAttributeRepository;_newsletterCategoryRepository = newsletterCategoryRepository;@@ -654,10 +647,6 @@ namespace Grand.Business.System.Services.Installation//pageawait dbContext.CreateIndex(_pageRepository, OrderBuilder<Page>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.SystemName), "DisplayOrder_SystemName");- //customeractivity- await dbContext.CreateIndex(_activityLogTypeRepository, OrderBuilder<ActivityLogType>.Create().Ascending(x => x.Name), "Name");- await dbContext.CreateIndex(_activityLogRepository, OrderBuilder<ActivityLog>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");-//warehouseawait dbContext.CreateIndex(_warehouseRepository, OrderBuilder<Warehouse>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");@@ -762,7 +751,6 @@ namespace Grand.Business.System.Services.Installationawait InstallPageLayouts();await InstallPages();await InstallLocaleResources();- await InstallActivityLogTypes();await HashDefaultCustomerPassword(defaultUserEmail, defaultUserPassword);await InstallProductLayouts();await InstallCategoryLayouts();diff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationActivityLogTypes.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationActivityLogTypes.csdeleted file mode 100644index 729f14c95..000000000--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationActivityLogTypes.cs+++ /dev/null@@ -1,65 +0,0 @@-using Grand.Domain.Data;-using Grand.Domain.Logging;-using Grand.Infrastructure.Migrations;-using Microsoft.Extensions.DependencyInjection;--namespace Grand.Business.System.Services.Migrations._1._1-{- public class MigrationActivityLogTypes : IMigration- {-- public int Priority => 0;- public DbVersion Version => new(1, 1);- public Guid Identity => new("FA12110D-6C60-401F-BA7C-7B94587CA0EC");- public string Name => "Add missing activity log type for brand collection";-- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- var repository = serviceProvider.GetRequiredService<IRepository<ActivityLogType>>();-- if (repository.Table.FirstOrDefault(x => x.SystemKeyword == "AddNewBrand") == null)- {- repository.Insert(- new ActivityLogType {- SystemKeyword = "AddNewBrand",- Enabled = true,- Name = "Add a new brand"- });- }- if (repository.Table.FirstOrDefault(x => x.SystemKeyword == "EditBrand") == null)- {- repository.Insert(- new ActivityLogType {- SystemKeyword = "EditBrand",- Enabled = true,- Name = "Edit a brand"- });- }- if (repository.Table.FirstOrDefault(x => x.SystemKeyword == "DeleteBrand") == null)- {- repository.Insert(- new ActivityLogType {- SystemKeyword = "DeleteBrand",- Enabled = true,- Name = "Delete a brand"- });- }- if (repository.Table.FirstOrDefault(x => x.SystemKeyword == "EditShipment") == null)- {- repository.Insert(- new ActivityLogType {- SystemKeyword = "EditShipment",- Enabled = true,- Name = "Edit a shipment"- });- }- return true;- }- }-}diff --git a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationActivityLogTypes.cs b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationActivityLogTypes.csdeleted file mode 100644index 196e1004c..000000000--- a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationActivityLogTypes.cs+++ /dev/null@@ -1,55 +0,0 @@-using Grand.Domain.Data;-using Grand.Domain.Logging;-using Grand.Infrastructure.Migrations;-using Microsoft.Extensions.DependencyInjection;-using Microsoft.Extensions.Logging;--namespace Grand.Business.System.Services.Migrations._2._1-{- public class MigrationActivityLogTypes : IMigration- {-- public int Priority => 0;- public DbVersion Version => new(2, 1);- public Guid Identity => new("6B364BD3-CB5D-4060-B5ED-E3D8E0D1DF6B");- public string Name => "Remove activity log types";-- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- var repository = serviceProvider.GetRequiredService<IRepository<ActivityLogType>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationActivityLogTypes>>();- try- {- var activityLogTypes = repository- .Table.Where(x =>- x.SystemKeyword == "InteractiveFormDelete" ||- x.SystemKeyword == "InteractiveFormEdit" ||- x.SystemKeyword == "InteractiveFormAdd" ||- x.SystemKeyword == "PublicStore.InteractiveForm" ||- x.SystemKeyword == "CustomerReminder.AbandonedCart" ||- x.SystemKeyword == "CustomerReminder.RegisteredCustomer" ||- x.SystemKeyword == "CustomerReminder.LastActivity" ||- x.SystemKeyword == "CustomerReminder.LastPurchase" ||- x.SystemKeyword == "CustomerReminder.Birthday" ||- x.SystemKeyword == "CustomerReminder.SendCampaign");- foreach (var item in activityLogTypes)- {- repository.Delete(item);- }-- }- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - RemoveOldActivityLogType");- }- return true;-- }- }-}diff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.csindex 84772e565..a2eaa0865 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs@@ -13,8 +13,8 @@ namespace Grand.Business.System.Services.Migrations._2._2{public int Priority => 0;public DbVersion Version => new(2, 2);- public Guid Identity => new("3F4E87C6-8ECE-4034-8211-39C3D3EBC567");- public string Name => "Install new permission - ManageAccessVendorPanel / Delete permission - ManageSystemLog";+ public Guid Identity => new("8F35D0AF-28EF-4734-BC93-9F8A0F63E79A");+ public string Name => "Install new permission - ManageAccessVendorPanel / Delete permission - ManageSystemLog/ManageActivityLog";/// <summary>/// Upgrade process@@ -49,6 +49,11 @@ namespace Grand.Business.System.Services.Migrations._2._2{repository.Delete(permissionManageSystemLog);}+ var permissionManageActivityLog = repository.Table.FirstOrDefault(x => x.SystemName == "ManageActivityLog");+ if (permissionManageActivityLog != null)+ {+ repository.Delete(permissionManageActivityLog);+ }}catch (Exception ex)diff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.csindex f7aa34a3f..7e03009a4 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs@@ -11,7 +11,7 @@ namespace Grand.Business.System.Services.Migrations._2._2{public int Priority => 0;public DbVersion Version => new(2, 2);- public Guid Identity => new("55E49962-66DD-4034-8AB2-7F4C33A5E0B2");+ public Guid Identity => new("D548BACF-3DF8-48ED-A522-086EAB165808");public string Name => "Update standard admin site map - add admin menu";/// <summary>@@ -30,26 +30,58 @@ namespace Grand.Business.System.Services.Migrations._2._2var sitemapConfiguration = repository.Table.FirstOrDefault(x => x.SystemName == "Configuration");if (sitemapConfiguration != null){- sitemapConfiguration.ChildNodes.Add(new AdminSiteMap() {- SystemName = "Admin menu",- ResourceName = "Admin.Configuration.Menu",- PermissionNames = new List<string> { PermissionSystemName.Maintenance },- ControllerName = "Menu",- ActionName = "Index",- DisplayOrder = 7,- IconClass = "fa fa-dot-circle-o"- });+ if (sitemapConfiguration.ChildNodes.FirstOrDefault(x => x.SystemName == "Admin menu") == null)+ {+ sitemapConfiguration.ChildNodes.Add(new AdminSiteMap() {+ SystemName = "Admin menu",+ ResourceName = "Admin.Configuration.Menu",+ PermissionNames = new List<string> { PermissionSystemName.Maintenance },+ ControllerName = "Menu",+ ActionName = "Index",+ DisplayOrder = 7,+ IconClass = "fa fa-dot-circle-o"+ });+ }+ sitemapConfiguration.PermissionNames.Remove("ManageActivityLog");repository.Update(sitemapConfiguration);}var sitemapSystem = repository.Table.FirstOrDefault(x => x.SystemName == "System");- if (sitemapSystem != null)+ var log = sitemapSystem?.ChildNodes.FirstOrDefault(x => x.SystemName == "Log");+ if (log != null){- var log = sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Log");sitemapSystem.ChildNodes.Remove(log);sitemapSystem.PermissionNames.Remove("ManageSystemLog");repository.Update(sitemapSystem);}++ var sitemapCustomers = repository.Table.FirstOrDefault(x => x.SystemName == "Customers");+ var activityLog = sitemapCustomers?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Log");+ if (activityLog != null)+ {+ sitemapCustomers.ChildNodes.Remove(activityLog);+ sitemapCustomers.PermissionNames.Remove("ManageActivityLog");+ repository.Update(sitemapCustomers);+ }++ var sitemapReports = repository.Table.FirstOrDefault(x => x.SystemName == "Reports");+ var activityStatLog = sitemapReports?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Stats");+ if (activityStatLog != null)+ {+ sitemapReports.ChildNodes.Remove(activityStatLog);+ sitemapReports.PermissionNames.Remove("ManageActivityLog");+ repository.Update(sitemapReports);+ }++ var sitemapSettings = repository.Table.FirstOrDefault(x => x.SystemName == "Settings");+ var activityTypes = sitemapSettings?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Types");+ if (activityTypes != null)+ {+ sitemapSettings.ChildNodes.Remove(activityTypes);+ sitemapSettings.PermissionNames.Remove("ManageActivityLog");+ repository.Update(sitemapSettings);+ }+}catch (Exception ex){diff --git a/src/Core/Grand.Domain/Customers/CustomerSettings.cs b/src/Core/Grand.Domain/Customers/CustomerSettings.csindex 2fc8d69ef..f5704af34 100644--- a/src/Core/Grand.Domain/Customers/CustomerSettings.cs+++ b/src/Core/Grand.Domain/Customers/CustomerSettings.cs@@ -139,11 +139,6 @@ namespace Grand.Domain.Customers/// </summary>public bool StoreLastVisitedPage { get; set; }- /// <summary>- /// For the reasons of efficiency it is required to set, besides settings in activity Log - PublicStore.Url- /// </summary>- public bool SaveVisitedPage { get; set; }-/// <summary>/// Gets or sets a value indicating whether during registration the customer has a free shipping to the next a order/// </summary>diff --git a/src/Core/Grand.Domain/Logging/ActivityLog.cs b/src/Core/Grand.Domain/Logging/ActivityLog.csdeleted file mode 100644index 65b474288..000000000--- a/src/Core/Grand.Domain/Logging/ActivityLog.cs+++ /dev/null@@ -1,50 +0,0 @@-namespace Grand.Domain.Logging-{- /// <summary>- /// Represents an activity log- /// </summary>- public partial class ActivityLog : BaseEntity- {- /// <summary>- /// Gets or sets the activity log type identifier- /// </summary>- public string ActivityLogTypeId { get; set; }-- /// <summary>- /// Gets or sets the customer identifier- /// </summary>- public string CustomerId { get; set; }-- /// <summary>- /// Gets or sets the IP address- /// </summary>- public string IpAddress { get; set; }-- /// <summary>- /// Gets or sets the entity key identifier- /// </summary>- public string EntityKeyId { get; set; }- /// <summary>- /// Gets or sets the activity comment- /// </summary>- public string Comment { get; set; }-- /// <summary>- /// Gets or sets the date and time of instance creation- /// </summary>- public DateTime CreatedOnUtc { get; set; }--- }-- /// <summary>- /// Represents an activity stats - Auxiliary class to reports- /// </summary>- public class ActivityStats- {- public string ActivityLogTypeId { get; set; }- public string EntityKeyId { get; set; }- public int Count { get; set; }- }--}diff --git a/src/Core/Grand.Domain/Logging/ActivityLogType.cs b/src/Core/Grand.Domain/Logging/ActivityLogType.csdeleted file mode 100644index 3e907f45d..000000000--- a/src/Core/Grand.Domain/Logging/ActivityLogType.cs+++ /dev/null@@ -1,23 +0,0 @@-namespace Grand.Domain.Logging-{- /// <summary>- /// Represents an activity log type- /// </summary>- public partial class ActivityLogType : BaseEntity- {- /// <summary>- /// Gets or sets the system keyword- /// </summary>- public string SystemKeyword { get; set; }-- /// <summary>- /// Gets or sets the display name- /// </summary>- public string Name { get; set; }-- /// <summary>- /// Gets or sets a value indicating whether the activity log type is enabled- /// </summary>- public bool Enabled { get; set; }- }-}diff --git a/src/Tests/Grand.Business.Catalog.Tests/Services/Directory/GeoLookupServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Services/Directory/GeoLookupServiceTests.csindex c96b731e2..848a84263 100644--- a/src/Tests/Grand.Business.Catalog.Tests/Services/Directory/GeoLookupServiceTests.cs+++ b/src/Tests/Grand.Business.Catalog.Tests/Services/Directory/GeoLookupServiceTests.cs@@ -1,5 +1,4 @@using Grand.Business.Catalog.Services.Directory;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.SharedKernel.Extensions;using Microsoft.Extensions.Logging;using Microsoft.VisualStudio.TestTools.UnitTesting;diff --git a/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.csindex 3acbb43e4..00586db8b 100644--- a/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs+++ b/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Interfaces.Catalog.Directory;using Grand.Business.Core.Interfaces.Catalog.Tax;using Grand.Business.Core.Interfaces.Common.Directory;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Domain.Catalog;using Grand.Domain.Common;using Grand.Domain.Customers;diff --git a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/CaptureCommandHandlerTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/CaptureCommandHandlerTests.csindex b5b74f807..b14357ba8 100644--- a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/CaptureCommandHandlerTests.cs+++ b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/CaptureCommandHandlerTests.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Commands.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Payments;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Queries.Checkout.Orders;using Grand.Domain.Payments;using MediatR;diff --git a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/PartiallyRefundCommandHandlerTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/PartiallyRefundCommandHandlerTests.csindex ccc2786dd..788975e5a 100644--- a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/PartiallyRefundCommandHandlerTests.cs+++ b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/PartiallyRefundCommandHandlerTests.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Commands.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Payments;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Messages;using Grand.Business.Core.Queries.Checkout.Orders;using Grand.Business.Core.Utilities.Checkout;diff --git a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/RefundCommandHandlerTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/RefundCommandHandlerTests.csindex c30dfd91f..83cdb9754 100644--- a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/RefundCommandHandlerTests.cs+++ b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/RefundCommandHandlerTests.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Commands.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Payments;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Messages;using Grand.Business.Core.Queries.Checkout.Orders;using Grand.Business.Core.Utilities.Checkout;diff --git a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/VoidCommandHandlerTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/VoidCommandHandlerTests.csindex 856538406..1338e040a 100644--- a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/VoidCommandHandlerTests.cs+++ b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/VoidCommandHandlerTests.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Commands.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Payments;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Messages;using Grand.Business.Core.Queries.Checkout.Orders;using Grand.Business.Core.Utilities.Checkout;diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingServiceTests.csindex ef12dc425..390ca3cbb 100644--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingServiceTests.cs+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingServiceTests.cs@@ -2,7 +2,6 @@using Grand.Business.Checkout.Services.Shipping;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Domain.Common;using Grand.Domain.Customers;using Grand.Domain.Orders;diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Logging/CustomerActivityServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Logging/CustomerActivityServiceTests.csdeleted file mode 100644index 236f15873..000000000--- a/src/Tests/Grand.Business.Common.Tests/Services/Logging/CustomerActivityServiceTests.cs+++ /dev/null@@ -1,251 +0,0 @@-using Grand.Business.Common.Services.Logging;-using Grand.Data.Tests.MongoDb;-using Grand.Domain.Data;-using Grand.Domain.Logging;-using Grand.Infrastructure.Caching;-using Grand.Infrastructure.Configuration;-using Grand.Infrastructure.Tests.Caching;-using MediatR;-using Microsoft.VisualStudio.TestTools.UnitTesting;-using Moq;--namespace Grand.Business.Common.Tests.Services.Logging-{- [TestClass()]- public class CustomerActivityServiceTests- {- private IRepository<ActivityLog> _repository;- private IRepository<ActivityLogType> _repositoryActivityLogType;- private Mock<IMediator> _mediatorMock;- private MemoryCacheBase _cacheBase;-- private CustomerActivityService _customerActivityService;-- [TestInitialize()]- public void Init()- {- _repository = new MongoDBRepositoryTest<ActivityLog>();- _repositoryActivityLogType = new MongoDBRepositoryTest<ActivityLogType>();-- _mediatorMock = new Mock<IMediator>();- _cacheBase = new MemoryCacheBase(MemoryCacheTest.Get(), _mediatorMock.Object, new CacheConfig(){ DefaultCacheTimeMinutes = 1});- _customerActivityService = new CustomerActivityService(_cacheBase, _repository, _repositoryActivityLogType);- }-- private async Task InsertActivityType()- {- await _customerActivityService.InsertActivityType(new ActivityLogType() { Id = "1", Enabled = true, Name = "test", SystemKeyword = "test" });- }-- [TestMethod()]- public async Task InsertActivityTypeTest()- {- //Act- await _customerActivityService.InsertActivityType(new ActivityLogType() { Enabled = true, Name = "test", SystemKeyword = "test" });- //Assert- Assert.IsTrue(_repositoryActivityLogType.Table.Any());- }-- [TestMethod()]- public async Task UpdateActivityTypeTest()- {- //Arrange- var activityLogType = new ActivityLogType();- await _customerActivityService.InsertActivityType(activityLogType);-- //Act- activityLogType.Enabled = true;- await _customerActivityService.UpdateActivityType(activityLogType);- //Assert- Assert.IsTrue(_repositoryActivityLogType.Table.FirstOrDefault(x=>x.Id == activityLogType.Id).Enabled);- }-- [TestMethod()]- public async Task DeleteActivityTypeTest()- {- //Arrange- var activityLogType = new ActivityLogType();- await _customerActivityService.InsertActivityType(activityLogType);-- //Act- await _customerActivityService.DeleteActivityType(activityLogType);- //Assert- Assert.IsNull(_repositoryActivityLogType.Table.FirstOrDefault(x => x.Id == activityLogType.Id));- }-- [TestMethod()]- public async Task GetAllActivityTypesTest()- {- //Arrange- var activityLogType = new ActivityLogType();- await _customerActivityService.InsertActivityType(activityLogType);-- //Act- var result = await _customerActivityService.GetAllActivityTypes();- //Assert- Assert.AreEqual(1, result.Count);- }-- [TestMethod()]- public async Task GetActivityTypeByIdTest()- {- //Arrange- var activityLogType = new ActivityLogType();- await _customerActivityService.InsertActivityType(activityLogType);-- //Act- var result = await _customerActivityService.GetActivityTypeById(activityLogType.Id);- //Assert- Assert.IsNotNull(result);- }-- [TestMethod()]- public async Task InsertActivityTest()- {- await InsertActivityType();- //Act- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1"});- //Assert- //TODO- Assert.IsTrue(true);- }-- [TestMethod()]- public async Task DeleteActivityTest()- {- await InsertActivityType();- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });- var activityLogs = await _customerActivityService.GetAllActivities();- //Act- await _customerActivityService.DeleteActivity(activityLogs.FirstOrDefault());- //Assert- Assert.IsFalse(_repository.Table.Any());- }-- [TestMethod()]- public async Task GetAllActivitiesTest()- {- //Arrange- await InsertActivityType();- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });- //Act- var activityLogs = await _customerActivityService.GetAllActivities();- //Assert- //TODO- Assert.IsTrue(activityLogs.Count > 0);- }-- [TestMethod()]- public async Task GetStatsActivitiesTest()- {- //Arrange- await InsertActivityType();- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });- //Act- var activityLogs = await _customerActivityService.GetStatsActivities();- //Assert- Assert.AreEqual(1, activityLogs.Count);- }-- [TestMethod()]- public async Task GetCategoryActivitiesTest()- {- //Arrange- await _customerActivityService.InsertActivityType(new ActivityLogType() { Id = "1", Enabled = true, Name = "AddNewCategory", SystemKeyword = "AddNewCategory" });- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });-- //Act- var activities = await _customerActivityService.GetCategoryActivities(categoryId:"1");- //Assert- Assert.IsTrue(activities.Count > 0);- }-- [TestMethod()]- public async Task GetKnowledgebaseCategoryActivitiesTest()- {- //Arrange- await _customerActivityService.InsertActivityType(new ActivityLogType() {Id = "1", Enabled = true, Name = "CreateKnowledgebaseCategory", SystemKeyword = "CreateKnowledgebaseCategory" });- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });- //Act- var activities = await _customerActivityService.GetKnowledgebaseCategoryActivities(categoryId:"1");- //Assert- Assert.IsTrue(activities.Count > 0);-- }-- [TestMethod()]- public async Task GetKnowledgebaseArticleActivitiesTest()- {- //Arrange- await _customerActivityService.InsertActivityType(new ActivityLogType() { Id = "1", Enabled = true, Name = "CreateKnowledgebaseArticle", SystemKeyword = "CreateKnowledgebaseArticle" });- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });-- //Act- var activities = await _customerActivityService.GetKnowledgebaseArticleActivities(categoryId:"1");- //Assert- Assert.IsTrue(activities.Count > 0);- }-- [TestMethod()]- public async Task GetBrandActivitiesTest()- {- //Arrange- await _customerActivityService.InsertActivityType(new ActivityLogType() { Id = "1", Enabled = true, Name = "AddNewBrand", SystemKeyword = "AddNewBrand" });- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });-- //Act- var activities = await _customerActivityService.GetBrandActivities(brandId:"1");- //Assert- Assert.IsTrue(activities.Count > 0);- }-- [TestMethod()]- public async Task GetCollectionActivitiesTest()- {- //Arrange- await _customerActivityService.InsertActivityType(new ActivityLogType() { Id = "1", Enabled = true, Name = "AddNewCollection", SystemKeyword = "AddNewCollection" });- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });- //Act- var activities = await _customerActivityService.GetCollectionActivities(collectionId:"1");- //Assert- Assert.IsTrue(activities.Count > 0);- }-- [TestMethod()]- public async Task GetProductActivitiesTest()- {- //Arrange- await _customerActivityService.InsertActivityType(new ActivityLogType() { Id = "1", Enabled = true, Name = "AddNewProduct", SystemKeyword = "AddNewProduct" });- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });-- //Act- var activities = await _customerActivityService.GetProductActivities(productId:"1");- //Assert- Assert.IsTrue(activities.Count > 0);- }-- [TestMethod()]- public async Task GetActivityByIdTest()- {- //Arrange- await InsertActivityType();- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });- //Act- var activityLogs = await _customerActivityService.GetAllActivities();- var result = await _customerActivityService.GetActivityById(activityLogs[0].Id);- //Assert- Assert.IsNotNull(result);- }-- [TestMethod()]- public async Task ClearAllActivitiesTest()- {- //Arrange- await _repository.InsertAsync(new ActivityLog() { ActivityLogTypeId = "1", EntityKeyId = "1" });- //Act- await _customerActivityService.ClearAllActivities();- //Assert- Assert.IsFalse(_repository.Table.Any());- }- }-}\ No newline at end of filediff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.csindex 207d7c58d..f592ea3f8 100644--- a/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs+++ b/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs@@ -1,5 +1,4 @@-using Grand.Business.Core.Interfaces.Common.Logging;-using Grand.Business.Marketing.Services.PushNotifications;+using Grand.Business.Marketing.Services.PushNotifications;using Grand.Business.Marketing.Utilities;using Grand.Data.Tests.MongoDb;using Grand.Domain.Data;diff --git a/src/Tests/Grand.Business.Storage.Tests/Services/PictureServiceTests.cs b/src/Tests/Grand.Business.Storage.Tests/Services/PictureServiceTests.csindex 065d4f8bf..c56a7fecf 100644--- a/src/Tests/Grand.Business.Storage.Tests/Services/PictureServiceTests.cs+++ b/src/Tests/Grand.Business.Storage.Tests/Services/PictureServiceTests.cs@@ -1,5 +1,4 @@-using Grand.Business.Core.Interfaces.Common.Logging;-using Grand.Business.Core.Interfaces.Storage;+using Grand.Business.Core.Interfaces.Storage;using Grand.Business.Storage.Services;using Grand.Domain.Data;using Grand.Domain.Media;diff --git a/src/Tests/Grand.Business.System.Tests/Services/BackgroundService/EndAuctionsTaskTests.cs b/src/Tests/Grand.Business.System.Tests/Services/BackgroundService/EndAuctionsTaskTests.csindex bcc8aaebd..925ac9844 100644--- a/src/Tests/Grand.Business.System.Tests/Services/BackgroundService/EndAuctionsTaskTests.cs+++ b/src/Tests/Grand.Business.System.Tests/Services/BackgroundService/EndAuctionsTaskTests.cs@@ -1,6 +1,5 @@using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Checkout.Orders;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Messages;using Grand.Business.System.Services.BackgroundServices.ScheduleTasks;diff --git a/src/Tests/Grand.Business.System.Tests/Services/BackgroundService/QueuedMessagesSendScheduleTaskTests.cs b/src/Tests/Grand.Business.System.Tests/Services/BackgroundService/QueuedMessagesSendScheduleTaskTests.csindex fccab6da3..d299a4a25 100644--- a/src/Tests/Grand.Business.System.Tests/Services/BackgroundService/QueuedMessagesSendScheduleTaskTests.cs+++ b/src/Tests/Grand.Business.System.Tests/Services/BackgroundService/QueuedMessagesSendScheduleTaskTests.cs@@ -1,5 +1,4 @@-using Grand.Business.Core.Interfaces.Common.Logging;-using Grand.Business.Core.Interfaces.Messages;+using Grand.Business.Core.Interfaces.Messages;using Grand.Business.System.Services.BackgroundServices.ScheduleTasks;using Grand.Domain;using Grand.Domain.Customers;diff --git a/src/Tests/Grand.Business.System.Tests/Services/Migrations/MigrationProcessTest.cs b/src/Tests/Grand.Business.System.Tests/Services/Migrations/MigrationProcessTest.csindex de1e882b8..7e041e4a1 100644--- a/src/Tests/Grand.Business.System.Tests/Services/Migrations/MigrationProcessTest.cs+++ b/src/Tests/Grand.Business.System.Tests/Services/Migrations/MigrationProcessTest.cs@@ -1,5 +1,4 @@-using Grand.Business.Core.Interfaces.Common.Logging;-using Grand.Business.System.Services.Migrations;+using Grand.Business.System.Services.Migrations;using Grand.Domain.Data;using Microsoft.Extensions.Logging;using Microsoft.VisualStudio.TestTools.UnitTesting;diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListLogs.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListLogs.cshtmldeleted file mode 100644index 8194b4f28..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListLogs.cshtml+++ /dev/null@@ -1,189 +0,0 @@-@model ActivityLogSearchModel-@inject AdminAreaSettings adminAreaSettings-@{- //page title- ViewBag.Title = Loc["Admin.Configuration.ActivityLog.ActivityLog"];-}--<div class="row">- <div class="col-md-12">- <div class="x_panel light form-fit popup-window">- <div class="x_title">- <div class="caption">- <i class="fa fa-sitemap"></i>- @Loc["Admin.Configuration.ActivityLog.ActivityLog"]- </div>- <div class="actions btn-group btn-group-devided">- <a asp-action="ClearAll" class="btn red" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]');">- <i class="fa fa-trash-o"></i>- @Loc["Admin.Common.Clear"]- </a>- <vc:admin-widget widget-zone="activity_log_list_buttons" additional-data="null" />- </div>- </div>- <div class="x_content form">- <div class="form-horizontal">- <div class="form-body">- <div class="main-header col-12 px-0">- <div class="row align-items-end">- <div class="col-md-8 col-ms-12 col-12">- <div class="form-group mb-0">- <admin-label asp-for="Comment" class="control-label" />- <admin-input asp-for="Comment" />- </div>- </div>- <div class="col-md-4 col-sm-12 col-12">- <div class="form-actions">- <div class="btn-group">- <button class="btn btn-success filter-submit" id="search-log">- <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]- </button>- <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">- <i class="fa fa-filter"></i> @Loc["Admin.Common.Filters"]- </button>- </div>- </div>- </div>- </div>- </div>- <div class="collapse" id="filterCollapse">- <div class="drop-filters-container">- <div class="form-group">- <admin-label asp-for="CreatedOnFrom" class="col-sm-3 control-label" />- <div class="col-md-9 col-sm-9">- <admin-input asp-for="CreatedOnFrom" />- </div>- </div>- <div class="form-group">- <admin-label asp-for="CreatedOnTo" class="col-sm-3 control-label" />- <div class="col-md-9 col-sm-9">- <admin-input asp-for="CreatedOnTo" />- </div>- </div>- <div class="form-group">- <admin-label asp-for="IpAddress" class="col-sm-3 control-label" />- <div class="col-md-9 col-sm-9">- <admin-input asp-for="IpAddress" />- </div>- </div>- <div class="form-group">- <admin-label asp-for="ActivityLogTypeId" class="col-sm-3 control-label" />- <div class="col-md-9 col-sm-9">- <admin-select asp-for="ActivityLogTypeId" asp-items="Model.ActivityLogType" />- </div>- </div>- </div>- </div>- </div>- </div>- </div>- <div class="x_content">- <div id="activityLog-grid"></div>- </div>- </div>- </div>-</div>-<script>- $(document).ready(function () {- $("#activityLog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListLogs", "ActivityLog", new { area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: additionalData- },- destroy: {- url: "@Html.Raw(Url.Action("ActivityLogDelete", "ActivityLog", new { area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors",- model: {- id: "Id",- fields: {- //do not implicitly specify all fields- //we do it only for fields which implicitly require it- //otherwise, they'll be formatted wrong way- CreatedOn: {type: "date" }- }- }- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Admin.Configuration.ActivityLog.ActivityLog.Fields.ActivityLogType"]",- width: 150- }, {- field: "CustomerId",- title: "@Loc["Admin.Configuration.ActivityLog.ActivityLog.Fields.Customer"]",- width: 100,- template: '<a href="@Url.Action("Edit", "Customer", new { area = Constants.AreaAdmin })/#=CustomerId#">#:CustomerEmail#</a>'- }, {- field: "IpAddress",- title: "@Loc["Admin.Configuration.ActivityLog.ActivityLog.Fields.IpAddress"]"- }, {- field: "Comment",- title: "@Loc["Admin.Configuration.ActivityLog.ActivityLog.Fields.Comment"]"- }, {- field: "CreatedOn",- title: "@Loc["Admin.Configuration.ActivityLog.ActivityLog.Fields.CreatedOn"]",- width: 200,- type: "date",- format: "{0:G}"- }, {- command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },- title: "@Loc["Admin.Common.Delete"]",- width: 100- }]- });- });-</script>-<script>-- $(document).ready(function () {-- $('#search-log').click(function () {- var grid = $('#activityLog-grid').data('kendoGrid');- grid.dataSource.page(1); //new search. Set page size to 1- //grid.dataSource.read(); we already loaded the grid above using "page" function- return false;- });- });-- function additionalData() {- var data = {- Comment: $('#@Html.IdFor(model => model.Comment)').val(),- CreatedOnFrom: $('#@Html.IdFor(model => model.CreatedOnFrom)').val(),- CreatedOnTo: $('#@Html.IdFor(model => model.CreatedOnTo)').val(),- IpAddress: $('#@Html.IdFor(model => model.IpAddress)').val(),- ActivityLogTypeId: $('#ActivityLogTypeId').val()- };- addAntiForgeryToken(data);- return data;- }-</script>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListStats.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListStats.cshtmldeleted file mode 100644index e1ed6f5b0..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListStats.cshtml+++ /dev/null@@ -1,121 +0,0 @@-@model ActivityLogSearchModel-@inject AdminAreaSettings adminAreaSettings-@{- //page title- ViewBag.Title = Loc["admin.reports.activitylog.activitystats"];-}--<div class="row">- <div class="col-md-12">- <div class="x_panel light form-fit popup-window">- <div class="x_title">- <div class="caption level-caption">- <i class="fa fa-sitemap"></i>- @Loc["admin.reports.activitylog.activitystats"]- </div>- </div>- <div class="x_content form">- <div class="form-horizontal col-12 px-0">- <div class="form-body row align-items-end">- <div class="form-group mb-0 col-md-3 col-sm-12 col-12">- <admin-label asp-for="CreatedOnFrom" class="d-flex flex-column align-items-start mw-100 px-0 text-left" />- <admin-input asp-for="CreatedOnFrom" />- </div>- <div class="form-group mb-0 col-md-3 col-sm-12 col-12">- <admin-label asp-for="CreatedOnTo" class="d-flex flex-column align-items-start mw-100 px-0 text-left" />- <admin-input asp-for="CreatedOnTo" />- </div>- <div class="form-group mb-0 col-md-3 col-sm-12 col-12">- <admin-label asp-for="ActivityLogTypeId" class="d-flex flex-column align-items-start mw-100 px-0 text-left" />- <admin-select asp-for="ActivityLogTypeId" asp-items="Model.ActivityLogType" />- </div>- <div class="form-actions col-md-3 col-sm-12 col-12">- <button class="btn btn-success filter-submit" id="search-log">- <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]- </button>- </div>- </div>- </div>- </div>- <div class="x_content">- <div id="activityLog-grid"></div>- </div>- </div>- </div>-</div>-<script>- $(document).ready(function () {- $("#activityLog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListStats", "ActivityLog", new { area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: additionalData- },- },- schema: {- data: "Data",- total: "Total",- errors: "Errors",- model: {- id: "Id",- }- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["admin.reports.activitylog.activitystats.Fields.ActivityLogType"]",- width: 250- }, {- field: "Name",- title: "@Loc["admin.reports.activitylog.activitystats.Fields.Name"]"- }, {- field: "Count",- title: "@Loc["admin.reports.activitylog.activitystats.Fields.Count"]",- width: 100,- }]- });- });-</script>-<script>-- $(document).ready(function () {-- $('#search-log').click(function () {- var grid = $('#activityLog-grid').data('kendoGrid');- grid.dataSource.page(1); //new search. Set page size to 1- //grid.dataSource.read(); we already loaded the grid above using "page" function- return false;- });- });-- function additionalData() {- var data = {- CreatedOnFrom: $('#@Html.IdFor(model => model.CreatedOnFrom)').val(),- CreatedOnTo: $('#@Html.IdFor(model => model.CreatedOnTo)').val(),- ActivityLogTypeId: $('#ActivityLogTypeId').val()- };- addAntiForgeryToken(data);- return data;- }-</script>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListTypes.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListTypes.cshtmldeleted file mode 100644index c2fdadcaf..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/ActivityLog/ListTypes.cshtml+++ /dev/null@@ -1,122 +0,0 @@-@model IList<ActivityLogTypeModel>-@{- //page title- ViewBag.Title = Loc["Admin.Settings.ActivityLog.ActivityLogType"];-}-<form asp-area="@Constants.AreaAdmin" asp-controller="ActivityLog" asp-action="SaveTypes" method="post">-- <div class="row">- <div class="col-md-12">- <div class="x_panel light form-fit">- <div class="x_title">- <div class="caption">- <i class="fa fa-tags"></i>- @Loc["Admin.Settings.ActivityLog.ActivityLogType"]- </div>- <div class="actions btn-group btn-group-devided">- <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> @Loc["Admin.Common.Save"] </button>- </div>- <vc:admin-widget widget-zone="activity_types_list_buttons" additional-data="null" />- </div>- <div class="x_content form">- <div class="form-horizontal">- <div class="form-body">- <div class="x_content">- <div id="activityLogType-grid"></div>- </div>- </div>- </div>- </div>- </div>- </div>- </div>-</form>---<script>-- //local datasource- var activityLogTypes = [- @for(var i=0;i<Model.Count;i++)- {- var alt = Model[i];- <text>- {- Id: '@(alt.Id)',- Name: "@(Html.Raw(System.Text.Encodings.Web.JavaScriptEncoder.Default.Encode(string.IsNullOrEmpty(alt.Name) ? "" : alt.Name)))",- Enabled: @(alt.Enabled.ToString().ToLowerInvariant())- }- </text>- if (i != Model.Count - 1)- {- <text>,</text>- }- }- ];-- $(document).ready(function () {- $("#activityLogType-grid").kendoGrid({- dataSource: {- data: activityLogTypes,- schema: {- model: {- fields: {- Id: { type: "string" },- Name: { type: "string" },- Enabled: { type: "boolean" }- }- }- },- error: function (e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- }- },- pageable: {- refresh: true,- numeric: false,- previousNext: false,- info: false- },- scrollable: false,- columns: [- {- field: "Name",- title: "@Loc["Admin.Settings.ActivityLog.ActivityLogType.Fields.Name"]",- width: 100- }, {- field: "Enabled",- headerTemplate: "@Loc["Admin.Settings.ActivityLog.ActivityLogType.Fields.Enabled"] <label class='mt-checkbox mt-checkbox-outline control control-checkbox'><input id='mastercheckbox' type='checkbox' /> <div class='control__indicator'></div></label>",- headerAttributes: { style: "text-align:center" },- attributes: { style: "text-align:center" },- template: "<label class='mt-checkbox mt-checkbox-outline control control-checkbox'><input name='ActivityTypes' value='#=Id#' type='checkbox' class='checkboxGroups' # if(Enabled) {# checked='checked' #} # /> <div class='control__indicator'></div></label>",- width: 100- }- ]- });- });--</script>-<script>-- $(document).ready(function () {-- updateMasterCheckbox();-- $('#mastercheckbox').click(function () {- $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();- });-- //wire up checkboxes.- $('#activityLogType-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function (e) {- updateMasterCheckbox();- });- });-- function updateMasterCheckbox() {- var numChkBoxes = $('#activityLogType-grid input[type=checkbox][id!=mastercheckbox]').length;- var numChkBoxesChecked = $('#activityLogType-grid input[type=checkbox][id!=mastercheckbox]:checked').length;- $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);- }-</script>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.TabActivityLog.cshtmldeleted file mode 100644index 8c1ef91a8..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.TabActivityLog.cshtml+++ /dev/null@@ -1,76 +0,0 @@-@model BrandModel-@inject AdminAreaSettings adminAreaSettings-@if (!string.IsNullOrEmpty(Model.Id))-{- <div class="panel panel-default">- <vc:admin-widget widget-zone="brand_activity_log_top" additional-data="Model" />- <div class="panel-body">- <div id="activitylog-grid"></div>- </div>- <vc:admin-widget widget-zone="brand_activity_log_bottom" additional-data="Model" />- </div>- <script>- $(document).ready(function () {- $("#activitylog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListActivityLog", "Brand", new { brandId = Model.Id, area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors"- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- autoBind: false,- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Admin.Catalog.Brands.ActivityLog.ActivityLogType"]",- }, {- field: "CustomerId",- title: "@Loc["Admin.Catalog.Brands.ActivityLog.Customer"]",- template: '<a href="@Url.Action("Edit", "Customer", new { area = Constants.AreaAdmin })/#=CustomerId#">#:CustomerEmail#</a>',- minScreenWidth: 500,- }, {- field: "Comment",- title: "@Loc["Admin.Catalog.Brands.ActivityLog.Comment"]",- minScreenWidth: 750,- }, {- field: "CreatedOn",- title: "@Loc["Admin.Catalog.Brands.ActivityLog.CreatedOn"]",- type: "date",- format: "{0:G}"- }]- });- });- </script>-}-else-{- <div class="note note-info">- @Loc["Admin.Catalog.SaveBeforeEdit"]- </div>-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.cshtmlindex a4a44807a..6c42608b9 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.cshtml@@ -46,13 +46,6 @@</div></content></tabstrip-item>- <tabstrip-item text="@Loc["Admin.Catalog.Collections.ActivityLog"]" tab-index="5">- <content>- <div>- <partial name="Partials/CreateOrUpdate.TabActivityLog" model="Model" />- </div>- </content>- </tabstrip-item><vc:admin-widget widget-zone="brand_details_tabs" additional-data="Model" /></items></admin-tabstrip>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.TabActivityLog.cshtmldeleted file mode 100644index 6b4d6e242..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.TabActivityLog.cshtml+++ /dev/null@@ -1,76 +0,0 @@-@model CategoryModel-@inject AdminAreaSettings adminAreaSettings-@if (!string.IsNullOrEmpty(Model.Id))-{- <vc:admin-widget widget-zone="category_details_activity_top" additional-data="Model" />- <div class="panel panel-default">- <div class="panel-body">- <div id="activitylog-grid"></div>- </div>- </div>- <vc:admin-widget widget-zone="category_details_activity_bottom" additional-data="Model" />- <script>- $(document).ready(function () {- $("#activitylog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListActivityLog", "Category", new { categoryId = Model.Id, area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors"- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- autoBind: false,- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Admin.Catalog.Categories.ActivityLog.ActivityLogType"]",- }, {- field: "CustomerId",- minScreenWidth: 500,- title: "@Loc["Admin.Catalog.Categories.ActivityLog.Customer"]",- template: '<a href="@Url.Action("Edit", "Customer", new { area = Constants.AreaAdmin })/#=CustomerId#">#:CustomerEmail#</a>'- }, {- field: "Comment",- minScreenWidth: 750,- title: "@Loc["Admin.Catalog.Categories.ActivityLog.Comment"]"- }, {- field: "CreatedOn",- title: "@Loc["Admin.Catalog.Categories.ActivityLog.CreatedOn"]",- type: "date",- format: "{0:G}"- }]- });- });- </script>-}-else-{- <div class="note note-info">- @Loc["Admin.Catalog.SaveBeforeEdit"]- </div>-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.cshtmlindex 500cd8b16..c444a5995 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.cshtml@@ -54,13 +54,6 @@</div></content></tabstrip-item>- <tabstrip-item text="@Loc["Admin.Catalog.Categories.ActivityLog"]" tab-index="6">- <content>- <div>- <partial name="Partials/CreateOrUpdate.TabActivityLog" model="Model" />- </div>- </content>- </tabstrip-item><vc:admin-widget widget-zone="category_details_tabs" additional-data="Model" /></items></admin-tabstrip>\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.TabActivityLog.cshtmldeleted file mode 100644index e1466be76..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.TabActivityLog.cshtml+++ /dev/null@@ -1,76 +0,0 @@-@model CollectionModel-@inject AdminAreaSettings adminAreaSettings-@if (!string.IsNullOrEmpty(Model.Id))-{- <div class="panel panel-default">- <vc:admin-widget widget-zone="collection_activity_log_top" additional-data="Model" />- <div class="panel-body">- <div id="activitylog-grid"></div>- </div>- <vc:admin-widget widget-zone="collection_activity_log_bottom" additional-data="Model" />- </div>- <script>- $(document).ready(function () {- $("#activitylog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListActivityLog", "Collection", new { collectionId = Model.Id, area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors"- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- autoBind: false,- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Admin.Catalog.Collections.ActivityLog.ActivityLogType"]",- }, {- field: "CustomerId",- title: "@Loc["Admin.Catalog.Collections.ActivityLog.Customer"]",- template: '<a href="@Url.Action("Edit", "Customer", new { area = Constants.AreaAdmin })/#=CustomerId#">#:CustomerEmail#</a>',- minScreenWidth: 500,- }, {- field: "Comment",- title: "@Loc["Admin.Catalog.Collections.ActivityLog.Comment"]",- minScreenWidth: 750,- }, {- field: "CreatedOn",- title: "@Loc["Admin.Catalog.Collections.ActivityLog.CreatedOn"]",- type: "date",- format: "{0:G}"- }]- });- });- </script>-}-else-{- <div class="note note-info">- @Loc["Admin.Catalog.SaveBeforeEdit"]- </div>-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.cshtmlindex a9ba9d1f8..597076fe4 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.cshtml@@ -53,13 +53,6 @@</div></content></tabstrip-item>- <tabstrip-item text="@Loc["Admin.Catalog.Collections.ActivityLog"]" tab-index="6">- <content>- <div>- <partial name="Partials/CreateOrUpdate.TabActivityLog" model="Model" />- </div>- </content>- </tabstrip-item><vc:admin-widget widget-zone="collection_details_tabs" additional-data="Model" /></items></admin-tabstrip>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabActivityLog.cshtmlindex 81ebe2916..2a302b586 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabActivityLog.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabActivityLog.cshtml@@ -5,78 +5,8 @@var defaultGridPageSize = adminAreaSettings.DefaultGridPageSize;var gridPageSizes = adminAreaSettings.GridPageSizes;- <strong>@Loc["Admin.Configuration.Activitylog"]</strong>- <div class="panel panel-default">- <vc:admin-widget widget-zone="customer_details_activity_log_top" additional-data="Model" />- <div class="panel-body">- <div id="activitylog-grid"></div>- </div>- <vc:admin-widget widget-zone="customer_details_activity_log_bottom" additional-data="Model" />- </div>-- <script>- $(document).ready(function () {- $("#activitylog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListActivityLog", "Customer", new { customerId = Model.Id, area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors"- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(defaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- autoBind: false,- pageable: {- refresh: true,- pageSizes: [@(gridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Admin.Customers.Customers.ActivityLog.ActivityLogType"]",- width: 140,- }, {- field: "Comment",- title: "@Loc["Admin.Customers.Customers.ActivityLog.Comment"]",- width: 250,- }, {- field: "CreatedOn",- title: "@Loc["Admin.Customers.Customers.ActivityLog.CreatedOn"]",- width: 120,- type: "date",- format: "{0:G}"- }, {- field: "IpAddress",- title: "@Loc["Admin.Customers.Customers.ActivityLog.IpAddress"]",- width: 50,- }]- });- });- </script>-if (Model.ShowMessageContactForm){- <br /><strong>@Loc["Admin.System.ContactForm"]</strong><div class="panel panel-default">diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateArticle.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateArticle.TabActivityLog.cshtmldeleted file mode 100644index 4f8cf0b61..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateArticle.TabActivityLog.cshtml+++ /dev/null@@ -1,67 +0,0 @@-@model KnowledgebaseArticleModel-@inject AdminAreaSettings adminAreaSettings-@{- <div class="panel panel-default">- <div class="panel-body">- <div id="activitylog-grid"></div>- </div>- </div>- <script>- $(document).ready(function () {- $("#activitylog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListArticleActivityLog", "Knowledgebase", new { articleId = Model.Id, area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors"- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Admin.Catalog.Articles.ActivityLog.ActivityLogType"]",- width: 200,- }, {- field: "CustomerId",- title: "@Loc["Admin.Catalog.Articles.ActivityLog.Customer"]",- width: 200,- template: '<a href="@Url.Action("Edit", "Customer", new { area = Constants.AreaAdmin })/#=CustomerId#">#:CustomerEmail#</a>'- }, {- field: "Comment",- title: "@Loc["Admin.Catalog.Articles.ActivityLog.Comment"]"- }, {- field: "CreatedOn",- title: "@Loc["Admin.Catalog.Articles.ActivityLog.CreatedOn"]",- width: 200,- type: "date",- format: "{0:G}"- }]- });- });- </script>-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateArticle.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateArticle.cshtmlindex bb4c8ff27..3a1223ebf 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateArticle.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateArticle.cshtml@@ -25,13 +25,6 @@</div></content></tabstrip-item>- <tabstrip-item text="@Loc["Admin.Content.Knowledgebase.KnowledgebaseArticle.ActivityLog"]" tab-index="3">- <content>- <div>- <partial name="Partials/CreateOrUpdateArticle.TabActivityLog" model="Model" />- </div>- </content>- </tabstrip-item><vc:admin-widget widget-zone="knowledgebase_article_details_tabs" additional-data="Model" /></items></admin-tabstrip>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateCategory.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateCategory.TabActivityLog.cshtmldeleted file mode 100644index 3755e1415..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateCategory.TabActivityLog.cshtml+++ /dev/null@@ -1,67 +0,0 @@-@model KnowledgebaseCategoryModel-@inject AdminAreaSettings adminAreaSettings-@{- <div class="panel panel-default">- <div class="panel-body">- <div id="activitylog-grid"></div>- </div>- </div>- <script>- $(document).ready(function () {- $("#activitylog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListCategoryActivityLog", "Knowledgebase", new { categoryId = Model.Id, area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors"- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Admin.Catalog.Categories.ActivityLog.ActivityLogType"]",- width: 200,- }, {- field: "CustomerId",- title: "@Loc["Admin.Catalog.Categories.ActivityLog.Customer"]",- width: 200,- template: '<a href="@Url.Action("Edit", "Customer", new { area = Constants.AreaAdmin })/#=CustomerId#">#:CustomerEmail#</a>'- }, {- field: "Comment",- title: "@Loc["Admin.Catalog.Categories.ActivityLog.Comment"]"- }, {- field: "CreatedOn",- title: "@Loc["Admin.Catalog.Categories.ActivityLog.CreatedOn"]",- width: 200,- type: "date",- format: "{0:G}"- }]- });- });- </script>-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateCategory.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateCategory.cshtmlindex 71df4a040..668df522c 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateCategory.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Knowledgebase/Partials/CreateOrUpdateCategory.cshtml@@ -25,13 +25,6 @@</div></content></tabstrip-item>- <tabstrip-item text="@Loc["Admin.Content.Knowledgebase.KnowledgebaseCategory.ActivityLog"]" tab-index="3">- <content>- <div>- <partial name="Partials/CreateOrUpdateCategory.TabActivityLog" model="Model" />- </div>- </content>- </tabstrip-item><vc:admin-widget widget-zone="knowledgebase_category_details_tabs" additional-data="Model" /></items></admin-tabstrip>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Maintenance/Maintenance.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Maintenance/Maintenance.cshtmlindex 466d8068b..66bbe0c3e 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Maintenance/Maintenance.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Maintenance/Maintenance.cshtml@@ -89,20 +89,6 @@<label class="offset-md-3">@string.Format(Loc["Admin.System.Maintenance.DeleteExportedFiles.TotalDeleted"], Model.DeleteExportedFiles.NumberOfDeletedFiles.Value)</label>}</div>- <div class="form-body panel panel-default">- <div class="note note-info">- <strong>@Loc["Admin.System.Maintenance.DeleteActivityLog"]</strong>- </div>- <div class="form-group">- <input type="submit" name="delete-activitylog" asp-action="MaintenanceDeleteActivitylog" class="btn red offset-md-3" value="@Loc["Admin.Common.Delete"]" />- </div>- @if (Model.DeleteActivityLog)- {- <div class="form-group">- <label class="offset-md-3">@Loc["Admin.System.Maintenance.DeleteActivityLog.Deleted"]</label>- </div>- }- </div><div class="form-body panel panel-default"><div class="note note-info form-actions"><strong>@Loc["Admin.System.Maintenance.ConvertPicture"]</strong>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.Activitylog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.Activitylog.cshtmldeleted file mode 100644index b9aca42d6..000000000--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.Activitylog.cshtml+++ /dev/null@@ -1,73 +0,0 @@-@model ProductModel-@inject AdminAreaSettings adminAreaSettings-@if (!string.IsNullOrEmpty(Model.Id))-{--<div class="panel panel-default">- <vc:admin-widget widget-zone="product_details_activity_log_top" additional-data="Model" />- <div class="panel-body">- <div id="activitylog-grid"></div>- </div>- <vc:admin-widget widget-zone="product_details_activity_log_bottom" additional-data="Model" />-</div>-- <script>- $(document).ready(function () {- $("#activitylog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListActivityLog", "Product", new { productId = Model.Id, area = Constants.AreaAdmin }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors"- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- autoBind: false,- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Admin.Catalog.Products.ActivityLog.ActivityLogType"]",- }, {- field: "CustomerId",- title: "@Loc["Admin.Catalog.Products.ActivityLog.Customer"]",- minScreenWidth: 500,- template: '<a href="@Url.Action("Edit", "Customer", new { area = Constants.AreaAdmin })/#=CustomerId#">#:CustomerEmail#</a>'- }, {- field: "Comment",- title: "@Loc["Admin.Catalog.Products.ActivityLog.Comment"]",- minScreenWidth: 750,- }, {- field: "CreatedOn",- title: "@Loc["Admin.Catalog.Products.ActivityLog.CreatedOn"]",- type: "date",- format: "{0:G}"- }]- });- });- </script>--}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.cshtmlindex 019fd834e..972d93239 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.cshtml@@ -113,21 +113,14 @@</tabstrip-item>@if (!string.IsNullOrEmpty(Model.Id)){- <tabstrip-item text="@Loc["Admin.Catalog.Products.ActivityLog"]" tab-index="14">- <content>- <div>- <partial name="Partials/CreateOrUpdate.Activitylog" model="Model" />- </div>- </content>- </tabstrip-item>- <tabstrip-item text="@Loc["Admin.Catalog.Products.PurchasedWithOrders"]" tab-index="15" id="tab-purchased-product">+ <tabstrip-item text="@Loc["Admin.Catalog.Products.PurchasedWithOrders"]" tab-index="14" id="tab-purchased-product"><content><div><partial name="Partials/CreateOrUpdate.PurchasedWithOrders" model="Model" /></div></content></tabstrip-item>- <tabstrip-item text="@Loc["Admin.Catalog.Products.Reviews"]" tab-index="16">+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Reviews"]" tab-index="15"><content><div><partial name="Partials/CreateOrUpdate.Reviews" model="Model" />@@ -136,7 +129,7 @@</tabstrip-item>if (canManageDocuments){- <tabstrip-item text="@Loc["Admin.Catalog.Products.Documents"]" tab-index="17">+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Documents"]" tab-index="16"><content><div><partial name="Partials/CreateOrUpdate.Documents" model="Model" />@@ -144,7 +137,7 @@</content></tabstrip-item>}- <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="18">+ <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="17"><content><div><partial name="Partials/UserFields" model="Model" />diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/_ViewImports.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/_ViewImports.cshtmlindex 5802f6f0a..1cef61f9d 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/_ViewImports.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/_ViewImports.cshtml@@ -24,7 +24,6 @@@using Grand.Web.Common.Page@using Grand.Web.Common.Link;@using Grand.Web.Admin.Extensions;-@using Grand.Web.Admin.Models.ActivityLog;@using Grand.Web.Admin.Models.Affiliates@using Grand.Web.Admin.Models.Blogs@using Grand.Web.Admin.Models.Catalogdiff --git a/src/Web/Grand.Web.Admin/Controllers/ActivityLogController.cs b/src/Web/Grand.Web.Admin/Controllers/ActivityLogController.csdeleted file mode 100644index d34e336a9..000000000--- a/src/Web/Grand.Web.Admin/Controllers/ActivityLogController.cs+++ /dev/null@@ -1,126 +0,0 @@-using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;-using Grand.Business.Core.Utilities.Common.Security;-using Grand.Web.Common.DataSource;-using Grand.Web.Common.Security.Authorization;-using Grand.Web.Admin.Interfaces;-using Grand.Web.Admin.Models.ActivityLog;-using Microsoft.AspNetCore.Mvc;--namespace Grand.Web.Admin.Controllers-{- [PermissionAuthorize(PermissionSystemName.ActivityLog)]- public class ActivityLogController : BaseAdminController- {- #region Fields-- private readonly ICustomerActivityService _customerActivityService;- private readonly ITranslationService _translationService;- private readonly IActivityLogViewModelService _activityLogViewModelService;-- #endregion Fields-- #region Constructors-- public ActivityLogController(ICustomerActivityService customerActivityService,- ITranslationService translationService, IActivityLogViewModelService activityLogViewModelService)- {- _customerActivityService = customerActivityService;- _translationService = translationService;- _activityLogViewModelService = activityLogViewModelService;- }-- #endregion-- #region Activity log types- [PermissionAuthorizeAction(PermissionActionName.List)]- public async Task<IActionResult> ListTypes()- {- var model = await _activityLogViewModelService.PrepareActivityLogTypeModels();- return View(model);- }-- [HttpPost]- [PermissionAuthorizeAction(PermissionActionName.Edit)]- public async Task<IActionResult> SaveTypes(ActivityTypeModel model)- {- var checkedActivityTypes = model.ActivityTypes.ToList();- await _activityLogViewModelService.SaveTypes(checkedActivityTypes);-- Success(_translationService.GetResource("Admin.Settings.ActivityLog.ActivityLogType.Updated"));- return RedirectToAction("ListTypes");- }-- #endregion-- #region Activity log- [PermissionAuthorizeAction(PermissionActionName.List)]- public async Task<IActionResult> ListLogs()- {- var model = await _activityLogViewModelService.PrepareActivityLogSearchModel();- return View(model);- }-- [HttpPost]- [PermissionAuthorizeAction(PermissionActionName.List)]- public async Task<IActionResult> ListLogs(DataSourceRequest command, ActivityLogSearchModel model)- {- var activitymodel = await _activityLogViewModelService.PrepareActivityLogModel(model, command.Page, command.PageSize);- var gridModel = new DataSourceResult- {- Data = activitymodel.activityLogs,- Total = activitymodel.totalCount- };- return Json(gridModel);- }-- [PermissionAuthorizeAction(PermissionActionName.Delete)]- public async Task<IActionResult> ActivityLogDelete(string id)- {- var activityLog = await _customerActivityService.GetActivityById(id);- if (activityLog == null)- {- throw new ArgumentException("No activity log found with the specified id");- }- if (ModelState.IsValid)- {- await _customerActivityService.DeleteActivity(activityLog);- return new JsonResult("");- }- return ErrorForKendoGridJson(ModelState);- }-- [PermissionAuthorizeAction(PermissionActionName.Delete)]- public async Task<IActionResult> ClearAll()- {- await _customerActivityService.ClearAllActivities();- return RedirectToAction("ListLogs");- }-- #endregion-- #region Activity Stats- [PermissionAuthorizeAction(PermissionActionName.List)]- public async Task<IActionResult> ListStats()- {- var model = await _activityLogViewModelService.PrepareActivityLogSearchModel();- return View(model);- }-- [PermissionAuthorizeAction(PermissionActionName.List)]- [HttpPost]- public async Task<IActionResult> ListStats(DataSourceRequest command, ActivityLogSearchModel model)- {- var activityStatmodel = await _activityLogViewModelService.PrepareActivityStatModel(model, command.Page, command.PageSize);- var gridModel = new DataSourceResult- {- Data = activityStatmodel.activityStats,- Total = activityStatmodel.totalCount- };- return Json(gridModel);-- }- #endregion-- }-}diff --git a/src/Web/Grand.Web.Admin/Controllers/BrandController.cs b/src/Web/Grand.Web.Admin/Controllers/BrandController.csindex 07b4c3109..ca0a4cc16 100644--- a/src/Web/Grand.Web.Admin/Controllers/BrandController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/BrandController.cs@@ -373,25 +373,6 @@ namespace Grand.Web.Admin.Controllers}#endregion- #region Activity log-- [PermissionAuthorizeAction(PermissionActionName.Preview)]- [HttpPost]- public async Task<IActionResult> ListActivityLog(DataSourceRequest command, string brandId)- {- var brand = await _brandService.GetBrandById(brandId);- var permission = await CheckAccessToBrand(brand);- if (!permission.allow)- return ErrorForKendoGridJson(permission.message);-- var (activityLogModels, totalCount) = await _brandViewModelService.PrepareActivityLogModel(brandId, command.Page, command.PageSize);- var gridModel = new DataSourceResult {- Data = activityLogModels.ToList(),- Total = totalCount- };- return Json(gridModel);- }- #endregion}}diff --git a/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs b/src/Web/Grand.Web.Admin/Controllers/CategoryController.csindex 23fdbd933..f2da390ae 100644--- a/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs@@ -420,27 +420,5 @@ namespace Grand.Web.Admin.Controllers#endregion- #region Activity log-- [PermissionAuthorizeAction(PermissionActionName.Preview)]- [HttpPost]- public async Task<IActionResult> ListActivityLog(DataSourceRequest command, string categoryId)- {- var category = await _categoryService.GetCategoryById(categoryId);-- var permission = await CheckAccessToCategory(category);- if (!permission.allow)- return ErrorForKendoGridJson(permission.message);-- var activityLog = await _categoryViewModelService.PrepareActivityLogModel(categoryId, command.Page, command.PageSize);- var gridModel = new DataSourceResult {- Data = activityLog.activityLogModel,- Total = activityLog.totalCount- };-- return Json(gridModel);- }-- #endregion}}diff --git a/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.csindex 408f7a4a9..67211f113 100644--- a/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs@@ -3,7 +3,6 @@ using Grand.Business.Core.Interfaces.Checkout.CheckoutAttributes;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Common.Security;using Grand.Domain.Directory;using Grand.Infrastructure;@@ -163,15 +162,11 @@ namespace Grand.Web.Admin.Controllers[HttpPost][PermissionAuthorizeAction(PermissionActionName.Delete)]public async Task<IActionResult> Delete(string id,- [FromServices] IWorkContext workContext,- [FromServices] ICustomerActivityService customerActivityService)+ [FromServices] IWorkContext workContext){var checkoutAttribute = await _checkoutAttributeService.GetCheckoutAttributeById(id);await _checkoutAttributeService.DeleteCheckoutAttribute(checkoutAttribute);- //activity log- await customerActivityService.InsertActivity("DeleteCheckoutAttribute", checkoutAttribute.Id, workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(), _translationService.GetResource("ActivityLog.DeleteCheckoutAttribute"), checkoutAttribute.Name);-Success(_translationService.GetResource("Admin.Orders.CheckoutAttributes.Deleted"));return RedirectToAction("List");}diff --git a/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs b/src/Web/Grand.Web.Admin/Controllers/CollectionController.csindex b35982b82..2c173cd24 100644--- a/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs@@ -462,25 +462,6 @@ namespace Grand.Web.Admin.Controllers}#endregion- #region Activity log-- [PermissionAuthorizeAction(PermissionActionName.Preview)]- [HttpPost]- public async Task<IActionResult> ListActivityLog(DataSourceRequest command, string collectionId)- {- var collection = await _collectionService.GetCollectionById(collectionId);- var permission = await CheckAccessToCollection(collection);- if (!permission.allow)- return ErrorForKendoGridJson(permission.message);-- var (activityLogModels, totalCount) = await _collectionViewModelService.PrepareActivityLogModel(collectionId, command.Page, command.PageSize);- var gridModel = new DataSourceResult {- Data = activityLogModels.ToList(),- Total = totalCount- };- return Json(gridModel);- }- #endregion}}diff --git a/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.csindex a8b14dcaf..2a6b59c8c 100644--- a/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs@@ -1,6 +1,5 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Common.Security;using Grand.Business.Core.Interfaces.Marketing.Contacts;using Grand.Web.Common.DataSource;@@ -145,19 +144,13 @@ namespace Grand.Web.Admin.Controllers[HttpPost][PermissionAuthorizeAction(PermissionActionName.Delete)]public async Task<IActionResult> Delete(string id,- [FromServices] IWorkContext workContext,- [FromServices] ICustomerActivityService customerActivityService)+ [FromServices] IWorkContext workContext){if (ModelState.IsValid){var contactAttribute = await _contactAttributeService.GetContactAttributeById(id);await _contactAttributeService.DeleteContactAttribute(contactAttribute);- //activity log- _ = customerActivityService.InsertActivity("DeleteContactAttribute", contactAttribute.Id,- workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteContactAttribute"), contactAttribute.Name);-Success(_translationService.GetResource("Admin.Catalog.Attributes.ContactAttributes.Deleted"));return RedirectToAction("List");}diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerController.csindex 1263b2eb7..c4ece6983 100644--- a/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs@@ -880,21 +880,7 @@ namespace Grand.Web.Admin.Controllers#endregion- #region Activity log and message contact form-- [PermissionAuthorizeAction(PermissionActionName.Preview)]- [HttpPost]- public async Task<IActionResult> ListActivityLog(DataSourceRequest command, string customerId)- {- var (activityLogModels, totalCount) = await _customerViewModelService.PrepareActivityLogModel(customerId, command.Page, command.PageSize);- var gridModel = new DataSourceResult- {- Data = activityLogModels.ToList(),- Total = totalCount- };-- return Json(gridModel);- }+ #region Message contact form[PermissionAuthorizeAction(PermissionActionName.Preview)][HttpPost]diff --git a/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs b/src/Web/Grand.Web.Admin/Controllers/DocumentController.csindex 2a60bca6f..2c3ece7e9 100644--- a/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs@@ -1,9 +1,7 @@using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Common.Security;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Marketing.Documents;-using Grand.Infrastructure;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Documents;@@ -22,24 +20,18 @@ namespace Grand.Web.Admin.Controllersprivate readonly IDocumentService _documentService;private readonly ITranslationService _translationService;private readonly ICustomerService _customerService;- private readonly ICustomerActivityService _customerActivityService;- private readonly IWorkContext _workContext;public DocumentController(IDocumentViewModelService documentViewModelService,IDocumentService documentService,IDocumentTypeService documentTypeService,ITranslationService translationService,- ICustomerService customerService,- ICustomerActivityService customerActivityService,- IWorkContext workContext)+ ICustomerService customerService){_documentViewModelService = documentViewModelService;_documentService = documentService;_documentTypeService = documentTypeService;_translationService = translationService;_customerService = customerService;- _customerActivityService = customerActivityService;- _workContext = workContext;}public IActionResult Index() => RedirectToAction("List");@@ -171,11 +163,6 @@ namespace Grand.Web.Admin.Controllersvar documenttype = model.ToEntity();await _documentTypeService.Insert(documenttype);- //activity log- _ = _customerActivityService.InsertActivity("AddNewDocumentType", documenttype.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewDocumentType"), documenttype.Name);-Success(_translationService.GetResource("Admin.Documents.Type.Added"));return continueEditing ? RedirectToAction("EditType", new { id = documenttype.Id }) : RedirectToAction("Types");}@@ -207,11 +194,6 @@ namespace Grand.Web.Admin.ControllersdocumentType = model.ToEntity(documentType);await _documentTypeService.Update(documentType);- //activity log- _ = _customerActivityService.InsertActivity("EditDocumentType", documentType.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditDocumentType"), documentType.Name);-Success(_translationService.GetResource("Admin.Documents.Type.Updated"));return continueEditing ? RedirectToAction("EditType", new { id = documentType.Id }) : RedirectToAction("Types");}@@ -231,11 +213,6 @@ namespace Grand.Web.Admin.Controllers{await _documentTypeService.Delete(documentType);- //activity log- _ = _customerActivityService.InsertActivity("DeleteDocumentType", documentType.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteDocumentType"), documentType.Name);-Success(_translationService.GetResource("Admin.Documents.Type.Deleted"));return RedirectToAction("Types");}diff --git a/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs b/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.csindex 3080ee15d..a2fd8e338 100644--- a/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs@@ -55,35 +55,6 @@ namespace Grand.Web.Admin.Controllersreturn Json(gridModel);}- [PermissionAuthorizeAction(PermissionActionName.List)]- [HttpPost]- public async Task<IActionResult> ListCategoryActivityLog(DataSourceRequest command, string categoryId)- {- var (activityLogModels, totalCount) = await _knowledgebaseViewModelService.PrepareCategoryActivityLogModels(categoryId, command.Page, command.PageSize);-- var gridModel = new DataSourceResult- {- Data = activityLogModels.ToList(),- Total = totalCount- };-- return Json(gridModel);- }-- [PermissionAuthorizeAction(PermissionActionName.List)]- [HttpPost]- public async Task<IActionResult> ListArticleActivityLog(DataSourceRequest command, string articleId)- {- var (activityLogModels, totalCount) = await _knowledgebaseViewModelService.PrepareArticleActivityLogModels(articleId, command.Page, command.PageSize);-- var gridModel = new DataSourceResult- {- Data = activityLogModels.ToList(),- Total = totalCount- };- return Json(gridModel);- }-[PermissionAuthorizeAction(PermissionActionName.Create)]public async Task<IActionResult> CreateCategory(){diff --git a/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs b/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.csindex 72fc6464f..40924e277 100644--- a/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs@@ -75,9 +75,6 @@ namespace Grand.Web.Admin.Controllersif (TempData["NumberOfDeletedCustomers"] != null)model.DeleteGuests.NumberOfDeletedCustomers = (int)TempData["NumberOfDeletedCustomers"];- if (TempData["DeleteActivityLog"] != null)- model.DeleteActivityLog = (bool)TempData["DeleteActivityLog"];-if (TempData["NumberOfConvertItems"] != null){model.ConvertedPictureModel = new MaintenanceModel.ConvertPictureModel {@@ -115,15 +112,6 @@ namespace Grand.Web.Admin.Controllersreturn RedirectToAction("Maintenance");}-- [HttpPost]- public async Task<IActionResult> MaintenanceDeleteActivitylog(MaintenanceModel model)- {- await _mediator.Send(new DeleteActivitylogCommand());- TempData["DeleteActivityLog"] = true;- return RedirectToAction("Maintenance");- }-[HttpPost]public async Task<IActionResult> MaintenanceConvertPicture([FromServices] IPictureService pictureService,diff --git a/src/Web/Grand.Web.Admin/Controllers/OrderController.cs b/src/Web/Grand.Web.Admin/Controllers/OrderController.csindex e1e4cfeb1..95f27ee0e 100644--- a/src/Web/Grand.Web.Admin/Controllers/OrderController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/OrderController.cs@@ -5,7 +5,6 @@ using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Addresses;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Pdf;using Grand.Business.Core.Utilities.Common.Security;using Grand.Domain.Catalog;@@ -237,8 +236,6 @@ namespace Grand.Web.Admin.Controllers{await _mediator.Send(new CancelOrderCommand { Order = order, NotifyCustomer = true });- _ = _orderViewModelService.LogEditOrder(order.Id);-Success("Successfully canceled order");return RedirectToAction("Edit", "Order", new { id });}@@ -267,7 +264,7 @@ namespace Grand.Web.Admin.Controllerstry{await _orderViewModelService.SaveOrderTags(order, orderModel.OrderTags);- _ = _orderViewModelService.LogEditOrder(order.Id);+var model = new OrderModel();await _orderViewModelService.PrepareOrderDetailsModel(model, order);return RedirectToAction("Edit", "Order", new { id = order.Id });@@ -312,7 +309,6 @@ namespace Grand.Web.Admin.ControllersOrderId = order.Id});- _ = _orderViewModelService.LogEditOrder(order.Id);model = new OrderModel();await _orderViewModelService.PrepareOrderDetailsModel(model, order);return RedirectToAction("Edit", "Order", new { id });@@ -350,8 +346,7 @@ namespace Grand.Web.Admin.Controllers[PermissionAuthorizeAction(PermissionActionName.Delete)][HttpPost]- public async Task<IActionResult> Delete(OrderDeleteModel model,- [FromServices] ICustomerActivityService customerActivityService)+ public async Task<IActionResult> Delete(OrderDeleteModel model){var order = await _orderService.GetOrderById(model.Id);if (order == null || await CheckSalesManager(order))@@ -361,9 +356,7 @@ namespace Grand.Web.Admin.Controllersif (ModelState.IsValid){await _mediator.Send(new DeleteOrderCommand { Order = order });- _ = customerActivityService.InsertActivity("DeleteOrder", model.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteOrder"), order.Id);+return RedirectToAction("List");}Error(ModelState);@@ -374,7 +367,6 @@ namespace Grand.Web.Admin.Controllers[HttpPost]public async Task<IActionResult> DeleteSelected(ICollection<string> selectedIds,- [FromServices] ICustomerActivityService customerActivityService,[FromServices] IShipmentService shipmentService){if (await _groupService.IsStaff(_workContext.CurrentCustomer))@@ -394,9 +386,6 @@ namespace Grand.Web.Admin.Controllersif (!shipments.Any()){await _mediator.Send(new DeleteOrderCommand { Order = order });- _ = customerActivityService.InsertActivity("DeleteOrder", order.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteOrder"), order.Id);}}}@@ -517,7 +506,6 @@ namespace Grand.Web.Admin.ControllersOrderId = order.Id});- _ = _orderViewModelService.LogEditOrder(order.Id);await _orderViewModelService.PrepareOrderDetailsModel(model, order);return RedirectToAction("Edit", "Order", new { id });}@@ -546,7 +534,6 @@ namespace Grand.Web.Admin.ControllersCreatedOnUtc = DateTime.UtcNow,OrderId = order.Id});- _ = _orderViewModelService.LogEditOrder(order.Id);await _orderViewModelService.PrepareOrderDetailsModel(model, order);//selected tab@@ -571,7 +558,6 @@ namespace Grand.Web.Admin.Controllersorder.UserFields = model.UserFields;await _orderService.UpdateOrder(order);- _ = _orderViewModelService.LogEditOrder(order.Id);await _orderViewModelService.PrepareOrderDetailsModel(model, order);@@ -727,7 +713,6 @@ namespace Grand.Web.Admin.ControllersorderItem.DownloadCount = 0;await _orderService.UpdateOrder(order);- _ = _orderViewModelService.LogEditOrder(order.Id);var model = new OrderModel();await _orderViewModelService.PrepareOrderDetailsModel(model, order);@@ -757,7 +742,6 @@ namespace Grand.Web.Admin.ControllersorderItem.IsDownloadActivated = !orderItem.IsDownloadActivated;await _orderService.UpdateOrder(order);- _ = _orderViewModelService.LogEditOrder(order.Id);var model = new OrderModel();await _orderViewModelService.PrepareOrderDetailsModel(model, order);@@ -823,7 +807,6 @@ namespace Grand.Web.Admin.ControllersorderItem.LicenseDownloadId = null;await _orderService.UpdateOrder(order);- _ = _orderViewModelService.LogEditOrder(order.Id);//successViewBag.RefreshPage = true;@@ -852,8 +835,6 @@ namespace Grand.Web.Admin.ControllersorderItem.LicenseDownloadId = null;await _orderService.UpdateOrder(order);- _ = _orderViewModelService.LogEditOrder(order.Id);-//successViewBag.RefreshPage = true;diff --git a/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs b/src/Web/Grand.Web.Admin/Controllers/PaymentController.csindex e645715d5..7e62d437f 100644--- a/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs@@ -4,7 +4,6 @@ using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Configuration;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Common.Security;using Grand.Domain.Payments;using Grand.Infrastructure;@@ -232,8 +231,7 @@ namespace Grand.Web.Admin.Controllersreturn View(model);}[HttpPost]- public async Task<IActionResult> Settings(PaymentSettingsModel model,- [FromServices] ICustomerActivityService customerActivityService)+ public async Task<IActionResult> Settings(PaymentSettingsModel model){var storeScope = await GetActiveStore();@@ -242,11 +240,6 @@ namespace Grand.Web.Admin.Controllersawait _settingService.SaveSetting(paymentSettings, storeScope);- //activity log- _ = customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));return RedirectToAction("Settings");}diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.csindex 0206ec80e..c20eaabe9 100644--- a/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Common.Security;using Grand.Web.Common.DataSource;using Grand.Web.Common.Filters;@@ -23,12 +22,11 @@ namespace Grand.Web.Admin.Controllersprivate readonly IProductAttributeService _productAttributeService;private readonly ILanguageService _languageService;private readonly ITranslationService _translationService;- private readonly ICustomerActivityService _customerActivityService;private readonly IWorkContext _workContext;private readonly IGroupService _groupService;private readonly SeoSettings _seoSettings;- #endregion Fields+ #endregion Fields#region Constructors@@ -37,7 +35,6 @@ namespace Grand.Web.Admin.ControllersIProductAttributeService productAttributeService,ILanguageService languageService,ITranslationService translationService,- ICustomerActivityService customerActivityService,IWorkContext workContext,IGroupService groupService,SeoSettings seoSettings)@@ -46,7 +43,6 @@ namespace Grand.Web.Admin.Controllers_productAttributeService = productAttributeService;_languageService = languageService;_translationService = translationService;- _customerActivityService = customerActivityService;_workContext = workContext;_groupService = groupService;_seoSettings = seoSettings;@@ -103,11 +99,6 @@ namespace Grand.Web.Admin.Controllersawait _productAttributeService.InsertProductAttribute(productAttribute);- //activity log- _ = _customerActivityService.InsertActivity("AddNewProductAttribute", productAttribute.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewProductAttribute"), productAttribute.Name);-Success(_translationService.GetResource("Admin.Catalog.Attributes.ProductAttributes.Added"));return continueEditing ? RedirectToAction("Edit", new { id = productAttribute.Id }) : RedirectToAction("List");}@@ -154,11 +145,6 @@ namespace Grand.Web.Admin.Controllers}await _productAttributeService.UpdateProductAttribute(productAttribute);- //activity log- _ = _customerActivityService.InsertActivity("EditProductAttribute", productAttribute.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditProductAttribute"), productAttribute.Name);-Success(_translationService.GetResource("Admin.Catalog.Attributes.ProductAttributes.Updated"));if (continueEditing){@@ -194,12 +180,6 @@ namespace Grand.Web.Admin.Controllersif (ModelState.IsValid){await _productAttributeService.DeleteProductAttribute(productAttribute);-- //activity log- _ = _customerActivityService.InsertActivity("DeleteProductAttribute", productAttribute.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteProductAttribute"), productAttribute.Name);-Success(_translationService.GetResource("Admin.Catalog.Attributes.ProductAttributes.Deleted"));return RedirectToAction("List");}@@ -335,7 +315,7 @@ namespace Grand.Web.Admin.Controllersif (ModelState.IsValid){var productAttribute = (await _productAttributeService.GetAllProductAttributes()).FirstOrDefault(x => x.PredefinedProductAttributeValues.Any(y => y.Id == id));- var ppav = productAttribute.PredefinedProductAttributeValues.FirstOrDefault(x => x.Id == id);+ var ppav = productAttribute?.PredefinedProductAttributeValues.FirstOrDefault(x => x.Id == id);if (ppav == null)throw new ArgumentException("No predefined product attribute value found with the specified id");productAttribute.PredefinedProductAttributeValues.Remove(ppav);diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductController.csindex 3ba27e78d..cf5ed1bca 100644--- a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/ProductController.cs@@ -3,7 +3,6 @@ using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Interfaces.ExportImport;using Grand.Business.Core.Interfaces.Storage;@@ -2413,29 +2412,7 @@ namespace Grand.Web.Admin.Controllers#endregion#endregion-- #region Activity log-- [PermissionAuthorizeAction(PermissionActionName.Preview)]- [HttpPost]- public async Task<IActionResult> ListActivityLog(DataSourceRequest command, string productId)- {- var product = await _productService.GetProductById(productId);-- var permission = await CheckAccessToProduct(product);- if (!permission.allow)- return ErrorForKendoGridJson(permission.message);-- var (activityLogModels, totalCount) = await _productViewModelService.PrepareActivityLogModel(productId, command.Page, command.PageSize);- var gridModel = new DataSourceResult {- Data = activityLogModels.ToList(),- Total = totalCount- };- return Json(gridModel);- }-- #endregion-+#region Reservation[PermissionAuthorizeAction(PermissionActionName.Preview)]@@ -2704,7 +2681,7 @@ namespace Grand.Web.Admin.Controllers[PermissionAuthorizeAction(PermissionActionName.Edit)][HttpPost]- public async Task<IActionResult> BidDelete(ProductModel.BidModel model, [FromServices] ICustomerActivityService customerActivityService)+ public async Task<IActionResult> BidDelete(ProductModel.BidModel model){var product = await _productService.GetProductById(model.ProductId);if (product == null)@@ -2719,10 +2696,6 @@ namespace Grand.Web.Admin.Controllers{if (string.IsNullOrEmpty(toDelete.OrderId)){- //activity log- _ = customerActivityService.InsertActivity("DeleteBid", toDelete.ProductId,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteBid"), product.Name);//delete bidawait _auctionService.DeleteBid(toDelete);return Json("");diff --git a/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs b/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.csindex e05e961bc..9c4050d50 100644--- a/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs@@ -1,6 +1,5 @@using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Common.Security;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Marketing.Documents;@@ -23,10 +22,7 @@ namespace Grand.Web.Admin.Controllersprivate readonly ISalesEmployeeService _salesEmployeeService;private readonly ICustomerService _customerService;private readonly IOrderService _orderService;- private readonly ICustomerActivityService _customerActivityService;- private readonly ITranslationService _translationService;private readonly IDocumentService _documentService;- private readonly IWorkContext _workContext;#endregion#region Constructors@@ -35,19 +31,13 @@ namespace Grand.Web.Admin.ControllersISalesEmployeeService salesEmployeeService,ICustomerService customerService,IOrderService orderService,- IDocumentService documentService,- ICustomerActivityService customerActivityService,- ITranslationService translationService,- IWorkContext workContext+ IDocumentService documentService){_salesEmployeeService = salesEmployeeService;_customerService = customerService;_orderService = orderService;_documentService = documentService;- _customerActivityService = customerActivityService;- _translationService = translationService;- _workContext = workContext;}#endregion@@ -84,13 +74,6 @@ namespace Grand.Web.Admin.Controllersvar salesemployee = await _salesEmployeeService.GetSalesEmployeeById(model.Id);salesemployee = model.ToEntity(salesemployee);await _salesEmployeeService.UpdateSalesEmployee(salesemployee);-- //activity log- _ = _customerActivityService.InsertActivity("EditSalesEmployee", salesemployee.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSalesEmployee"),- salesemployee.Name);-return new JsonResult("");}@@ -107,12 +90,6 @@ namespace Grand.Web.Admin.ControllerssalesEmployee = model.ToEntity(salesEmployee);await _salesEmployeeService.InsertSalesEmployee(salesEmployee);- //activity log- _ = _customerActivityService.InsertActivity("AddNewSalesEmployee", salesEmployee.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewSalesEmployee"),- salesEmployee.Name);-return new JsonResult("");}@@ -138,12 +115,6 @@ namespace Grand.Web.Admin.Controllersawait _salesEmployeeService.DeleteSalesEmployee(salesemployee);- //activity log- _ = _customerActivityService.InsertActivity("DeleteSalesEmployee", salesemployee.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteSalesEmployee"),- salesemployee.Name);-return new JsonResult("");}diff --git a/src/Web/Grand.Web.Admin/Controllers/SettingController.cs b/src/Web/Grand.Web.Admin/Controllers/SettingController.csindex 1e253d0a4..ee1a6c6b2 100644--- a/src/Web/Grand.Web.Admin/Controllers/SettingController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/SettingController.cs@@ -4,7 +4,6 @@ using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Configuration;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Common.Security;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Admin;@@ -53,7 +52,6 @@ namespace Grand.Web.Admin.Controllersprivate readonly ITranslationService _translationService;private readonly IDateTimeService _dateTimeService;private readonly IThemeProvider _themeProvider;- private readonly ICustomerActivityService _customerActivityService;private readonly IWorkContext _workContext;private readonly IMediator _mediator;private readonly IMerchandiseReturnService _merchandiseReturnService;@@ -71,7 +69,6 @@ namespace Grand.Web.Admin.ControllersITranslationService translationService,IDateTimeService dateTimeService,IThemeProvider themeProvider,- ICustomerActivityService customerActivityService,IWorkContext workContext,IMediator mediator,IMerchandiseReturnService merchandiseReturnService,@@ -85,7 +82,6 @@ namespace Grand.Web.Admin.Controllers_translationService = translationService;_dateTimeService = dateTimeService;_themeProvider = themeProvider;- _customerActivityService = customerActivityService;_workContext = workContext;_mediator = mediator;_merchandiseReturnService = merchandiseReturnService;@@ -145,11 +141,6 @@ namespace Grand.Web.Admin.Controllers//now clear cacheawait ClearCache();- //activity log- _ = _customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));return RedirectToAction("Content");}@@ -178,11 +169,6 @@ namespace Grand.Web.Admin.Controllers//now clear cacheawait ClearCache();- //activity log- _ = _customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));return RedirectToAction("Vendor");}@@ -209,11 +195,6 @@ namespace Grand.Web.Admin.Controllers//now clear cacheawait ClearCache();- //activity log- _ = _customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));//selected tab@@ -343,11 +324,6 @@ namespace Grand.Web.Admin.Controllers//now clear cacheawait ClearCache();- //activity log- _ = _customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));return RedirectToAction("Sales");}@@ -577,12 +553,6 @@ namespace Grand.Web.Admin.Controllers//clear old Thumbsawait _pictureService.ClearThumbs();-- //activity log- _ = _customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));return RedirectToAction("Media");}@@ -617,11 +587,6 @@ namespace Grand.Web.Admin.Controllers//now clear cacheawait ClearCache();- //activity log- _ = _customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));//selected tab@@ -754,11 +719,6 @@ namespace Grand.Web.Admin.Controllers//now clear cacheawait ClearCache();- //activity log- _ = _customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));//selected tab@@ -959,11 +919,6 @@ namespace Grand.Web.Admin.Controllers//save pictureawait SavePictureStorage(storeIdDb);- //activity log- _ = _customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-//now clear cacheawait ClearCache();diff --git a/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs b/src/Web/Grand.Web.Admin/Controllers/ShipmentController.csindex 787608178..8e7ca8200 100644--- a/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs@@ -209,9 +209,6 @@ namespace Grand.Web.Admin.ControllersOrderId = order.Id});- _ = _shipmentViewModelService.LogShipment(shipment.Id,- $"A shipment #{shipment.ShipmentNumber} has been added");-Success(_translationService.GetResource("Admin.Orders.Shipments.Added"));return continueEditing? RedirectToAction("ShipmentDetails", new { id = shipment.Id })@@ -278,9 +275,6 @@ namespace Grand.Web.Admin.ControllersOrderId = order.Id});- _ = _shipmentViewModelService.LogShipment(shipment.Id,- $"A shipment #{shipment.ShipmentNumber} has been deleted");-Success(_translationService.GetResource("Admin.Orders.Shipments.Deleted"));return RedirectToAction("Edit", "Order", new { order.Id });diff --git a/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs b/src/Web/Grand.Web.Admin/Controllers/ShippingController.csindex 456c16516..032a15b6c 100644--- a/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs@@ -11,13 +11,11 @@ using Grand.Web.Common.Models;using Grand.Web.Common.Security.Authorization;using Grand.Domain.Directory;using Grand.Domain.Shipping;-using Grand.Infrastructure;using Grand.Web.Admin.Models.Directory;using Grand.Web.Admin.Models.Shipping;using Microsoft.AspNetCore.Mvc;using Microsoft.AspNetCore.Mvc.Rendering;using Grand.Web.Admin.Models.Common;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Domain;using Grand.Domain.Customers;using Grand.Web.Admin.Extensions.Mapping;@@ -41,7 +39,7 @@ namespace Grand.Web.Admin.Controllersprivate readonly ILanguageService _languageService;private readonly IStoreService _storeService;private readonly IGroupService _groupService;- private readonly IWorkContext _workContext;+#endregion#region Constructors@@ -57,8 +55,7 @@ namespace Grand.Web.Admin.ControllersITranslationService translationService,ILanguageService languageService,IStoreService storeService,- IGroupService groupService,- IWorkContext workContext)+ IGroupService groupService){_shippingService = shippingService;_shippingMethodService = shippingMethodService;@@ -71,7 +68,6 @@ namespace Grand.Web.Admin.Controllers_languageService = languageService;_storeService = storeService;_groupService = groupService;- _workContext = workContext;}#endregion@@ -335,8 +331,7 @@ namespace Grand.Web.Admin.Controllersreturn View(model);}[HttpPost]- public async Task<IActionResult> Settings(ShippingSettingsModel model,- [FromServices] ICustomerActivityService customerActivityService)+ public async Task<IActionResult> Settings(ShippingSettingsModel model){//load settings for a chosen store scopevar storeScope = await GetActiveStore();@@ -345,11 +340,6 @@ namespace Grand.Web.Admin.Controllersawait _settingService.SaveSetting(shippingSettings, storeScope);- //activity log- _ = customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-Success(_translationService.GetResource("Admin.Configuration.Updated"));return RedirectToAction("Settings");}diff --git a/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.csindex bf5d4ec55..822285637 100644--- a/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Common.Security;using Grand.Web.Common.DataSource;using Grand.Web.Common.Filters;@@ -24,7 +23,6 @@ namespace Grand.Web.Admin.Controllersprivate readonly IProductService _productService;private readonly ILanguageService _languageService;private readonly ITranslationService _translationService;- private readonly ICustomerActivityService _customerActivityService;private readonly IWorkContext _workContext;private readonly IGroupService _groupService;private readonly SeoSettings _seoSettings;@@ -37,7 +35,6 @@ namespace Grand.Web.Admin.ControllersISpecificationAttributeService specificationAttributeService,ILanguageService languageService,ITranslationService translationService,- ICustomerActivityService customerActivityService,IWorkContext workContext,IGroupService groupService,IProductService productService,@@ -46,7 +43,6 @@ namespace Grand.Web.Admin.Controllers_specificationAttributeService = specificationAttributeService;_languageService = languageService;_translationService = translationService;- _customerActivityService = customerActivityService;_workContext = workContext;_groupService = groupService;_productService = productService;@@ -100,10 +96,7 @@ namespace Grand.Web.Admin.Controllersmodel.Stores = new[] { _workContext.CurrentCustomer.StaffStoreId };}await _specificationAttributeService.InsertSpecificationAttribute(specificationAttribute);- //activity log- _ = _customerActivityService.InsertActivity("AddNewSpecAttribute", specificationAttribute.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewSpecAttribute"), specificationAttribute.Name);+Success(_translationService.GetResource("Admin.Catalog.Attributes.SpecificationAttributes.Added"));return continueEditing ? RedirectToAction("Edit", new { id = specificationAttribute.Id }) : RedirectToAction("List");}@@ -149,10 +142,6 @@ namespace Grand.Web.Admin.Controllersmodel.Stores = new[] { _workContext.CurrentCustomer.StaffStoreId };}await _specificationAttributeService.UpdateSpecificationAttribute(specificationAttribute);- //activity log- _ = _customerActivityService.InsertActivity("EditSpecAttribute", specificationAttribute.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSpecAttribute"), specificationAttribute.Name);Success(_translationService.GetResource("Admin.Catalog.Attributes.SpecificationAttributes.Updated"));@@ -188,11 +177,6 @@ namespace Grand.Web.Admin.Controllers{await _specificationAttributeService.DeleteSpecificationAttribute(specificationAttribute);- //activity log- _ = _customerActivityService.InsertActivity("DeleteSpecAttribute", specificationAttribute.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteSpecAttribute"), specificationAttribute.Name);-Success(_translationService.GetResource("Admin.Catalog.Attributes.SpecificationAttributes.Deleted"));return RedirectToAction("List");}diff --git a/src/Web/Grand.Web.Admin/Controllers/TaxController.cs b/src/Web/Grand.Web.Admin/Controllers/TaxController.csindex 938449989..12ae3fe3b 100644--- a/src/Web/Grand.Web.Admin/Controllers/TaxController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/TaxController.cs@@ -5,7 +5,6 @@ using Grand.Web.Common.DataSource;using Grand.Web.Common.Extensions;using Grand.Web.Common.Security.Authorization;using Grand.Domain.Tax;-using Grand.Infrastructure;using Grand.Infrastructure.Caching;using Grand.Infrastructure.Plugins;using Grand.Web.Admin.Models.Tax;@@ -15,7 +14,6 @@ using Grand.Business.Core.Interfaces.Common.Localization;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Web.Admin.Models.Common;using Grand.Domain.Directory;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Extensions.Mapping.Settings;@@ -27,7 +25,6 @@ namespace Grand.Web.Admin.Controllers#region Fieldsprivate readonly ITaxService _taxService;- private readonly IWorkContext _workContext;private readonly ITaxCategoryService _taxCategoryService;private readonly ISettingService _settingService;private readonly IServiceProvider _serviceProvider;@@ -40,7 +37,6 @@ namespace Grand.Web.Admin.Controllers#region Constructorspublic TaxController(ITaxService taxService,- IWorkContext workContext,ITaxCategoryService taxCategoryService,ISettingService settingService,IServiceProvider serviceProvider,@@ -49,7 +45,6 @@ namespace Grand.Web.Admin.ControllersICountryService countryService){_taxService = taxService;- _workContext = workContext;_taxCategoryService = taxCategoryService;_settingService = settingService;_serviceProvider = serviceProvider;@@ -173,8 +168,7 @@ namespace Grand.Web.Admin.Controllersreturn View(model);}[HttpPost]- public async Task<IActionResult> Settings(TaxSettingsModel model,- [FromServices] ICustomerActivityService customerActivityService)+ public async Task<IActionResult> Settings(TaxSettingsModel model){//load settings for a chosen store scopevar storeScope = await GetActiveStore();@@ -185,12 +179,7 @@ namespace Grand.Web.Admin.Controllers//now clear cacheawait ClearCache();-- //activity log- _ = customerActivityService.InsertActivity("EditSettings", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditSettings"));-+Success(_translationService.GetResource("Admin.Configuration.Updated"));return RedirectToAction("Settings");}diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ActivityLogMappingExtensions.cs b/src/Web/Grand.Web.Admin/Extensions/Mapping/ActivityLogMappingExtensions.csdeleted file mode 100644index 4512edfe7..000000000--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ActivityLogMappingExtensions.cs+++ /dev/null@@ -1,23 +0,0 @@-using Grand.Domain.Logging;-using Grand.Infrastructure.Mapper;-using Grand.Web.Admin.Models.ActivityLog;--namespace Grand.Web.Admin.Extensions.Mapping;--public static class ActivityLogMappingExtensions-{- public static ActivityLogTypeModel ToModel(this ActivityLogType entity)- {- return entity.MapTo<ActivityLogType, ActivityLogTypeModel>();- }-- public static ActivityLogModel ToModel(this ActivityLog entity)- {- return entity.MapTo<ActivityLog, ActivityLogModel>();- }-- public static ActivityStatsModel ToModel(this ActivityStats entity)- {- return entity.MapTo<ActivityStats, ActivityStatsModel>();- }-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.cs b/src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.csindex 29f669d3f..66509e9a2 100644--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.cs+++ b/src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.cs@@ -15,7 +15,11 @@ namespace Grand.Web.Admin.Extensions.Mappingdiscount.EndDate = entity.EndDateUtc.ConvertToUserTime(dateTimeService);return discount;}-+ public static DiscountModel ToModel(this Discount entity)+ {+ var discount = entity.MapTo<Discount, DiscountModel>();+ return discount;+ }public static Discount ToEntity(this DiscountModel model, IDateTimeService dateTimeService){var discount = model.MapTo<DiscountModel, Discount>();diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductsMappingExtensions.cs b/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductsMappingExtensions.csindex 26176bf5a..35488f1d5 100644--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductsMappingExtensions.cs+++ b/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductsMappingExtensions.cs@@ -19,7 +19,12 @@ namespace Grand.Web.Admin.Extensions.Mappingreturn product;}+ public static ProductModel ToModel(this Product entity)+ {+ var product = entity.MapTo<Product, ProductModel>();+ return product;+ }public static Product ToEntity(this ProductModel model, IDateTimeService dateTimeService){var product = model.MapTo<ProductModel, Product>();diff --git a/src/Web/Grand.Web.Admin/Interfaces/IActivityLogViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/IActivityLogViewModelService.csdeleted file mode 100644index 3c31b6974..000000000--- a/src/Web/Grand.Web.Admin/Interfaces/IActivityLogViewModelService.cs+++ /dev/null@@ -1,13 +0,0 @@-using Grand.Web.Admin.Models.ActivityLog;--namespace Grand.Web.Admin.Interfaces-{- public interface IActivityLogViewModelService- {- Task<IList<ActivityLogTypeModel>> PrepareActivityLogTypeModels();- Task SaveTypes(List<string> types);- Task<ActivityLogSearchModel> PrepareActivityLogSearchModel();- Task<(IEnumerable<ActivityLogModel> activityLogs, int totalCount)> PrepareActivityLogModel(ActivityLogSearchModel model, int pageIndex, int pageSize);- Task<(IEnumerable<ActivityStatsModel> activityStats, int totalCount)> PrepareActivityStatModel(ActivityLogSearchModel model, int pageIndex, int pageSize);- }-}diff --git a/src/Web/Grand.Web.Admin/Interfaces/IBrandViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/IBrandViewModelService.csindex ffba03cce..44c82a3fd 100644--- a/src/Web/Grand.Web.Admin/Interfaces/IBrandViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Interfaces/IBrandViewModelService.cs@@ -11,6 +11,5 @@ namespace Grand.Web.Admin.InterfacesTask<Brand> InsertBrandModel(BrandModel model);Task<Brand> UpdateBrandModel(Brand brand, BrandModel model);Task DeleteBrand(Brand brand);- Task<(IEnumerable<BrandModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string brandId, int pageIndex, int pageSize);}}diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICategoryViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/ICategoryViewModelService.csindex 9be94b048..f722207b9 100644--- a/src/Web/Grand.Web.Admin/Interfaces/ICategoryViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Interfaces/ICategoryViewModelService.cs@@ -17,7 +17,6 @@ namespace Grand.Web.Admin.InterfacesTask DeleteProductCategoryModel(string id, string productId);Task<CategoryModel.AddCategoryProductModel> PrepareAddCategoryProductModel(string storeId);Task InsertCategoryProductModel(CategoryModel.AddCategoryProductModel model);- Task<(IEnumerable<CategoryModel.ActivityLogModel> activityLogModel, int totalCount)> PrepareActivityLogModel(string categoryId, int pageIndex, int pageSize);Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(CategoryModel.AddCategoryProductModel model, int pageIndex, int pageSize);}}diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICollectionViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/ICollectionViewModelService.csindex f5bd31fb7..2037381e7 100644--- a/src/Web/Grand.Web.Admin/Interfaces/ICollectionViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Interfaces/ICollectionViewModelService.cs@@ -17,6 +17,5 @@ namespace Grand.Web.Admin.InterfacesTask ProductUpdate(CollectionModel.CollectionProductModel model);Task ProductDelete(string id, string productId);Task InsertCollectionProductModel(CollectionModel.AddCollectionProductModel model);- Task<(IEnumerable<CollectionModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string collectionId, int pageIndex, int pageSize);}}diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICustomerViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/ICustomerViewModelService.csindex 13612040b..1f0fc2531 100644--- a/src/Web/Grand.Web.Admin/Interfaces/ICustomerViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Interfaces/ICustomerViewModelService.cs@@ -39,7 +39,6 @@ namespace Grand.Web.Admin.InterfacesTask DeleteProductPrice(string id);Task UpdatePersonalizedProduct(CustomerModel.ProductModel model);Task DeletePersonalizedProduct(string id);- Task<(IEnumerable<CustomerModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string customerId, int pageIndex, int pageSize);Task<(IEnumerable<ContactFormModel> contactFormModels, int totalCount)> PrepareContactFormModel(string customerId, int pageIndex, int pageSize);Task<(IEnumerable<CustomerModel.OutOfStockSubscriptionModel> outOfStockSubscriptionModels, int totalCount)> PrepareOutOfStockSubscriptionModel(string customerId, int pageIndex, int pageSize);Task<IList<CustomerModel.CustomerNote>> PrepareCustomerNoteList(string customerId);diff --git a/src/Web/Grand.Web.Admin/Interfaces/IKnowledgebaseViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/IKnowledgebaseViewModelService.csindex d477f2563..44efcbbe8 100644--- a/src/Web/Grand.Web.Admin/Interfaces/IKnowledgebaseViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Interfaces/IKnowledgebaseViewModelService.cs@@ -9,8 +9,6 @@ namespace Grand.Web.Admin.InterfacesTask PrepareCategory(KnowledgebaseCategoryModel model);Task PrepareCategory(KnowledgebaseArticleModel model);Task<(IEnumerable<KnowledgebaseArticleGridModel> knowledgebaseArticleGridModels, int totalCount)> PrepareKnowledgebaseArticleGridModel(string parentCategoryId, int pageIndex, int pageSize);- Task<(IEnumerable<KnowledgebaseCategoryModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareCategoryActivityLogModels(string categoryId, int pageIndex, int pageSize);- Task<(IEnumerable<KnowledgebaseArticleModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareArticleActivityLogModels(string articleId, int pageIndex, int pageSize);Task<KnowledgebaseCategoryModel> PrepareKnowledgebaseCategoryModel();Task<KnowledgebaseCategory> InsertKnowledgebaseCategoryModel(KnowledgebaseCategoryModel model);Task<KnowledgebaseCategory> UpdateKnowledgebaseCategoryModel(KnowledgebaseCategory knowledgebaseCategory, KnowledgebaseCategoryModel model);diff --git a/src/Web/Grand.Web.Admin/Interfaces/IOrderViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/IOrderViewModelService.csindex dd2b2ed94..6ef7d92a0 100644--- a/src/Web/Grand.Web.Admin/Interfaces/IOrderViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Interfaces/IOrderViewModelService.cs@@ -12,7 +12,6 @@ namespace Grand.Web.Admin.InterfacesTask<OrderModel.AddOrderProductModel> PrepareAddOrderProductModel(Order order);Task<OrderModel.AddOrderProductModel.ProductDetailsModel> PrepareAddProductToOrderModel(Order order, string productId);Task<OrderAddressModel> PrepareOrderAddressModel(Order order, Address address);- Task LogEditOrder(string orderId);Task<IList<OrderModel.OrderNote>> PrepareOrderNotes(Order order);Task InsertOrderNote(Order order, string downloadId, bool displayToCustomer, string message);Task DeleteOrderNote(Order order, string id);diff --git a/src/Web/Grand.Web.Admin/Interfaces/IProductViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/IProductViewModelService.csindex 084679107..b4afc7153 100644--- a/src/Web/Grand.Web.Admin/Interfaces/IProductViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Interfaces/IProductViewModelService.cs@@ -59,7 +59,6 @@ namespace Grand.Web.Admin.Interfaces//tierpricesTask<IList<ProductModel.TierPriceModel>> PrepareTierPriceModel(Product product);Task<(IEnumerable<ProductModel.BidModel> bidModels, int totalCount)> PrepareBidMode(string productId, int pageIndex, int pageSize);- Task<(IEnumerable<ProductModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string productId, int pageIndex, int pageSize);Task<ProductModel.ProductAttributeMappingModel> PrepareProductAttributeMappingModel(Product product);Task<ProductModel.ProductAttributeMappingModel> PrepareProductAttributeMappingModel(ProductModel.ProductAttributeMappingModel model);Task<ProductModel.ProductAttributeMappingModel> PrepareProductAttributeMappingModel(Product product, ProductAttributeMapping productAttributeMapping);diff --git a/src/Web/Grand.Web.Admin/Interfaces/IShipmentViewModelService.cs b/src/Web/Grand.Web.Admin/Interfaces/IShipmentViewModelService.csindex d9e3d1fe5..6beca7dbd 100644--- a/src/Web/Grand.Web.Admin/Interfaces/IShipmentViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Interfaces/IShipmentViewModelService.cs@@ -10,7 +10,6 @@ namespace Grand.Web.Admin.InterfacesTask<ShipmentModel> PrepareShipmentModel(Shipment shipment, bool prepareProducts, bool prepareShipmentEvent = false);Task<int> GetStockQty(Product product, string warehouseId);Task<int> GetReservedQty(Product product, string warehouseId);- Task LogShipment(string shipmentId, string message);Task<IList<ShipmentModel.ShipmentNote>> PrepareShipmentNotes(Shipment shipment);Task InsertShipmentNote(Shipment shipment, string downloadId, bool displayToCustomer, string message);Task DeleteShipmentNote(Shipment shipment, string id);diff --git a/src/Web/Grand.Web.Admin/Mapper/ActivityLogTypeProfile.cs b/src/Web/Grand.Web.Admin/Mapper/ActivityLogTypeProfile.csdeleted file mode 100644index 15d2c87c5..000000000--- a/src/Web/Grand.Web.Admin/Mapper/ActivityLogTypeProfile.cs+++ /dev/null@@ -1,27 +0,0 @@-using AutoMapper;-using Grand.Domain.Logging;-using Grand.Infrastructure.Mapper;-using Grand.Web.Admin.Models.ActivityLog;--namespace Grand.Web.Admin.Mapper-{- public class ActivityLogTypeProfile : Profile, IAutoMapperProfile- {- public ActivityLogTypeProfile()- {- CreateMap<ActivityLogTypeModel, ActivityLogType>()- .ForMember(dest => dest.Id, mo => mo.Ignore())- .ForMember(dest => dest.SystemKeyword, mo => mo.Ignore());-- CreateMap<ActivityLogType, ActivityLogTypeModel>();-- CreateMap<ActivityLog, ActivityLogModel>()- .ForMember(dest => dest.CreatedOn, mo => mo.Ignore());-- CreateMap<ActivityStats, ActivityStatsModel>()- .ForMember(dest => dest.ActivityLogTypeName, mo => mo.Ignore());- }-- public int Order => 0;- }-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogModel.cs b/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogModel.csdeleted file mode 100644index 47d724ad2..000000000--- a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogModel.cs+++ /dev/null@@ -1,40 +0,0 @@-using Grand.Infrastructure.ModelBinding;-using Grand.Infrastructure.Models;--namespace Grand.Web.Admin.Models.ActivityLog-{- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- public string ActivityLogTypeId { get; set; }-- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.Customer")]- public string CustomerId { get; set; }- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.Customer")]- public string CustomerEmail { get; set; }- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.IpAddress")]- public string IpAddress { get; set; }- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.CreatedOn")]- public DateTime CreatedOn { get; set; }- }-- public class ActivityStatsModel : BaseEntityModel- {- [GrandResourceDisplayName("admin.reports.activitylog.activitystats.Fields.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- public string ActivityLogTypeId { get; set; }-- [GrandResourceDisplayName("admin.reports.activitylog.activitystats.Fields.EntityKeyId")]- public string EntityKeyId { get; set; }-- [GrandResourceDisplayName("admin.reports.activitylog.activitystats.Fields.Name")]- public string Name { get; set; }-- [GrandResourceDisplayName("admin.reports.activitylog.activitystats.Fields.Count")]- public int Count { get; set; }-- }-}diff --git a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogSearchModel.cs b/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogSearchModel.csdeleted file mode 100644index 95f48388b..000000000--- a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogSearchModel.cs+++ /dev/null@@ -1,36 +0,0 @@-using Grand.Infrastructure.ModelBinding;-using Grand.Infrastructure.Models;-using Microsoft.AspNetCore.Mvc.Rendering;-using System.ComponentModel.DataAnnotations;--namespace Grand.Web.Admin.Models.ActivityLog-{- public class ActivityLogSearchModel : BaseModel- {- public ActivityLogSearchModel()- {- ActivityLogType = new List<SelectListItem>();- }-- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.Comment")]- public string Comment { get; set; }-- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.CreatedOnFrom")]- [UIHint("DateNullable")]- public DateTime? CreatedOnFrom { get; set; }-- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.CreatedOnTo")]- [UIHint("DateNullable")]- public DateTime? CreatedOnTo { get; set; }-- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.ActivityLogType")]- public string ActivityLogTypeId { get; set; }-- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.ActivityLogType")]- public IList<SelectListItem> ActivityLogType { get; set; }-- [GrandResourceDisplayName("Admin.Configuration.ActivityLog.ActivityLog.Fields.IpAddress")]- public string IpAddress { get; set; }-- }-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogTypeModel.cs b/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogTypeModel.csdeleted file mode 100644index 000021366..000000000--- a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogTypeModel.cs+++ /dev/null@@ -1,13 +0,0 @@-using Grand.Infrastructure.ModelBinding;-using Grand.Infrastructure.Models;--namespace Grand.Web.Admin.Models.ActivityLog-{- public class ActivityLogTypeModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Settings.ActivityLog.ActivityLogType.Fields.Name")]- public string Name { get; set; }- [GrandResourceDisplayName("Admin.Settings.ActivityLog.ActivityLogType.Fields.Enabled")]- public bool Enabled { get; set; }- }-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityTypeModel.cs b/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityTypeModel.csdeleted file mode 100644index a7f9d8a92..000000000--- a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityTypeModel.cs+++ /dev/null@@ -1,6 +0,0 @@-namespace Grand.Web.Admin.Models.ActivityLog;--public record ActivityTypeModel-{- public List<string> ActivityTypes { get; set; }-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.csindex b6d38ad9f..b2102355d 100644--- a/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs@@ -96,23 +96,6 @@ namespace Grand.Web.Admin.Models.Catalog//discountspublic List<DiscountModel> AvailableDiscounts { get; set; }public string[] SelectedDiscountIds { get; set; }-- #region Nested classes-- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Catalog.Brands.ActivityLog.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Brands.ActivityLog.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Brands.ActivityLog.CreatedOn")]- public DateTime CreatedOn { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Brands.ActivityLog.Customer")]- public string CustomerId { get; set; }- public string CustomerEmail { get; set; }- }-- #endregion}public class BrandLocalizedModel : ILocalizedModelLocal, ISlugModelLocaldiff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.csindex 8944bae3b..6a24970e9 100644--- a/src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.cs@@ -177,19 +177,6 @@ namespace Grand.Web.Admin.Models.Catalogpublic string[] SelectedProductIds { get; set; }}- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Catalog.Categories.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Categories.ActivityLog.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Categories.ActivityLog.CreatedOn")]- public DateTime CreatedOn { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Categories.ActivityLog.Customer")]- public string CustomerId { get; set; }- public string CustomerEmail { get; set; }- }-#endregion}diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.csindex 6a32923a4..454d15777 100644--- a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs@@ -154,22 +154,6 @@ namespace Grand.Web.Admin.Models.Catalogpublic string[] SelectedProductIds { get; set; }}-- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Catalog.Collections.ActivityLog.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Collections.ActivityLog.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Collections.ActivityLog.CreatedOn")]- public DateTime CreatedOn { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Collections.ActivityLog.Customer")]- public string CustomerId { get; set; }- public string CustomerEmail { get; set; }- }---#endregion}diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/ProductModel.csindex 691e4c542..d25faf080 100644--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Catalog/ProductModel.cs@@ -969,18 +969,6 @@ namespace Grand.Web.Admin.Models.Catalog#endregion}- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Catalog.Products.ActivityLog.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Products.ActivityLog.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Products.ActivityLog.CreatedOn")]- public DateTime CreatedOn { get; set; }- [GrandResourceDisplayName("Admin.Catalog.Products.ActivityLog.Customer")]- public string CustomerId { get; set; }- public string CustomerEmail { get; set; }- }public class ProductAttributeValueLocalizedModel : ILocalizedModelLocal{public string LanguageId { get; set; }diff --git a/src/Web/Grand.Web.Admin/Models/Common/MaintenanceModel.cs b/src/Web/Grand.Web.Admin/Models/Common/MaintenanceModel.csindex 2363403b2..2433a65c8 100644--- a/src/Web/Grand.Web.Admin/Models/Common/MaintenanceModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Common/MaintenanceModel.cs@@ -19,8 +19,6 @@ namespace Grand.Web.Admin.Models.Commonpublic DeleteExportedFilesModel DeleteExportedFiles { get; set; }public ConvertPictureModel ConvertedPictureModel { get; set; }- public bool DeleteActivityLog { get; set; }-#region Nested classespublic class DeleteGuestsModel : BaseModeldiff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs b/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.csindex b1921f8a3..930599bec 100644--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs@@ -306,18 +306,6 @@ namespace Grand.Web.Admin.Models.Customers[GrandResourceDisplayName("Admin.Customers.Customers.Orders.CreatedOn")]public DateTime CreatedOn { get; set; }}-- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Customers.Customers.ActivityLog.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- [GrandResourceDisplayName("Admin.Customers.Customers.ActivityLog.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Admin.Customers.Customers.ActivityLog.CreatedOn")]- public DateTime CreatedOn { get; set; }- [GrandResourceDisplayName("Admin.Customers.Customers.ActivityLog.IpAddress")]- public string IpAddress { get; set; }- }public class ProductModel : BaseEntityModel{[GrandResourceDisplayName("Admin.Customers.Customers.PersonalizedProduct.ProductName")]diff --git a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleModel.cs b/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleModel.csindex 3cd36bc46..d5c760898 100644--- a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleModel.cs@@ -61,19 +61,6 @@ namespace Grand.Web.Admin.Models.Knowledgebase[UIHint("Stores")]public string[] Stores { get; set; }- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Content.Knowledgebase.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- [GrandResourceDisplayName("Admin.Content.Knowledgebase.ActivityLog.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Admin.Content.Knowledgebase.ActivityLog.CreatedOn")]- public DateTime CreatedOn { get; set; }- [GrandResourceDisplayName("Admin.Content.Knowledgebase.ActivityLog.Customer")]- public string CustomerId { get; set; }- public string CustomerEmail { get; set; }- }-public class AddRelatedArticleModel : BaseEntityModel{public AddRelatedArticleModel()diff --git a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseCategoryModel.cs b/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseCategoryModel.csindex 6f1c507de..addd8db74 100644--- a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseCategoryModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseCategoryModel.cs@@ -56,18 +56,6 @@ namespace Grand.Web.Admin.Models.Knowledgebasepublic string[] Stores { get; set; }public bool LimitedToStores { get; set; }- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Admin.Content.Knowledgebase.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- [GrandResourceDisplayName("Admin.Content.Knowledgebase.ActivityLog.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Admin.Content.Knowledgebase.ActivityLog.CreatedOn")]- public DateTime CreatedOn { get; set; }- [GrandResourceDisplayName("Admin.Content.Knowledgebase.ActivityLog.Customer")]- public string CustomerId { get; set; }- public string CustomerEmail { get; set; }- }}public class KnowledgebaseCategoryLocalizedModel : ILocalizedModelLocal, ISlugModelLocaldiff --git a/src/Web/Grand.Web.Admin/Services/ActivityLogViewModelService.cs b/src/Web/Grand.Web.Admin/Services/ActivityLogViewModelService.csdeleted file mode 100644index 7337a889f..000000000--- a/src/Web/Grand.Web.Admin/Services/ActivityLogViewModelService.cs+++ /dev/null@@ -1,189 +0,0 @@-using Grand.Business.Core.Interfaces.Catalog.Categories;-using Grand.Business.Core.Interfaces.Catalog.Collections;-using Grand.Business.Core.Interfaces.Catalog.Products;-using Grand.Business.Core.Interfaces.Cms;-using Grand.Business.Core.Interfaces.Common.Directory;-using Grand.Business.Core.Interfaces.Common.Logging;-using Grand.Business.Core.Interfaces.Customers;-using Grand.Web.Admin.Extensions.Mapping;-using Grand.Web.Admin.Interfaces;-using Grand.Web.Admin.Models.ActivityLog;-using Microsoft.AspNetCore.Mvc.Rendering;--namespace Grand.Web.Admin.Services-{- public class ActivityLogViewModelService : IActivityLogViewModelService- {- private readonly ICustomerActivityService _customerActivityService;- private readonly IDateTimeService _dateTimeService;- private readonly ICustomerService _customerService;- private readonly ICategoryService _categoryService;- private readonly ICollectionService _collectionService;- private readonly IKnowledgebaseService _knowledgebaseService;- private readonly IProductService _productService;-- public ActivityLogViewModelService(ICustomerActivityService customerActivityService,- IDateTimeService dateTimeService, ICustomerService customerService,- ICategoryService categoryService, ICollectionService collectionService,- IProductService productService, IKnowledgebaseService knowledgebaseService)- {- _customerActivityService = customerActivityService;- _dateTimeService = dateTimeService;- _customerService = customerService;- _categoryService = categoryService;- _collectionService = collectionService;- _productService = productService;- _knowledgebaseService = knowledgebaseService;- }- public virtual async Task<IList<ActivityLogTypeModel>> PrepareActivityLogTypeModels()- {- var model = (await _customerActivityService- .GetAllActivityTypes())- .Select(x => x.ToModel())- .ToList();- return model;- }- public virtual async Task SaveTypes(List<string> types)- {- var activityTypes = await _customerActivityService.GetAllActivityTypes();- foreach (var activityType in activityTypes)- {- activityType.Enabled = types.Contains(activityType.Id);- await _customerActivityService.UpdateActivityType(activityType);- }- }- public virtual async Task<ActivityLogSearchModel> PrepareActivityLogSearchModel()- {- var activityLogSearchModel = new ActivityLogSearchModel();- activityLogSearchModel.ActivityLogType.Add(new SelectListItem- {- Value = "",- Text = "All"- });- foreach (var at in await _customerActivityService.GetAllActivityTypes())- {- activityLogSearchModel.ActivityLogType.Add(new SelectListItem- {- Value = at.Id,- Text = at.Name- });- }- return activityLogSearchModel;- }-- public virtual async Task<(IEnumerable<ActivityLogModel> activityLogs, int totalCount)> PrepareActivityLogModel(ActivityLogSearchModel model, int pageIndex, int pageSize)- {- DateTime? startDateValue = model.CreatedOnFrom == null ? null- : _dateTimeService.ConvertToUtcTime(model.CreatedOnFrom.Value, _dateTimeService.CurrentTimeZone);-- DateTime? endDateValue = model.CreatedOnTo == null ? null- : _dateTimeService.ConvertToUtcTime(model.CreatedOnTo.Value, _dateTimeService.CurrentTimeZone).AddDays(1);-- var activityLog = await _customerActivityService.GetAllActivities(model.Comment, startDateValue, endDateValue, null, model.ActivityLogTypeId, model.IpAddress, pageIndex - 1, pageSize);- var activityLogModel = new List<ActivityLogModel>();- foreach (var item in activityLog)- {- var customer = await _customerService.GetCustomerById(item.CustomerId);- var cas = await _customerActivityService.GetActivityTypeById(item.ActivityLogTypeId);-- var m = item.ToModel();- m.CreatedOn = _dateTimeService.ConvertToUserTime(item.CreatedOnUtc, DateTimeKind.Utc);- m.ActivityLogTypeName = cas?.Name;- m.CustomerEmail = customer != null ? customer.Email : "NULL";- activityLogModel.Add(m);- }- return (activityLogModel, activityLog.TotalCount);- }-- public virtual async Task<(IEnumerable<ActivityStatsModel> activityStats, int totalCount)> PrepareActivityStatModel(ActivityLogSearchModel model, int pageIndex, int pageSize)- {- DateTime? startDateValue = model.CreatedOnFrom == null ? null- : _dateTimeService.ConvertToUtcTime(model.CreatedOnFrom.Value, _dateTimeService.CurrentTimeZone);-- DateTime? endDateValue = model.CreatedOnTo == null ? null- : _dateTimeService.ConvertToUtcTime(model.CreatedOnTo.Value, _dateTimeService.CurrentTimeZone).AddDays(1);-- var activityStat = await _customerActivityService.GetStatsActivities(startDateValue, endDateValue, model.ActivityLogTypeId, pageIndex - 1, pageSize);- var activityStatModel = new List<ActivityStatsModel>();- foreach (var x in activityStat)- {- var activityLogType = await _customerActivityService.GetActivityTypeById(x.ActivityLogTypeId);- var _name = "-empty-";- if (activityLogType != null)- {- IList<string> systemKeywordsCategory = new List<string>();- systemKeywordsCategory.Add("PublicStore.ViewCategory");- systemKeywordsCategory.Add("EditCategory");- systemKeywordsCategory.Add("AddNewCategory");-- if (systemKeywordsCategory.Contains(activityLogType.SystemKeyword))- {- var category = await _categoryService.GetCategoryById(x.EntityKeyId);- if (category != null)- _name = category.Name;- }-- IList<string> systemKeywordsCollection = new List<string>();- systemKeywordsCollection.Add("PublicStore.ViewCollection");- systemKeywordsCollection.Add("EditCollection");- systemKeywordsCollection.Add("AddNewCollection");-- if (systemKeywordsCollection.Contains(activityLogType.SystemKeyword))- {- var collection = await _collectionService.GetCollectionById(x.EntityKeyId);- if (collection != null)- _name = collection.Name;- }-- IList<string> systemKeywordsProduct = new List<string>();- systemKeywordsProduct.Add("PublicStore.ViewProduct");- systemKeywordsProduct.Add("EditProduct");- systemKeywordsProduct.Add("AddNewProduct");-- if (systemKeywordsProduct.Contains(activityLogType.SystemKeyword))- {- var product = await _productService.GetProductById(x.EntityKeyId);- if (product != null)- _name = product.Name;- }- IList<string> systemKeywordsUrl = new List<string>();- systemKeywordsUrl.Add("PublicStore.Url");- if (systemKeywordsUrl.Contains(activityLogType.SystemKeyword))- {- _name = x.EntityKeyId;- }-- IList<string> systemKeywordsKnowledgebaseCategory = new List<string>();- systemKeywordsKnowledgebaseCategory.Add("CreateKnowledgebaseCategory");- systemKeywordsKnowledgebaseCategory.Add("UpdateKnowledgebaseCategory");- systemKeywordsKnowledgebaseCategory.Add("DeleteKnowledgebaseCategory");-- if (systemKeywordsKnowledgebaseCategory.Contains(activityLogType.SystemKeyword))- {- var category = await _knowledgebaseService.GetKnowledgebaseCategory(x.EntityKeyId);- if (category != null)- _name = category.Name;- }-- IList<string> systemKeywordsKnowledgebaseArticle = new List<string>();- systemKeywordsKnowledgebaseArticle.Add("CreateKnowledgebaseArticle");- systemKeywordsKnowledgebaseArticle.Add("UpdateKnowledgebaseArticle");- systemKeywordsKnowledgebaseArticle.Add("DeleteKnowledgebaseArticle");-- if (systemKeywordsKnowledgebaseArticle.Contains(activityLogType.SystemKeyword))- {- var article = await _knowledgebaseService.GetKnowledgebaseArticle(x.EntityKeyId);- if (article != null)- _name = article.Name;- }- }-- var m = x.ToModel();- m.ActivityLogTypeName = activityLogType != null ? activityLogType.Name : "-empty-";- m.Name = _name;- activityStatModel.Add(m);- }- return (activityStatModel, activityStat.TotalCount);- }- }-}diff --git a/src/Web/Grand.Web.Admin/Services/BlogViewModelService.cs b/src/Web/Grand.Web.Admin/Services/BlogViewModelService.csindex cfa10f573..39255db98 100644--- a/src/Web/Grand.Web.Admin/Services/BlogViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/BlogViewModelService.cs@@ -195,7 +195,7 @@ namespace Grand.Web.Admin.Services{model.SearchStoreId = _workContext.CurrentCustomer.StaffStoreId;var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, model.SearchProductName, pageIndex, pageSize);- return (products.Select(x => x.ToModel(_dateTimeService)).ToList(), products.TotalCount);+ return (products.Select(x => x.ToModel()).ToList(), products.TotalCount);}public virtual async Task InsertProductModel(string blogPostId, BlogProductModel.AddProductModel model)diff --git a/src/Web/Grand.Web.Admin/Services/BrandViewModelService.cs b/src/Web/Grand.Web.Admin/Services/BrandViewModelService.csindex 4a5630d31..6baee2ae1 100644--- a/src/Web/Grand.Web.Admin/Services/BrandViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/BrandViewModelService.cs@@ -3,9 +3,7 @@ using Grand.Business.Core.Interfaces.Catalog.Discounts;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;-using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Catalog;using Grand.Domain.Discounts;@@ -27,16 +25,12 @@ namespace Grand.Web.Admin.Servicesprivate readonly IBrandService _brandService;private readonly IBrandLayoutService _brandLayoutService;- private readonly ICustomerService _customerService;private readonly ISlugService _slugService;private readonly IPictureService _pictureService;- private readonly ITranslationService _translationService;private readonly IDiscountService _discountService;- private readonly ICustomerActivityService _customerActivityService;private readonly IDateTimeService _dateTimeService;private readonly ILanguageService _languageService;private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly SeoSettings _seoSettings;#endregion@@ -46,30 +40,22 @@ namespace Grand.Web.Admin.Servicespublic BrandViewModelService(IBrandService brandService,IBrandLayoutService brandLayoutService,- ICustomerService customerService,ISlugService slugService,IPictureService pictureService,- ITranslationService translationService,IDiscountService discountService,- ICustomerActivityService customerActivityService,IDateTimeService dateTimeService,ILanguageService languageService,IWorkContext workContext,- IHttpContextAccessor httpContextAccessor,SeoSettings seoSettings){_brandLayoutService = brandLayoutService;_brandService = brandService;- _customerService = customerService;_slugService = slugService;_pictureService = pictureService;- _translationService = translationService;_discountService = discountService;- _customerActivityService = customerActivityService;_dateTimeService = dateTimeService;_languageService = languageService;_workContext = workContext;- _httpContextAccessor = httpContextAccessor;_seoSettings = seoSettings;}@@ -141,10 +127,6 @@ namespace Grand.Web.Admin.Services//update picture seo file nameawait _pictureService.UpdatePictureSeoNames(brand.PictureId, brand.Name);- //activity log- _ = _customerActivityService.InsertActivity("AddNewBrand", brand.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewBrand"), brand.Name);return brand;}@@ -188,40 +170,13 @@ namespace Grand.Web.Admin.Services//update picture seo file nameawait _pictureService.UpdatePictureSeoNames(brand.PictureId, brand.Name);- //activity log- _ = _customerActivityService.InsertActivity("EditBrand", brand.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditBrand"), brand.Name);return brand;}public virtual async Task DeleteBrand(Brand brand){await _brandService.DeleteBrand(brand);- //activity log- _ = _customerActivityService.InsertActivity("DeleteBrand", brand.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteBrand"), brand.Name);}- public virtual async Task<(IEnumerable<BrandModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string brandId, int pageIndex, int pageSize)- {- var activityLog = await _customerActivityService.GetBrandActivities(null, null, brandId, pageIndex - 1, pageSize);- var items = new List<BrandModel.ActivityLogModel>();- foreach (var x in activityLog)- {- var customer = await _customerService.GetCustomerById(x.CustomerId);- var m = new BrandModel.ActivityLogModel {- Id = x.Id,- ActivityLogTypeName = (await _customerActivityService.GetActivityTypeById(x.ActivityLogTypeId))?.Name,- Comment = x.Comment,- CreatedOn = _dateTimeService.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc),- CustomerId = x.CustomerId,- CustomerEmail = customer != null ? customer.Email : "null"- };- items.Add(m);- }- return (items, activityLog.TotalCount);- }}}diff --git a/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.csindex ec31c53a5..a2b6a035c 100644--- a/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs@@ -2,9 +2,7 @@using Grand.Business.Core.Interfaces.Catalog.Discounts;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Extensions;-using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;@@ -12,13 +10,11 @@ using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Catalog;using Grand.Domain.Discounts;using Grand.Domain.Seo;-using Grand.Infrastructure;using Grand.Web.Admin.Extensions;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Catalog;using Grand.Web.Common.Extensions;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Admin.Services@@ -31,17 +27,11 @@ namespace Grand.Web.Admin.Servicesprivate readonly IDiscountService _discountService;private readonly ITranslationService _translationService;private readonly IStoreService _storeService;- private readonly ICustomerService _customerService;private readonly ISlugService _slugService;private readonly IPictureService _pictureService;- private readonly ICustomerActivityService _customerActivityService;private readonly IProductService _productService;private readonly IVendorService _vendorService;- private readonly IDateTimeService _dateTimeService;private readonly ILanguageService _languageService;- private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;-private readonly CatalogSettings _catalogSettings;private readonly SeoSettings _seoSettings;@@ -52,16 +42,11 @@ namespace Grand.Web.Admin.ServicesIDiscountService discountService,ITranslationService translationService,IStoreService storeService,- ICustomerService customerService,IPictureService pictureService,ISlugService slugService,- ICustomerActivityService customerActivityService,IProductService productService,IVendorService vendorService,- IDateTimeService dateTimeService,ILanguageService languageService,- IWorkContext workContext,- IHttpContextAccessor httpContextAccessor,CatalogSettings catalogSettings,SeoSettings seoSettings){@@ -71,17 +56,12 @@ namespace Grand.Web.Admin.Services_discountService = discountService;_translationService = translationService;_storeService = storeService;- _customerService = customerService;_slugService = slugService;- _customerActivityService = customerActivityService;_productService = productService;_pictureService = pictureService;_vendorService = vendorService;_languageService = languageService;- _workContext = workContext;- _httpContextAccessor = httpContextAccessor;_catalogSettings = catalogSettings;- _dateTimeService = dateTimeService;_seoSettings = seoSettings;}@@ -107,7 +87,7 @@ namespace Grand.Web.Admin.Servicesmodel.AvailableDiscounts = (await _discountService.GetAllDiscounts(DiscountType.AssignedToCategories, storeId: storeId, showHidden: true))- .Select(d => d.ToModel(_dateTimeService))+ .Select(d => d.ToModel()).ToList();if (!excludeProperties && category != null)@@ -205,12 +185,7 @@ namespace Grand.Web.Admin.Services//update picture seo file nameawait _pictureService.UpdatePictureSeoNames(category.PictureId, category.Name);-- //activity log- _ = _customerActivityService.InsertActivity("AddNewCategory", category.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewCategory"), category.Name);-+return category;}@@ -255,19 +230,11 @@ namespace Grand.Web.Admin.Services//update picture seo file nameawait _pictureService.UpdatePictureSeoNames(category.PictureId, category.Name);- //activity log- _ = _customerActivityService.InsertActivity("EditCategory", category.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditCategory"), category.Name);return category;}public virtual async Task DeleteCategory(Category category){await _categoryService.DeleteCategory(category);- //activity log- _ = _customerActivityService.InsertActivity("DeleteCategory", category.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteCategory"), category.Name);}public virtual async Task<(IEnumerable<CategoryModel.CategoryProductModel> categoryProductModels, int totalCount)> PrepareCategoryProductModel(string categoryId, int pageIndex, int pageSize)@@ -353,29 +320,10 @@ namespace Grand.Web.Admin.Services}}}- public virtual async Task<(IEnumerable<CategoryModel.ActivityLogModel> activityLogModel, int totalCount)> PrepareActivityLogModel(string categoryId, int pageIndex, int pageSize)- {- var activityLog = await _customerActivityService.GetCategoryActivities(null, null, categoryId, pageIndex - 1, pageSize);- var activityLogModelList = new List<CategoryModel.ActivityLogModel>();- foreach (var item in activityLog)- {- var customer = await _customerService.GetCustomerById(item.CustomerId);- var m = new CategoryModel.ActivityLogModel {- Id = item.Id,- ActivityLogTypeName = (await _customerActivityService.GetActivityTypeById(item.ActivityLogTypeId))?.Name,- Comment = item.Comment,- CreatedOn = _dateTimeService.ConvertToUserTime(item.CreatedOnUtc, DateTimeKind.Utc),- CustomerId = item.CustomerId,- CustomerEmail = customer != null ? customer.Email : "null"- };- activityLogModelList.Add(m);- }- return (activityLogModelList, activityLog.TotalCount);- }public virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(CategoryModel.AddCategoryProductModel model, int pageIndex, int pageSize){var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, model.SearchProductName, pageIndex, pageSize);- return (products.Select(x => x.ToModel(_dateTimeService)).ToList(), products.TotalCount);+ return (products.Select(x => x.ToModel()).ToList(), products.TotalCount);}}}diff --git a/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.csindex aa37b6942..d82c2c502 100644--- a/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs@@ -3,7 +3,6 @@ using Grand.Business.Core.Interfaces.Checkout.CheckoutAttributes;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Infrastructure;using Grand.Domain.Catalog;using Grand.Domain.Common;@@ -12,7 +11,6 @@ using Grand.Domain.Orders;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Orders;using Microsoft.AspNetCore.Mvc.Rendering;-using Microsoft.AspNetCore.Http;using Grand.Business.Core.Interfaces.Catalog.Directory;using Grand.Web.Admin.Extensions.Mapping;@@ -26,11 +24,9 @@ namespace Grand.Web.Admin.Servicesprivate readonly ITaxCategoryService _taxCategoryService;private readonly IWorkContext _workContext;private readonly ICurrencyService _currencyService;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly CurrencySettings _currencySettings;private readonly IMeasureService _measureService;private readonly MeasureSettings _measureSettings;- private readonly ICustomerActivityService _customerActivityService;public CheckoutAttributeViewModelService(ICheckoutAttributeService checkoutAttributeService,@@ -39,8 +35,6 @@ namespace Grand.Web.Admin.ServicesITaxCategoryService taxCategoryService,IWorkContext workContext,ICurrencyService currencyService,- ICustomerActivityService customerActivityService,- IHttpContextAccessor httpContextAccessor,CurrencySettings currencySettings,IMeasureService measureService,MeasureSettings measureSettings@@ -52,8 +46,6 @@ namespace Grand.Web.Admin.Services_taxCategoryService = taxCategoryService;_workContext = workContext;_currencyService = currencyService;- _customerActivityService = customerActivityService;- _httpContextAccessor = httpContextAccessor;_currencySettings = currencySettings;_measureService = measureService;_measureSettings = measureSettings;@@ -225,10 +217,6 @@ namespace Grand.Web.Admin.Servicesvar checkoutAttribute = model.ToEntity();await _checkoutAttributeService.InsertCheckoutAttribute(checkoutAttribute);- //activity log- _ = _customerActivityService.InsertActivity("AddNewCheckoutAttribute", checkoutAttribute.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewCheckoutAttribute"), checkoutAttribute.Name);return checkoutAttribute;}public virtual async Task<CheckoutAttribute> UpdateCheckoutAttributeModel(CheckoutAttribute checkoutAttribute, CheckoutAttributeModel model)@@ -236,11 +224,6 @@ namespace Grand.Web.Admin.ServicescheckoutAttribute = model.ToEntity(checkoutAttribute);await SaveConditionAttributes(checkoutAttribute, model);await _checkoutAttributeService.UpdateCheckoutAttribute(checkoutAttribute);-- //activity log- _ = _customerActivityService.InsertActivity("EditCheckoutAttribute", checkoutAttribute.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditCheckoutAttribute"), checkoutAttribute.Name);return checkoutAttribute;}diff --git a/src/Web/Grand.Web.Admin/Services/CollectionViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CollectionViewModelService.csindex 071d571ed..fe299f1de 100644--- a/src/Web/Grand.Web.Admin/Services/CollectionViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CollectionViewModelService.cs@@ -2,9 +2,7 @@using Grand.Business.Core.Interfaces.Catalog.Discounts;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Extensions;-using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;@@ -18,7 +16,6 @@ using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Catalog;using Grand.Web.Common.Extensions;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Admin.Services@@ -31,18 +28,14 @@ namespace Grand.Web.Admin.Servicesprivate readonly IProductCollectionService _productCollectionService;private readonly ICollectionLayoutService _collectionLayoutService;private readonly IProductService _productService;- private readonly ICustomerService _customerService;private readonly IStoreService _storeService;private readonly ISlugService _slugService;private readonly IPictureService _pictureService;private readonly ITranslationService _translationService;private readonly IDiscountService _discountService;- private readonly ICustomerActivityService _customerActivityService;private readonly IVendorService _vendorService;- private readonly IDateTimeService _dateTimeService;private readonly ILanguageService _languageService;private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly SeoSettings _seoSettings;#endregion@@ -54,36 +47,28 @@ namespace Grand.Web.Admin.ServicesIProductCollectionService productCollectionService,ICollectionLayoutService collectionLayoutService,IProductService productService,- ICustomerService customerService,IStoreService storeService,ISlugService slugService,IPictureService pictureService,ITranslationService translationService,IDiscountService discountService,- ICustomerActivityService customerActivityService,IVendorService vendorService,- IDateTimeService dateTimeService,ILanguageService languageService,IWorkContext workContext,- IHttpContextAccessor httpContextAccessor,SeoSettings seoSettings){_collectionLayoutService = collectionLayoutService;_collectionService = collectionService;_productCollectionService = productCollectionService;_productService = productService;- _customerService = customerService;_storeService = storeService;_slugService = slugService;_pictureService = pictureService;_translationService = translationService;_discountService = discountService;- _customerActivityService = customerActivityService;_vendorService = vendorService;- _dateTimeService = dateTimeService;_languageService = languageService;_workContext = workContext;- _httpContextAccessor = httpContextAccessor;_seoSettings = seoSettings;}@@ -121,7 +106,7 @@ namespace Grand.Web.Admin.Servicesmodel.AvailableDiscounts = (await _discountService.GetAllDiscounts(DiscountType.AssignedToCollections, storeId: _workContext.CurrentCustomer.Id, showHidden: true))- .Select(d => d.ToModel(_dateTimeService))+ .Select(d => d.ToModel()).ToList();if (!excludeProperties && collection != null)@@ -155,10 +140,6 @@ namespace Grand.Web.Admin.Services//update picture seo file nameawait _pictureService.UpdatePictureSeoNames(collection.PictureId, collection.Name);- //activity log- _ = _customerActivityService.InsertActivity("AddNewCollection", collection.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewCollection"), collection.Name);return collection;}@@ -202,20 +183,12 @@ namespace Grand.Web.Admin.Services//update picture seo file nameawait _pictureService.UpdatePictureSeoNames(collection.PictureId, collection.Name);- //activity log- _ = _customerActivityService.InsertActivity("EditCollection", collection.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditCollection"), collection.Name);return collection;}public virtual async Task DeleteCollection(Collection collection){await _collectionService.DeleteCollection(collection);- //activity log- _ = _customerActivityService.InsertActivity("DeleteCollection", collection.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteCollection"), collection.Name);}public virtual async Task<CollectionModel.AddCollectionProductModel> PrepareAddCollectionProductModel(string storeId)@@ -246,7 +219,7 @@ namespace Grand.Web.Admin.Servicespublic virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(CollectionModel.AddCollectionProductModel model, int pageIndex, int pageSize){var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, model.SearchProductName, pageIndex, pageSize);- return (products.Select(x => x.ToModel(_dateTimeService)).ToList(), products.TotalCount);+ return (products.Select(x => x.ToModel()).ToList(), products.TotalCount);}public virtual async Task<(IEnumerable<CollectionModel.CollectionProductModel> collectionProductModels, int totalCount)> PrepareCollectionProductModel(string collectionId, string storeId, int pageIndex, int pageSize)@@ -314,24 +287,5 @@ namespace Grand.Web.Admin.Services}}}- public virtual async Task<(IEnumerable<CollectionModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string collectionId, int pageIndex, int pageSize)- {- var activityLog = await _customerActivityService.GetCollectionActivities(null, null, collectionId, pageIndex - 1, pageSize);- var items = new List<CollectionModel.ActivityLogModel>();- foreach (var x in activityLog)- {- var customer = await _customerService.GetCustomerById(x.CustomerId);- var m = new CollectionModel.ActivityLogModel {- Id = x.Id,- ActivityLogTypeName = (await _customerActivityService.GetActivityTypeById(x.ActivityLogTypeId))?.Name,- Comment = x.Comment,- CreatedOn = _dateTimeService.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc),- CustomerId = x.CustomerId,- CustomerEmail = customer != null ? customer.Email : "null"- };- items.Add(m);- }- return (items, activityLog.TotalCount);- }}}diff --git a/src/Web/Grand.Web.Admin/Services/ContactAttributeViewModelService.cs b/src/Web/Grand.Web.Admin/Services/ContactAttributeViewModelService.csindex df54ec6e7..2eed0d8b5 100644--- a/src/Web/Grand.Web.Admin/Services/ContactAttributeViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/ContactAttributeViewModelService.cs@@ -1,6 +1,5 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Marketing.Contacts;using Grand.Infrastructure;using Grand.Domain.Catalog;@@ -10,7 +9,6 @@ using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Messages;using Microsoft.AspNetCore.Mvc.Rendering;-using Microsoft.AspNetCore.Http;namespace Grand.Web.Admin.Services{@@ -21,22 +19,16 @@ namespace Grand.Web.Admin.Servicesprivate readonly IContactAttributeParser _contactAttributeParser;private readonly ITranslationService _translationService;private readonly IWorkContext _workContext;- private readonly ICustomerActivityService _customerActivityService;- private readonly IHttpContextAccessor _httpContextAccessor;public ContactAttributeViewModelService(IContactAttributeService contactAttributeService,IContactAttributeParser contactAttributeParser,ITranslationService translationService,- IWorkContext workContext,- ICustomerActivityService customerActivityService,- IHttpContextAccessor httpContextAccessor)+ IWorkContext workContext){_contactAttributeService = contactAttributeService;_contactAttributeParser = contactAttributeParser;_translationService = translationService;_workContext = workContext;- _customerActivityService = customerActivityService;- _httpContextAccessor = httpContextAccessor;}#region Utilities@@ -142,11 +134,6 @@ namespace Grand.Web.Admin.Services{var contactAttribute = model.ToEntity();await _contactAttributeService.InsertContactAttribute(contactAttribute);-- //activity log- _ = _customerActivityService.InsertActivity("AddNewContactAttribute", contactAttribute.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewContactAttribute"), contactAttribute.Name);return contactAttribute;}public virtual async Task<ContactAttribute> UpdateContactAttributeModel(ContactAttribute contactAttribute, ContactAttributeModel model)@@ -154,11 +141,6 @@ namespace Grand.Web.Admin.ServicescontactAttribute = model.ToEntity(contactAttribute);await SaveConditionAttributes(contactAttribute, model);await _contactAttributeService.UpdateContactAttribute(contactAttribute);-- //activity log- _ = _customerActivityService.InsertActivity("EditContactAttribute", contactAttribute.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditContactAttribute"), contactAttribute.Name);return contactAttribute;}diff --git a/src/Web/Grand.Web.Admin/Services/CourseViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CourseViewModelService.csindex 86af2c526..563d331a5 100644--- a/src/Web/Grand.Web.Admin/Services/CourseViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CourseViewModelService.cs@@ -1,8 +1,6 @@using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Extensions;-using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;@@ -11,16 +9,13 @@ using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Catalog;using Grand.Domain.Courses;using Grand.Domain.Seo;-using Grand.Infrastructure;using Grand.Web.Admin.Extensions;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Catalog;using Grand.Web.Admin.Models.Courses;using Grand.Web.Common.Extensions;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;-using Microsoft.Extensions.DependencyInjection;namespace Grand.Web.Admin.Services{@@ -34,13 +29,11 @@ namespace Grand.Web.Admin.Servicesprivate readonly IPictureService _pictureService;private readonly ILanguageService _languageService;private readonly ITranslationService _translationService;- private readonly ICustomerActivityService _customerActivityService;private readonly IProductCourseService _productCourseService;private readonly IDownloadService _downloadService;- private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;-- private readonly IServiceProvider _serviceProvider;+ private readonly IStoreService _storeService;+ private readonly IProductService _productService;+ private readonly IVendorService _vendorService;private readonly SeoSettings _seoSettings;public CourseViewModelService(@@ -52,12 +45,11 @@ namespace Grand.Web.Admin.ServicesIPictureService pictureService,ILanguageService languageService,ITranslationService translationService,- ICustomerActivityService customerActivityService,IProductCourseService productCourseService,IDownloadService downloadService,- IWorkContext workContext,- IHttpContextAccessor httpContextAccessor,- IServiceProvider serviceProvider,+ IProductService productService,+ IStoreService storeService,+ IVendorService vendorService,SeoSettings seoSettings){_courseService = courseService;@@ -68,13 +60,12 @@ namespace Grand.Web.Admin.Services_pictureService = pictureService;_languageService = languageService;_translationService = translationService;- _customerActivityService = customerActivityService;_productCourseService = productCourseService;_downloadService = downloadService;- _workContext = workContext;- _httpContextAccessor = httpContextAccessor;- _serviceProvider = serviceProvider;+ _productService = productService;_seoSettings = seoSettings;+ _storeService = storeService;+ _vendorService = vendorService;}public virtual async Task<CourseModel> PrepareCourseModel(CourseModel model = null)@@ -95,8 +86,7 @@ namespace Grand.Web.Admin.Services}if (!string.IsNullOrEmpty(model.ProductId)){- var productService = _serviceProvider.GetRequiredService<IProductService>();- model.ProductName = (await productService.GetProductById(model.ProductId))?.Name;+ model.ProductName = (await _productService.GetProductById(model.ProductId))?.Name;}return model;}@@ -123,12 +113,6 @@ namespace Grand.Web.Admin.Servicesif (!string.IsNullOrEmpty(course.ProductId))await _productCourseService.UpdateCourseOnProduct(course.ProductId, course.Id);-- //activity log- _ = _customerActivityService.InsertActivity("AddNewCourse", course.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewCourse"), course.Name);-return course;}@@ -163,21 +147,12 @@ namespace Grand.Web.Admin.Servicesif (!string.IsNullOrEmpty(course.ProductId))await _productCourseService.UpdateCourseOnProduct(course.ProductId, course.Id);-- //activity log- _ = _customerActivityService.InsertActivity("EditCourse", course.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditCourse"), course.Name);-+return course;}public virtual async Task DeleteCourse(Course course){await _courseService.Delete(course);- //activity log- _ = _customerActivityService.InsertActivity("DeleteCourse", course.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteCourse"), course.Name);}public virtual async Task<CourseLessonModel> PrepareCourseLessonModel(string courseId, CourseLessonModel model = null)@@ -205,10 +180,7 @@ namespace Grand.Web.Admin.Services{var lesson = model.ToEntity();await _courseLessonService.Insert(lesson);- //activity log- _ = _customerActivityService.InsertActivity("AddNewCourseLesson", lesson.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewCourseLesson"), lesson.Name);+return lesson;}@@ -245,11 +217,6 @@ namespace Grand.Web.Admin.Servicesawait _downloadService.DeleteDownload(prevVideo);}- //activity log- _ = _customerActivityService.InsertActivity("EditCourseLesson", lesson.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditLessonCourse"), lesson.Name);-return lesson;}public virtual async Task DeleteCourseLesson(CourseLesson lesson)@@ -270,10 +237,6 @@ namespace Grand.Web.Admin.Servicesawait _downloadService.DeleteDownload(prevAttachment);}- //activity log- _ = _customerActivityService.InsertActivity("DeleteCourseLesson", lesson.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteCourseLesson"), lesson.Name);}public virtual async Task<CourseModel.AssociateProductToCourseModel> PrepareAssociateProductToCourseModel()@@ -281,14 +244,12 @@ namespace Grand.Web.Admin.Servicesvar model = new CourseModel.AssociateProductToCourseModel();//storesmodel.AvailableStores.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = " " });- var storeService = _serviceProvider.GetRequiredService<IStoreService>();- foreach (var s in await storeService.GetAllStores())+ foreach (var s in await _storeService.GetAllStores())model.AvailableStores.Add(new SelectListItem { Text = s.Shortcut, Value = s.Id });//vendorsmodel.AvailableVendors.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = " " });- var vendorService = _serviceProvider.GetRequiredService<IVendorService>();- foreach (var v in await vendorService.GetAllVendors(showHidden: true))+ foreach (var v in await _vendorService.GetAllVendors(showHidden: true))model.AvailableVendors.Add(new SelectListItem { Text = v.Name, Value = v.Id });//product types@@ -298,10 +259,8 @@ namespace Grand.Web.Admin.Services}public virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(CourseModel.AssociateProductToCourseModel model, int pageIndex, int pageSize){- var productService = _serviceProvider.GetRequiredService<IProductService>();- var dateTimeService = _serviceProvider.GetRequiredService<IDateTimeService>();- var products = await productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, model.SearchProductName, pageIndex, pageSize);- return (products.Select(x => x.ToModel(dateTimeService)).ToList(), products.TotalCount);+ var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, model.SearchProductName, pageIndex, pageSize);+ return (products.Select(x => x.ToModel()).ToList(), products.TotalCount);}}}diff --git a/src/Web/Grand.Web.Admin/Services/CustomerGroupViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CustomerGroupViewModelService.csindex 17ec46014..7b93c71b6 100644--- a/src/Web/Grand.Web.Admin/Services/CustomerGroupViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CustomerGroupViewModelService.cs@@ -1,18 +1,15 @@using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;using Grand.Domain.Catalog;using Grand.Domain.Customers;-using Grand.Infrastructure;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Catalog;using Grand.Web.Admin.Models.Customers;using Grand.Web.Common.Extensions;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Admin.Services@@ -22,13 +19,9 @@ namespace Grand.Web.Admin.Servicesprivate readonly IGroupService _groupService;private readonly ICustomerGroupProductService _customerGroupProductService;private readonly ITranslationService _translationService;- private readonly ICustomerActivityService _customerActivityService;private readonly IProductService _productService;private readonly IStoreService _storeService;private readonly IVendorService _vendorService;- private readonly IDateTimeService _dateTimeService;- private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;#region Constructors@@ -36,24 +29,16 @@ namespace Grand.Web.Admin.ServicesIGroupService groupService,ICustomerGroupProductService customerGroupProductService,ITranslationService translationService,- ICustomerActivityService customerActivityService,IProductService productService,IStoreService storeService,- IVendorService vendorService,- IDateTimeService dateTimeService,- IWorkContext workContext,- IHttpContextAccessor httpContextAccessor)+ IVendorService vendorService){_groupService = groupService;_customerGroupProductService = customerGroupProductService;_translationService = translationService;- _customerActivityService = customerActivityService;_productService = productService;_storeService = storeService;_vendorService = vendorService;- _dateTimeService = dateTimeService;- _workContext = workContext;- _httpContextAccessor = httpContextAccessor;}#endregion@@ -77,31 +62,17 @@ namespace Grand.Web.Admin.Services{var customerGroup = model.ToEntity();await _groupService.InsertCustomerGroup(customerGroup);- //activity log- _ = _customerActivityService.InsertActivity("AddNewCustomerGroup", customerGroup.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewCustomerGroup"), customerGroup.Name);return customerGroup;}public virtual async Task<CustomerGroup> UpdateCustomerGroupModel(CustomerGroup customerGroup, CustomerGroupModel model){customerGroup = model.ToEntity(customerGroup);await _groupService.UpdateCustomerGroup(customerGroup);-- //activity log- _ = _customerActivityService.InsertActivity("EditCustomerGroup", customerGroup.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditCustomerGroup"), customerGroup.Name);return customerGroup;}public virtual async Task DeleteCustomerGroup(CustomerGroup customerGroup){await _groupService.DeleteCustomerGroup(customerGroup);-- //activity log- _ = _customerActivityService.InsertActivity("DeleteCustomerGroup", customerGroup.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteCustomerGroup"), customerGroup.Name);}public virtual async Task<IList<CustomerGroupProductModel>> PrepareCustomerGroupProductModel(string customerGroupId){@@ -145,7 +116,7 @@ namespace Grand.Web.Admin.Servicespublic virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(CustomerGroupProductModel.AddProductModel model, int pageIndex, int pageSize){var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, model.SearchProductName, pageIndex, pageSize);- return (products.Select(x => x.ToModel(_dateTimeService)).ToList(), products.TotalCount);+ return (products.Select(x => x.ToModel()).ToList(), products.TotalCount);}public virtual async Task InsertProductModel(CustomerGroupProductModel.AddProductModel model){diff --git a/src/Web/Grand.Web.Admin/Services/CustomerTagViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CustomerTagViewModelService.csindex 097cfe842..8801d8757 100644--- a/src/Web/Grand.Web.Admin/Services/CustomerTagViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CustomerTagViewModelService.cs@@ -1,19 +1,15 @@using Grand.Business.Core.Interfaces.Catalog.Products;-using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Marketing.Customers;using Grand.Domain.Catalog;using Grand.Domain.Customers;-using Grand.Infrastructure;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Catalog;using Grand.Web.Admin.Models.Customers;using Grand.Web.Common.Extensions;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Admin.Services@@ -21,35 +17,23 @@ namespace Grand.Web.Admin.Servicespublic class CustomerTagViewModelService : ICustomerTagViewModelService{private readonly ITranslationService _translationService;- private readonly ICustomerActivityService _customerActivityService;private readonly IProductService _productService;private readonly IStoreService _storeService;private readonly IVendorService _vendorService;private readonly ICustomerTagService _customerTagService;- private readonly IDateTimeService _dateTimeService;- private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;public CustomerTagViewModelService(ITranslationService translationService,- ICustomerActivityService customerActivityService,IProductService productService,IStoreService storeService,IVendorService vendorService,- ICustomerTagService customerTagService,- IDateTimeService dateTimeService,- IWorkContext workContext,- IHttpContextAccessor httpContextAccessor)+ ICustomerTagService customerTagService){_translationService = translationService;- _customerActivityService = customerActivityService;_productService = productService;_storeService = storeService;_vendorService = vendorService;_customerTagService = customerTagService;- _dateTimeService = dateTimeService;- _workContext = workContext;- _httpContextAccessor = httpContextAccessor;}public virtual CustomerModel PrepareCustomerModelForList(Customer customer)@@ -70,11 +54,6 @@ namespace Grand.Web.Admin.Servicesvar customertag = model.ToEntity();customertag.Name = customertag.Name.ToLower();await _customerTagService.InsertCustomerTag(customertag);-- //activity log- _ = _customerActivityService.InsertActivity("AddNewCustomerTag", customertag.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewCustomerTag"), customertag.Name);return customertag;}public virtual async Task<CustomerTag> UpdateCustomerTagModel(CustomerTag customerTag, CustomerTagModel model)@@ -83,19 +62,10 @@ namespace Grand.Web.Admin.ServicescustomerTag.Name = customerTag.Name.ToLower();await _customerTagService.UpdateCustomerTag(customerTag);-- //activity log- _ = _customerActivityService.InsertActivity("EditCustomerTage", customerTag.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditCustomerTag"), customerTag.Name);return customerTag;}public virtual async Task DeleteCustomerTag(CustomerTag customerTag){- //activity log- _ = _customerActivityService.InsertActivity("DeleteCustomerTag", customerTag.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteCustomerTag"), customerTag.Name);await _customerTagService.DeleteCustomerTag(customerTag);}public virtual async Task<CustomerTagProductModel.AddProductModel> PrepareProductModel(string customerTagId)@@ -122,7 +92,7 @@ namespace Grand.Web.Admin.Servicespublic virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(CustomerTagProductModel.AddProductModel model, int pageIndex, int pageSize){var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, model.SearchProductName, pageIndex, pageSize);- return (products.Select(x => x.ToModel(_dateTimeService)).ToList(), products.TotalCount);+ return (products.Select(x => x.ToModel()).ToList(), products.TotalCount);}public virtual async Task InsertProductModel(CustomerTagProductModel.AddProductModel model){diff --git a/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.csindex 50f334a27..9c838faf1 100644--- a/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs@@ -7,7 +7,6 @@ using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Addresses;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Marketing.Contacts;@@ -46,14 +45,12 @@ namespace Grand.Web.Admin.Servicesprivate readonly ICustomerProductService _customerProductService;private readonly INewsLetterSubscriptionService _newsLetterSubscriptionService;private readonly IUserFieldService _userFieldService;- private readonly ICustomerManagerService _customerManagerService;private readonly IDateTimeService _dateTimeService;private readonly ITranslationService _translationService;private readonly ILoyaltyPointsService _loyaltyPointsService;private readonly ICountryService _countryService;private readonly IWorkContext _workContext;private readonly IVendorService _vendorService;- private readonly ICustomerActivityService _customerActivityService;private readonly IStoreService _storeService;private readonly ICustomerAttributeParser _customerAttributeParser;private readonly ICustomerAttributeService _customerAttributeService;@@ -79,14 +76,12 @@ namespace Grand.Web.Admin.ServicesICustomerProductService customerProductService,INewsLetterSubscriptionService newsLetterSubscriptionService,IUserFieldService userFieldService,- ICustomerManagerService customerManagerService,IDateTimeService dateTimeService,ITranslationService translationService,ILoyaltyPointsService loyaltyPointsService,ICountryService countryService,IWorkContext workContext,IVendorService vendorService,- ICustomerActivityService customerActivityService,IStoreService storeService,ICustomerAttributeParser customerAttributeParser,ICustomerAttributeService customerAttributeService,@@ -110,7 +105,6 @@ namespace Grand.Web.Admin.Services_customerProductService = customerProductService;_newsLetterSubscriptionService = newsLetterSubscriptionService;_userFieldService = userFieldService;- _customerManagerService = customerManagerService;_dateTimeService = dateTimeService;_translationService = translationService;_loyaltyPointsService = loyaltyPointsService;@@ -121,7 +115,6 @@ namespace Grand.Web.Admin.Services_commonSettings = commonSettings;_workContext = workContext;_vendorService = vendorService;- _customerActivityService = customerActivityService;_addressSettings = addressSettings;_storeService = storeService;_customerAttributeParser = customerAttributeParser;@@ -723,13 +716,9 @@ namespace Grand.Web.Admin.Servicescustomer.Groups.Add(customerGroup.Id);await _customerService.InsertCustomerGroupInCustomer(customerGroup, customer.Id);}-//tagsawait SaveCustomerTags(customer, ParseCustomerTags(model.CustomerTags));- //activity log- _ = _customerActivityService.InsertActivity("AddNewCustomer", customer.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.AddNewCustomer"), customer.Id);-return customer;}@@ -883,8 +872,6 @@ namespace Grand.Web.Admin.Services//tagsawait SaveCustomerTags(customer, ParseCustomerTags(model.CustomerTags));- //activity log- _ = _customerActivityService.InsertActivity("EditCustomer", customer.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditCustomer"), customer.Id);return customer;}@@ -899,9 +886,6 @@ namespace Grand.Web.Admin.Servicesif (subscription != null)await _newsLetterSubscriptionService.DeleteNewsLetterSubscription(subscription);}-- //activity log- _ = _customerActivityService.InsertActivity("DeleteCustomer", customer.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.DeleteCustomer"), customer.Id);}public virtual async Task DeleteSelected(IEnumerable<string> selectedIds)@@ -915,8 +899,6 @@ namespace Grand.Web.Admin.Services{await _customerService.DeleteCustomer(customer);}- //activity log- _ = _customerActivityService.InsertActivity("DeleteCustomer", customer.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.DeleteCustomer"), customer.Id);}}@@ -945,7 +927,6 @@ namespace Grand.Web.Admin.Servicesnull : _dateTimeService.ConvertToUtcTime(model.DontSendBeforeDate.Value)};await queuedEmailService.InsertQueuedEmail(email);- _ = _customerActivityService.InsertActivity("CustomerAdmin.SendEmail", "", customer, "", _translationService.GetResource("ActivityLog.SendEmailfromAdminPanel"), model.Subject);}public virtual async Task<IEnumerable<CustomerModel.LoyaltyPointsHistoryModel>> PrepareLoyaltyPointsHistoryModel(string customerId)@@ -967,9 +948,6 @@ namespace Grand.Web.Admin.Servicespublic virtual async Task<LoyaltyPointsHistory> InsertLoyaltyPointsHistory(Customer customer, string storeId, int addLoyaltyPointsValue, string addLoyaltyPointsMessage){- //activity log- _ = _customerActivityService.InsertActivity("AddLoyaltyPoints", customer.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.AddNewLoyaltyPoints"), customer.Email, addLoyaltyPointsValue);-return await _loyaltyPointsService.AddLoyaltyPointsHistory(customer.Id, addLoyaltyPointsValue, storeId, addLoyaltyPointsMessage);}@@ -1102,7 +1080,7 @@ namespace Grand.Web.Admin.Servicesvar taxService = _serviceProvider.GetRequiredService<ITaxService>();var priceCalculationService = _serviceProvider.GetRequiredService<IPricingService>();var priceFormatter = _serviceProvider.GetRequiredService<IPriceFormatter>();-+ var productAttributeFormatter = _serviceProvider.GetRequiredService<IProductAttributeFormatter>();foreach (var sci in cart){var store = await _storeService.GetStoreById(sci.StoreId);@@ -1116,7 +1094,7 @@ namespace Grand.Web.Admin.ServicesProductId = sci.ProductId,Quantity = sci.Quantity,ProductName = product.Name,- AttributeInfo = await _serviceProvider.GetRequiredService<IProductAttributeFormatter>().FormatAttributes(product, sci.Attributes),+ AttributeInfo = await productAttributeFormatter.FormatAttributes(product, sci.Attributes),UnitPrice = priceFormatter.FormatPrice(price),UnitPriceValue = price,Total = priceFormatter.FormatPrice((await taxService.GetProductPrice(product, (await priceCalculationService.GetSubTotal(sci, product)).subTotal)).productprice),@@ -1144,10 +1122,6 @@ namespace Grand.Web.Admin.Servicesvar cart = customer.ShoppingCartItems.FirstOrDefault(a => a.Id == shoppingCartId);if (cart != null){- //activity log- _ = _customerActivityService.InsertActivity("CustomerAdmin.UpdateCartCustomer", customer.Id,_workContext.CurrentCustomer,"",- _translationService.GetResource("ActivityLog.UpdateCartCustomer"), customer.Email, customer.Id, unitprice);-return await _serviceProvider.GetRequiredService<IShoppingCartService>().UpdateShoppingCartItem(customer,@@ -1220,7 +1194,7 @@ namespace Grand.Web.Admin.Servicespublic virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(CustomerModel.AddProductModel model, int pageIndex, int pageSize){var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, model.SearchProductName, pageIndex, pageSize);- return (products.Select(x => x.ToModel(_dateTimeService)).ToList(), products.TotalCount);+ return (products.Select(x => x.ToModel()).ToList(), products.TotalCount);}public virtual async Task InsertCustomerAddProductModel(string customerId, bool personalized, CustomerModel.AddProductModel model)@@ -1282,23 +1256,6 @@ namespace Grand.Web.Admin.Servicesawait _customerProductService.DeleteCustomerProduct(customerproduct);}- public virtual async Task<(IEnumerable<CustomerModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string customerId, int pageIndex, int pageSize)- {- var activityLog = await _customerActivityService.GetAllActivities(null, null, null, customerId, "", null, pageIndex - 1, pageSize);- var items = new List<CustomerModel.ActivityLogModel>();- foreach (var x in activityLog)- {- var m = new CustomerModel.ActivityLogModel {- Id = x.Id,- ActivityLogTypeName = (await _customerActivityService.GetActivityTypeById(x.ActivityLogTypeId))?.Name,- Comment = x.Comment,- CreatedOn = _dateTimeService.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc),- IpAddress = x.IpAddress- };- items.Add(m);- }- return (items, activityLog.TotalCount);- }public virtual async Task<(IEnumerable<ContactFormModel> contactFormModels, int totalCount)> PrepareContactFormModel(string customerId, int pageIndex, int pageSize){var contactUsService = _serviceProvider.GetRequiredService<IContactUsService>();diff --git a/src/Web/Grand.Web.Admin/Services/DiscountViewModelService.cs b/src/Web/Grand.Web.Admin/Services/DiscountViewModelService.csindex 23b9d0638..4f4c6cdc3 100644--- a/src/Web/Grand.Web.Admin/Services/DiscountViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/DiscountViewModelService.cs@@ -8,7 +8,6 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;using Grand.Domain.Catalog;@@ -20,7 +19,6 @@ using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Catalog;using Grand.Web.Admin.Models.Discounts;using Grand.Web.Common.Extensions;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Admin.Services@@ -31,7 +29,6 @@ namespace Grand.Web.Admin.Servicesprivate readonly IDiscountService _discountService;private readonly ITranslationService _translationService;- private readonly ICustomerActivityService _customerActivityService;private readonly ICurrencyService _currencyService;private readonly ICategoryService _categoryService;private readonly IProductService _productService;@@ -43,7 +40,6 @@ namespace Grand.Web.Admin.Servicesprivate readonly IOrderService _orderService;private readonly IPriceFormatter _priceFormatter;private readonly IDateTimeService _dateTimeService;- private readonly IHttpContextAccessor _httpContextAccessor;#endregion@@ -54,7 +50,6 @@ namespace Grand.Web.Admin.ServicesICurrencyService currencyService,ICategoryService categoryService,IProductService productService,- ICustomerActivityService customerActivityService,IWorkContext workContext,ICollectionService collectionService,IBrandService brandService,@@ -62,15 +57,13 @@ namespace Grand.Web.Admin.ServicesIVendorService vendorService,IOrderService orderService,IPriceFormatter priceFormatter,- IDateTimeService dateTimeService,- IHttpContextAccessor httpContextAccessor)+ IDateTimeService dateTimeService){_discountService = discountService;_translationService = translationService;_currencyService = currencyService;_categoryService = categoryService;_productService = productService;- _customerActivityService = customerActivityService;_workContext = workContext;_collectionService = collectionService;_brandService = brandService;@@ -79,7 +72,6 @@ namespace Grand.Web.Admin.Services_orderService = orderService;_priceFormatter = priceFormatter;_dateTimeService = dateTimeService;- _httpContextAccessor = httpContextAccessor;}#endregion@@ -174,10 +166,6 @@ namespace Grand.Web.Admin.Servicesvar discount = model.ToEntity(_dateTimeService);await _discountService.InsertDiscount(discount);- //activity log- _ = _customerActivityService.InsertActivity("AddNewDiscount", discount.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewDiscount"), discount.Name);return discount;}@@ -235,21 +223,12 @@ namespace Grand.Web.Admin.Servicesbreak;}}-- //activity log- _ = _customerActivityService.InsertActivity("EditDiscount", discount.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditDiscount"), discount.Name);return discount;}public virtual async Task DeleteDiscount(Discount discount){await _discountService.DeleteDiscount(discount);- //activity log- _ = _customerActivityService.InsertActivity("DeleteDiscount", discount.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteDiscount"), discount.Name);}public virtual async Task InsertCouponCode(string discountId, string couponCode)diff --git a/src/Web/Grand.Web.Admin/Services/DocumentViewModelService.cs b/src/Web/Grand.Web.Admin/Services/DocumentViewModelService.csindex 442ef05d5..331275f78 100644--- a/src/Web/Grand.Web.Admin/Services/DocumentViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/DocumentViewModelService.cs@@ -4,17 +4,14 @@ using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Marketing.Documents;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Common;using Grand.Domain.Documents;-using Grand.Infrastructure;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Documents;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Admin.Services@@ -33,10 +30,7 @@ namespace Grand.Web.Admin.Servicesprivate readonly ICollectionService _collectionService;private readonly IVendorService _vendorService;private readonly ISalesEmployeeService _salesEmployeeService;- private readonly ICustomerActivityService _customerActivityService;private readonly IDownloadService _downloadService;- private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;public DocumentViewModelService(IDocumentService documentService,@@ -51,10 +45,7 @@ namespace Grand.Web.Admin.ServicesICollectionService collectionService,IVendorService vendorService,ISalesEmployeeService salesEmployeeService,- ICustomerActivityService customerActivityService,- IDownloadService downloadService,- IWorkContext workContext,- IHttpContextAccessor httpContextAccessor)+ IDownloadService downloadService){_documentService = documentService;_documentTypeService = documentTypeService;@@ -68,10 +59,7 @@ namespace Grand.Web.Admin.Services_collectionService = collectionService;_vendorService = vendorService;_salesEmployeeService = salesEmployeeService;- _customerActivityService = customerActivityService;_downloadService = downloadService;- _workContext = workContext;- _httpContextAccessor = httpContextAccessor;}public virtual async Task<(IEnumerable<DocumentModel> documetListModel, int totalCount)> PrepareDocumentListModel(DocumentListModel model, int pageIndex, int pageSize)@@ -219,21 +207,11 @@ namespace Grand.Web.Admin.Servicespublic virtual async Task<Document> InsertDocument(DocumentModel model){- if (!string.IsNullOrEmpty(model.CustomerEmail))- model.CustomerId = (await _customerService.GetCustomerByEmail(model.CustomerEmail))?.Id;- else- model.CustomerId = string.Empty;+ model.CustomerId = !string.IsNullOrEmpty(model.CustomerEmail) ? (await _customerService.GetCustomerByEmail(model.CustomerEmail))?.Id : string.Empty;var document = model.ToEntity();document.CreatedOnUtc = DateTime.UtcNow;-await _documentService.Insert(document);-- //activity log- _ = _customerActivityService.InsertActivity("AddNewDocument", document.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewDocument"), document.Name);-return document;}public virtual async Task<Document> UpdateDocument(Document document, DocumentModel model)@@ -260,12 +238,6 @@ namespace Grand.Web.Admin.Servicesif (prevAttachment != null)await _downloadService.DeleteDownload(prevAttachment);}-- //activity log- _ = _customerActivityService.InsertActivity("EditDocument", document.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditDocument"), document.Name);-return document;}@@ -280,12 +252,6 @@ namespace Grand.Web.Admin.Servicesif (prevAttachment != null)await _downloadService.DeleteDownload(prevAttachment);}-- //activity log- _ = _customerActivityService.InsertActivity("DeleteDocument", document.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteDocument"), document.Name);-}}}diff --git a/src/Web/Grand.Web.Admin/Services/GiftVoucherViewModelService.cs b/src/Web/Grand.Web.Admin/Services/GiftVoucherViewModelService.csindex 94afb663f..1dddd2fc6 100644--- a/src/Web/Grand.Web.Admin/Services/GiftVoucherViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/GiftVoucherViewModelService.cs@@ -3,7 +3,6 @@ using Grand.Business.Core.Interfaces.Checkout.GiftVouchers;using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Messages;using Grand.Infrastructure;using Grand.Domain.Localization;@@ -11,7 +10,6 @@ using Grand.Domain.Orders;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Orders;using Microsoft.AspNetCore.Mvc.Rendering;-using Microsoft.AspNetCore.Http;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Web.Admin.Extensions.Mapping;@@ -30,9 +28,6 @@ namespace Grand.Web.Admin.Servicesprivate readonly LanguageSettings _languageSettings;private readonly ITranslationService _translationService;private readonly ILanguageService _languageService;- private readonly ICustomerActivityService _customerActivityService;- private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly IStoreService _storeService;#endregion@@ -46,8 +41,7 @@ namespace Grand.Web.Admin.ServicesICurrencyService currencyService,LanguageSettings languageSettings,ITranslationService translationService, ILanguageService languageService,- ICustomerActivityService customerActivityService, IWorkContext workContext,- IHttpContextAccessor httpContextAccessor,+ IWorkContext workContext,IStoreService storeService){_giftVoucherService = giftVoucherService;@@ -59,9 +53,6 @@ namespace Grand.Web.Admin.Services_languageSettings = languageSettings;_translationService = translationService;_languageService = languageService;- _customerActivityService = customerActivityService;- _workContext = workContext;- _httpContextAccessor = httpContextAccessor;_storeService = storeService;}@@ -142,11 +133,6 @@ namespace Grand.Web.Admin.Servicesvar giftVoucher = model.ToEntity(_dateTimeService);giftVoucher.CreatedOnUtc = DateTime.UtcNow;await _giftVoucherService.InsertGiftVoucher(giftVoucher);-- //activity log- _ = _customerActivityService.InsertActivity("AddNewGiftVoucher", giftVoucher.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewGiftVoucher"), giftVoucher.Code);return giftVoucher;}@@ -200,10 +186,6 @@ namespace Grand.Web.Admin.Services{giftVoucher = model.ToEntity(giftVoucher, _dateTimeService);await _giftVoucherService.UpdateGiftVoucher(giftVoucher);- //activity log- _ = _customerActivityService.InsertActivity("EditGiftVoucher", giftVoucher.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditGiftVoucher"), giftVoucher.Code);return giftVoucher;}@@ -211,10 +193,6 @@ namespace Grand.Web.Admin.Servicespublic virtual async Task DeleteGiftVoucher(GiftVoucher giftVoucher){await _giftVoucherService.DeleteGiftVoucher(giftVoucher);- //activity log- _ = _customerActivityService.InsertActivity("DeleteGiftVoucher", giftVoucher.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteGiftVoucher"), giftVoucher.Code);}public virtual async Task<GiftVoucherModel> PrepareGiftVoucherModel(GiftVoucher giftVoucher)diff --git a/src/Web/Grand.Web.Admin/Services/KnowledgebaseViewModelService.cs b/src/Web/Grand.Web.Admin/Services/KnowledgebaseViewModelService.csindex 0b56a6914..fa94957e8 100644--- a/src/Web/Grand.Web.Admin/Services/KnowledgebaseViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/KnowledgebaseViewModelService.cs@@ -1,57 +1,35 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Cms;-using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;-using Grand.Business.Core.Interfaces.Customers;using Grand.Domain.Knowledgebase;using Grand.Domain.Seo;-using Grand.Infrastructure;using Grand.Web.Admin.Extensions;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Knowledgebase;using Grand.Web.Common.Extensions;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Admin.Services{public class KnowledgebaseViewModelService : IKnowledgebaseViewModelService{- private readonly ITranslationService _translationService;private readonly IKnowledgebaseService _knowledgebaseService;- private readonly ICustomerActivityService _customerActivityService;- private readonly ICustomerService _customerService;- private readonly IDateTimeService _dateTimeService;private readonly ISlugService _slugService;private readonly ILanguageService _languageService;- private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly SeoSettings _seoSettings;- public KnowledgebaseViewModelService(ITranslationService translationService,+ public KnowledgebaseViewModelService(IKnowledgebaseService knowledgebaseService,- ICustomerActivityService customerActivityService,- ICustomerService customerService,- IDateTimeService dateTimeService,ISlugService slugService,ILanguageService languageService,- IWorkContext workContext,- IHttpContextAccessor httpContextAccessor,SeoSettings seoSettings){- _translationService = translationService;_knowledgebaseService = knowledgebaseService;- _customerActivityService = customerActivityService;- _customerService = customerService;- _dateTimeService = dateTimeService;_slugService = slugService;_languageService = languageService;- _workContext = workContext;- _httpContextAccessor = httpContextAccessor;_seoSettings = seoSettings;}@@ -141,46 +119,7 @@ namespace Grand.Web.Admin.ServicesId = x.Id}), articles.TotalCount);}- public virtual async Task<(IEnumerable<KnowledgebaseCategoryModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareCategoryActivityLogModels(string categoryId, int pageIndex, int pageSize)- {- var activityLog = await _customerActivityService.GetKnowledgebaseCategoryActivities(null, null, categoryId, pageIndex - 1, pageSize);- var items = new List<KnowledgebaseCategoryModel.ActivityLogModel>();- foreach (var x in activityLog)- {- var customer = await _customerService.GetCustomerById(x.CustomerId);- var m = new KnowledgebaseCategoryModel.ActivityLogModel- {- Id = x.Id,- ActivityLogTypeName = (await _customerActivityService.GetActivityTypeById(x.ActivityLogTypeId))?.Name,- Comment = x.Comment,- CreatedOn = _dateTimeService.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc),- CustomerId = x.CustomerId,- CustomerEmail = customer != null ? customer.Email : "null"- };- items.Add(m);- }- return (items, activityLog.TotalCount);- }- public virtual async Task<(IEnumerable<KnowledgebaseArticleModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareArticleActivityLogModels(string articleId, int pageIndex, int pageSize)- {- var activityLog = await _customerActivityService.GetKnowledgebaseArticleActivities(null, null, articleId, pageIndex - 1, pageSize);- var items = new List<KnowledgebaseArticleModel.ActivityLogModel>();- foreach (var x in activityLog)- {- var customer = await _customerService.GetCustomerById(x.CustomerId);- var m = new KnowledgebaseArticleModel.ActivityLogModel- {- Id = x.Id,- ActivityLogTypeName = (await _customerActivityService.GetActivityTypeById(x.ActivityLogTypeId))?.Name,- Comment = x.Comment,- CreatedOn = _dateTimeService.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc),- CustomerId = x.CustomerId,- CustomerEmail = customer != null ? customer.Email : "null"- };- items.Add(m);- }- return (items, activityLog.TotalCount);- }+public virtual async Task<KnowledgebaseCategoryModel> PrepareKnowledgebaseCategoryModel(){var model = new KnowledgebaseCategoryModel {@@ -200,9 +139,6 @@ namespace Grand.Web.Admin.ServicesknowledgebaseCategory.SeName = model.SeName;await _knowledgebaseService.InsertKnowledgebaseCategory(knowledgebaseCategory);await _slugService.SaveSlug(knowledgebaseCategory, model.SeName, "");- _ = _customerActivityService.InsertActivity("CreateKnowledgebaseCategory", knowledgebaseCategory.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.CreateKnowledgebaseCategory"), knowledgebaseCategory.Name);return knowledgebaseCategory;}@@ -215,18 +151,12 @@ namespace Grand.Web.Admin.ServicesknowledgebaseCategory.SeName = model.SeName;await _knowledgebaseService.UpdateKnowledgebaseCategory(knowledgebaseCategory);await _slugService.SaveSlug(knowledgebaseCategory, model.SeName, "");- _ = _customerActivityService.InsertActivity("UpdateKnowledgebaseCategory", knowledgebaseCategory.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.UpdateKnowledgebaseCategory"), knowledgebaseCategory.Name);return knowledgebaseCategory;}public virtual async Task DeleteKnowledgebaseCategoryModel(KnowledgebaseCategory knowledgebaseCategory){await _knowledgebaseService.DeleteKnowledgebaseCategory(knowledgebaseCategory);- _ = _customerActivityService.InsertActivity("DeleteKnowledgebaseCategory", knowledgebaseCategory.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteKnowledgebaseCategory"), knowledgebaseCategory.Name);}public virtual async Task<KnowledgebaseArticleModel> PrepareKnowledgebaseArticleModel(){@@ -249,9 +179,6 @@ namespace Grand.Web.Admin.ServicesknowledgebaseArticle.AllowComments = model.AllowComments;await _knowledgebaseService.InsertKnowledgebaseArticle(knowledgebaseArticle);await _slugService.SaveSlug(knowledgebaseArticle, model.SeName, "");- _ = _customerActivityService.InsertActivity("CreateKnowledgebaseArticle", knowledgebaseArticle.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.CreateKnowledgebaseArticle"), knowledgebaseArticle.Name);return knowledgebaseArticle;}@@ -265,18 +192,12 @@ namespace Grand.Web.Admin.ServicesknowledgebaseArticle.AllowComments = model.AllowComments;await _knowledgebaseService.UpdateKnowledgebaseArticle(knowledgebaseArticle);await _slugService.SaveSlug(knowledgebaseArticle, model.SeName, "");- _ = _customerActivityService.InsertActivity("UpdateKnowledgebaseArticle", knowledgebaseArticle.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.UpdateKnowledgebaseArticle"), knowledgebaseArticle.Name);return knowledgebaseArticle;}public virtual async Task DeleteKnowledgebaseArticle(KnowledgebaseArticle knowledgebaseArticle){await _knowledgebaseService.DeleteKnowledgebaseArticle(knowledgebaseArticle);- _ = _customerActivityService.InsertActivity("DeleteKnowledgebaseArticle", knowledgebaseArticle.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteKnowledgebaseArticle"), knowledgebaseArticle.Name);}public virtual async Task InsertKnowledgebaseRelatedArticle(KnowledgebaseArticleModel.AddRelatedArticleModel model){diff --git a/src/Web/Grand.Web.Admin/Services/MerchandiseReturnViewModelService.cs b/src/Web/Grand.Web.Admin/Services/MerchandiseReturnViewModelService.csindex 216ed4044..9bc296b65 100644--- a/src/Web/Grand.Web.Admin/Services/MerchandiseReturnViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/MerchandiseReturnViewModelService.cs@@ -4,7 +4,6 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Common.Addresses;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Messages;using Grand.Business.Core.Interfaces.Storage;@@ -19,7 +18,6 @@ using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Common;using Grand.Web.Admin.Models.Orders;using Microsoft.AspNetCore.Mvc.Rendering;-using Microsoft.AspNetCore.Http;namespace Grand.Web.Admin.Services{@@ -35,7 +33,6 @@ namespace Grand.Web.Admin.Servicesprivate readonly ITranslationService _translationService;private readonly IMessageProviderService _messageProviderService;private readonly LanguageSettings _languageSettings;- private readonly ICustomerActivityService _customerActivityService;private readonly IMerchandiseReturnService _merchandiseReturnService;private readonly IPriceFormatter _priceFormatter;private readonly AddressSettings _addressSettings;@@ -44,9 +41,8 @@ namespace Grand.Web.Admin.Servicesprivate readonly IAddressAttributeService _addressAttributeService;private readonly IAddressAttributeParser _addressAttributeParser;private readonly IDownloadService _downloadService;- private readonly IHttpContextAccessor _httpContextAccessor;- #endregion Fields+ #endregion Fields#region Constructors@@ -56,7 +52,6 @@ namespace Grand.Web.Admin.ServicesICustomerService customerService, IDateTimeService dateTimeService,ITranslationService translationService,IMessageProviderService messageProviderService, LanguageSettings languageSettings,- ICustomerActivityService customerActivityService,IMerchandiseReturnService merchandiseReturnService,IPriceFormatter priceFormatter,AddressSettings addressSettings,@@ -64,8 +59,7 @@ namespace Grand.Web.Admin.ServicesIAddressAttributeService addressAttributeService,IAddressAttributeParser addressAttributeParser,IDownloadService downloadService,- OrderSettings orderSettings,- IHttpContextAccessor httpContextAccessor)+ OrderSettings orderSettings){_orderService = orderService;_workContext = workContext;@@ -75,7 +69,6 @@ namespace Grand.Web.Admin.Services_translationService = translationService;_messageProviderService = messageProviderService;_languageSettings = languageSettings;- _customerActivityService = customerActivityService;_merchandiseReturnService = merchandiseReturnService;_priceFormatter = priceFormatter;_addressSettings = addressSettings;@@ -84,7 +77,6 @@ namespace Grand.Web.Admin.Services_addressAttributeParser = addressAttributeParser;_downloadService = downloadService;_orderSettings = orderSettings;- _httpContextAccessor = httpContextAccessor;}#endregion@@ -286,11 +278,6 @@ namespace Grand.Web.Admin.Services}merchandiseReturn.NotifyCustomer = model.NotifyCustomer;await _merchandiseReturnService.UpdateMerchandiseReturn(merchandiseReturn);- //activity log- _ = _customerActivityService.InsertActivity("EditMerchandiseReturn", merchandiseReturn.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditMerchandiseReturn"), merchandiseReturn.Id);-if (model.NotifyCustomer)await NotifyCustomer(merchandiseReturn);return merchandiseReturn;@@ -298,10 +285,6 @@ namespace Grand.Web.Admin.Servicespublic virtual async Task DeleteMerchandiseReturn(MerchandiseReturn merchandiseReturn){await _merchandiseReturnService.DeleteMerchandiseReturn(merchandiseReturn);- //activity log- _ = _customerActivityService.InsertActivity("DeleteMerchandiseReturn", merchandiseReturn.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteMerchandiseReturn"), merchandiseReturn.Id);}public virtual async Task<IList<MerchandiseReturnModel.MerchandiseReturnNote>> PrepareMerchandiseReturnNotes(MerchandiseReturn merchandiseReturn)diff --git a/src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs b/src/Web/Grand.Web.Admin/Services/OrderViewModelService.csindex b860ff6d2..4db5f95dc 100644--- a/src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs@@ -11,7 +11,6 @@ using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Addresses;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Messages;@@ -30,7 +29,6 @@ using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Orders;using Grand.Web.Common.Extensions;using MediatR;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;using Microsoft.Extensions.DependencyInjection;using System.Net;@@ -68,7 +66,6 @@ namespace Grand.Web.Admin.Servicesprivate readonly ITaxService _taxService;private readonly IMerchandiseReturnService _merchandiseReturnService;private readonly ICustomerService _customerService;- private readonly ICustomerActivityService _customerActivityService;private readonly IWarehouseService _warehouseService;private readonly IServiceProvider _serviceProvider;private readonly IShoppingCartValidator _shoppingCartValidator;@@ -110,7 +107,6 @@ namespace Grand.Web.Admin.ServicesITaxService taxService,IMerchandiseReturnService merchandiseReturnService,ICustomerService customerService,- ICustomerActivityService customerActivityService,IWarehouseService warehouseService,IServiceProvider serviceProvider,IShoppingCartValidator shoppingCartValidator,@@ -147,7 +143,6 @@ namespace Grand.Web.Admin.Services_pictureService = pictureService;_taxService = taxService;_merchandiseReturnService = merchandiseReturnService;- _customerActivityService = customerActivityService;_warehouseService = warehouseService;_serviceProvider = serviceProvider;_shoppingCartValidator = shoppingCartValidator;@@ -1049,15 +1044,6 @@ namespace Grand.Web.Admin.Services}}- public virtual Task LogEditOrder(string orderId)- {- var httpContextAccessor = _serviceProvider.GetRequiredService<IHttpContextAccessor>();- _ = _customerActivityService.InsertActivity("EditOrder", orderId,- _workContext.CurrentCustomer, httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditOrder"), orderId);- return Task.CompletedTask;- }-public virtual async Task<Address> UpdateOrderAddress(Order order, Address address, OrderAddressModel model,List<CustomAttribute> customAttributes){@@ -1072,7 +1058,6 @@ namespace Grand.Web.Admin.ServicesCreatedOnUtc = DateTime.UtcNow,OrderId = order.Id});- _ = LogEditOrder(order.Id);return address;}@@ -1240,7 +1225,6 @@ namespace Grand.Web.Admin.Servicesawait _mediator.Send(new InsertOrderItemCommand{ Order = order, OrderItem = orderItem, Product = product });- _ = LogEditOrder(order.Id);}return warnings;diff --git a/src/Web/Grand.Web.Admin/Services/PageViewModelService.cs b/src/Web/Grand.Web.Admin/Services/PageViewModelService.csindex 8cda58a13..fc9a6fc50 100644--- a/src/Web/Grand.Web.Admin/Services/PageViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/PageViewModelService.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Domain.Seo;@@ -13,7 +12,6 @@ using Microsoft.AspNetCore.Mvc.Rendering;using Grand.Infrastructure;using Grand.Web.Admin.Extensions.Mapping;using Grand.Web.Common.Extensions;-using Microsoft.AspNetCore.Http;namespace Grand.Web.Admin.Services{@@ -23,12 +21,9 @@ namespace Grand.Web.Admin.Servicesprivate readonly IPageService _pageService;private readonly ISlugService _slugService;private readonly ITranslationService _translationService;- private readonly ICustomerActivityService _customerActivityService;private readonly IStoreService _storeService;private readonly ILanguageService _languageService;private readonly IDateTimeService _dateTimeService;- private readonly IWorkContext _workContext;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly SeoSettings _seoSettings;public PageViewModelService(@@ -36,24 +31,18 @@ namespace Grand.Web.Admin.ServicesIPageService pageService,ISlugService slugService,ITranslationService translationService,- ICustomerActivityService customerActivityService,IStoreService storeService,ILanguageService languageService,IDateTimeService dateTimeService,- IWorkContext workContext,- IHttpContextAccessor httpContextAccessor,SeoSettings seoSettings){_pageLayoutService = pageLayoutService;_pageService = pageService;_slugService = slugService;_translationService = translationService;- _customerActivityService = customerActivityService;_storeService = storeService;_languageService = languageService;_dateTimeService = dateTimeService;- _workContext = workContext;- _httpContextAccessor = httpContextAccessor;_seoSettings = seoSettings;}@@ -97,11 +86,6 @@ namespace Grand.Web.Admin.Servicespage.SeName = model.SeName;await _pageService.UpdatePage(page);await _slugService.SaveSlug(page, model.SeName, "");-- //activity log- _ = _customerActivityService.InsertActivity("AddNewPage", page.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewPage"), page.Title ?? page.SystemName);return page;}public virtual async Task<Page> UpdatePageModel(Page page, PageModel model)@@ -118,20 +102,11 @@ namespace Grand.Web.Admin.Services//search engine nameawait _slugService.SaveSlug(page, model.SeName, "");- //activity log- _ = _customerActivityService.InsertActivity("EditPage", page.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditPage"), page.Title ?? page.SystemName);-return page;}public virtual async Task DeletePage(Page page){await _pageService.DeletePage(page);- //activity log- _ = _customerActivityService.InsertActivity("DeletePage", page.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeletePage"), page.Title ?? page.SystemName);}}}diff --git a/src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs b/src/Web/Grand.Web.Admin/Services/ProductViewModelService.csindex 687c7b329..a0eb90678 100644--- a/src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs@@ -10,7 +10,6 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;@@ -63,13 +62,11 @@ namespace Grand.Web.Admin.Servicesprivate readonly ICustomerService _customerService;private readonly IStoreService _storeService;private readonly ISlugService _slugService;- private readonly ICustomerActivityService _customerActivityService;private readonly IOutOfStockSubscriptionService _outOfStockSubscriptionService;private readonly IDownloadService _downloadService;private readonly IStockQuantityService _stockQuantityService;private readonly ILanguageService _languageService;private readonly IProductAttributeFormatter _productAttributeFormatter;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly IServiceProvider _serviceProvider;private readonly CurrencySettings _currencySettings;private readonly MeasureSettings _measureSettings;@@ -101,13 +98,11 @@ namespace Grand.Web.Admin.ServicesICustomerService customerService,IStoreService storeService,ISlugService slugService,- ICustomerActivityService customerActivityService,IOutOfStockSubscriptionService outOfStockSubscriptionService,IDownloadService downloadService,ILanguageService languageService,IProductAttributeFormatter productAttributeFormatter,IStockQuantityService stockQuantityService,- IHttpContextAccessor httpContextAccessor,IServiceProvider serviceProvider,CurrencySettings currencySettings,MeasureSettings measureSettings,@@ -138,13 +133,11 @@ namespace Grand.Web.Admin.Services_customerService = customerService;_storeService = storeService;_slugService = slugService;- _customerActivityService = customerActivityService;_outOfStockSubscriptionService = outOfStockSubscriptionService;_downloadService = downloadService;_stockQuantityService = stockQuantityService;_languageService = languageService;_productAttributeFormatter = productAttributeFormatter;- _httpContextAccessor = httpContextAccessor;_serviceProvider = serviceProvider;_currencySettings = currencySettings;_measureSettings = measureSettings;@@ -896,11 +889,6 @@ namespace Grand.Web.Admin.Services}await _productService.UpdateProduct(product);- //activity log- _ = _customerActivityService.InsertActivity("AddNewProduct", product.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewProduct"), product.Name);-return product;}public virtual async Task<Product> UpdateProductModel(Product product, ProductModel model)@@ -975,10 +963,6 @@ namespace Grand.Web.Admin.Servicesif (prevSampleDownload != null)await _downloadService.DeleteDownload(prevSampleDownload);}- //activity log- _ = _customerActivityService.InsertActivity("EditProduct", product.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditProduct"), product.Name);return product;}public virtual async Task DeleteProduct(Product product)@@ -999,10 +983,6 @@ namespace Grand.Web.Admin.Servicesif (sampledownload != null)await _downloadService.DeleteDownload(sampledownload);}- //activity log- _ = _customerActivityService.InsertActivity("DeleteProduct", product.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteProduct"), product.Name);}public virtual async Task DeleteSelected(IEnumerable<string> selectedIds){@@ -1565,25 +1545,6 @@ namespace Grand.Web.Admin.Services}return (bidsModel, bids.TotalCount);}- public virtual async Task<(IEnumerable<ProductModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string productId, int pageIndex, int pageSize)- {- var activityLog = await _customerActivityService.GetProductActivities(null, null, productId, pageIndex - 1, pageSize);- var items = new List<ProductModel.ActivityLogModel>();- foreach (var x in activityLog)- {- var customer = await _customerService.GetCustomerById(x.CustomerId);- items.Add(- new ProductModel.ActivityLogModel {- Id = x.Id,- ActivityLogTypeName = (await _customerActivityService.GetActivityTypeById(x.ActivityLogTypeId))?.Name,- Comment = x.Comment,- CreatedOn = _dateTimeService.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc),- CustomerId = x.CustomerId,- CustomerEmail = customer != null ? customer.Email : "null"- });- }- return (items, activityLog.TotalCount);- }public virtual async Task<ProductModel.ProductAttributeMappingModel> PrepareProductAttributeMappingModel(Product product){var model = new ProductModel.ProductAttributeMappingModel {diff --git a/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs b/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.csindex 2b321190c..28cba8253 100644--- a/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs@@ -5,7 +5,6 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Catalog;using Grand.Domain.Directory;@@ -14,7 +13,6 @@ using Grand.Domain.Shipping;using Grand.Infrastructure;using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Orders;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Admin.Services@@ -23,19 +21,16 @@ namespace Grand.Web.Admin.Services{private readonly IOrderService _orderService;private readonly IWorkContext _workContext;- private readonly IGroupService _groupService;private readonly IProductService _productService;private readonly IShipmentService _shipmentService;private readonly IWarehouseService _warehouseService;private readonly IMeasureService _measureService;private readonly IDateTimeService _dateTimeService;private readonly ICountryService _countryService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IDownloadService _downloadService;private readonly IShippingService _shippingService;private readonly IStockQuantityService _stockQuantityService;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly MeasureSettings _measureSettings;private readonly ShippingSettings _shippingSettings;private readonly ShippingProviderSettings _shippingProviderSettings;@@ -43,38 +38,32 @@ namespace Grand.Web.Admin.Servicespublic ShipmentViewModelService(IOrderService orderService,IWorkContext workContext,- IGroupService groupService,IProductService productService,IShipmentService shipmentService,IWarehouseService warehouseService,IMeasureService measureService,IDateTimeService dateTimeService,ICountryService countryService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IDownloadService downloadService,IShippingService shippingService,IStockQuantityService stockQuantityService,- IHttpContextAccessor httpContextAccessor,MeasureSettings measureSettings,ShippingSettings shippingSettings,ShippingProviderSettings shippingProviderSettings){_orderService = orderService;_workContext = workContext;- _groupService = groupService;_productService = productService;_shipmentService = shipmentService;_warehouseService = warehouseService;_measureService = measureService;_dateTimeService = dateTimeService;_countryService = countryService;- _customerActivityService = customerActivityService;_translationService = translationService;_downloadService = downloadService;_shippingService = shippingService;_stockQuantityService = stockQuantityService;- _httpContextAccessor = httpContextAccessor;_measureSettings = measureSettings;_shippingSettings = shippingSettings;_shippingProviderSettings = shippingProviderSettings;@@ -293,14 +282,6 @@ namespace Grand.Web.Admin.Services}}- public virtual Task LogShipment(string shipmentId, string message)- {- _ = _customerActivityService.InsertActivity("EditShipment", shipmentId,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress?.ToString(),- message);- return Task.CompletedTask;- }-public virtual async Task<(IEnumerable<Shipment> shipments, int totalCount)> PrepareShipments(ShipmentListModel model, int pageIndex, int pageSize){diff --git a/src/Web/Grand.Web.Admin/Startup/StartupApplication.cs b/src/Web/Grand.Web.Admin/Startup/StartupApplication.csindex 180946811..84a4e4995 100644--- a/src/Web/Grand.Web.Admin/Startup/StartupApplication.cs+++ b/src/Web/Grand.Web.Admin/Startup/StartupApplication.cs@@ -22,7 +22,6 @@ namespace Grand.Web.Admin.Startup#endregion- services.AddScoped<IActivityLogViewModelService, ActivityLogViewModelService>();services.AddScoped<IAddressAttributeViewModelService, AddressAttributeViewModelService>();services.AddScoped<IAffiliateViewModelService, AffiliateViewModelService>();services.AddScoped<IBlogViewModelService, BlogViewModelService>();diff --git a/src/Web/Grand.Web.Common/Filters/CustomerActivityAttribute.cs b/src/Web/Grand.Web.Common/Filters/CustomerActivityAttribute.csindex a17a1c653..71d4e1ebd 100644--- a/src/Web/Grand.Web.Common/Filters/CustomerActivityAttribute.cs+++ b/src/Web/Grand.Web.Common/Filters/CustomerActivityAttribute.cs@@ -1,6 +1,5 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Domain.Common;using Grand.Domain.Customers;@@ -37,7 +36,6 @@ namespace Grand.Web.Common.Filtersprivate readonly ICustomerService _customerService;private readonly IWorkContext _workContext;private readonly IUserFieldService _userFieldService;- private readonly ICustomerActivityService _customerActivityService;private readonly CustomerSettings _customerSettings;#endregion@@ -48,13 +46,11 @@ namespace Grand.Web.Common.FiltersICustomerService customerService,IWorkContext workContext,IUserFieldService userFieldService,- ICustomerActivityService customerActivityService,CustomerSettings customerSettings){_customerService = customerService;_workContext = workContext;_userFieldService = userFieldService;- _customerActivityService = customerActivityService;_customerSettings = customerSettings;}@@ -118,16 +114,6 @@ namespace Grand.Web.Common.Filtersawait _userFieldService.SaveField(_workContext.CurrentCustomer, SystemCustomerFieldNames.LastUrlReferrer, referer);}}-- if (_customerSettings.SaveVisitedPage)- {- if (!_workContext.CurrentCustomer.IsSearchEngineAccount())- {- //activity- _ = _customerActivityService.InsertActivity("PublicStore.Url", pageUrl, _workContext.CurrentCustomer,- context.HttpContext?.Connection?.RemoteIpAddress?.ToString(), pageUrl);- }- }}#endregion}diff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.Activitylog.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.Activitylog.cshtmldeleted file mode 100644index a4676f570..000000000--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.Activitylog.cshtml+++ /dev/null@@ -1,73 +0,0 @@-@model ProductModel-@inject AdminAreaSettings adminAreaSettings-@if (!string.IsNullOrEmpty(Model.Id))-{--<div class="panel panel-default">- <vc:vendor-widget widget-zone="vendor_product_details_activity_log_top" additional-data="Model" />- <div class="panel-body">- <div id="activitylog-grid"></div>- </div>- <vc:vendor-widget widget-zone="vendor_product_details_activity_log_bottom" additional-data="Model" />-</div>-- <script>- $(document).ready(function () {- $("#activitylog-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("ListActivityLog", "Product", new { productId = Model.Id, area = Constants.AreaVendor }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors"- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- pageSize: @(adminAreaSettings.DefaultGridPageSize),- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- autoBind: false,- pageable: {- refresh: true,- pageSizes: [@(adminAreaSettings.GridPageSizes)]- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "ActivityLogTypeName",- title: "@Loc["Vendor.Catalog.Products.ActivityLog.ActivityLogType"]",- }, {- field: "CustomerId",- title: "@Loc["Vendor.Catalog.Products.ActivityLog.Customer"]",- minScreenWidth: 500,- template: '#:CustomerEmail#'- }, {- field: "Comment",- title: "@Loc["Vendor.Catalog.Products.ActivityLog.Comment"]",- minScreenWidth: 750,- }, {- field: "CreatedOn",- title: "@Loc["Vendor.Catalog.Products.ActivityLog.CreatedOn"]",- type: "date",- format: "{0:G}"- }]- });- });- </script>--}\ No newline at end of filediff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.cshtmlindex 9a42c1e40..cfa73f01d 100644--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.cshtml+++ b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.cshtml@@ -109,21 +109,14 @@</tabstrip-item>@if (!string.IsNullOrEmpty(Model.Id)){- <tabstrip-item text="@Loc["Vendor.Catalog.Products.ActivityLog"]" tab-index="14">- <content>- <div>- <partial name="Partials/CreateOrUpdate.Activitylog" model="Model" />- </div>- </content>- </tabstrip-item>- <tabstrip-item text="@Loc["Vendor.Catalog.Products.PurchasedWithOrders"]" tab-index="15" id="tab-purchased-product">+ <tabstrip-item text="@Loc["Vendor.Catalog.Products.PurchasedWithOrders"]" tab-index="14" id="tab-purchased-product"><content><div><partial name="Partials/CreateOrUpdate.PurchasedWithOrders" model="Model" /></div></content></tabstrip-item>- <tabstrip-item text="@Loc["Vendor.Catalog.Products.Reviews"]" tab-index="16">+ <tabstrip-item text="@Loc["Vendor.Catalog.Products.Reviews"]" tab-index="15"><content><div><partial name="Partials/CreateOrUpdate.Reviews" model="Model" />diff --git a/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs b/src/Web/Grand.Web.Vendor/Controllers/ProductController.csindex 65f0b3fb5..84fdc5932 100644--- a/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs+++ b/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Interfaces.ExportImport;using Grand.Business.Core.Interfaces.Storage;@@ -40,7 +39,6 @@ namespace Grand.Web.Vendor.Controllersprivate readonly IAuctionService _auctionService;private readonly IDateTimeService _dateTimeService;private readonly IPermissionService _permissionService;- private readonly ICustomerActivityService _customerActivityService;#endregion@@ -56,8 +54,7 @@ namespace Grand.Web.Vendor.ControllersIProductReservationService productReservationService,IAuctionService auctionService,IDateTimeService dateTimeService,- IPermissionService permissionService,- ICustomerActivityService customerActivityService)+ IPermissionService permissionService){_productViewModelService = productViewModelService;_productService = productService;@@ -69,7 +66,6 @@ namespace Grand.Web.Vendor.Controllers_auctionService = auctionService;_dateTimeService = dateTimeService;_permissionService = permissionService;- _customerActivityService = customerActivityService;}#endregion@@ -151,12 +147,6 @@ namespace Grand.Web.Vendor.Controllersif (ModelState.IsValid){var product = await _productViewModelService.InsertProductModel(model);- //activity log- _ = _customerActivityService.InsertActivity("AddNewProduct", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.AddNewProduct"), product.Name);--Success(_translationService.GetResource("Vendor.Catalog.Products.Added"));return continueEditing ? RedirectToAction("Edit", new { id = product.Id }) : RedirectToAction("List");}@@ -212,11 +202,6 @@ namespace Grand.Web.Vendor.Controllers{product = await _productViewModelService.UpdateProductModel(product, model);- //activity log- _ = _customerActivityService.InsertActivity("EditProduct", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditProduct"), product.Name);-Success(_translationService.GetResource("Vendor.Catalog.Products.Updated"));if (continueEditing){@@ -247,12 +232,6 @@ namespace Grand.Web.Vendor.Controllersif (ModelState.IsValid){await _productViewModelService.DeleteProduct(product);-- //activity log- _ = _customerActivityService.InsertActivity("DeleteProduct", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteProduct"), product.Name);-Success(_translationService.GetResource("Vendor.Catalog.Products.Deleted"));return RedirectToAction("List");}@@ -2402,29 +2381,6 @@ namespace Grand.Web.Vendor.Controllers#endregion- #region Activity log-- [PermissionAuthorizeAction(PermissionActionName.Preview)]- [HttpPost]- public async Task<IActionResult> ListActivityLog(DataSourceRequest command, string productId)- {- var product = await _productService.GetProductById(productId);-- var permission = await CheckAccessToProduct(product);- if (!permission.allow)- return ErrorForKendoGridJson(permission.message);-- var (activityLogModels, totalCount) =- await _productViewModelService.PrepareActivityLogModel(productId, command.Page, command.PageSize);- var gridModel = new DataSourceResult {- Data = activityLogModels.ToList(),- Total = totalCount- };- return Json(gridModel);- }-- #endregion-#region Reservation[PermissionAuthorizeAction(PermissionActionName.Preview)]@@ -2702,10 +2658,6 @@ namespace Grand.Web.Vendor.Controllers{if (string.IsNullOrEmpty(toDelete.OrderId)){- //activity log- _ = _customerActivityService.InsertActivity("DeleteBid", toDelete.ProductId,- _workContext.CurrentCustomer, HttpContext.Connection.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteBid"), product.Name);//delete bidawait _auctionService.DeleteBid(toDelete);return Json("");diff --git a/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs b/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.csindex b6fb3cf0b..e43aec910 100644--- a/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs+++ b/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs@@ -178,10 +178,6 @@ namespace Grand.Web.Vendor.ControllersCreatedOnUtc = DateTime.UtcNow,OrderId = order.Id});-- _ = _shipmentViewModelService.LogShipment(shipment.Id,- $"A shipment #{shipment.ShipmentNumber} has been added");-Success(_translationService.GetResource("Admin.Orders.Shipments.Added"));return continueEditing? RedirectToAction("ShipmentDetails", new { id = shipment.Id })@@ -218,10 +214,6 @@ namespace Grand.Web.Vendor.ControllersCreatedOnUtc = DateTime.UtcNow,OrderId = shipment.OrderId});-- _ = _shipmentViewModelService.LogShipment(shipment.Id,- $"A shipment #{shipment.ShipmentNumber} has been deleted");-Success(_translationService.GetResource("Admin.Orders.Shipments.Deleted"));return RedirectToAction("Edit", "Order", new { Id = shipment.OrderId });diff --git a/src/Web/Grand.Web.Vendor/Interfaces/IProductViewModelService.cs b/src/Web/Grand.Web.Vendor/Interfaces/IProductViewModelService.csindex 781a00fd4..97933e8bb 100644--- a/src/Web/Grand.Web.Vendor/Interfaces/IProductViewModelService.cs+++ b/src/Web/Grand.Web.Vendor/Interfaces/IProductViewModelService.cs@@ -59,7 +59,6 @@ namespace Grand.Web.Vendor.Interfaces//tier-pricesTask<IList<ProductModel.TierPriceModel>> PrepareTierPriceModel(Product product);Task<(IEnumerable<ProductModel.BidModel> bidModels, int totalCount)> PrepareBidMode(string productId, int pageIndex, int pageSize);- Task<(IEnumerable<ProductModel.ActivityLogModel> activityLogModels, int totalCount)> PrepareActivityLogModel(string productId, int pageIndex, int pageSize);Task<ProductModel.ProductAttributeMappingModel> PrepareProductAttributeMappingModel(Product product);Task<ProductModel.ProductAttributeMappingModel> PrepareProductAttributeMappingModel(ProductModel.ProductAttributeMappingModel model);Task<IList<ProductModel.ProductAttributeMappingModel>> PrepareProductAttributeMappingModels(Product product);diff --git a/src/Web/Grand.Web.Vendor/Interfaces/IShipmentViewModelService.cs b/src/Web/Grand.Web.Vendor/Interfaces/IShipmentViewModelService.csindex b557ba185..e01548a53 100644--- a/src/Web/Grand.Web.Vendor/Interfaces/IShipmentViewModelService.cs+++ b/src/Web/Grand.Web.Vendor/Interfaces/IShipmentViewModelService.cs@@ -10,7 +10,6 @@ namespace Grand.Web.Vendor.InterfacesTask<ShipmentModel> PrepareShipmentModel(Shipment shipment, bool prepareProducts, bool prepareShipmentEvent = false);Task<int> GetStockQty(Product product, string warehouseId);Task<int> GetReservedQty(Product product, string warehouseId);- Task LogShipment(string shipmentId, string message);Task<IList<ShipmentModel.ShipmentNote>> PrepareShipmentNotes(Shipment shipment);Task InsertShipmentNote(Shipment shipment, bool displayToCustomer, string message);Task DeleteShipmentNote(Shipment shipment, string id);diff --git a/src/Web/Grand.Web.Vendor/Models/Catalog/ProductModel.cs b/src/Web/Grand.Web.Vendor/Models/Catalog/ProductModel.csindex 098476690..5ea1a0b5c 100644--- a/src/Web/Grand.Web.Vendor/Models/Catalog/ProductModel.cs+++ b/src/Web/Grand.Web.Vendor/Models/Catalog/ProductModel.cs@@ -883,18 +883,6 @@ namespace Grand.Web.Vendor.Models.Catalog#endregion}- public class ActivityLogModel : BaseEntityModel- {- [GrandResourceDisplayName("Vendor.Catalog.Products.ActivityLog.ActivityLogType")]- public string ActivityLogTypeName { get; set; }- [GrandResourceDisplayName("Vendor.Catalog.Products.ActivityLog.Comment")]- public string Comment { get; set; }- [GrandResourceDisplayName("Vendor.Catalog.Products.ActivityLog.CreatedOn")]- public DateTime CreatedOn { get; set; }- [GrandResourceDisplayName("Vendor.Catalog.Products.ActivityLog.Customer")]- public string CustomerId { get; set; }- public string CustomerEmail { get; set; }- }public class ProductAttributeValueLocalizedModel : ILocalizedModelLocal{public string LanguageId { get; set; }diff --git a/src/Web/Grand.Web.Vendor/Services/MerchandiseReturnViewModelService.cs b/src/Web/Grand.Web.Vendor/Services/MerchandiseReturnViewModelService.csindex a7d5c00c9..6cf9c2412 100644--- a/src/Web/Grand.Web.Vendor/Services/MerchandiseReturnViewModelService.cs+++ b/src/Web/Grand.Web.Vendor/Services/MerchandiseReturnViewModelService.cs@@ -4,7 +4,6 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Common.Addresses;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Messages;using Grand.Web.Common.Extensions;@@ -34,7 +33,6 @@ namespace Grand.Web.Vendor.Servicesprivate readonly ITranslationService _translationService;private readonly IMessageProviderService _messageProviderService;private readonly LanguageSettings _languageSettings;- private readonly ICustomerActivityService _customerActivityService;private readonly IMerchandiseReturnService _merchandiseReturnService;private readonly IPriceFormatter _priceFormatter;private readonly AddressSettings _addressSettings;@@ -54,7 +52,6 @@ namespace Grand.Web.Vendor.ServicesICustomerService customerService, IDateTimeService dateTimeService,ITranslationService translationService,IMessageProviderService messageProviderService, LanguageSettings languageSettings,- ICustomerActivityService customerActivityService,IMerchandiseReturnService merchandiseReturnService,IPriceFormatter priceFormatter,AddressSettings addressSettings,@@ -72,7 +69,6 @@ namespace Grand.Web.Vendor.Services_translationService = translationService;_messageProviderService = messageProviderService;_languageSettings = languageSettings;- _customerActivityService = customerActivityService;_merchandiseReturnService = merchandiseReturnService;_priceFormatter = priceFormatter;_addressSettings = addressSettings;@@ -277,11 +273,6 @@ namespace Grand.Web.Vendor.Services}merchandiseReturn.NotifyCustomer = model.NotifyCustomer;await _merchandiseReturnService.UpdateMerchandiseReturn(merchandiseReturn);- //activity log- _ = _customerActivityService.InsertActivity("EditMerchandiseReturn", merchandiseReturn.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.EditMerchandiseReturn"), merchandiseReturn.Id);-if (model.NotifyCustomer)await NotifyCustomer(merchandiseReturn);return merchandiseReturn;@@ -289,10 +280,6 @@ namespace Grand.Web.Vendor.Servicespublic virtual async Task DeleteMerchandiseReturn(MerchandiseReturn merchandiseReturn){await _merchandiseReturnService.DeleteMerchandiseReturn(merchandiseReturn);- //activity log- _ = _customerActivityService.InsertActivity("DeleteMerchandiseReturn", merchandiseReturn.Id,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.DeleteMerchandiseReturn"), merchandiseReturn.Id);}public virtual async Task<IList<MerchandiseReturnModel.MerchandiseReturnNote>> PrepareMerchandiseReturnNotes(MerchandiseReturn merchandiseReturn)diff --git a/src/Web/Grand.Web.Vendor/Services/ProductViewModelService.cs b/src/Web/Grand.Web.Vendor/Services/ProductViewModelService.csindex fb538f829..a1b0b6727 100644--- a/src/Web/Grand.Web.Vendor/Services/ProductViewModelService.cs+++ b/src/Web/Grand.Web.Vendor/Services/ProductViewModelService.cs@@ -9,7 +9,6 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Seo;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Customers;@@ -59,7 +58,6 @@ namespace Grand.Web.Vendor.Servicesprivate readonly IStockQuantityService _stockQuantityService;private readonly ILanguageService _languageService;private readonly IProductAttributeFormatter _productAttributeFormatter;- private readonly ICustomerActivityService _customerActivityService;private readonly IServiceProvider _serviceProvider;private readonly CurrencySettings _currencySettings;private readonly MeasureSettings _measureSettings;@@ -91,7 +89,6 @@ namespace Grand.Web.Vendor.ServicesILanguageService languageService,IProductAttributeFormatter productAttributeFormatter,IStockQuantityService stockQuantityService,- ICustomerActivityService customerActivityService,IServiceProvider serviceProvider,CurrencySettings currencySettings,MeasureSettings measureSettings,@@ -122,7 +119,6 @@ namespace Grand.Web.Vendor.Services_stockQuantityService = stockQuantityService;_languageService = languageService;_productAttributeFormatter = productAttributeFormatter;- _customerActivityService = customerActivityService;_serviceProvider = serviceProvider;_currencySettings = currencySettings;_measureSettings = measureSettings;@@ -1357,30 +1353,6 @@ namespace Grand.Web.Vendor.Servicesreturn (bidsModel, bids.TotalCount);}- public virtual async Task<(IEnumerable<ProductModel.ActivityLogModel> activityLogModels, int totalCount)>- PrepareActivityLogModel(string productId, int pageIndex, int pageSize)- {- var activityLog =- await _customerActivityService.GetProductActivities(null, null, productId, pageIndex - 1, pageSize);- var items = new List<ProductModel.ActivityLogModel>();- foreach (var x in activityLog)- {- var customer = await _customerService.GetCustomerById(x.CustomerId);- items.Add(- new ProductModel.ActivityLogModel {- Id = x.Id,- ActivityLogTypeName = (await _customerActivityService.GetActivityTypeById(x.ActivityLogTypeId))- ?.Name,- Comment = x.Comment,- CreatedOn = _dateTimeService.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc),- CustomerId = x.CustomerId,- CustomerEmail = customer != null ? customer.Email : "null"- });- }-- return (items, activityLog.TotalCount);- }-public virtual async Task<ProductModel.ProductAttributeMappingModel> PrepareProductAttributeMappingModel(Product product){diff --git a/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs b/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.csindex 970d76cb8..7737a9cda 100644--- a/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs+++ b/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs@@ -5,7 +5,6 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Domain.Catalog;using Grand.Domain.Directory;using Grand.Domain.Orders;@@ -14,7 +13,6 @@ using Grand.Infrastructure;using Grand.Web.Vendor.Extensions;using Grand.Web.Vendor.Interfaces;using Grand.Web.Vendor.Models.Shipment;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;namespace Grand.Web.Vendor.Services@@ -29,11 +27,9 @@ namespace Grand.Web.Vendor.Servicesprivate readonly IWarehouseService _warehouseService;private readonly IMeasureService _measureService;private readonly IDateTimeService _dateTimeService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly IShippingService _shippingService;private readonly IStockQuantityService _stockQuantityService;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly MeasureSettings _measureSettings;private readonly ShippingSettings _shippingSettings;private readonly ShippingProviderSettings _shippingProviderSettings;@@ -47,11 +43,9 @@ namespace Grand.Web.Vendor.ServicesIWarehouseService warehouseService,IMeasureService measureService,IDateTimeService dateTimeService,- ICustomerActivityService customerActivityService,ITranslationService translationService,IShippingService shippingService,IStockQuantityService stockQuantityService,- IHttpContextAccessor httpContextAccessor,MeasureSettings measureSettings,ShippingSettings shippingSettings,ShippingProviderSettings shippingProviderSettings)@@ -64,11 +58,9 @@ namespace Grand.Web.Vendor.Services_warehouseService = warehouseService;_measureService = measureService;_dateTimeService = dateTimeService;- _customerActivityService = customerActivityService;_translationService = translationService;_shippingService = shippingService;_stockQuantityService = stockQuantityService;- _httpContextAccessor = httpContextAccessor;_measureSettings = measureSettings;_shippingSettings = shippingSettings;_shippingProviderSettings = shippingProviderSettings;@@ -269,14 +261,6 @@ namespace Grand.Web.Vendor.Servicesawait _shipmentService.DeleteShipmentNote(shipmentNote);}- public virtual Task LogShipment(string shipmentId, string message)- {- _ = _customerActivityService.InsertActivity("EditShipment", shipmentId,- _workContext.CurrentCustomer, _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress?.ToString(),- message);- return Task.CompletedTask;- }-public virtual async Task<(IEnumerable<Shipment> shipments, int totalCount)> PrepareShipments(ShipmentListModel model, int pageIndex, int pageSize){diff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xmlindex 00e067cb6..abf3da328 100644--- a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml+++ b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml@@ -909,327 +909,6 @@<Resource Name="Account.YourPersonalDetails" Area="Front"><Value>Your Personal Details</Value></Resource>- <Resource Name="ActivityLog.AbandonedCart" Area="Front">- <Value>Send email AbandonedCart - ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewBrand" Area="Front">- <Value>Added a new brand ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewCategory" Area="Front">- <Value>Added a new category ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewCheckoutAttribute" Area="Front">- <Value>Added a new checkout attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewCollection" Area="Front">- <Value>Added a new collection ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewContactAttribute" Area="Front">- <Value>Added a new contact attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewCourse" Area="Front">- <Value>Added a new course ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewCourseLesson" Area="Front">- <Value>Added a new lesson ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewCustomer" Area="Front">- <Value>Added a new customer (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.AddNewCustomerGroup" Area="Front">- <Value>Added a new customer group ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewCustomerTag" Area="Front">- <Value>Added a new customer tag ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewDiscount" Area="Front">- <Value>Added a new discount ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewDocument" Area="Front">- <Value>Added a new document ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewDocumentType" Area="Front">- <Value>Added a new document type ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewGiftVoucher" Area="Front">- <Value>Added a new gift voucher ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewLoyaltyPoints" Area="Front">- <Value>Added a loyalty points {1} to customer {0}</Value>- </Resource>- <Resource Name="ActivityLog.AddNewPage" Area="Front">- <Value>Added a new page ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewProduct" Area="Front">- <Value>Added a new product ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewProductAttribute" Area="Front">- <Value>Added a new product attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewSalesEmployee" Area="Front">- <Value>Added a new sales employee ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewSetting" Area="Front">- <Value>Added a new setting ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewSpecAttribute" Area="Front">- <Value>Added a new specification attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.AddNewWidget" Area="Front">- <Value>Added a new widget (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.CreateKnowledgebaseArticle" Area="Front">- <Value>Created knowledgebase article ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.CreateKnowledgebaseCategory" Area="Front">- <Value>Created knowledgebase category ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteAccount" Area="Front">- <Value>Customer was deleted</Value>- </Resource>- <Resource Name="ActivityLog.DeleteBid" Area="Front">- <Value>Deleted a bid for product ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteBrand" Area="Front">- <Value>Deleted a brand ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteCategory" Area="Front">- <Value>Deleted a category ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteCheckoutAttribute" Area="Front">- <Value>Deleted a checkout attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteCollection" Area="Front">- <Value>Deleted a collection ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteContactAttribute" Area="Front">- <Value>Deleted a contact attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteCourse" Area="Front">- <Value>Deleted a course ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteCourseLesson" Area="Front">- <Value>Deleted a lesson ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteCustomer" Area="Front">- <Value>Deleted a customer (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.DeleteCustomerGroup" Area="Front">- <Value>Deleted a customer group ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteCustomerTag" Area="Front">- <Value>Deleted a customer group ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteDiscount" Area="Front">- <Value>Deleted a discount ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteDocument" Area="Front">- <Value>Deleted a document ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteDocumentType" Area="Front">- <Value>Deleted a document type ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteGiftVoucher" Area="Front">- <Value>Deleted a gift voucher ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteKnowledgebaseArticle" Area="Front">- <Value>Deleted knowledgebase article ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteKnowledgebaseCategory" Area="Front">- <Value>Deleted knowledgebase category ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteMerchandiseReturn" Area="Front">- <Value>Deleted a merchandise return (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.DeleteOrder" Area="Front">- <Value>Deleted an order (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.DeletePage" Area="Front">- <Value>Deleted a page ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteProduct" Area="Front">- <Value>Deleted a product ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteProductAttribute" Area="Front">- <Value>Deleted a product attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteSalesEmployee" Area="Front">- <Value>Deleted a sales employee ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteSetting" Area="Front">- <Value>Deleted a setting ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteSpecAttribute" Area="Front">- <Value>Deleted a specification attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.DeleteWidget" Area="Front">- <Value>Deleted a widget (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.EditBrand" Area="Front">- <Value>Edited a brand ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditCategory" Area="Front">- <Value>Edited a category ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditCheckoutAttribute" Area="Front">- <Value>Edited a checkout attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditCollection" Area="Front">- <Value>Edited a collection ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditContactAttribute" Area="Front">- <Value>Edited a contact attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditCourse" Area="Front">- <Value>Edited a course ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditCustomer" Area="Front">- <Value>Edited a customer (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.EditCustomerGroup" Area="Front">- <Value>Edited a customer group ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditCustomerTag" Area="Front">- <Value>Edited a customer group ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditDiscount" Area="Front">- <Value>Edited a discount ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditDocument" Area="Front">- <Value>Edited a document ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditDocumentType" Area="Front">- <Value>Edited a document type ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditGiftVoucher" Area="Front">- <Value>Edited a gift voucher ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditLessonCourse" Area="Front">- <Value>Edited a lesson ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditMerchandiseReturn" Area="Front">- <Value>Edited a merchandise return (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.EditOrder" Area="Front">- <Value>Edited an order (ID = {0}). See order notes for details</Value>- </Resource>- <Resource Name="ActivityLog.EditPage" Area="Front">- <Value>Edited a page ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditProduct" Area="Front">- <Value>Edited a product ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditProductAttribute" Area="Front">- <Value>Edited a product attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditSalesEmployee" Area="Front">- <Value>Edited a sales employee ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditSettings" Area="Front">- <Value>Edited settings</Value>- </Resource>- <Resource Name="ActivityLog.EditSpecAttribute" Area="Front">- <Value>Edited a specification attribute ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.EditWidget" Area="Front">- <Value>Edited a widget (ID = {0})</Value>- </Resource>- <Resource Name="Activitylog.lastactivity" Area="Front">- <Value>Public store. Last Activity </Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddArticleComment" Area="Front">- <Value>Added an article comment</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddArticleComment" Area="Front">- <Value>Added an article comment</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddBlogComment" Area="Front">- <Value>Added a blog comment</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddNewsComment" Area="Front">- <Value>Added a news comment</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddProductReview" Area="Front">- <Value>Added a product review ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddToBid" Area="Front">- <Value>A new bid has been added ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddToCompareList" Area="Front">- <Value>Added a product to compare list ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddToShoppingCart" Area="Front">- <Value>Added a product to shopping cart ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AddToWishlist" Area="Front">- <Value>Added a product to wishlist ('{0}')</Value>- </Resource>- <Resource Name="Activitylog.PublicStore.AddvendorReview" Area="Front">- <Value>Add vendor review</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.AskQuestion" Area="Front">- <Value>Ask a question about product</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.ContactUs" Area="Front">- <Value>Used contact us form</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.Login" Area="Front">- <Value>Login</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.Logout" Area="Front">- <Value>Logout</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.PlaceOrder" Area="Front">- <Value>Placed a new order (ID = {0})</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.SendPM" Area="Front">- <Value>Sent PM to customer ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.ViewBrand" Area="Front">- <Value>Public store. Viewed a brand details page ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.ViewCategory" Area="Front">- <Value>Public store. Viewed a category details page ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.ViewCourse" Area="Front">- <Value>Public store. Viewed a course details page ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.ViewLesson" Area="Front">- <Value>Public store. Viewed a lesson details page ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.PublicStore.ViewProduct" Area="Front">- <Value>Public store. Viewed a product details page ('{0}')</Value>- </Resource>- <Resource Name="Activitylog.Registeredcustomer" Area="Front">- <Value>Public store. Registered Customer </Value>- </Resource>- <Resource Name="ActivityLog.SendCampaign" Area="Front">- <Value>Email campaign {0}</Value>- </Resource>- <Resource Name="ActivityLog.SendEmailfromAdminPanel">- <Value>Email (from admin panel) {0}</Value>- </Resource>- <Resource Name="ActivityLog.SendPM" Area="Front">- <Value>PM (from admin panel) {0}</Value>- </Resource>- <Resource Name="ActivityLog.SendPmFromAdminPanel">- <Value>Send pm from admin panel</Value>- </Resource>- <Resource Name="ActivityLog.UpdateCartCustomer" Area="Front">- <Value>Edited price for customer {0} (ID: {1}) price: {2}</Value>- </Resource>- <Resource Name="ActivityLog.UpdateKnowledgebaseArticle" Area="Front">- <Value>Updated knowledgebase article ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.UpdateKnowledgebaseCategory" Area="Front">- <Value>Updated knowledgebase category ('{0}')</Value>- </Resource>- <Resource Name="ActivityLog.UploadNewPlugin" Area="Front">- <Value>UploadedNewPlugin</Value>- </Resource>- <Resource Name="ActivityLog.UploadNewTheme" Area="Front">- <Value>UploadedNewTheme</Value>- </Resource><Resource Name="Address" Area="Front"><Value>Address</Value></Resource>@@ -1662,18 +1341,6 @@<Resource Name="Admin.Catalog" Area="Admin"><Value>Catalog</Value></Resource>- <Resource Name="Admin.Catalog.Articles.ActivityLog.ActivityLogType" Area="Admin">- <Value>Activity log type</Value>- </Resource>- <Resource Name="Admin.Catalog.Articles.ActivityLog.Comment" Area="Admin">- <Value>Comment</Value>- </Resource>- <Resource Name="Admin.Catalog.Articles.ActivityLog.CreatedOn" Area="Admin">- <Value>Created on</Value>- </Resource>- <Resource Name="Admin.Catalog.Articles.ActivityLog.Customer" Area="Admin">- <Value>Customer</Value>- </Resource><Resource Name="Admin.Catalog.Attributes" Area="Admin"><Value>Attributes</Value></Resource>@@ -1956,21 +1623,6 @@<Resource Name="Admin.Catalog.Brands.Acl" Area="Admin"><Value>Access control list</Value></Resource>- <Resource Name="Admin.Catalog.Brands.ActivityLog" Area="Admin">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Admin.Catalog.Brands.ActivityLog.ActivityLogType" Area="Admin">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Admin.Catalog.Brands.ActivityLog.Comment" Area="Admin">- <Value>Comment</Value>- </Resource>- <Resource Name="Admin.Catalog.Brands.ActivityLog.CreatedOn" Area="Admin">- <Value>Created on</Value>- </Resource>- <Resource Name="Admin.Catalog.Brands.ActivityLog.Customer" Area="Admin">- <Value>Customer</Value>- </Resource><Resource Name="Admin.Catalog.Brands.Added" Area="Admin"><Value>The new brand has been added successfully.</Value></Resource>@@ -2142,21 +1794,6 @@<Resource Name="Admin.Catalog.Categories.Acl" Area="Admin"><Value>Access control list</Value></Resource>- <Resource Name="Admin.Catalog.Categories.ActivityLog" Area="Admin">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Admin.Catalog.Categories.ActivityLog.ActivityLogType" Area="Admin">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Admin.Catalog.Categories.ActivityLog.Comment" Area="Admin">- <Value>Comment</Value>- </Resource>- <Resource Name="Admin.Catalog.Categories.ActivityLog.CreatedOn" Area="Admin">- <Value>Created on</Value>- </Resource>- <Resource Name="Admin.Catalog.Categories.ActivityLog.Customer" Area="Admin">- <Value>Customer</Value>- </Resource><Resource Name="Admin.Catalog.Categories.Added" Area="Admin"><Value>The new category has been added successfully.</Value></Resource>@@ -2358,21 +1995,6 @@<Resource Name="Admin.Catalog.Collections.Acl" Area="Admin"><Value>Access control list</Value></Resource>- <Resource Name="Admin.Catalog.Collections.ActivityLog" Area="Admin">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Admin.Catalog.Collections.ActivityLog.ActivityLogType" Area="Admin">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Admin.Catalog.Collections.ActivityLog.Comment" Area="Admin">- <Value>Comment</Value>- </Resource>- <Resource Name="Admin.Catalog.Collections.ActivityLog.CreatedOn" Area="Admin">- <Value>Created on</Value>- </Resource>- <Resource Name="Admin.Catalog.Collections.ActivityLog.Customer" Area="Admin">- <Value>Customer</Value>- </Resource><Resource Name="Admin.Catalog.Collections.Added" Area="Admin"><Value>The new collection has been added successfully.</Value></Resource>@@ -2622,21 +2244,6 @@<Resource Name="Admin.Catalog.Products" Area="Admin"><Value>Products</Value></Resource>- <Resource Name="Admin.Catalog.Products.ActivityLog" Area="Admin">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Admin.Catalog.Products.ActivityLog.ActivityLogType" Area="Admin">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Admin.Catalog.Products.ActivityLog.Comment" Area="Admin">- <Value>Comment</Value>- </Resource>- <Resource Name="Admin.Catalog.Products.ActivityLog.CreatedOn" Area="Admin">- <Value>Created on</Value>- </Resource>- <Resource Name="Admin.Catalog.Products.ActivityLog.Customer" Area="Admin">- <Value>Customer</Value>- </Resource><Resource Name="Admin.Catalog.Products.Added" Area="Admin"><Value>The new product has been added successfully.</Value></Resource>@@ -4059,39 +3666,6 @@<Resource Name="Admin.Configuration" Area="Admin"><Value>Configuration</Value></Resource>- <Resource Name="Admin.Configuration.ActivityLog" Area="Admin">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog" Area="Admin">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.ActivityLogType" Area="Admin">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.ActivityLogTypeColumn" Area="Admin">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.Comment" Area="Admin">- <Value>Message</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.CreatedOn" Area="Admin">- <Value>Created On</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.CreatedOnFrom" Area="Admin">- <Value>Created From</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.CreatedOnTo" Area="Admin">- <Value>Created to</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.Customer" Area="Admin">- <Value>Customer</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.CustomerEmail" Area="Admin">- <Value>Customer Email</Value>- </Resource>- <Resource Name="Admin.Configuration.ActivityLog.ActivityLog.Fields.IpAddress" Area="Admin">- <Value>Ip address</Value>- </Resource><Resource Name="Admin.Configuration.Countries" Area="Admin"><Value>Countries</Value></Resource>@@ -5649,18 +5223,6 @@<Resource Name="Admin.Content.Knowledgebase" Area="Admin"><Value>Knowledgebase</Value></Resource>- <Resource Name="Admin.Content.Knowledgebase.ActivityLog.Comment" Area="Admin">- <Value>Comment</Value>- </Resource>- <Resource Name="Admin.Content.Knowledgebase.ActivityLog.CreatedOn" Area="Admin">- <Value>Created on</Value>- </Resource>- <Resource Name="Admin.Content.Knowledgebase.ActivityLog.Customer" Area="Admin">- <Value>Customer</Value>- </Resource>- <Resource Name="Admin.Content.Knowledgebase.ActivityLogType" Area="Admin">- <Value>Activity log type</Value>- </Resource><Resource Name="Admin.Content.Knowledgebase.CreateKnowledgebaseArticle" Area="Admin"><Value>Create article</Value></Resource>@@ -5691,9 +5253,6 @@<Resource Name="Admin.Content.Knowledgebase.KnowgledgebaseCategory.EditKnowgledgebaseCategory" Area="Admin"><Value>Edit knowledgebase category</Value></Resource>- <Resource Name="Admin.Content.Knowledgebase.KnowledgebaseArticle.ActivityLog" Area="Admin">- <Value>Activity log</Value>- </Resource><Resource Name="Admin.Content.Knowledgebase.KnowledgebaseArticle.Added" Area="Admin"><Value>Article added</Value></Resource>@@ -5769,9 +5328,6 @@<Resource Name="Admin.Content.Knowledgebase.KnowledgebaseArticle.Updated" Area="Admin"><Value>Article updated</Value></Resource>- <Resource Name="Admin.Content.Knowledgebase.KnowledgebaseCategory.ActivityLog" Area="Admin">- <Value>Activity log</Value>- </Resource><Resource Name="Admin.Content.Knowledgebase.KnowledgebaseCategory.Added" Area="Admin"><Value>Category added</Value></Resource>@@ -6606,21 +6162,6 @@<Resource Name="Admin.Customers.Customers" Area="Admin"><Value>Customers</Value></Resource>- <Resource Name="Admin.Customers.Customers.ActivityLog" Area="Admin">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Admin.Customers.Customers.ActivityLog.ActivityLogType" Area="Admin">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Admin.Customers.Customers.ActivityLog.Comment" Area="Admin">- <Value>Comment</Value>- </Resource>- <Resource Name="Admin.Customers.Customers.ActivityLog.CreatedOn" Area="Admin">- <Value>Created on</Value>- </Resource>- <Resource Name="Admin.Customers.Customers.ActivityLog.IpAddress" Area="Admin">- <Value>Ip address</Value>- </Resource><Resource Name="Admin.Customers.Customers.Added" Area="Admin"><Value>The new customer has been added successfully.</Value></Resource>@@ -9633,18 +9174,6 @@<Resource Name="Admin.Reports" Area="Admin"><Value>Reports</Value></Resource>- <Resource Name="Admin.Reports.ActivityLog.ActivityStats" Area="Admin">- <Value>Activity Stat</Value>- </Resource>- <Resource Name="Admin.Reports.ActivityLog.ActivityStats.Fields.ActivityLogType" Area="Admin">- <Value>Activity Types</Value>- </Resource>- <Resource Name="Admin.Reports.ActivityLog.ActivityStats.Fields.Count" Area="Admin">- <Value>Visit counter</Value>- </Resource>- <Resource Name="Admin.Reports.ActivityLog.ActivityStats.Fields.Name" Area="Admin">- <Value>Catalog name</Value>- </Resource><Resource Name="Admin.Reports.Average" Area="Admin"><Value>Order totals</Value></Resource>@@ -9885,18 +9414,6 @@<Resource Name="Admin.Settings" Area="Admin"><Value>Settings</Value></Resource>- <Resource Name="Admin.Settings.ActivityLog.ActivityLogType" Area="Admin">- <Value>Activity log types</Value>- </Resource>- <Resource Name="Admin.Settings.ActivityLog.ActivityLogType.Fields.Enabled" Area="Admin">- <Value>Is Enabled</Value>- </Resource>- <Resource Name="Admin.Settings.ActivityLog.ActivityLogType.Fields.Name" Area="Admin">- <Value>Name</Value>- </Resource>- <Resource Name="Admin.Settings.ActivityLog.ActivityLogType.Updated" Area="Admin">- <Value>The types have been updated successfully.</Value>- </Resource><Resource Name="Admin.Settings.AdminSearch" Area="Admin"><Value>Admin search</Value></Resource>@@ -11595,12 +11112,6 @@<Resource Name="Admin.System.Maintenance.DeleteAbandonedCarts.TotalDeleted" Area="Admin"><Value>{0} items were deleted</Value></Resource>- <Resource Name="Admin.System.Maintenance.DeleteActivityLog" Area="Admin">- <Value>Deleting activity Log</Value>- </Resource>- <Resource Name="Admin.System.Maintenance.DeleteActivityLog.Deleted" Area="Admin">- <Value>Deleted activity Log</Value>- </Resource><Resource Name="Admin.System.Maintenance.DeleteExportedFiles" Area="Admin"><Value>Deleting old exported files</Value></Resource>@@ -14508,9 +14019,6 @@<Resource Name="Permission.ManageACL" Area="Admin"><Value>Admin area. Manage ACL</Value></Resource>- <Resource Name="Permission.ManageActivityLog" Area="Admin">- <Value>Admin area. Manage Activity Log</Value>- </Resource><Resource Name="Permission.ManageAffiliates" Area="Admin"><Value>Admin area. Manage Affiliates</Value></Resource>@@ -16074,21 +15582,6 @@<Resource Name="Vendor.Catalog.ProductReviews.Fields.Title" Area="Vendor"><Value>Title</Value></Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog" Area="Vendor">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog.ActivityLogType" Area="Vendor">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog.Comment" Area="Vendor">- <Value>Comment</Value>- </Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog.CreatedOn" Area="Vendor">- <Value>Created on</Value>- </Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog.Customer" Area="Vendor">- <Value>Customer</Value>- </Resource><Resource Name="Vendor.Catalog.Products.Added" Area="Vendor"><Value>The new product has been added successfully.</Value></Resource>diff --git a/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_220.xml b/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_220.xmlindex 0c36a586a..fde5bfb81 100644--- a/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_220.xml+++ b/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_220.xml@@ -238,21 +238,6 @@<Resource Name="Vendor.Catalog.ProductReviews.Fields.Title" Area="Vendor"><Value>Title</Value></Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog" Area="Vendor">- <Value>Activity Log</Value>- </Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog.ActivityLogType" Area="Vendor">- <Value>Activity Log Type</Value>- </Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog.Comment" Area="Vendor">- <Value>Comment</Value>- </Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog.CreatedOn" Area="Vendor">- <Value>Created on</Value>- </Resource>- <Resource Name="Vendor.Catalog.Products.ActivityLog.Customer" Area="Vendor">- <Value>Customer</Value>- </Resource><Resource Name="Vendor.Catalog.Products.Added" Area="Vendor"><Value>The new product has been added successfully.</Value></Resource>diff --git a/src/Web/Grand.Web/App_Data/appsettings.json b/src/Web/Grand.Web/App_Data/appsettings.jsonindex 1713db459..996a67ce3 100644--- a/src/Web/Grand.Web/App_Data/appsettings.json+++ b/src/Web/Grand.Web/App_Data/appsettings.json@@ -136,7 +136,7 @@"UseResponseCompression": false,//Gets or sets a value indicating whether mini profiler should be displayed in public store (used for debugging)- "DisplayMiniProfilerInPublicStore": false,+ "DisplayMiniProfilerInPublicStore": true,//Indicates whether to ignore InstallUrlMiddleware"IgnoreInstallUrlMiddleware": false,diff --git a/src/Web/Grand.Web/Commands/Handler/Blogs/InsertBlogCommentCommandHandler.cs b/src/Web/Grand.Web/Commands/Handler/Blogs/InsertBlogCommentCommandHandler.csindex a57deca0c..1075acd7a 100644--- a/src/Web/Grand.Web/Commands/Handler/Blogs/InsertBlogCommentCommandHandler.cs+++ b/src/Web/Grand.Web/Commands/Handler/Blogs/InsertBlogCommentCommandHandler.cs@@ -1,6 +1,4 @@using Grand.Business.Core.Interfaces.Cms;-using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Messages;using Grand.Domain.Blogs;@@ -16,23 +14,19 @@ namespace Grand.Web.Commands.Handler.Blogsprivate readonly IBlogService _blogService;private readonly IWorkContext _workContext;private readonly ICustomerService _customerService;- private readonly ICustomerActivityService _customerActivityService;private readonly IMessageProviderService _messageProviderService;- private readonly ITranslationService _translationService;private readonly LanguageSettings _languageSettings;private readonly BlogSettings _blogSettings;public InsertBlogCommentCommandHandler(IBlogService blogService, IWorkContext workContext,- ICustomerService customerService, ICustomerActivityService customerActivityService, IMessageProviderService messageProviderService,- ITranslationService translationService, LanguageSettings languageSettings, BlogSettings blogSettings)+ ICustomerService customerService, IMessageProviderService messageProviderService,+ LanguageSettings languageSettings, BlogSettings blogSettings){_blogService = blogService;_workContext = workContext;_customerService = customerService;- _customerActivityService = customerActivityService;_messageProviderService = messageProviderService;- _translationService = translationService;_languageSettings = languageSettings;_blogSettings = blogSettings;@@ -64,9 +58,6 @@ namespace Grand.Web.Commands.Handler.Blogsif (_blogSettings.NotifyAboutNewBlogComments)await _messageProviderService.SendBlogCommentMessage(request.BlogPost, comment, _languageSettings.DefaultAdminLanguageId);- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddBlogComment", comment.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.PublicStore.AddBlogComment"));-return comment;}}diff --git a/src/Web/Grand.Web/Commands/Handler/Contact/ContactUsSendCommandHandler.cs b/src/Web/Grand.Web/Commands/Handler/Contact/ContactUsSendCommandHandler.csindex 282268662..f3c1c7c93 100644--- a/src/Web/Grand.Web/Commands/Handler/Contact/ContactUsSendCommandHandler.cs+++ b/src/Web/Grand.Web/Commands/Handler/Contact/ContactUsSendCommandHandler.cs@@ -1,5 +1,4 @@using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Marketing.Contacts;using Grand.Business.Core.Interfaces.Messages;using Grand.Domain.Common;@@ -18,7 +17,6 @@ namespace Grand.Web.Commands.Handler.Contactprivate readonly IContactAttributeParser _contactAttributeParser;private readonly ITranslationService _translationService;private readonly IMessageProviderService _messageProviderService;- private readonly ICustomerActivityService _customerActivityService;private readonly CommonSettings _commonSettings;@@ -26,14 +24,12 @@ namespace Grand.Web.Commands.Handler.ContactIContactAttributeParser contactAttributeParser,ITranslationService translationService,IMessageProviderService messageProviderService,- ICustomerActivityService customerActivityService,CommonSettings commonSettings){_workContext = workContext;_contactAttributeParser = contactAttributeParser;_translationService = translationService;_messageProviderService = messageProviderService;- _customerActivityService = customerActivityService;_commonSettings = commonSettings;}@@ -48,11 +44,6 @@ namespace Grand.Web.Commands.Handler.Contact_workContext.CurrentCustomer);request.Model = await SendContactUs(request, _workContext.CurrentStore);- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.ContactUs", "",- _workContext.CurrentCustomer, request.IpAddress,- _translationService.GetResource("ActivityLog.PublicStore.ContactUs"));-return request.Model;}diff --git a/src/Web/Grand.Web/Commands/Handler/Customers/DeleteAccountCommandHandler.cs b/src/Web/Grand.Web/Commands/Handler/Customers/DeleteAccountCommandHandler.csindex 16704833c..03ebcff4f 100644--- a/src/Web/Grand.Web/Commands/Handler/Customers/DeleteAccountCommandHandler.cs+++ b/src/Web/Grand.Web/Commands/Handler/Customers/DeleteAccountCommandHandler.cs@@ -1,6 +1,4 @@-using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;-using Grand.Business.Core.Interfaces.Customers;+using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Marketing.Newsletters;using Grand.Business.Core.Interfaces.Messages;using Grand.Domain.Localization;@@ -15,8 +13,6 @@ namespace Grand.Web.Commands.Handler.Customersprivate readonly IMessageProviderService _messageProviderService;private readonly IQueuedEmailService _queuedEmailService;private readonly INewsLetterSubscriptionService _newsLetterSubscriptionService;- private readonly ICustomerActivityService _customerActivityService;- private readonly ITranslationService _translationService;private readonly LanguageSettings _languageSettings;public DeleteAccountCommandHandler(@@ -24,26 +20,17 @@ namespace Grand.Web.Commands.Handler.CustomersIMessageProviderService messageProviderService,IQueuedEmailService queuedEmailService,INewsLetterSubscriptionService newsLetterSubscriptionService,- ICustomerActivityService customerActivityService,- ITranslationService translationService,LanguageSettings languageSettings){_customerService = customerService;_messageProviderService = messageProviderService;_queuedEmailService = queuedEmailService;_newsLetterSubscriptionService = newsLetterSubscriptionService;- _customerActivityService = customerActivityService;- _translationService = translationService;_languageSettings = languageSettings;}public async Task<bool> Handle(DeleteAccountCommand request, CancellationToken cancellationToken){- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.DeleteAccount", request.Customer.Id,- request.Customer, request.IpAddress,- _translationService.GetResource("ActivityLog.DeleteAccount"), request.Customer);-//send notification to customerawait _messageProviderService.SendCustomerDeleteStoreOwnerMessage(request.Customer, _languageSettings.DefaultAdminLanguageId);diff --git a/src/Web/Grand.Web/Controllers/ActionCartController.cs b/src/Web/Grand.Web/Controllers/ActionCartController.csindex fd6921027..5d8f3290e 100644--- a/src/Web/Grand.Web/Controllers/ActionCartController.cs+++ b/src/Web/Grand.Web/Controllers/ActionCartController.cs@@ -3,7 +3,6 @@ using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Utilities.Checkout;using Grand.Domain.Catalog;using Grand.Domain.Common;@@ -34,7 +33,6 @@ namespace Grand.Web.Controllersprivate readonly ITranslationService _translationService;private readonly ICurrencyService _currencyService;private readonly IShoppingCartValidator _shoppingCartValidator;- private readonly ICustomerActivityService _customerActivityService;private readonly IMediator _mediator;private readonly ShoppingCartSettings _shoppingCartSettings;@@ -49,7 +47,6 @@ namespace Grand.Web.ControllersITranslationService translationService,ICurrencyService currencyService,IShoppingCartValidator shoppingCartValidator,- ICustomerActivityService customerActivityService,IMediator mediator,ShoppingCartSettings shoppingCartSettings){@@ -60,7 +57,6 @@ namespace Grand.Web.Controllers_translationService = translationService;_currencyService = currencyService;_shoppingCartValidator = shoppingCartValidator;- _customerActivityService = customerActivityService;_mediator = mediator;_shoppingCartSettings = shoppingCartSettings;}@@ -265,11 +261,6 @@ namespace Grand.Web.Controllers{case ShoppingCartType.Wishlist:{- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddToWishlist", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddToWishlist"), product.Name);-if (_shoppingCartSettings.DisplayWishlistAfterAddingProduct || model.ForceRedirection){//redirect to the wishlist page@@ -295,11 +286,6 @@ namespace Grand.Web.Controllerscase ShoppingCartType.ShoppingCart:default:{- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddToShoppingCart", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddToShoppingCart"), product.Name);-if (_shoppingCartSettings.DisplayCartAfterAddingProduct || model.ForceRedirection){//redirect to the shopping cart page@@ -486,11 +472,6 @@ namespace Grand.Web.Controllers{case ShoppingCartType.Wishlist:{- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddToWishlist", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddToWishlist"), product.Name);-if (_shoppingCartSettings.DisplayWishlistAfterAddingProduct){//redirect to the wishlist page@@ -516,11 +497,6 @@ namespace Grand.Web.Controllerscase ShoppingCartType.ShoppingCart:default:{- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddToShoppingCart", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddToShoppingCart"), product.Name);-if (_shoppingCartSettings.DisplayCartAfterAddingProduct){//redirect to the shopping cart page@@ -852,15 +828,9 @@ namespace Grand.Web.Controllersmessage = toReturn});}-//insert new bidawait auctionService.NewBid(customer, product, _workContext.CurrentStore, _workContext.WorkingLanguage, warehouseId, bid);- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddNewBid", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddToBid"), product.Name);-var addtoCartModel = await _mediator.Send(new GetAddToCart {Product = product,Customer = customer,diff --git a/src/Web/Grand.Web/Controllers/CatalogController.cs b/src/Web/Grand.Web/Controllers/CatalogController.csindex 602f2c25a..bb1813df0 100644--- a/src/Web/Grand.Web/Controllers/CatalogController.cs+++ b/src/Web/Grand.Web/Controllers/CatalogController.cs@@ -5,7 +5,6 @@ using Grand.Business.Core.Interfaces.Catalog.Collections;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Utilities.Common.Security;@@ -39,7 +38,6 @@ namespace Grand.Web.Controllersprivate readonly IUserFieldService _userFieldService;private readonly IAclService _aclService;private readonly IPermissionService _permissionService;- private readonly ICustomerActivityService _customerActivityService;private readonly IMediator _mediator;private readonly VendorSettings _vendorSettings;@@ -58,7 +56,6 @@ namespace Grand.Web.ControllersIUserFieldService userFieldService,IAclService aclService,IPermissionService permissionService,- ICustomerActivityService customerActivityService,IMediator mediator,VendorSettings vendorSettings){@@ -72,7 +69,6 @@ namespace Grand.Web.Controllers_userFieldService = userFieldService;_aclService = aclService;_permissionService = permissionService;- _customerActivityService = customerActivityService;_mediator = mediator;_vendorSettings = vendorSettings;}@@ -132,11 +128,6 @@ namespace Grand.Web.Controllersif (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) && await _permissionService.Authorize(StandardPermission.ManageCategories, customer))DisplayEditLink(Url.Action("Edit", "Category", new { id = category.Id, area = "Admin" }));- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.ViewCategory", category.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.ViewCategory"), category.Name);-//modelvar model = await _mediator.Send(new GetCategory {Category = category,@@ -197,11 +188,6 @@ namespace Grand.Web.Controllersif (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) && await _permissionService.Authorize(StandardPermission.ManageBrands, customer))DisplayEditLink(Url.Action("Edit", "Brand", new { id = brand.Id, area = "Admin" }));- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.ViewBrand", brand.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.ViewBrand"), brand.Name);-//modelvar model = await _mediator.Send(new GetBrand {Command = command,@@ -261,11 +247,6 @@ namespace Grand.Web.Controllersif (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) && await _permissionService.Authorize(StandardPermission.ManageCollections, customer))DisplayEditLink(Url.Action("Edit", "Collection", new { id = collection.Id, area = "Admin" }));- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.ViewCollection", collection.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.ViewCollection"), collection.Name);-//modelvar model = await _mediator.Send(new GetCollection {Command = command,@@ -356,11 +337,6 @@ namespace Grand.Web.Controllersif (ModelState.IsValid){var vendorReview = await _mediator.Send(new InsertVendorReviewCommand { Vendor = vendor, Store = _workContext.CurrentStore, Model = model });- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddVendorReview", vendor.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddVendorReview"), vendor.Name);-//raise eventif (vendorReview.IsApproved)await _mediator.Publish(new VendorReviewApprovedEvent(vendorReview));diff --git a/src/Web/Grand.Web/Controllers/CheckoutController.cs b/src/Web/Grand.Web/Controllers/CheckoutController.csindex 42e56f655..a7d3d773f 100644--- a/src/Web/Grand.Web/Controllers/CheckoutController.cs+++ b/src/Web/Grand.Web/Controllers/CheckoutController.cs@@ -7,7 +7,6 @@ using Grand.Business.Core.Interfaces.Checkout.Payments;using Grand.Business.Core.Interfaces.Checkout.Shipping;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Utilities.Checkout;using Grand.Domain.Common;@@ -47,7 +46,6 @@ namespace Grand.Web.Controllersprivate readonly IPaymentTransactionService _paymentTransactionService;private readonly ILogger<CheckoutController> _logger;private readonly IOrderService _orderService;- private readonly ICustomerActivityService _customerActivityService;private readonly IMediator _mediator;private readonly IProductService _productService;private readonly IShoppingCartValidator _shoppingCartValidator;@@ -74,7 +72,6 @@ namespace Grand.Web.ControllersIPaymentTransactionService paymentTransactionService,ILogger<CheckoutController> logger,IOrderService orderService,- ICustomerActivityService customerActivityService,IMediator mediator,IProductService productService,IShoppingCartValidator shoppingCartValidator,@@ -96,7 +93,6 @@ namespace Grand.Web.Controllers_paymentTransactionService = paymentTransactionService;_logger = logger;_orderService = orderService;- _customerActivityService = customerActivityService;_mediator = mediator;_productService = productService;_shoppingCartValidator = shoppingCartValidator;@@ -956,11 +952,6 @@ namespace Grand.Web.Controllersvar placeOrderResult = await _mediator.Send(new PlaceOrderCommand());if (placeOrderResult.Success){- _ = _customerActivityService.InsertActivity("PublicStore.PlaceOrder", "",- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.PlaceOrder"),- placeOrderResult.PlacedOrder.Id);-var paymentMethod =_paymentService.LoadPaymentMethodBySystemName(placeOrderResult.PaymentTransaction.PaymentMethodSystemName);diff --git a/src/Web/Grand.Web/Controllers/CourseController.cs b/src/Web/Grand.Web/Controllers/CourseController.csindex 651d1f46c..9942390a3 100644--- a/src/Web/Grand.Web/Controllers/CourseController.cs+++ b/src/Web/Grand.Web/Controllers/CourseController.cs@@ -1,6 +1,5 @@using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Interfaces.Marketing.Courses;using Grand.Business.Core.Interfaces.Storage;@@ -22,7 +21,6 @@ namespace Grand.Web.Controllersprivate readonly IAclService _aclService;private readonly IWorkContext _workContext;private readonly IGroupService _groupService;- private readonly ICustomerActivityService _customerActivityService;private readonly ITranslationService _translationService;private readonly ICourseService _courseService;private readonly ICourseLessonService _courseLessonService;@@ -35,7 +33,6 @@ namespace Grand.Web.ControllersIAclService aclService,IWorkContext workContext,IGroupService groupService,- ICustomerActivityService customerActivityService,ITranslationService translationService,ICourseService courseService,ICourseLessonService courseLessonService,@@ -47,7 +44,6 @@ namespace Grand.Web.Controllers_aclService = aclService;_workContext = workContext;_groupService = groupService;- _customerActivityService = customerActivityService;_translationService = translationService;_courseService = courseService;_courseLessonService = courseLessonService;@@ -95,11 +91,6 @@ namespace Grand.Web.Controllersif (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) && await _permissionService.Authorize(StandardPermission.ManageCourses, customer))DisplayEditLink(Url.Action("Edit", "Course", new { id = course.Id, area = "Admin" }));- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.ViewCourse", course.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.ViewCourse"), course.Name);-//modelvar model = await _mediator.Send(new GetCourse {Course = course,@@ -128,12 +119,7 @@ namespace Grand.Web.Controllers//display "edit" (manage) linkif (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) && await _permissionService.Authorize(StandardPermission.ManageCourses, customer))DisplayEditLink(Url.Action("EditLesson", "Course", new { id = lesson.Id, area = "Admin" }));-- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.ViewLesson", lesson.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.ViewLesson"), lesson.Name);-+//modelvar model = await _mediator.Send(new GetLesson {Course = course,diff --git a/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs b/src/Web/Grand.Web/Controllers/KnowledgebaseController.csindex 7f3a0db5d..0386fa512 100644--- a/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs+++ b/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs@@ -2,7 +2,6 @@using Grand.Business.Core.Interfaces.Cms;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Messages;@@ -31,7 +30,6 @@ namespace Grand.Web.Controllersprivate readonly IAclService _aclService;private readonly ITranslationService _translationService;private readonly IMessageProviderService _messageProviderService;- private readonly ICustomerActivityService _customerActivityService;private readonly IDateTimeService _dateTimeService;private readonly IPermissionService _permissionService;private readonly CustomerSettings _customerSettings;@@ -46,7 +44,6 @@ namespace Grand.Web.ControllersIAclService aclService,ITranslationService translationService,IMessageProviderService messageProviderService,- ICustomerActivityService customerActivityService,IDateTimeService dateTimeService,IPermissionService permissionService,CustomerSettings customerSettings,@@ -62,7 +59,6 @@ namespace Grand.Web.Controllers_captchaSettings = captchaSettings;_languageSettings = languageSettings;_messageProviderService = messageProviderService;- _customerActivityService = customerActivityService;_dateTimeService = dateTimeService;_customerSettings = customerSettings;_permissionService = permissionService;@@ -285,11 +281,6 @@ namespace Grand.Web.Controllersif (_knowledgebaseSettings.NotifyAboutNewArticleComments)await _messageProviderService.SendArticleCommentMessage(article, comment, _languageSettings.DefaultAdminLanguageId);- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddArticleComment", comment.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddArticleComment"));-//The text boxes should be cleared after a comment has been posted//That' why we reload the pageTempData["Grand.knowledgebase.addarticlecomment.result"] = _translationService.GetResource("Knowledgebase.Article.Comments.SuccessfullyAdded");diff --git a/src/Web/Grand.Web/Controllers/NewsController.cs b/src/Web/Grand.Web/Controllers/NewsController.csindex eba70bb62..fcf5e3655 100644--- a/src/Web/Grand.Web/Controllers/NewsController.cs+++ b/src/Web/Grand.Web/Controllers/NewsController.cs@@ -1,7 +1,6 @@using Grand.Business.Core.Interfaces.Cms;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Utilities.Common.Security;using Grand.Domain.Customers;@@ -27,7 +26,6 @@ namespace Grand.Web.Controllersprivate readonly INewsService _newsService;private readonly IWorkContext _workContext;private readonly ITranslationService _translationService;- private readonly ICustomerActivityService _customerActivityService;private readonly IAclService _aclService;private readonly IPermissionService _permissionService;private readonly IMediator _mediator;@@ -40,7 +38,6 @@ namespace Grand.Web.Controllerspublic NewsController(INewsService newsService,IWorkContext workContext,ITranslationService translationService,- ICustomerActivityService customerActivityService,IAclService aclService,IPermissionService permissionService,IMediator mediator,@@ -49,7 +46,6 @@ namespace Grand.Web.Controllers_newsService = newsService;_workContext = workContext;_translationService = translationService;- _customerActivityService = customerActivityService;_aclService = aclService;_permissionService = permissionService;_mediator = mediator;@@ -118,11 +114,6 @@ namespace Grand.Web.Controllers//notificationawait _mediator.Publish(new NewsCommentEvent(newsItem, model));- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AddNewsComment", newsItem.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddNewsComment"));-return Json(new{success = true,diff --git a/src/Web/Grand.Web/Controllers/ProductController.cs b/src/Web/Grand.Web/Controllers/ProductController.csindex 52f41da72..2fc444566 100644--- a/src/Web/Grand.Web/Controllers/ProductController.cs+++ b/src/Web/Grand.Web/Controllers/ProductController.cs@@ -4,7 +4,6 @@ using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Checkout.Orders;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Storage;@@ -38,7 +37,6 @@ namespace Grand.Web.Controllersprivate readonly IShoppingCartService _shoppingCartService;private readonly IAclService _aclService;private readonly IPermissionService _permissionService;- private readonly ICustomerActivityService _customerActivityService;private readonly IMediator _mediator;private readonly CatalogSettings _catalogSettings;private readonly CaptchaSettings _captchaSettings;@@ -55,7 +53,6 @@ namespace Grand.Web.ControllersIShoppingCartService shoppingCartService,IAclService aclService,IPermissionService permissionService,- ICustomerActivityService customerActivityService,IMediator mediator,CatalogSettings catalogSettings,CaptchaSettings captchaSettings@@ -68,7 +65,6 @@ namespace Grand.Web.Controllers_shoppingCartService = shoppingCartService;_aclService = aclService;_permissionService = permissionService;- _customerActivityService = customerActivityService;_mediator = mediator;_catalogSettings = catalogSettings;_captchaSettings = captchaSettings;@@ -138,11 +134,6 @@ namespace Grand.Web.ControllersDisplayEditLink(Url.Action("Edit", "Product", new { id = product.Id, area = "Admin" }));}}-- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.ViewProduct", product.Id, _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.ViewProduct"), product.Name);-_ = _productService.IncrementProductField(product, x => x.Viewed, 1);return View(productLayoutViewPath, model);@@ -379,10 +370,6 @@ namespace Grand.Web.Controllers//save as recently viewedawait _recentlyViewedProductsService.AddProductToRecentlyViewedList(customer.Id, product.Id);- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.ViewProduct", product.Id, _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.ViewProduct"), product.Name);-_ = _productService.IncrementProductField(product, x => x.Viewed, 1);return Json(new@@ -488,10 +475,6 @@ namespace Grand.Web.Controllers//notificationawait _mediator.Publish(new ProductReviewEvent(product, model.AddProductReview));- _ = _customerActivityService.InsertActivity("PublicStore.AddProductReview", product.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AddProductReview"), product.Name);-//raise eventif (productReview.IsApproved)await _mediator.Publish(new ProductReviewApprovedEvent(productReview));@@ -694,10 +677,6 @@ namespace Grand.Web.ControllersRemoteIpAddress = HttpContext.Connection?.RemoteIpAddress?.ToString()});- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.AskQuestion", _workContext.CurrentCustomer.Id,- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.AskQuestion"));//return Jsonreturn Json(new{diff --git a/src/Web/Grand.Web/Events/CustomerLoggedInEventHandler.cs b/src/Web/Grand.Web/Events/CustomerLoggedInEventHandler.csdeleted file mode 100644index 621b8a228..000000000--- a/src/Web/Grand.Web/Events/CustomerLoggedInEventHandler.cs+++ /dev/null@@ -1,35 +0,0 @@-using Grand.Business.Core.Events.Customers;-using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;-using MediatR;-using Microsoft.AspNetCore.Http;--namespace Grand.Web.Events-{- public class CustomerLoggedInEventHandler : INotificationHandler<CustomerLoggedInEvent>- {- private readonly ICustomerActivityService _customerActivityService;- private readonly IHttpContextAccessor _httpContextAccessor;- private readonly ITranslationService _translationService;-- public CustomerLoggedInEventHandler(- ICustomerActivityService customerActivityService,- IHttpContextAccessor httpContextAccessor,- ITranslationService translationService)- {- _customerActivityService = customerActivityService;- _httpContextAccessor = httpContextAccessor;- _translationService = translationService;- }-- public Task Handle(CustomerLoggedInEvent notification, CancellationToken cancellationToken)- {- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.Login",- notification.Customer.Id, notification.Customer,- _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.Login"));- return Task.CompletedTask;- }- }-}diff --git a/src/Web/Grand.Web/Events/CustomerLoggedOutEventHandler.cs b/src/Web/Grand.Web/Events/CustomerLoggedOutEventHandler.csdeleted file mode 100644index b6927b58b..000000000--- a/src/Web/Grand.Web/Events/CustomerLoggedOutEventHandler.cs+++ /dev/null@@ -1,34 +0,0 @@-using Grand.Business.Core.Events.Customers;-using Grand.Business.Core.Interfaces.Common.Localization;-using Grand.Business.Core.Interfaces.Common.Logging;-using MediatR;-using Microsoft.AspNetCore.Http;--namespace Grand.Web.Events-{- public class CustomerLoggedOutEventHandler : INotificationHandler<CustomerLoggedOutEvent>- {- private readonly ICustomerActivityService _customerActivityService;- private readonly IHttpContextAccessor _httpContextAccessor;- private readonly ITranslationService _translationService;-- public CustomerLoggedOutEventHandler(- ICustomerActivityService customerActivityService,- IHttpContextAccessor httpContextAccessor,- ITranslationService translationService)- {- _customerActivityService = customerActivityService;- _httpContextAccessor = httpContextAccessor;- _translationService = translationService;- }-- public Task Handle(CustomerLoggedOutEvent notification, CancellationToken cancellationToken)- {- //activity log- _ = _customerActivityService.InsertActivity("PublicStore.Logout", "", notification.Customer,- _httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(),- _translationService.GetResource("ActivityLog.PublicStore.Logout"));- return Task.CompletedTask;- }- }-}