Skip to content

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.

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.cs
index 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.Catalog
private 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.Catalog
await _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.cs
index 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.Catalog
private 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.Catalog
ICategoryService 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.Catalog
await _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.cs
index 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.Catalog
private 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.Catalog
ICollectionService 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.Catalog
await _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.cs
index 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.Catalog
public 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.Catalog
public 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.cs
index 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.Catalog
public 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.Catalog
await _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.cs
index 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.Catalog
public 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.Catalog
var 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.cs
index 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.Catalog
public 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.Catalog
if (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.cs
index 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.Catalog
public 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.Catalog
if (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.cs
index 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.Catalog
public 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.Catalog
if (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.cs
index 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.Catalog
public 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.Catalog
if (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.cs
index 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.Catalog
public 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.Catalog
if (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.cs
index 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.Catalog
public 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.Catalog
if (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.cs
index 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.Catalog
private 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.Catalog
IBrandService 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.Catalog
if (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.cs
index 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.Catalog
private 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.Catalog
ICategoryService 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.Catalog
await _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.Catalog
if (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.cs
index 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.Catalog
private 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.Catalog
ICollectionService 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.Catalog
if (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.cs
index 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.Catalog
public 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.Catalog
productAttribute = 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.cs
index 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.Catalog
private 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.Catalog
public 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.Catalog
await _outOfStockSubscriptionService.SendNotificationsToSubscribers(product, "");
}
- //activity log
- _ = _customerActivityService.InsertActivity("EditProduct", product.Id, _workContext.CurrentCustomer, "", _translationService.GetResource("ActivityLog.EditProduct"), product.Name);
-
switch (prevPublished)
{
//raise event
diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductStockCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateProductStockCommandHandler.cs
index 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.Catalog
private 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.Catalog
IProductService 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.cs
index 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.Catalog
public 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.cs
index 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.Customers
public 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.Customers
await _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.cs
index 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.Customers
public 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.Customers
var 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.cs
index 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.Customers
public 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.Customers
if (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.cs
index 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.Customers
public 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.Customers
if (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.cs
index 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.Customers
public 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.Customers
await _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.cs
index 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.Customers
public 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.Customers
customerGroup = 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.cs
deleted file mode 100644
index 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.cs
index 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.Security
StandardPermission.ManageShippingSettings,
StandardPermission.ManageCurrencies,
StandardPermission.ManageMeasures,
- StandardPermission.ManageActivityLog,
StandardPermission.ManageAcl,
StandardPermission.ManageEmailAccounts,
StandardPermission.ManageStores,
@@ -147,7 +146,6 @@ namespace Grand.Business.Common.Services.Security
StandardPermission.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.cs
index 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.Startup
RegisterDirectoryService(services);
RegisterConfigurationService(services);
RegisterLocalizationService(services);
- RegisterLoggingService(services);
RegisterSecurityService(services);
RegisterSeoService(services);
RegisterStoresService(services);
@@ -75,10 +72,6 @@ namespace Grand.Business.Common.Startup
serviceCollection.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.cs
deleted file mode 100644
index 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.cs
deleted file mode 100644
index 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.cs
index 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.cs
index 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.Security
PermissionActionName.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.cs
index 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.System
new () {
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.System
PermissionNames = 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.System
new () {
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.System
ActionName = "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.System
PermissionNames = 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.System
ActionName = "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.cs
deleted file mode 100644
index 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.cs
deleted file mode 100644
index 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.cs
index 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.Installation
OnlineCustomerMinutes = 20,
OnlineShoppingCartMinutes = 60,
StoreLastVisitedPage = true,
- SaveVisitedPage = false,
AllowUsersToDeleteAccount = false,
AllowUsersToExportData = false,
TwoFactorAuthenticationEnabled = false
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs b/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs
index 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.Installation
private 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.Installation
IRepository<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
//page
await 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");
-
//warehouse
await dbContext.CreateIndex(_warehouseRepository, OrderBuilder<Warehouse>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
@@ -762,7 +751,6 @@ namespace Grand.Business.System.Services.Installation
await 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.cs
deleted file mode 100644
index 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.cs
deleted file mode 100644
index 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.cs
index 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.cs
index 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._2
var 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.cs
index 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.cs
deleted file mode 100644
index 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.cs
deleted file mode 100644
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cs
deleted file mode 100644
index 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 file
diff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cshtml
deleted file mode 100644
index 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>&nbsp; @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.cshtml
deleted file mode 100644
index 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.cshtml
deleted file mode 100644
index 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"]&nbsp<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.cshtml
deleted file mode 100644
index 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 file
diff --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.cshtml
index 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.cshtml
deleted file mode 100644
index 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 file
diff --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.cshtml
index 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 file
diff --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.cshtml
deleted file mode 100644
index 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 file
diff --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.cshtml
index 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.cshtml
index 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.cshtml
deleted file mode 100644
index 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 file
diff --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.cshtml
index 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.cshtml
deleted file mode 100644
index 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 file
diff --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.cshtml
index 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.cshtml
index 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.cshtml
deleted file mode 100644
index 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 file
diff --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.cshtml
index 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.cshtml
index 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.Catalog
diff --git a/src/Web/Grand.Web.Admin/Controllers/ActivityLogController.cs b/src/Web/Grand.Web.Admin/Controllers/ActivityLogController.cs
deleted file mode 100644
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.cs
index 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.Controllers
private 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.Controllers
var 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.Controllers
documentType = 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.cs
index 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.Controllers
return 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.cs
index 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.Controllers
if (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.Controllers
return 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.cs
index 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.Controllers
try
{
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.Controllers
OrderId = 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.Controllers
if (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.Controllers
if (!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.Controllers
OrderId = 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.Controllers
CreatedOnUtc = DateTime.UtcNow,
OrderId = order.Id
});
- _ = _orderViewModelService.LogEditOrder(order.Id);
await _orderViewModelService.PrepareOrderDetailsModel(model, order);
//selected tab
@@ -571,7 +558,6 @@ namespace Grand.Web.Admin.Controllers
order.UserFields = model.UserFields;
await _orderService.UpdateOrder(order);
- _ = _orderViewModelService.LogEditOrder(order.Id);
await _orderViewModelService.PrepareOrderDetailsModel(model, order);
@@ -727,7 +713,6 @@ namespace Grand.Web.Admin.Controllers
orderItem.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.Controllers
orderItem.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.Controllers
orderItem.LicenseDownloadId = null;
await _orderService.UpdateOrder(order);
- _ = _orderViewModelService.LogEditOrder(order.Id);
//success
ViewBag.RefreshPage = true;
@@ -852,8 +835,6 @@ namespace Grand.Web.Admin.Controllers
orderItem.LicenseDownloadId = null;
await _orderService.UpdateOrder(order);
- _ = _orderViewModelService.LogEditOrder(order.Id);
-
//success
ViewBag.RefreshPage = true;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs b/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs
index 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.Controllers
return 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.Controllers
await _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.cs
index 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.Controllers
private 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.Controllers
IProductAttributeService 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.Controllers
await _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.Controllers
if (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.Controllers
if (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.cs
index 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 bid
await _auctionService.DeleteBid(toDelete);
return Json("");
diff --git a/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs b/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs
index 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.Controllers
private 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.Controllers
ISalesEmployeeService 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.Controllers
var 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.Controllers
salesEmployee = 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.Controllers
await _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.cs
index 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.Controllers
private 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.Controllers
ITranslationService 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 cache
await 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 cache
await 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 cache
await 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 cache
await 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 Thumbs
await _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 cache
await 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 cache
await 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 picture
await SavePictureStorage(storeIdDb);
- //activity log
- _ = _customerActivityService.InsertActivity("EditSettings", "",
- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),
- _translationService.GetResource("ActivityLog.EditSettings"));
-
//now clear cache
await ClearCache();
diff --git a/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs b/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs
index 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.Controllers
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 })
@@ -278,9 +275,6 @@ namespace Grand.Web.Admin.Controllers
OrderId = 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.cs
index 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.Controllers
private 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.Controllers
ITranslationService 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.Controllers
return 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 scope
var storeScope = await GetActiveStore();
@@ -345,11 +340,6 @@ namespace Grand.Web.Admin.Controllers
await _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.cs
index 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.Controllers
private 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.Controllers
ISpecificationAttributeService 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.Controllers
model.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.Controllers
model.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.cs
index 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 Fields
private 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 Constructors
public TaxController(ITaxService taxService,
- IWorkContext workContext,
ITaxCategoryService taxCategoryService,
ISettingService settingService,
IServiceProvider serviceProvider,
@@ -49,7 +45,6 @@ namespace Grand.Web.Admin.Controllers
ICountryService countryService)
{
_taxService = taxService;
- _workContext = workContext;
_taxCategoryService = taxCategoryService;
_settingService = settingService;
_serviceProvider = serviceProvider;
@@ -173,8 +168,7 @@ namespace Grand.Web.Admin.Controllers
return 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 scope
var storeScope = await GetActiveStore();
@@ -185,12 +179,7 @@ namespace Grand.Web.Admin.Controllers
//now clear cache
await 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.cs
deleted file mode 100644
index 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 file
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.cs b/src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.cs
index 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.Mapping
discount.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.cs
index 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.Mapping
return 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.cs
deleted file mode 100644
index 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.cs
index 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.Interfaces
Task<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.cs
index 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.Interfaces
Task 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.cs
index 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.Interfaces
Task 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.cs
index 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.Interfaces
Task 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.cs
index 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.Interfaces
Task 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.cs
index 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.Interfaces
Task<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.cs
index 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
//tierprices
Task<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.cs
index 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.Interfaces
Task<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.cs
deleted file mode 100644
index 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 file
diff --git a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogModel.cs b/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogModel.cs
deleted file mode 100644
index 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.cs
deleted file mode 100644
index 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 file
diff --git a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogTypeModel.cs b/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityLogTypeModel.cs
deleted file mode 100644
index 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 file
diff --git a/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityTypeModel.cs b/src/Web/Grand.Web.Admin/Models/ActivityLog/ActivityTypeModel.cs
deleted file mode 100644
index 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 file
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs
index 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
//discounts
public 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, ISlugModelLocal
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.cs
index 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.Catalog
public 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.cs
index 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.Catalog
public 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.cs
index 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.cs
index 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.Common
public DeleteExportedFilesModel DeleteExportedFiles { get; set; }
public ConvertPictureModel ConvertedPictureModel { get; set; }
- public bool DeleteActivityLog { get; set; }
-
#region Nested classes
public class DeleteGuestsModel : BaseModel
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs b/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs
index 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.cs
index 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.cs
index 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.Knowledgebase
public 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, ISlugModelLocal
diff --git a/src/Web/Grand.Web.Admin/Services/ActivityLogViewModelService.cs b/src/Web/Grand.Web.Admin/Services/ActivityLogViewModelService.cs
deleted file mode 100644
index 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.cs
index 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.cs
index 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.Services
private 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.Services
public 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 name
await _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 name
await _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.cs
index 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.Services
private 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.Services
IDiscountService 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.Services
model.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 name
await _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 name
await _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.cs
index 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.Services
private 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.Services
ITaxCategoryService 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.Services
var 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.Services
checkoutAttribute = 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.cs
index 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.Services
private 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.Services
IProductCollectionService 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.Services
model.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 name
await _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 name
await _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.Services
public 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.cs
index 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.Services
private 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.Services
contactAttribute = 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.cs
index 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.Services
private 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.Services
IPictureService 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.Services
if (!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.Services
if (!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.Services
await _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.Services
await _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.Services
var model = new CourseModel.AssociateProductToCourseModel();
//stores
model.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 });
//vendors
model.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.cs
index 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.Services
private 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.Services
IGroupService 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.Services
public 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.cs
index 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.Services
public 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.Services
var 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.Services
customerTag.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.Services
public 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.cs
index 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.Services
private 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.Services
ICustomerProductService 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.Services
customer.Groups.Add(customerGroup.Id);
await _customerService.InsertCustomerGroupInCustomer(customerGroup, customer.Id);
}
-
//tags
await 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
//tags
await 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.Services
if (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.Services
null : _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.Services
public 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.Services
var 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.Services
ProductId = 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.Services
var 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.Services
public 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.Services
await _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.cs
index 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.Services
private 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.Services
private readonly IOrderService _orderService;
private readonly IPriceFormatter _priceFormatter;
private readonly IDateTimeService _dateTimeService;
- private readonly IHttpContextAccessor _httpContextAccessor;
#endregion
@@ -54,7 +50,6 @@ namespace Grand.Web.Admin.Services
ICurrencyService currencyService,
ICategoryService categoryService,
IProductService productService,
- ICustomerActivityService customerActivityService,
IWorkContext workContext,
ICollectionService collectionService,
IBrandService brandService,
@@ -62,15 +57,13 @@ namespace Grand.Web.Admin.Services
IVendorService 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.Services
var 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.Services
break;
}
}
-
- //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.cs
index 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.Services
private 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.Services
ICollectionService 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.Services
public 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.Services
if (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.Services
if (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.cs
index 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.Services
private 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.Services
ICurrencyService 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.Services
var 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.Services
public 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.cs
index 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.Services
Id = 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.Services
knowledgebaseCategory.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.Services
knowledgebaseCategory.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.Services
knowledgebaseArticle.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.Services
knowledgebaseArticle.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.cs
index 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.Services
private 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.Services
private 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.Services
ICustomerService 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.Services
IAddressAttributeService 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.Services
public 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.cs
index 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.Services
private 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.Services
ITaxService 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.Services
CreatedOnUtc = DateTime.UtcNow,
OrderId = order.Id
});
- _ = LogEditOrder(order.Id);
return address;
}
@@ -1240,7 +1225,6 @@ namespace Grand.Web.Admin.Services
await _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.cs
index 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.Services
private 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.Services
IPageService 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.Services
page.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 name
await _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.cs
index 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.Services
private 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.Services
ICustomerService 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.Services
if (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.Services
if (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.cs
index 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.Services
public 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.cs
index 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.cs
index 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.Filters
private 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.Filters
ICustomerService 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.Filters
await _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.cshtml
deleted file mode 100644
index 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 file
diff --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.cshtml
index 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.cs
index 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.Controllers
private readonly IAuctionService _auctionService;
private readonly IDateTimeService _dateTimeService;
private readonly IPermissionService _permissionService;
- private readonly ICustomerActivityService _customerActivityService;
#endregion
@@ -56,8 +54,7 @@ namespace Grand.Web.Vendor.Controllers
IProductReservationService 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.Controllers
if (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.Controllers
if (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 bid
await _auctionService.DeleteBid(toDelete);
return Json("");
diff --git a/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs b/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs
index 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.Controllers
CreatedOnUtc = 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.Controllers
CreatedOnUtc = 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.cs
index 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-prices
Task<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.cs
index 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.Interfaces
Task<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.cs
index 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.cs
index 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.Services
private 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.Services
ICustomerService 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.Services
public 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.cs
index 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.Services
private 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.Services
ILanguageService 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.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)
{
diff --git a/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs b/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs
index 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.Services
private 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.Services
IWarehouseService 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.Services
await _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.xml
index 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.xml
index 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.json
index 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.cs
index 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.Blogs
private 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.Blogs
if (_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.cs
index 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.Contact
private 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.Contact
IContactAttributeParser 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.cs
index 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.Customers
private 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.Customers
IMessageProviderService 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 customer
await _messageProviderService.SendCustomerDeleteStoreOwnerMessage(request.Customer, _languageSettings.DefaultAdminLanguageId);
diff --git a/src/Web/Grand.Web/Controllers/ActionCartController.cs b/src/Web/Grand.Web/Controllers/ActionCartController.cs
index 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.Controllers
private 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.Controllers
ITranslationService 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.Controllers
case 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.Controllers
case 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.Controllers
message = toReturn
});
}
-
//insert new bid
await 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.cs
index 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.Controllers
private 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.Controllers
IUserFieldService 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.Controllers
if (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);
-
//model
var model = await _mediator.Send(new GetCategory {
Category = category,
@@ -197,11 +188,6 @@ namespace Grand.Web.Controllers
if (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);
-
//model
var model = await _mediator.Send(new GetBrand {
Command = command,
@@ -261,11 +247,6 @@ namespace Grand.Web.Controllers
if (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);
-
//model
var model = await _mediator.Send(new GetCollection {
Command = command,
@@ -356,11 +337,6 @@ namespace Grand.Web.Controllers
if (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 event
if (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.cs
index 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.Controllers
private 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.Controllers
IPaymentTransactionService 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.Controllers
var 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.cs
index 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.Controllers
private 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.Controllers
IAclService 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.Controllers
if (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);
-
//model
var model = await _mediator.Send(new GetCourse {
Course = course,
@@ -128,12 +119,7 @@ namespace Grand.Web.Controllers
//display "edit" (manage) link
if (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);
-
+
//model
var 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.cs
index 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.Controllers
private 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.Controllers
IAclService 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.Controllers
if (_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 page
TempData["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.cs
index 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.Controllers
private 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.Controllers
public 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
//notification
await _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.cs
index 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.Controllers
private 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.Controllers
IShoppingCartService 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.Controllers
DisplayEditLink(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 viewed
await _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
//notification
await _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 event
if (productReview.IsApproved)
await _mediator.Publish(new ProductReviewApprovedEvent(productReview));
@@ -694,10 +677,6 @@ namespace Grand.Web.Controllers
RemoteIpAddress = 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 Json
return Json(new
{
diff --git a/src/Web/Grand.Web/Events/CustomerLoggedInEventHandler.cs b/src/Web/Grand.Web/Events/CustomerLoggedInEventHandler.cs
deleted file mode 100644
index 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.cs
deleted file mode 100644
index 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;
- }
- }
-}