From 96df0ab8ca90733615c9fd12c5e3ace00810e56b Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Mon, 7 Sep 2020 16:53:39 +0300 Subject: [PATCH 01/14] Api: added payment settings --- config/appsettings.json | 4 +++- products/ASC.Files/Core/Helpers/Global.cs | 2 +- .../Services/DocumentService/Configuration.cs | 7 +++--- .../Controllers/SettingsController.cs | 22 +++++++++++++++++++ .../Notify/StudioNotifyService.cs | 2 +- web/ASC.Web.Core/Utility/CommonLinkUtility.cs | 2 +- .../AdditionalWhiteLabelSettings.cs | 15 +++++-------- 7 files changed, 37 insertions(+), 17 deletions(-) diff --git a/config/appsettings.json b/config/appsettings.json index 91944f7e91..45b353f8cc 100644 --- a/config/appsettings.json +++ b/config/appsettings.json @@ -100,7 +100,9 @@ }, "controlpanel": { "url": "" - } + }, + "support-feedback": "https://helpdesk.onlyoffice.com", + "teamlab-site": "http://www.onlyoffice.com" }, "ConnectionStrings": { "default": { diff --git a/products/ASC.Files/Core/Helpers/Global.cs b/products/ASC.Files/Core/Helpers/Global.cs index c3a0dcf565..0eddddfa8a 100644 --- a/products/ASC.Files/Core/Helpers/Global.cs +++ b/products/ASC.Files/Core/Helpers/Global.cs @@ -417,7 +417,7 @@ namespace ASC.Web.Files.Classes id = my ? folderDao.GetFolderIDUser(true) : folderDao.GetFolderIDCommon(true); //Copy start document - if (AdditionalWhiteLabelSettings.Instance(SettingsManager).StartDocsEnabled) + if (SettingsManager.LoadForDefaultTenant().StartDocsEnabled) { try { diff --git a/products/ASC.Files/Core/Services/DocumentService/Configuration.cs b/products/ASC.Files/Core/Services/DocumentService/Configuration.cs index f5cb61acdf..231069778e 100644 --- a/products/ASC.Files/Core/Services/DocumentService/Configuration.cs +++ b/products/ASC.Files/Core/Services/DocumentService/Configuration.cs @@ -593,13 +593,14 @@ namespace ASC.Web.Files.Services.DocumentService set { } get { - if (CoreBaseSettings.Standalone) return null; - if (!AdditionalWhiteLabelSettings.Instance(SettingsManager).FeedbackAndSupportEnabled) return null; + if (CoreBaseSettings.Standalone) return null; + var settings = SettingsManager.LoadForDefaultTenant(); + if (!settings.FeedbackAndSupportEnabled) return null; return new FeedbackConfig { Url = BaseCommonLinkUtility.GetRegionalUrl( - AdditionalWhiteLabelSettings.Instance(SettingsManager).FeedbackAndSupportUrl, + settings.FeedbackAndSupportUrl, CultureInfo.CurrentCulture.TwoLetterISOLanguageName), }; } diff --git a/web/ASC.Web.Api/Controllers/SettingsController.cs b/web/ASC.Web.Api/Controllers/SettingsController.cs index 95a9ce0913..8950e672cc 100644 --- a/web/ASC.Web.Api/Controllers/SettingsController.cs +++ b/web/ASC.Web.Api/Controllers/SettingsController.cs @@ -1821,6 +1821,28 @@ namespace ASC.Api.Settings return changed; } + [Read("payment")] + public object PaymentSettings() + { + var settings = SettingsManager.LoadForDefaultTenant(); + var currentQuota = TenantExtra.GetTenantQuota(); + var currentTariff = TenantExtra.GetCurrentTariff(); + + return + new + { + settings.SalesEmail, + settings.FeedbackAndSupportUrl, + settings.BuyUrl, + CoreBaseSettings.Standalone, + currentLicense = new + { + currentQuota.Trial, + currentTariff.DueDate.Date + } + }; + } + private readonly int maxCount = 10; private readonly int expirationMinutes = 2; private void CheckCache(string basekey) diff --git a/web/ASC.Web.Core/Notify/StudioNotifyService.cs b/web/ASC.Web.Core/Notify/StudioNotifyService.cs index bb0affa9e4..420acf0fa3 100644 --- a/web/ASC.Web.Core/Notify/StudioNotifyService.cs +++ b/web/ASC.Web.Core/Notify/StudioNotifyService.cs @@ -144,7 +144,7 @@ namespace ASC.Web.Studio.Core.Notify if (string.IsNullOrEmpty(site)) throw new ArgumentNullException("site"); message = (message ?? "").Trim(); - var salesEmail = AdditionalWhiteLabelSettings.Instance(SettingsManager).SalesEmail ?? SetupInfo.SalesEmail; + var salesEmail = SettingsManager.LoadForDefaultTenant().SalesEmail ?? SetupInfo.SalesEmail; var recipient = (IRecipient)(new DirectRecipient(AuthContext.CurrentAccount.ID.ToString(), string.Empty, new[] { salesEmail }, false)); diff --git a/web/ASC.Web.Core/Utility/CommonLinkUtility.cs b/web/ASC.Web.Core/Utility/CommonLinkUtility.cs index bdbe0c8695..8e06a8a33f 100644 --- a/web/ASC.Web.Core/Utility/CommonLinkUtility.cs +++ b/web/ASC.Web.Core/Utility/CommonLinkUtility.cs @@ -488,7 +488,7 @@ namespace ASC.Web.Studio.Utility public string GetHelpLink(SettingsManager settingsManager, AdditionalWhiteLabelSettingsHelper additionalWhiteLabelSettingsHelper, bool inCurrentCulture = true) { - if (!AdditionalWhiteLabelSettings.Instance(settingsManager).HelpCenterEnabled) + if (!settingsManager.LoadForDefaultTenant().HelpCenterEnabled) return string.Empty; var url = additionalWhiteLabelSettingsHelper.DefaultHelpCenterUrl; diff --git a/web/ASC.Web.Core/WhiteLabel/AdditionalWhiteLabelSettings.cs b/web/ASC.Web.Core/WhiteLabel/AdditionalWhiteLabelSettings.cs index f082779544..b67c3157ac 100644 --- a/web/ASC.Web.Core/WhiteLabel/AdditionalWhiteLabelSettings.cs +++ b/web/ASC.Web.Core/WhiteLabel/AdditionalWhiteLabelSettings.cs @@ -123,11 +123,6 @@ namespace ASC.Web.Core.WhiteLabel } } - public static AdditionalWhiteLabelSettings Instance(SettingsManager settingsManager) - { - return settingsManager.LoadForDefaultTenant(); - } - public ISettings GetDefault(IServiceProvider serviceProvider) { return GetDefault(serviceProvider.GetService()); @@ -147,7 +142,7 @@ namespace ASC.Web.Core.WhiteLabel { get { - var url = Configuration["web.help-center"]; + var url = Configuration["web:help-center"]; return string.IsNullOrEmpty(url) ? null : url; } } @@ -156,7 +151,7 @@ namespace ASC.Web.Core.WhiteLabel { get { - var url = Configuration["web.support-feedback"]; + var url = Configuration["web:support-feedback"]; return string.IsNullOrEmpty(url) ? null : url; } } @@ -165,7 +160,7 @@ namespace ASC.Web.Core.WhiteLabel { get { - var url = Configuration["web.user-forum"]; + var url = Configuration["web:user-forum"]; return string.IsNullOrEmpty(url) ? null : url; } } @@ -183,7 +178,7 @@ namespace ASC.Web.Core.WhiteLabel { get { - var email = Configuration["web.payment.email"]; + var email = Configuration["web:payment:email"]; return !string.IsNullOrEmpty(email) ? email : "sales@onlyoffice.com"; } } @@ -192,7 +187,7 @@ namespace ASC.Web.Core.WhiteLabel { get { - var site = Configuration["web.teamlab-site"]; + var site = Configuration["web:teamlab-site"]; return !string.IsNullOrEmpty(site) ? site + "/post.ashx?type=buyenterprise" : ""; } } From f464e031b88359b63ebf655bbfbb1af39d1a3ea6 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 8 Sep 2020 11:42:13 +0300 Subject: [PATCH 02/14] Notify: fix --- .../Notify/Engine/NotifyEngine.cs | 26 +- .../Notify/Engine/NotifyRequest.cs | 22 +- products/ASC.Files/Core/ASC.Files.Core.csproj | 23 ++ .../Core/Configuration/ProductEntryPoint.cs | 14 +- .../FilesPatternResource.Designer.cs | 366 +++++++++--------- .../Services/NotifyService/NotifySource.cs | 2 +- .../Core/Services/NotifyService/patterns.xml | 38 +- products/ASC.Files/Server/Startup.cs | 4 +- .../Notify/NotifyConfiguration.cs | 15 +- 9 files changed, 280 insertions(+), 230 deletions(-) diff --git a/common/ASC.Core.Common/Notify/Engine/NotifyEngine.cs b/common/ASC.Core.Common/Notify/Engine/NotifyEngine.cs index 3ce113fbe7..23c6c7fe8d 100644 --- a/common/ASC.Core.Common/Notify/Engine/NotifyEngine.cs +++ b/common/ASC.Core.Common/Notify/Engine/NotifyEngine.cs @@ -283,7 +283,7 @@ namespace ASC.Notify.Engine { if (request.Recipient is IDirectRecipient) { - var subscriptionSource = request.NotifySource.GetSubscriptionProvider(); + var subscriptionSource = request.GetSubscriptionProvider(serviceScope); if (!request.IsNeedCheckSubscriptions || !subscriptionSource.IsUnsubscribe(request.Recipient as IDirectRecipient, request.NotifyAction, request.ObjectID)) { var directresponses = new List(1); @@ -309,7 +309,7 @@ namespace ASC.Notify.Engine } else { - var recipientProvider = request.NotifySource.GetRecipientsProvider(); + var recipientProvider = request.GetRecipientsProvider(serviceScope); try { @@ -358,9 +358,9 @@ namespace ASC.Notify.Engine try { - PrepareRequestFillSenders(request); - PrepareRequestFillPatterns(request); - PrepareRequestFillTags(request); + PrepareRequestFillSenders(request, serviceScope); + PrepareRequestFillPatterns(request, serviceScope); + PrepareRequestFillTags(request, serviceScope); } catch (Exception ex) { @@ -421,7 +421,7 @@ namespace ASC.Notify.Engine { if (request == null) throw new ArgumentNullException("request"); - var recipientProvider = request.NotifySource.GetRecipientsProvider(); + var recipientProvider = request.GetRecipientsProvider(serviceScope); var recipient = request.Recipient as IDirectRecipient; var addresses = recipient.Addresses; @@ -450,7 +450,7 @@ namespace ASC.Notify.Engine noticeMessage.Pattern = pattern; noticeMessage.ContentType = pattern.ContentType; noticeMessage.AddArgument(request.Arguments.ToArray()); - var patternProvider = request.NotifySource.GetPatternProvider(); + var patternProvider = request.GetPatternProvider(serviceScope); var formatter = patternProvider.GetFormatter(pattern); try @@ -500,11 +500,11 @@ namespace ASC.Notify.Engine } } - private void PrepareRequestFillSenders(NotifyRequest request) + private void PrepareRequestFillSenders(NotifyRequest request, IServiceScope serviceScope) { if (request.SenderNames == null) { - var subscriptionProvider = request.NotifySource.GetSubscriptionProvider(); + var subscriptionProvider = request.GetSubscriptionProvider(serviceScope); var senderNames = new List(); senderNames.AddRange(subscriptionProvider.GetSubscriptionMethod(request.NotifyAction, request.Recipient) ?? new string[0]); @@ -514,14 +514,14 @@ namespace ASC.Notify.Engine } } - private void PrepareRequestFillPatterns(NotifyRequest request) + private void PrepareRequestFillPatterns(NotifyRequest request, IServiceScope serviceScope) { if (request.Patterns == null) { request.Patterns = new IPattern[request.SenderNames.Length]; if (request.Patterns.Length == 0) return; - var apProvider = request.NotifySource.GetPatternProvider(); + var apProvider = request.GetPatternProvider(serviceScope); for (var i = 0; i < request.SenderNames.Length; i++) { var senderName = request.SenderNames[i]; @@ -540,9 +540,9 @@ namespace ASC.Notify.Engine } } - private void PrepareRequestFillTags(NotifyRequest request) + private void PrepareRequestFillTags(NotifyRequest request, IServiceScope serviceScope) { - var patternProvider = request.NotifySource.GetPatternProvider(); + var patternProvider = request.GetPatternProvider(serviceScope); foreach (var pattern in request.Patterns) { IPatternFormatter formatter; diff --git a/common/ASC.Core.Common/Notify/Engine/NotifyRequest.cs b/common/ASC.Core.Common/Notify/Engine/NotifyRequest.cs index b5f634b794..12ae7ef5c3 100644 --- a/common/ASC.Core.Common/Notify/Engine/NotifyRequest.cs +++ b/common/ASC.Core.Common/Notify/Engine/NotifyRequest.cs @@ -41,7 +41,7 @@ namespace ASC.Notify.Engine { public class NotifyRequest { - public INotifySource NotifySource { get; internal set; } + private INotifySource NotifySource { get; set; } public INotifyAction NotifyAction { get; internal set; } @@ -142,6 +142,26 @@ namespace ASC.Notify.Engine internal NoticeMessage CreateMessage(IDirectRecipient recipient) { return new NoticeMessage(recipient, NotifyAction, ObjectID); + } + + public IActionProvider GetActionProvider(IServiceScope scope) + { + return ((INotifySource)scope.ServiceProvider.GetService(NotifySource.GetType())).GetActionProvider(); + } + + public IPatternProvider GetPatternProvider(IServiceScope scope) + { + return ((INotifySource)scope.ServiceProvider.GetService(NotifySource.GetType())).GetPatternProvider(); + } + + public IRecipientProvider GetRecipientsProvider(IServiceScope scope) + { + return ((INotifySource)scope.ServiceProvider.GetService(NotifySource.GetType())).GetRecipientsProvider(); + } + + public ISubscriptionProvider GetSubscriptionProvider(IServiceScope scope) + { + return ((INotifySource)scope.ServiceProvider.GetService(NotifySource.GetType())).GetSubscriptionProvider(); } } } \ No newline at end of file diff --git a/products/ASC.Files/Core/ASC.Files.Core.csproj b/products/ASC.Files/Core/ASC.Files.Core.csproj index ca559f55d8..71f414e513 100644 --- a/products/ASC.Files/Core/ASC.Files.Core.csproj +++ b/products/ASC.Files/Core/ASC.Files.Core.csproj @@ -70,6 +70,29 @@ + + + True + True + FilesPatternResource.resx + + + + + + PublicResXFileCodeGenerator + FilesPatternResource.Designer.cs + + + + + + + + + + + FilesCommonResource.resx diff --git a/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs b/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs index 8fedfcdd6c..83a0c922af 100644 --- a/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs +++ b/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs @@ -36,7 +36,8 @@ using ASC.Web.Core; using ASC.Web.Core.PublicResources; using ASC.Web.Files.Classes; using ASC.Web.Files.Core.Search; - +using ASC.Web.Studio.Core.Notify; + namespace ASC.Web.Files.Configuration { public class ProductEntryPoint : Product @@ -60,14 +61,16 @@ namespace ASC.Web.Files.Configuration // FilesSpaceUsageStatManager filesSpaceUsageStatManager, CoreBaseSettings coreBaseSettings, AuthContext authContext, - UserManager userManager + UserManager userManager, + IServiceProvider serviceProvider // SubscriptionManager subscriptionManager ) { // FilesSpaceUsageStatManager = filesSpaceUsageStatManager; CoreBaseSettings = coreBaseSettings; AuthContext = authContext; - UserManager = userManager; + UserManager = userManager; + ServiceProvider = serviceProvider; //SubscriptionManager = subscriptionManager; } @@ -99,7 +102,9 @@ namespace ASC.Web.Files.Configuration AdminOpportunities = adminOpportunities, UserOpportunities = userOpportunities, CanNotBeDisabled = true, - }; + }; + + NotifyConfiguration.Configure(ServiceProvider); //SearchHandlerManager.Registry(new SearchHandler()); } @@ -175,6 +180,7 @@ namespace ASC.Web.Files.Configuration { if (services.TryAddScoped()) { + services.TryAddScoped(); return services .AddFilesSpaceUsageStatManagerService() .AddCoreBaseSettingsService() diff --git a/products/ASC.Files/Core/Services/NotifyService/FilesPatternResource.Designer.cs b/products/ASC.Files/Core/Services/NotifyService/FilesPatternResource.Designer.cs index 26bd68556b..fc9708b8bd 100644 --- a/products/ASC.Files/Core/Services/NotifyService/FilesPatternResource.Designer.cs +++ b/products/ASC.Files/Core/Services/NotifyService/FilesPatternResource.Designer.cs @@ -1,215 +1,215 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ASC.Web.Files.Services.NotifyService { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class FilesPatternResource { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal FilesPatternResource() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASC.Web.Files.Services.NotifyService.FilesPatternResource", typeof(FilesPatternResource).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ASC.Web.Files.Services.NotifyService { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class FilesPatternResource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal FilesPatternResource() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASC.Files.Core.Services.NotifyService.FilesPatternResource", typeof(FilesPatternResource).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// /// Looks up a localized string similar to h1. All signers completed $Message /// ///This is a mail message to notify you that all signers completed "$DocumentTitle":"$DocumentURL". /// - ///^You receive this email because you are a registered user of the "${__VirtualRootPath}":"${__VirtualRootPath}" portal.^. - /// - public static string pattern_DocuSignComplete { - get { - return ResourceManager.GetString("pattern_DocuSignComplete", resourceCulture); - } - } - - /// + ///^You receive this email because you are a registered user of the "${__VirtualRootPath}":"${__VirtualRootPath}" portal.^. + /// + public static string pattern_DocuSignComplete { + get { + return ResourceManager.GetString("pattern_DocuSignComplete", resourceCulture); + } + } + + /// /// Looks up a localized string similar to h1. $Message: $DocumentTitle /// ///Watch your DocuSign account for more information. /// - ///^You receive this email because you are a registered user of the "${__VirtualRootPath}":"${__VirtualRootPath}" portal.^. - /// - public static string pattern_DocuSignStatus { - get { - return ResourceManager.GetString("pattern_DocuSignStatus", resourceCulture); - } - } - - /// + ///^You receive this email because you are a registered user of the "${__VirtualRootPath}":"${__VirtualRootPath}" portal.^. + /// + public static string pattern_DocuSignStatus { + get { + return ResourceManager.GetString("pattern_DocuSignStatus", resourceCulture); + } + } + + /// /// Looks up a localized string similar to h1. "$DocumentTitle":"$DocumentURL" /// ///This is a mail message to notify you that you have mentioned by "$__AuthorName":"$__AuthorUrl". /// ///$Message /// - ///^You receive this email because you are a registered user of the "${__VirtualRootPath}":"${__VirtualRootPath}" portal.^. - /// - public static string pattern_EditorMentions { - get { - return ResourceManager.GetString("pattern_EditorMentions", resourceCulture); - } - } - - /// + ///^You receive this email because you are a registered user of the "${__VirtualRootPath}":"${__VirtualRootPath}" portal.^. + /// + public static string pattern_EditorMentions { + get { + return ResourceManager.GetString("pattern_EditorMentions", resourceCulture); + } + } + + /// /// Looks up a localized string similar to h1. Mailing completed /// ///This is a mail message to notify you that you have requested the mailing of $MailsCount messages and the process is now complete. $Message /// ///The successfully sent mail messages can be found in your "Sent":"$__VirtualRootPath/addons/mail/#sent" folder of the Mail module. /// - ///^You receive this email because you are a registered user of the "${__VirtualRootPath}":"${__VirtualRootPath}" portal.^. - /// - public static string pattern_MailMergeEnd { - get { - return ResourceManager.GetString("pattern_MailMergeEnd", resourceCulture); - } - } - - /// + ///^You receive this email because you are a registered user of the "${__VirtualRootPath}":"${__VirtualRootPath}" portal.^. + /// + public static string pattern_MailMergeEnd { + get { + return ResourceManager.GetString("pattern_MailMergeEnd", resourceCulture); + } + } + + /// /// Looks up a localized string similar to h1. Access granted to document: "$DocumentTitle":"$DocumentURL" /// ///$__DateTime "$__AuthorName":"$__AuthorUrl" granted you the access to the "$DocumentTitle":"$DocumentURL" document with the following access rights: "$AccessRights". /// - ///$Message. - /// - public static string pattern_ShareDocument { - get { - return ResourceManager.GetString("pattern_ShareDocument", resourceCulture); - } - } - - /// + ///$Message. + /// + public static string pattern_ShareDocument { + get { + return ResourceManager.GetString("pattern_ShareDocument", resourceCulture); + } + } + + /// /// Looks up a localized string similar to h1. Access granted to folder: "$DocumentTitle":"$__VirtualRootPath/products/files/#$FolderID" /// ///$__DateTime "$__AuthorName":"$__AuthorUrl" granted you the access to the "$DocumentTitle":"$__VirtualRootPath/products/files/#$FolderID" folder with the following access rights: "$AccessRights". /// - ///$Message. - /// - public static string pattern_ShareFolder { - get { - return ResourceManager.GetString("pattern_ShareFolder", resourceCulture); - } - } - - /// + ///$Message. + /// + public static string pattern_ShareFolder { + get { + return ResourceManager.GetString("pattern_ShareFolder", resourceCulture); + } + } + + /// /// Looks up a localized string similar to <patterns> - /// <formatter type="ASC.Notify.Patterns.NVelocityPatternFormatter, ASC.Common" /> + /// <formatter type="ASC.Notify.Patterns.NVelocityPatternFormatter, ASC.Core.Common" /> /// /// <pattern id="DocuSignComplete" sender="email.sender"> - /// <subject resource="|subject_DocuSignComplete|ASC.Web.Files.Services.NotifyService.FilesPatternResource,ASC.Web.Files" /> - /// <body styler="ASC.Notify.Textile.TextileStyler,ASC.Notify.Textile" resource="|pattern_DocuSignComplete|ASC.Web.Files.Services.NotifyService.FilesPatternResource,ASC.Web.Files" /> + /// <subject resource="|subject_DocuSignComplete|ASC.Web.Files.Services.NotifyService.FilesPatternResource,ASC.Files.Core" /> + /// <body styler="ASC.Notify.Textile.TextileStyler,ASC.Notify.Textile" resource="|pattern_DocuSignComplete|ASC.Web.Files.Services.NotifyService.FilesPatternResource,ASC.Files.Core" /> /// </pattern> - /// <pattern id="DocuSignComplete" se [rest of string was truncated]";. - /// - public static string patterns { - get { - return ResourceManager.GetString("patterns", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Documents. All signers completed $DocumentTitle. - /// - public static string subject_DocuSignComplete { - get { - return ResourceManager.GetString("subject_DocuSignComplete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Documents. Sign status changed. - /// - public static string subject_DocuSignStatus { - get { - return ResourceManager.GetString("subject_DocuSignStatus", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Documents. Mentioned in document. - /// - public static string subject_EditorMentions { - get { - return ResourceManager.GetString("subject_EditorMentions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Documents. Mailing is complete.. - /// - public static string subject_MailMergeEnd { - get { - return ResourceManager.GetString("subject_MailMergeEnd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Documents. Access granted to document: $DocumentTitle. - /// - public static string subject_ShareDocument { - get { - return ResourceManager.GetString("subject_ShareDocument", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Documents. Access granted to folder: $DocumentTitle. - /// - public static string subject_ShareFolder { - get { - return ResourceManager.GetString("subject_ShareFolder", resourceCulture); - } - } - } -} + /// <pattern id="DocuSignComplete" send [rest of string was truncated]";. + /// + public static string patterns { + get { + return ResourceManager.GetString("patterns", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Documents. All signers completed $DocumentTitle. + /// + public static string subject_DocuSignComplete { + get { + return ResourceManager.GetString("subject_DocuSignComplete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Documents. Sign status changed. + /// + public static string subject_DocuSignStatus { + get { + return ResourceManager.GetString("subject_DocuSignStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Documents. Mentioned in document. + /// + public static string subject_EditorMentions { + get { + return ResourceManager.GetString("subject_EditorMentions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Documents. Mailing is complete.. + /// + public static string subject_MailMergeEnd { + get { + return ResourceManager.GetString("subject_MailMergeEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Documents. Access granted to document: $DocumentTitle. + /// + public static string subject_ShareDocument { + get { + return ResourceManager.GetString("subject_ShareDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Documents. Access granted to folder: $DocumentTitle. + /// + public static string subject_ShareFolder { + get { + return ResourceManager.GetString("subject_ShareFolder", resourceCulture); + } + } + } +} diff --git a/products/ASC.Files/Core/Services/NotifyService/NotifySource.cs b/products/ASC.Files/Core/Services/NotifyService/NotifySource.cs index 02115c0e15..196e19cd0e 100644 --- a/products/ASC.Files/Core/Services/NotifyService/NotifySource.cs +++ b/products/ASC.Files/Core/Services/NotifyService/NotifySource.cs @@ -28,7 +28,7 @@ using System; using ASC.Common; using ASC.Core; -using ASC.Core.Notify; +using ASC.Core.Notify; using ASC.Notify.Model; using ASC.Notify.Patterns; using ASC.Notify.Recipients; diff --git a/products/ASC.Files/Core/Services/NotifyService/patterns.xml b/products/ASC.Files/Core/Services/NotifyService/patterns.xml index ea52f60624..6d721e461c 100644 --- a/products/ASC.Files/Core/Services/NotifyService/patterns.xml +++ b/products/ASC.Files/Core/Services/NotifyService/patterns.xml @@ -1,30 +1,30 @@ - + - - + + - + $DocumentURL - - + + - + $Message: $DocumentTitle - - + + - + $__AuthorName $Message @@ -32,11 +32,11 @@ $Message - - + + - + $__AuthorName $AccessRights @@ -48,11 +48,11 @@ $DocumentURL - - + + - + $__AuthorName $AccessRights @@ -64,11 +64,11 @@ $__VirtualRootPath/products/files/#$FolderID - - + + - + $__AuthorName $DocumentTitle diff --git a/products/ASC.Files/Server/Startup.cs b/products/ASC.Files/Server/Startup.cs index 56c3d99689..591bd3d13e 100644 --- a/products/ASC.Files/Server/Startup.cs +++ b/products/ASC.Files/Server/Startup.cs @@ -7,6 +7,7 @@ using ASC.Api.Documents; using ASC.Common; using ASC.Web.Files; using ASC.Web.Files.HttpHandlers; +using ASC.Web.Studio.Core.Notify; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -42,7 +43,8 @@ namespace ASC.Files .AddFileHandlerService() .AddChunkedUploaderHandlerService() .AddThirdPartyAppHandlerService() - .AddDocuSignHandlerService(); + .AddDocuSignHandlerService() + .AddNotifyConfiguration(); base.ConfigureServices(services); } diff --git a/web/ASC.Web.Core/Notify/NotifyConfiguration.cs b/web/ASC.Web.Core/Notify/NotifyConfiguration.cs index dd2bb7ac2c..be3086716f 100644 --- a/web/ASC.Web.Core/Notify/NotifyConfiguration.cs +++ b/web/ASC.Web.Core/Notify/NotifyConfiguration.cs @@ -242,14 +242,14 @@ namespace ASC.Web.Studio.Core.Notify } - private static void BeforeTransferRequest(NotifyEngine sender, NotifyRequest request, IServiceScope serviceScope) + private static void BeforeTransferRequest(NotifyEngine sender, NotifyRequest request, IServiceScope scope) { var aid = Guid.Empty; var aname = string.Empty; - var tenant = serviceScope.ServiceProvider.GetService().GetCurrentTenant(); - var authContext = serviceScope.ServiceProvider.GetService(); - var userManager = serviceScope.ServiceProvider.GetService(); - var displayUserSettingsHelper = serviceScope.ServiceProvider.GetService(); + var tenant = scope.ServiceProvider.GetService().GetCurrentTenant(); + var authContext = scope.ServiceProvider.GetService(); + var userManager = scope.ServiceProvider.GetService(); + var displayUserSettingsHelper = scope.ServiceProvider.GetService(); if (authContext.IsAuthenticated) { @@ -262,9 +262,7 @@ namespace ASC.Web.Studio.Core.Notify .Replace("<", "<"); } } - using var scope = ServiceProvider.CreateScope(); var tenantExtra = scope.ServiceProvider.GetService(); - var webItemManagerSecurity = scope.ServiceProvider.GetService(); var webItemManager = scope.ServiceProvider.GetService(); var configuration = scope.ServiceProvider.GetService(); var tenantLogoManager = scope.ServiceProvider.GetService(); @@ -390,7 +388,8 @@ namespace ASC.Web.Studio.Core.Notify .AddCoreBaseSettingsService() .AddAdditionalWhiteLabelSettingsService() .AddCommonLinkUtilityService() - .AddMailWhiteLabelSettingsService(); + .AddMailWhiteLabelSettingsService() + .AddStudioNotifyHelperService(); } } } From 187e5de648e60290da7757ccb32b9a9b72fea691 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 8 Sep 2020 16:10:18 +0300 Subject: [PATCH 03/14] TagDao: fix --- products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs b/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs index 27beb1ecf5..81ebf673be 100644 --- a/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs +++ b/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs @@ -201,11 +201,10 @@ namespace ASC.Files.Core.Data .Where(r => r.TagId == row.Link.TagId) .Where(r => r.EntryId == row.Link.EntryId) .Where(r => r.EntryType == row.Link.EntryType); - FilesDbContext.TagLink.RemoveRange(linksToRemove); + FilesDbContext.TagLink.RemoveRange(linksToRemove); + FilesDbContext.SaveChanges(); } - FilesDbContext.SaveChanges(); - var tagsToRemove = Query(FilesDbContext.Tag) .Where(r => !Query(FilesDbContext.TagLink).Where(a => a.TagId == r.Id).Any()); From f8b3382a425d5e61e9a4f078fe9cd889becb08e4 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 8 Sep 2020 16:22:45 +0300 Subject: [PATCH 04/14] Files: tagDao. Fix --- products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs b/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs index 81ebf673be..33bcf432fd 100644 --- a/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs +++ b/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs @@ -200,11 +200,13 @@ namespace ASC.Files.Core.Data var linksToRemove = Query(FilesDbContext.TagLink) .Where(r => r.TagId == row.Link.TagId) .Where(r => r.EntryId == row.Link.EntryId) - .Where(r => r.EntryType == row.Link.EntryType); - FilesDbContext.TagLink.RemoveRange(linksToRemove); - FilesDbContext.SaveChanges(); + .Where(r => r.EntryType == row.Link.EntryType) + .ToList(); + FilesDbContext.TagLink.RemoveRange(linksToRemove); } + FilesDbContext.SaveChanges(); + var tagsToRemove = Query(FilesDbContext.Tag) .Where(r => !Query(FilesDbContext.TagLink).Where(a => a.TagId == r.Id).Any()); From 92a72d7983e5571485d51e3ffa7cc230ddd4b831 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 8 Sep 2020 16:33:39 +0300 Subject: [PATCH 05/14] Files: Tag. Fix --- products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs b/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs index 33bcf432fd..6c34f1cf5e 100644 --- a/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs +++ b/products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs @@ -193,7 +193,8 @@ namespace ASC.Files.Core.Data Query(FilesDbContext.Tag) .Join(FilesDbContext.TagLink, r => r.Id, l => l.TagId, (tag, link) => new TagLinkData { Tag = tag, Link = link }) .Where(r => r.Link.TenantId == r.Tag.TenantId) - .Where(r => r.Tag.Flag == TagType.New && r.Link.CreateOn <= TenantUtil.DateTimeNow().AddMonths(-1)); + .Where(r => r.Tag.Flag == TagType.New && r.Link.CreateOn <= TenantUtil.DateTimeNow().AddMonths(-1)) + .ToList(); foreach (var row in mustBeDeleted) { From ad51a6bf2989fe32e461433ac8313e91fac46a32 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 8 Sep 2020 17:00:29 +0300 Subject: [PATCH 06/14] Files: fix --- products/ASC.Files/Core/Configuration/ProductEntryPoint.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs b/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs index 83a0c922af..85555708f1 100644 --- a/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs +++ b/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs @@ -104,8 +104,10 @@ namespace ASC.Web.Files.Configuration CanNotBeDisabled = true, }; - NotifyConfiguration.Configure(ServiceProvider); - + if (ServiceProvider != null) + { + NotifyConfiguration.Configure(ServiceProvider); + } //SearchHandlerManager.Registry(new SearchHandler()); } From c87fd2cfdbc551d4bc3435d2656ff9e8da526690 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 8 Sep 2020 17:36:22 +0300 Subject: [PATCH 07/14] Files: share fix --- .../ASC.Files/Core/Core/Dao/TeamlabDao/SecurityDao.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/products/ASC.Files/Core/Core/Dao/TeamlabDao/SecurityDao.cs b/products/ASC.Files/Core/Core/Dao/TeamlabDao/SecurityDao.cs index 21d1d6e227..9698d9f72f 100644 --- a/products/ASC.Files/Core/Core/Dao/TeamlabDao/SecurityDao.cs +++ b/products/ASC.Files/Core/Core/Dao/TeamlabDao/SecurityDao.cs @@ -354,9 +354,14 @@ namespace ASC.Files.Core.Data private FileShareRecord ToFileShareRecord(SecurityTreeRecord r) { - var result = ToFileShareRecord(r.DbFilesSecurity); - result.EntryId = r.DbFolderTree?.FolderId; - result.Level = r.DbFolderTree?.Level ?? -1; + var result = ToFileShareRecord(r.DbFilesSecurity); + if (r.DbFolderTree != null) + { + result.EntryId = r.DbFolderTree.FolderId; + } + + result.Level = r.DbFolderTree?.Level ?? -1; + return result; } } From ce27032fbbd73433e85ae209aa4ba9bf6682ff3f Mon Sep 17 00:00:00 2001 From: SuhorukovAnton <62381554+SuhorukovAnton@users.noreply.github.com> Date: Wed, 9 Sep 2020 12:31:57 +0300 Subject: [PATCH 08/14] default-value-module: first version --- .../Configuration/Appender.cs | 44 ++++++++++++++++--- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/common/ASC.Data.Storage/Configuration/Appender.cs b/common/ASC.Data.Storage/Configuration/Appender.cs index 1cb51c2aae..6a83f87ce3 100644 --- a/common/ASC.Data.Storage/Configuration/Appender.cs +++ b/common/ASC.Data.Storage/Configuration/Appender.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Configuration; using System.Linq; using ASC.Common; @@ -62,7 +63,7 @@ namespace ASC.Data.Storage.Configuration public string Value { get; set; } } - public class Module + public class Module : ConfigurationElement { public string Name { get; set; } public string Data { get; set; } @@ -71,13 +72,42 @@ namespace ASC.Data.Storage.Configuration public ACL Acl { get; set; } public string VirtualPath { get; set; } public TimeSpan Expires { get; set; } - public bool Visible { get; set; } - public bool AppendTenantId { get; set; } - public bool Public { get; set; } - public bool DisableMigrate { get; set; } - public bool Count { get; set; } - public IEnumerable Domain { get; set; } + + [ConfigurationProperty("visible", DefaultValue = true)] + public bool Visible + { + get { return (bool)this["visible"]; } + set { this["visible"] = value; } + } + + [ConfigurationProperty("appendTenantId", DefaultValue = true)] + public bool AppendTenantId + { + get { return (bool)this["appendTenantId"]; } + set { this["appendTenantId"] = value; } + } + + [ConfigurationProperty("public", DefaultValue = true)] + public bool Public + { + get { return (bool)this["public"]; } + set { this["public"] = value; } + } + + [ConfigurationProperty("disableMigrate", DefaultValue = true)] + public bool DisableMigrate + { + get { return (bool)this["disableMigrate"]; } + set { this["disableMigrate"] = value; } + } + + [ConfigurationProperty("count", DefaultValue = true)] + public bool Count + { + get { return (bool)this["count"]; } + set { this["count"] = value; } + } } } From 0f7901628befd0da2737158e83b88e0a02ee758d Mon Sep 17 00:00:00 2001 From: SuhorukovAnton <62381554+SuhorukovAnton@users.noreply.github.com> Date: Wed, 9 Sep 2020 13:25:13 +0300 Subject: [PATCH 09/14] default-value-module: fix --- .../Configuration/Appender.cs | 41 +++---------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/common/ASC.Data.Storage/Configuration/Appender.cs b/common/ASC.Data.Storage/Configuration/Appender.cs index 6a83f87ce3..32749c7460 100644 --- a/common/ASC.Data.Storage/Configuration/Appender.cs +++ b/common/ASC.Data.Storage/Configuration/Appender.cs @@ -72,42 +72,11 @@ namespace ASC.Data.Storage.Configuration public ACL Acl { get; set; } public string VirtualPath { get; set; } public TimeSpan Expires { get; set; } - public IEnumerable Domain { get; set; } - - [ConfigurationProperty("visible", DefaultValue = true)] - public bool Visible - { - get { return (bool)this["visible"]; } - set { this["visible"] = value; } - } - - [ConfigurationProperty("appendTenantId", DefaultValue = true)] - public bool AppendTenantId - { - get { return (bool)this["appendTenantId"]; } - set { this["appendTenantId"] = value; } - } - - [ConfigurationProperty("public", DefaultValue = true)] - public bool Public - { - get { return (bool)this["public"]; } - set { this["public"] = value; } - } - - [ConfigurationProperty("disableMigrate", DefaultValue = true)] - public bool DisableMigrate - { - get { return (bool)this["disableMigrate"]; } - set { this["disableMigrate"] = value; } - } - - [ConfigurationProperty("count", DefaultValue = true)] - public bool Count - { - get { return (bool)this["count"]; } - set { this["count"] = value; } - } + public bool Visible { get; set; } = true; + public bool AppendTenantId { get; set; } = true; + public bool Public { get; set; } = true; + public bool DisableMigrate { get; set; } = true; + public bool Count { get; set; } = true; } } From 2378c3746e1b22e4ceaa45e4d102b2dd83c6c12f Mon Sep 17 00:00:00 2001 From: SuhorukovAnton <62381554+SuhorukovAnton@users.noreply.github.com> Date: Wed, 9 Sep 2020 13:25:50 +0300 Subject: [PATCH 10/14] default-value-module: fix --- common/ASC.Data.Storage/Configuration/Appender.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/ASC.Data.Storage/Configuration/Appender.cs b/common/ASC.Data.Storage/Configuration/Appender.cs index 32749c7460..94033231c3 100644 --- a/common/ASC.Data.Storage/Configuration/Appender.cs +++ b/common/ASC.Data.Storage/Configuration/Appender.cs @@ -63,7 +63,7 @@ namespace ASC.Data.Storage.Configuration public string Value { get; set; } } - public class Module : ConfigurationElement + public class Module { public string Name { get; set; } public string Data { get; set; } @@ -77,6 +77,9 @@ namespace ASC.Data.Storage.Configuration public bool Public { get; set; } = true; public bool DisableMigrate { get; set; } = true; public bool Count { get; set; } = true; + + public IEnumerable Domain { get; set; } + } } From 3875f9f4b005ded52c3729a97d15e37fd15a2a15 Mon Sep 17 00:00:00 2001 From: SuhorukovAnton <62381554+SuhorukovAnton@users.noreply.github.com> Date: Wed, 9 Sep 2020 13:36:53 +0300 Subject: [PATCH 11/14] default-value-module: fix --- common/ASC.Data.Storage/Configuration/Appender.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/ASC.Data.Storage/Configuration/Appender.cs b/common/ASC.Data.Storage/Configuration/Appender.cs index 94033231c3..d720c2059c 100644 --- a/common/ASC.Data.Storage/Configuration/Appender.cs +++ b/common/ASC.Data.Storage/Configuration/Appender.cs @@ -69,17 +69,16 @@ namespace ASC.Data.Storage.Configuration public string Data { get; set; } public string Type { get; set; } public string Path { get; set; } - public ACL Acl { get; set; } + public ACL Acl { get; set; } = ACL.Read; public string VirtualPath { get; set; } public TimeSpan Expires { get; set; } public bool Visible { get; set; } = true; public bool AppendTenantId { get; set; } = true; - public bool Public { get; set; } = true; - public bool DisableMigrate { get; set; } = true; + public bool Public { get; set; } + public bool DisableMigrate { get; set; } public bool Count { get; set; } = true; public IEnumerable Domain { get; set; } - } } From 88646b2d2f5efc8c68edf4b6d636849541c638e1 Mon Sep 17 00:00:00 2001 From: SuhorukovAnton <62381554+SuhorukovAnton@users.noreply.github.com> Date: Wed, 9 Sep 2020 13:38:43 +0300 Subject: [PATCH 12/14] default-value-module: fix --- common/ASC.Data.Storage/Configuration/Appender.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/common/ASC.Data.Storage/Configuration/Appender.cs b/common/ASC.Data.Storage/Configuration/Appender.cs index d720c2059c..3cff660614 100644 --- a/common/ASC.Data.Storage/Configuration/Appender.cs +++ b/common/ASC.Data.Storage/Configuration/Appender.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Configuration; using System.Linq; using ASC.Common; From a70b890581bdf464787a93d7f5a7d4b953fbe642 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Wed, 9 Sep 2020 13:43:39 +0300 Subject: [PATCH 13/14] Notify: rename --- .../Core/Configuration/SubscriptionManager.cs | 2 +- .../ASC.Files/Core/Core/FileStorageService.cs | 2 +- .../Core/HttpHandlers/docusignhandler.ashx.cs | 2 +- .../DocumentService/DocumentServiceTracker.cs | 2 +- .../FilesPatternResource.Designer.cs | 8 ++--- .../Services/NotifyService/NotifyClient.cs | 2 +- .../Services/NotifyService/NotifyConstants.cs | 2 +- .../Services/NotifyService/NotifySource.cs | 2 +- .../Core/Services/NotifyService/patterns.xml | 36 +++++++++---------- products/ASC.Files/Core/Utils/FileSharing.cs | 2 +- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/products/ASC.Files/Core/Configuration/SubscriptionManager.cs b/products/ASC.Files/Core/Configuration/SubscriptionManager.cs index 332fabed58..cb3d16ca59 100644 --- a/products/ASC.Files/Core/Configuration/SubscriptionManager.cs +++ b/products/ASC.Files/Core/Configuration/SubscriptionManager.cs @@ -32,7 +32,7 @@ using ASC.Core; using ASC.Files.Core.Resources; using ASC.Notify.Model; using ASC.Web.Core.Subscriptions; -using ASC.Web.Files.Services.NotifyService; +using ASC.Files.Core.Services.NotifyService; namespace ASC.Web.Files.Classes { diff --git a/products/ASC.Files/Core/Core/FileStorageService.cs b/products/ASC.Files/Core/Core/FileStorageService.cs index 56c9d53855..d6296aebb2 100644 --- a/products/ASC.Files/Core/Core/FileStorageService.cs +++ b/products/ASC.Files/Core/Core/FileStorageService.cs @@ -60,7 +60,7 @@ using ASC.Web.Files.Classes; using ASC.Web.Files.Core.Search; using ASC.Web.Files.Helpers; using ASC.Web.Files.Services.DocumentService; -using ASC.Web.Files.Services.NotifyService; +using ASC.Files.Core.Services.NotifyService; using ASC.Web.Files.Services.WCFService.FileOperations; using ASC.Web.Files.ThirdPartyApp; using ASC.Web.Files.Utils; diff --git a/products/ASC.Files/Core/HttpHandlers/docusignhandler.ashx.cs b/products/ASC.Files/Core/HttpHandlers/docusignhandler.ashx.cs index 7906c6765d..e77e54807b 100644 --- a/products/ASC.Files/Core/HttpHandlers/docusignhandler.ashx.cs +++ b/products/ASC.Files/Core/HttpHandlers/docusignhandler.ashx.cs @@ -39,7 +39,7 @@ using ASC.Files.Core.Resources; using ASC.Web.Core.Files; using ASC.Web.Files.Classes; using ASC.Web.Files.Helpers; -using ASC.Web.Files.Services.NotifyService; +using ASC.Files.Core.Services.NotifyService; using ASC.Web.Studio.Utility; using Microsoft.AspNetCore.Builder; diff --git a/products/ASC.Files/Core/Services/DocumentService/DocumentServiceTracker.cs b/products/ASC.Files/Core/Services/DocumentService/DocumentServiceTracker.cs index 74bdbe5dd1..e6e03ee2ee 100644 --- a/products/ASC.Files/Core/Services/DocumentService/DocumentServiceTracker.cs +++ b/products/ASC.Files/Core/Services/DocumentService/DocumentServiceTracker.cs @@ -52,7 +52,7 @@ using ASC.Web.Files.Classes; using ASC.Web.Files.Core; using ASC.Web.Files.Core.Entries; using ASC.Web.Files.Helpers; -using ASC.Web.Files.Services.NotifyService; +using ASC.Files.Core.Services.NotifyService; using ASC.Web.Files.ThirdPartyApp; using ASC.Web.Files.Utils; diff --git a/products/ASC.Files/Core/Services/NotifyService/FilesPatternResource.Designer.cs b/products/ASC.Files/Core/Services/NotifyService/FilesPatternResource.Designer.cs index fc9708b8bd..3eb30c8e10 100644 --- a/products/ASC.Files/Core/Services/NotifyService/FilesPatternResource.Designer.cs +++ b/products/ASC.Files/Core/Services/NotifyService/FilesPatternResource.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace ASC.Web.Files.Services.NotifyService { +namespace ASC.Files.Core.Services.NotifyService { using System; @@ -147,10 +147,10 @@ namespace ASC.Web.Files.Services.NotifyService { /// <formatter type="ASC.Notify.Patterns.NVelocityPatternFormatter, ASC.Core.Common" /> /// /// <pattern id="DocuSignComplete" sender="email.sender"> - /// <subject resource="|subject_DocuSignComplete|ASC.Web.Files.Services.NotifyService.FilesPatternResource,ASC.Files.Core" /> - /// <body styler="ASC.Notify.Textile.TextileStyler,ASC.Notify.Textile" resource="|pattern_DocuSignComplete|ASC.Web.Files.Services.NotifyService.FilesPatternResource,ASC.Files.Core" /> + /// <subject resource="|subject_DocuSignComplete|ASC.Files.Core.Services.NotifyService.FilesPatternResource,ASC.Files.Core" /> + /// <body styler="ASC.Notify.Textile.TextileStyler,ASC.Notify.Textile" resource="|pattern_DocuSignComplete|ASC.Files.Core.Services.NotifyService.FilesPatternResource,ASC.Files.Core" /> /// </pattern> - /// <pattern id="DocuSignComplete" send [rest of string was truncated]";. + /// <pattern id="DocuSignComplete" se [rest of string was truncated]";. /// public static string patterns { get { diff --git a/products/ASC.Files/Core/Services/NotifyService/NotifyClient.cs b/products/ASC.Files/Core/Services/NotifyService/NotifyClient.cs index e0929b26a6..8a0c76b3f3 100644 --- a/products/ASC.Files/Core/Services/NotifyService/NotifyClient.cs +++ b/products/ASC.Files/Core/Services/NotifyService/NotifyClient.cs @@ -41,7 +41,7 @@ using ASC.Web.Files.Classes; using Microsoft.Extensions.DependencyInjection; -namespace ASC.Web.Files.Services.NotifyService +namespace ASC.Files.Core.Services.NotifyService { public class NotifyClient { diff --git a/products/ASC.Files/Core/Services/NotifyService/NotifyConstants.cs b/products/ASC.Files/Core/Services/NotifyService/NotifyConstants.cs index bbec8147a9..623b8797c0 100644 --- a/products/ASC.Files/Core/Services/NotifyService/NotifyConstants.cs +++ b/products/ASC.Files/Core/Services/NotifyService/NotifyConstants.cs @@ -26,7 +26,7 @@ using ASC.Notify.Model; -namespace ASC.Web.Files.Services.NotifyService +namespace ASC.Files.Core.Services.NotifyService { public static class NotifyConstants { diff --git a/products/ASC.Files/Core/Services/NotifyService/NotifySource.cs b/products/ASC.Files/Core/Services/NotifyService/NotifySource.cs index 196e19cd0e..da6d7bfcea 100644 --- a/products/ASC.Files/Core/Services/NotifyService/NotifySource.cs +++ b/products/ASC.Files/Core/Services/NotifyService/NotifySource.cs @@ -35,7 +35,7 @@ using ASC.Notify.Recipients; using NotifySourceBase = ASC.Core.Notify.NotifySource; -namespace ASC.Web.Files.Services.NotifyService +namespace ASC.Files.Core.Services.NotifyService { public class NotifySource : NotifySourceBase { diff --git a/products/ASC.Files/Core/Services/NotifyService/patterns.xml b/products/ASC.Files/Core/Services/NotifyService/patterns.xml index 6d721e461c..ab7fa9371c 100644 --- a/products/ASC.Files/Core/Services/NotifyService/patterns.xml +++ b/products/ASC.Files/Core/Services/NotifyService/patterns.xml @@ -2,29 +2,29 @@ - - + + - + $DocumentURL - - + + - + $Message: $DocumentTitle - - + + - + $__AuthorName $Message @@ -32,11 +32,11 @@ $Message - - + + - + $__AuthorName $AccessRights @@ -48,11 +48,11 @@ $DocumentURL - - + + - + $__AuthorName $AccessRights @@ -64,11 +64,11 @@ $__VirtualRootPath/products/files/#$FolderID - - + + - + $__AuthorName $DocumentTitle diff --git a/products/ASC.Files/Core/Utils/FileSharing.cs b/products/ASC.Files/Core/Utils/FileSharing.cs index e78f627e0c..de791a2e7a 100644 --- a/products/ASC.Files/Core/Utils/FileSharing.cs +++ b/products/ASC.Files/Core/Utils/FileSharing.cs @@ -41,7 +41,7 @@ using ASC.Web.Core.Files; using ASC.Web.Core.Users; using ASC.Web.Files.Classes; using ASC.Web.Files.Services.DocumentService; -using ASC.Web.Files.Services.NotifyService; +using ASC.Files.Core.Services.NotifyService; using ASC.Web.Files.Services.WCFService; using Microsoft.Extensions.Options; From a53cdc568d8cd1e924d1452c7ce394615b792c64 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Wed, 9 Sep 2020 15:08:28 +0300 Subject: [PATCH 14/14] Consumers: fix --- config/autofac.consumers.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config/autofac.consumers.json b/config/autofac.consumers.json index 9dfa4c0a04..92f6f61d91 100644 --- a/config/autofac.consumers.json +++ b/config/autofac.consumers.json @@ -41,11 +41,11 @@ "type": "ASC.FederatedLogin.LoginProviders.BoxLoginProvider, ASC.FederatedLogin" }, { - "key": "box", + "key": "Box", "type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common" }, { - "key": "box", + "key": "Box", "type": "ASC.FederatedLogin.LoginProviders.BoxLoginProvider, ASC.FederatedLogin" } ], @@ -191,11 +191,11 @@ "type": "ASC.FederatedLogin.LoginProviders.FacebookLoginProvider, ASC.FederatedLogin" }, { - "key": "facebook", + "key": "Facebook", "type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common" }, { - "key": "facebook", + "key": "Facebook", "type": "ASC.FederatedLogin.LoginProviders.FacebookLoginProvider, ASC.FederatedLogin" } ], @@ -252,11 +252,11 @@ "type": "ASC.FederatedLogin.LoginProviders.GoogleLoginProvider, ASC.FederatedLogin" }, { - "key": "google", + "key": "Google", "type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common" }, { - "key": "google", + "key": "Google", "type": "ASC.FederatedLogin.LoginProviders.GoogleLoginProvider, ASC.FederatedLogin" } ], @@ -283,11 +283,11 @@ "type": "ASC.FederatedLogin.LoginProviders.LinkedInLoginProvider, ASC.FederatedLogin" }, { - "key": "linkedin", + "key": "LinkedIn", "type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common" }, { - "key": "linkedin", + "key": "LinkedIn", "type": "ASC.FederatedLogin.LoginProviders.LinkedInLoginProvider, ASC.FederatedLogin" } ], @@ -406,11 +406,11 @@ "type": "ASC.FederatedLogin.LoginProviders.TwitterLoginProvider, ASC.FederatedLogin" }, { - "key": "twitter", + "key": "Twitter", "type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common" }, { - "key": "twitter", + "key": "Twitter", "type": "ASC.FederatedLogin.LoginProviders.TwitterLoginProvider, ASC.FederatedLogin" } ],