From b1c52c36eb4345332713391e8f39ec346d3e2481 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Thu, 11 Sep 2014 22:23:48 +0300 Subject: [PATCH 01/28] Added functionality of Service Levels --- WebsitePanel/Database/update_db.sql | 700 ++++++++++++++++++ .../HostedSolution/ServiceLevel.cs | 33 + .../Packages/Quotas.cs | 1 + .../Servers/ResourceGroups.cs | 1 + .../WebsitePanel.EnterpriseServer.Base.csproj | 1 + .../OrganizationProxy.cs | 423 ++++++++++- .../Data/DataProvider.cs | 78 ++ .../ExchangeServerController.cs | 25 + .../HostedSolution/OrganizationController.cs | 130 +++- .../esOrganizations.asmx.cs | 39 +- .../HostedSolution/ExchangeAccount.cs | 18 +- .../HostedSolution/OrganizationUser.cs | 14 + .../WebsitePanel_SharedResources.ascx.resx | 14 +- .../SettingsServiceLevels.ascx.resx | 144 ++++ .../UserAccountPolicySettings.ascx.resx | 3 + .../ExchangeMailboxes.ascx.resx | 3 + .../OrganizationUserGeneralSettings.ascx.resx | 9 + .../OrganizationUsers.ascx.resx | 3 + .../ExchangeCreateMailbox.ascx.cs | 4 +- .../ExchangeServer/ExchangeMailboxes.ascx | 20 +- .../ExchangeServer/ExchangeMailboxes.ascx.cs | 37 +- .../ExchangeMailboxes.ascx.designer.cs | 28 - .../OrganizationCreateUser.ascx.cs | 4 +- .../OrganizationUserGeneralSettings.ascx | 25 +- .../OrganizationUserGeneralSettings.ascx.cs | 66 +- ...zationUserGeneralSettings.ascx.designer.cs | 82 +- .../ExchangeServer/OrganizationUsers.ascx | 15 +- .../ExchangeServer/OrganizationUsers.ascx.cs | 26 +- .../OrganizationUsers.ascx.designer.cs | 28 - .../WebsitePanel/SettingsEditor.ascx.cs | 2 +- .../WebsitePanel/SettingsServiceLevels.ascx | 84 +++ .../SettingsServiceLevels.ascx.cs | 176 +++++ .../SettingsServiceLevels.ascx.designer.cs | 132 ++++ .../WebsitePanel/SpaceQuotasControl.ascx | 2 +- .../WebsitePanel/SpaceQuotasControl.ascx.cs | 8 + .../SpaceQuotasControl.ascx.designer.cs | 28 - .../UserAccountPolicySettings.ascx | 4 + ...UserAccountPolicySettings.ascx.designer.cs | 38 +- .../WebsitePanel.Portal.Modules.csproj | 9 + 39 files changed, 2282 insertions(+), 175 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/ServiceLevel.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsServiceLevels.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.designer.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index aad554db..80899c0a 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -4506,3 +4506,703 @@ GO UPDATE [dbo].[ScheduleTaskParameters] SET [DefaultValue]= N'MsSQL2005=SQL Server 2005;MsSQL2008=SQL Server 2008;MsSQL2012=SQL Server 2012;MsSQL2014=SQL Server 2014;MySQL4=MySQL 4.0;MySQL5=MySQL 5.0' WHERE [TaskID]= 'SCHEDULE_TASK_BACKUP_DATABASE' AND [ParameterID]='DATABASE_GROUP' GO +/*SUPPORT SERVICE LEVELS*/ + +IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'Service Levels') +BEGIN +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (47, N'Service Levels', 2, NULL, 1) +END +GO + +IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'SupportServiceLevels') +CREATE TABLE SupportServiceLevels +( +[LevelID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, +[LevelName] NVARCHAR(100) NOT NULL, +[LevelDescription] NVARCHAR(1000) NULL +) +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetSupportServiceLevels') +DROP PROCEDURE GetSupportServiceLevels +GO + +CREATE PROCEDURE [dbo].[GetSupportServiceLevels] +AS +SELECT * +FROM SupportServiceLevels +RETURN +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetSupportServiceLevel') +DROP PROCEDURE GetSupportServiceLevel +GO + +CREATE PROCEDURE [dbo].[GetSupportServiceLevel] +( + @LevelID int +) +AS +SELECT * +FROM SupportServiceLevels +WHERE LevelID = @LevelID +RETURN +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddSupportServiceLevel') +DROP PROCEDURE AddSupportServiceLevel +GO + +CREATE PROCEDURE [dbo].[AddSupportServiceLevel] +( + @LevelID int OUTPUT, + @LevelName nvarchar(100), + @LevelDescription nvarchar(1000) +) +AS +BEGIN + + IF EXISTS (SELECT * FROM SupportServiceLevels WHERE LevelName = @LevelName) + BEGIN + SET @LevelID = -1 + + RETURN + END + + INSERT INTO SupportServiceLevels + ( + LevelName, + LevelDescription + ) + VALUES + ( + @LevelName, + @LevelDescription + ) + + SET @LevelID = SCOPE_IDENTITY() + + DECLARE @ResourseGroupID int + + IF EXISTS (SELECT * FROM ResourceGroups WHERE GroupName = 'Service Levels') + BEGIN + DECLARE @QuotaLastID int, @CurQuotaName nvarchar(100), + @CurQuotaDescription nvarchar(1000), @QuotaOrderInGroup int + + SET @CurQuotaName = N'ServiceLevel.' + @LevelName + SET @CurQuotaDescription = @LevelName + N', users' + + SELECT @ResourseGroupID = GroupID FROM ResourceGroups WHERE GroupName = 'Service Levels' + + SELECT @QuotaLastID = MAX(QuotaID) FROM Quotas + + SELECT @QuotaOrderInGroup = MAX(QuotaOrder) FROM Quotas WHERE GroupID = @ResourseGroupID + + IF @QuotaOrderInGroup IS NULL SET @QuotaOrderInGroup = 0 + + IF NOT EXISTS (SELECT * FROM Quotas WHERE QuotaName = @CurQuotaName) + BEGIN + INSERT Quotas + (QuotaID, + GroupID, + QuotaOrder, + QuotaName, + QuotaDescription, + QuotaTypeID, + ServiceQuota, + ItemTypeID) + VALUES + (@QuotaLastID + 1, + @ResourseGroupID, + @QuotaOrderInGroup + 1, + @CurQuotaName, + @CurQuotaDescription, + 3, + 0, + NULL) + END + END + +END + +RETURN +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteSupportServiceLevel') +DROP PROCEDURE DeleteSupportServiceLevel +GO + +CREATE PROCEDURE [dbo].[DeleteSupportServiceLevel] +( + @LevelID int +) +AS +BEGIN + + DECLARE @LevelName nvarchar(100), @QuotaName nvarchar(100), @QuotaID int + + SELECT @LevelName = LevelName FROM SupportServiceLevels WHERE LevelID = @LevelID + + SET @QuotaName = N'ServiceLevel.' + @LevelName + + SELECT @QuotaID = QuotaID FROM Quotas WHERE QuotaName = @QuotaName + + IF @QuotaID IS NOT NULL + BEGIN + DELETE FROM HostingPlanQuotas WHERE QuotaID = @QuotaID + DELETE FROM PackageQuotas WHERE QuotaID = @QuotaID + DELETE FROM Quotas WHERE QuotaID = @QuotaID + END + + IF EXISTS (SELECT * FROM ExchangeAccounts WHERE LevelID = @LevelID) + UPDATE ExchangeAccounts + SET LevelID = NULL + WHERE LevelID = @LevelID + + DELETE FROM SupportServiceLevels WHERE LevelID = @LevelID + +END + +RETURN +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateSupportServiceLevel') +DROP PROCEDURE UpdateSupportServiceLevel +GO + +CREATE PROCEDURE [dbo].[UpdateSupportServiceLevel] +( + @LevelID int, + @LevelName nvarchar(100), + @LevelDescription nvarchar(1000) +) +AS +BEGIN + + DECLARE @PrevQuotaName nvarchar(100), @PrevLevelName nvarchar(100) + + SELECT @PrevLevelName = LevelName FROM SupportServiceLevels WHERE LevelID = @LevelID + + SET @PrevQuotaName = N'ServiceLevel.' + @PrevLevelName + + UPDATE SupportServiceLevels + SET LevelName = @LevelName, + LevelDescription = @LevelDescription + WHERE LevelID = @LevelID + + IF EXISTS (SELECT * FROM Quotas WHERE QuotaName = @PrevQuotaName) + BEGIN + DECLARE @QuotaID INT + + SELECT @QuotaID = QuotaID FROM Quotas WHERE QuotaName = @PrevQuotaName + + UPDATE Quotas + SET QuotaName = N'ServiceLevel.' + @LevelName, + QuotaDescription = @LevelName + ', users' + WHERE QuotaID = @QuotaID + END + +END + +RETURN +GO + +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='LevelID') +BEGIN +ALTER TABLE [dbo].[ExchangeAccounts] ADD + [LevelID] [int] NULL, + [IsVIP] [bit] NOT NULL DEFAULT 0 +END +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type IN ('FN', 'IF', 'TF') AND name = 'GetPackageServiceLevelResource') +DROP FUNCTION GetPackageServiceLevelResource +GO + +CREATE FUNCTION dbo.GetPackageServiceLevelResource +( + @PackageID int, + @GroupID int, + @ServerID int +) +RETURNS bit +AS +BEGIN + +IF NOT EXISTS (SELECT * FROM dbo.ResourceGroups WHERE GroupID = @GroupID AND GroupName = 'Service Levels') +RETURN 0 + +IF @PackageID IS NULL +RETURN 1 + +DECLARE @Result bit +SET @Result = 1 -- enabled + +DECLARE @PID int, @ParentPackageID int +SET @PID = @PackageID + +DECLARE @OverrideQuotas bit + +IF @ServerID IS NULL OR @ServerID = 0 +SELECT @ServerID = ServerID FROM Packages +WHERE PackageID = @PackageID + +WHILE 1 = 1 +BEGIN + + DECLARE @GroupEnabled int + + -- get package info + SELECT + @ParentPackageID = ParentPackageID, + @OverrideQuotas = OverrideQuotas + FROM Packages WHERE PackageID = @PID + + -- check if this is a root 'System' package + SET @GroupEnabled = 1 -- enabled + IF @ParentPackageID IS NULL + BEGIN + + IF @ServerID = 0 + RETURN 0 + ELSE IF @PID = -1 + RETURN 1 + ELSE IF @ServerID IS NULL + RETURN 1 + ELSE IF @ServerID > 0 + RETURN 1 + ELSE RETURN 0 + END + ELSE -- parentpackage is not null + BEGIN + -- check the current package + IF @OverrideQuotas = 1 + BEGIN + IF NOT EXISTS( + SELECT GroupID FROM PackageResources WHERE GroupID = @GroupID AND PackageID = @PID + ) + SET @GroupEnabled = 0 + END + ELSE + BEGIN + IF NOT EXISTS( + SELECT HPR.GroupID FROM Packages AS P + INNER JOIN HostingPlanResources AS HPR ON P.PlanID = HPR.PlanID + WHERE HPR.GroupID = @GroupID AND P.PackageID = @PID + ) + SET @GroupEnabled = 0 + END + + -- check addons + IF EXISTS( + SELECT HPR.GroupID FROM PackageAddons AS PA + INNER JOIN HostingPlanResources AS HPR ON PA.PlanID = HPR.PlanID + WHERE HPR.GroupID = @GroupID AND PA.PackageID = @PID + AND PA.StatusID = 1 -- active add-on + ) + SET @GroupEnabled = 1 + END + + IF @GroupEnabled = 0 + RETURN 0 + + SET @PID = @ParentPackageID + +END -- end while + +RETURN @Result +END +GO + +ALTER PROCEDURE [dbo].[GetPackageQuotasForEdit] +( + @ActorID int, + @PackageID int +) +AS + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +DECLARE @ServerID int, @ParentPackageID int, @PlanID int +SELECT @ServerID = ServerID, @ParentPackageID = ParentPackageID, @PlanID = PlanID FROM Packages +WHERE PackageID = @PackageID + +-- get resource groups +SELECT + RG.GroupID, + RG.GroupName, + ISNULL(PR.CalculateDiskSpace, ISNULL(HPR.CalculateDiskSpace, 0)) AS CalculateDiskSpace, + ISNULL(PR.CalculateBandwidth, ISNULL(HPR.CalculateBandwidth, 0)) AS CalculateBandwidth, + --dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, @ServerID) AS Enabled, + CASE + WHEN RG.GroupName = 'Service Levels' THEN dbo.GetPackageServiceLevelResource(PackageID, RG.GroupID, @ServerID) + ELSE dbo.GetPackageAllocatedResource(PackageID, RG.GroupID, @ServerID) + END AS Enabled, + --dbo.GetPackageAllocatedResource(@ParentPackageID, RG.GroupID, @ServerID) AS ParentEnabled + CASE + WHEN RG.GroupName = 'Service Levels' THEN dbo.GetPackageServiceLevelResource(@ParentPackageID, RG.GroupID, @ServerID) + ELSE dbo.GetPackageAllocatedResource(@ParentPackageID, RG.GroupID, @ServerID) + END AS ParentEnabled +FROM ResourceGroups AS RG +LEFT OUTER JOIN PackageResources AS PR ON RG.GroupID = PR.GroupID AND PR.PackageID = @PackageID +LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID +ORDER BY RG.GroupOrder + + +-- return quotas +SELECT + Q.QuotaID, + Q.GroupID, + Q.QuotaName, + Q.QuotaDescription, + Q.QuotaTypeID, + CASE + WHEN PQ.QuotaValue IS NULL THEN dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) + ELSE PQ.QuotaValue + END QuotaValue, + dbo.GetPackageAllocatedQuota(@ParentPackageID, Q.QuotaID) AS ParentQuotaValue +FROM Quotas AS Q +LEFT OUTER JOIN PackageQuotas AS PQ ON PQ.QuotaID = Q.QuotaID AND PQ.PackageID = @PackageID +ORDER BY Q.QuotaOrder + +RETURN +GO + +ALTER PROCEDURE [dbo].[GetPackageQuotas] +( + @ActorID int, + @PackageID int +) +AS + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +DECLARE @PlanID int, @ParentPackageID int +SELECT @PlanID = PlanID, @ParentPackageID = ParentPackageID FROM Packages +WHERE PackageID = @PackageID + +-- get resource groups +SELECT + RG.GroupID, + RG.GroupName, + ISNULL(HPR.CalculateDiskSpace, 0) AS CalculateDiskSpace, + ISNULL(HPR.CalculateBandwidth, 0) AS CalculateBandwidth, + --dbo.GetPackageAllocatedResource(@ParentPackageID, RG.GroupID, 0) AS ParentEnabled + CASE + WHEN RG.GroupName = 'Service Levels' THEN dbo.GetPackageServiceLevelResource(@ParentPackageID, RG.GroupID, 0) + ELSE dbo.GetPackageAllocatedResource(@ParentPackageID, RG.GroupID, 0) + END AS ParentEnabled +FROM ResourceGroups AS RG +LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID +--WHERE dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, 0) = 1 +WHERE (dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, 0) = 1 AND RG.GroupName <> 'Service Levels') OR + (dbo.GetPackageServiceLevelResource(@PackageID, RG.GroupID, 0) = 1 AND RG.GroupName = 'Service Levels') +ORDER BY RG.GroupOrder + + +-- return quotas +SELECT + Q.QuotaID, + Q.GroupID, + Q.QuotaName, + Q.QuotaDescription, + Q.QuotaTypeID, + dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS QuotaValue, + dbo.GetPackageAllocatedQuota(@ParentPackageID, Q.QuotaID) AS ParentQuotaValue, + ISNULL(dbo.CalculateQuotaUsage(@PackageID, Q.QuotaID), 0) AS QuotaUsedValue +FROM Quotas AS Q +WHERE Q.HideQuota IS NULL OR Q.HideQuota = 0 +ORDER BY Q.QuotaOrder +RETURN +GO + +ALTER PROCEDURE [dbo].[GetHostingPlanQuotas] +( + @ActorID int, + @PlanID int, + @PackageID int, + @ServerID int +) +AS + +-- check rights +IF dbo.CheckActorParentPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +DECLARE @IsAddon bit + +IF @ServerID = 0 +SELECT @ServerID = ServerID FROM Packages +WHERE PackageID = @PackageID + +-- get resource groups +SELECT + RG.GroupID, + RG.GroupName, + CASE + WHEN HPR.CalculateDiskSpace IS NULL THEN CAST(0 as bit) + ELSE CAST(1 as bit) + END AS Enabled, + --dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, @ServerID) AS ParentEnabled, + CASE + WHEN RG.GroupName = 'Service Levels' THEN dbo.GetPackageServiceLevelResource(@PackageID, RG.GroupID, @ServerID) + ELSE dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, @ServerID) + END AS ParentEnabled, + ISNULL(HPR.CalculateDiskSpace, 1) AS CalculateDiskSpace, + ISNULL(HPR.CalculateBandwidth, 1) AS CalculateBandwidth +FROM ResourceGroups AS RG +LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID +WHERE (RG.ShowGroup = 1) +ORDER BY RG.GroupOrder + +-- get quotas by groups +SELECT + Q.QuotaID, + Q.GroupID, + Q.QuotaName, + Q.QuotaDescription, + Q.QuotaTypeID, + ISNULL(HPQ.QuotaValue, 0) AS QuotaValue, + dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS ParentQuotaValue +FROM Quotas AS Q +LEFT OUTER JOIN HostingPlanQuotas AS HPQ ON Q.QuotaID = HPQ.QuotaID AND HPQ.PlanID = @PlanID +WHERE Q.HideQuota IS NULL OR Q.HideQuota = 0 +ORDER BY Q.QuotaOrder +RETURN +GO + +ALTER PROCEDURE [dbo].[SearchOrganizationAccounts] +( + @ActorID int, + @ItemID int, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @IncludeMailboxes bit +) +AS +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +(EA.AccountType = 7 OR (EA.AccountType = 1 AND @IncludeMailboxes = 1) ) +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.SubscriberNumber, + EA.UserPrincipalName, + EA.LevelID, + EA.IsVIP +FROM ExchangeAccounts AS EA +WHERE ' + @condition + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes bit', +@ItemID, @IncludeMailboxes + +RETURN +GO + +ALTER PROCEDURE [dbo].[GetExchangeAccount] +( + @ItemID int, + @AccountID int +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber, + E.UserPrincipalName, + E.ArchivingMailboxPlanId, + AP.MailboxPlan as 'ArchivingMailboxPlan', + E.EnableArchiving, + E.LevelID, + E.IsVIP +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +LEFT OUTER JOIN ExchangeMailboxPlans AS AP ON E.ArchivingMailboxPlanId = AP.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountID = @AccountID +RETURN +GO + +ALTER PROCEDURE [dbo].[GetExchangeAccountsPaged] +( + @ActorID int, + @ItemID int, + @AccountTypes nvarchar(30), + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int, + @Archiving bit +) +AS + +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +EA.AccountType IN (' + @AccountTypes + ') +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +BEGIN + IF @FilterColumn = 'PrimaryEmailAddress' AND @AccountTypes <> '2' + BEGIN + SET @condition = @condition + ' AND EA.AccountID IN (SELECT EAEA.AccountID FROM ExchangeAccountEmailAddresses EAEA WHERE EAEA.EmailAddress LIKE ''' + @FilterValue + ''')' + END + ELSE + BEGIN + SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + END +END + +if @Archiving = 1 +BEGIN + SET @condition = @condition + ' AND (EA.ArchivingMailboxPlanId > 0) ' +END + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @joincondition nvarchar(700) + SET @joincondition = ',P.MailboxPlan FROM ExchangeAccounts AS EA + LEFT OUTER JOIN ExchangeMailboxPlans AS P ON EA.MailboxPlanId = P.MailboxPlanId' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT COUNT(EA.AccountID) FROM ExchangeAccounts AS EA +WHERE ' + @condition + '; + +WITH Accounts AS ( + SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row, + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.MailEnabledPublicFolder, + EA.MailboxPlanId, + EA.SubscriberNumber, + EA.UserPrincipalName, + EA.LevelID, + EA.IsVIP ' + @joincondition + + ' WHERE ' + @condition + ' +) + +SELECT * FROM Accounts +WHERE Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows +' + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @StartRow int, @MaximumRows int', +@ItemID, @StartRow, @MaximumRows + +RETURN +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateExchangeAccountSLSettings') +DROP PROCEDURE UpdateExchangeAccountSLSettings +GO + +CREATE PROCEDURE [dbo].[UpdateExchangeAccountSLSettings] +( + @AccountID int, + @LevelID int, + @IsVIP bit +) +AS + +BEGIN TRAN + + IF (@LevelID = -1) + BEGIN + SET @LevelID = NULL + END + + UPDATE ExchangeAccounts SET + LevelID = @LevelID, + IsVIP = @IsVIP + WHERE + AccountID = @AccountID + + IF (@@ERROR <> 0 ) + BEGIN + ROLLBACK TRANSACTION + RETURN -1 + END +COMMIT TRAN +RETURN +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'CheckServiceLevelUsage') +DROP PROCEDURE CheckServiceLevelUsage +GO + +CREATE PROCEDURE [dbo].[CheckServiceLevelUsage] +( + @LevelID int +) +AS +SELECT COUNT(EA.AccountID) +FROM SupportServiceLevels AS SL +INNER JOIN ExchangeAccounts AS EA ON SL.LevelID = EA.LevelID +WHERE EA.LevelID = @LevelID +RETURN +GO \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/ServiceLevel.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/ServiceLevel.cs new file mode 100644 index 00000000..72174095 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/ServiceLevel.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.EnterpriseServer.Base.HostedSolution +{ + public class ServiceLevel + { + int levelId; + string levelName; + string levelDescription; + + public int LevelId + { + get { return levelId; } + set { levelId = value; } + } + + public string LevelName + { + get { return levelName; } + set { levelName = value; } + } + + public string LevelDescription + { + get { return levelDescription; } + set { levelDescription = value; } + } + } + +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 956aedcc..e6a2d6d9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -255,5 +255,6 @@ order by rg.groupOrder public const string ENTERPRISESTORAGE_FOLDERS = "EnterpriseStorage.Folders"; public const string ENTERPRICESTORAGE_DRIVEMAPS = "EnterpriseStorage.DriveMaps"; + public const string SERVICE_LEVELS = "ServiceLevel."; } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs index 78480041..9494443f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs @@ -55,5 +55,6 @@ namespace WebsitePanel.EnterpriseServer public const string VPSForPC = "VPSForPC"; public const string Lync = "Lync"; public const string EnterpriseStorage = "EnterpriseStorage"; + public const string ServiceLevels = "Service Levels"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj index 90172b0b..7ce9ade3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj @@ -117,6 +117,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index 1d9d15f0..b81cc96d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -146,6 +146,16 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution private System.Threading.SendOrPostCallback SetDefaultOrganizationOperationCompleted; + private System.Threading.SendOrPostCallback GetSupportServiceLevelsOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateSupportServiceLevelOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteSupportServiceLevelOperationCompleted; + + private System.Threading.SendOrPostCallback AddSupportServiceLevelOperationCompleted; + + private System.Threading.SendOrPostCallback GetSupportServiceLevelOperationCompleted; + /// public esOrganizations() { @@ -272,6 +282,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution /// public event SetDefaultOrganizationCompletedEventHandler SetDefaultOrganizationCompleted; + /// + public event GetSupportServiceLevelsCompletedEventHandler GetSupportServiceLevelsCompleted; + + /// + public event UpdateSupportServiceLevelCompletedEventHandler UpdateSupportServiceLevelCompleted; + + /// + public event DeleteSupportServiceLevelCompletedEventHandler DeleteSupportServiceLevelCompleted; + + /// + public event AddSupportServiceLevelCompletedEventHandler AddSupportServiceLevelCompleted; + + /// + public event GetSupportServiceLevelCompletedEventHandler GetSupportServiceLevelCompleted; /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckOrgIdExists", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1415,7 +1439,9 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution string webPage, string notes, string externalEmail, - string subscriberNumber) + string subscriberNumber, + int levelId, + bool isVIP) { object[] results = this.Invoke("SetUserGeneralSettings", new object[] { itemId, @@ -1446,7 +1472,9 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution webPage, notes, externalEmail, - subscriberNumber}); + subscriberNumber, + levelId, + isVIP}); return ((int)(results[0])); } @@ -1481,6 +1509,8 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution string notes, string externalEmail, string subscriberNumber, + int levelId, + bool isVIP, System.AsyncCallback callback, object asyncState) { @@ -1513,7 +1543,9 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution webPage, notes, externalEmail, - subscriberNumber}, callback, asyncState); + subscriberNumber, + levelId, + isVIP}, callback, asyncState); } /// @@ -1553,9 +1585,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution string webPage, string notes, string externalEmail, - string subscriberNumber) + string subscriberNumber, + int levelId, + bool isVIP) { - this.SetUserGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, subscriberNumber, null); + this.SetUserGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, subscriberNumber, levelId, isVIP, null); } /// @@ -1589,6 +1623,8 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution string notes, string externalEmail, string subscriberNumber, + int levelId, + bool isVIP, object userState) { if ((this.SetUserGeneralSettingsOperationCompleted == null)) @@ -1624,7 +1660,9 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution webPage, notes, externalEmail, - subscriberNumber}, this.SetUserGeneralSettingsOperationCompleted, userState); + subscriberNumber, + levelId, + isVIP}, this.SetUserGeneralSettingsOperationCompleted, userState); } private void OnSetUserGeneralSettingsOperationCompleted(object arg) @@ -2663,6 +2701,255 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSupportServiceLevels", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ServiceLevel[] GetSupportServiceLevels() + { + object[] results = this.Invoke("GetSupportServiceLevels", new object[0]); + return ((ServiceLevel[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetSupportServiceLevels(System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetSupportServiceLevels", new object[0], callback, asyncState); + } + + /// + public ServiceLevel[] EndGetSupportServiceLevels(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ServiceLevel[])(results[0])); + } + + /// + public void GetSupportServiceLevelsAsync() + { + this.GetSupportServiceLevelsAsync(null); + } + + /// + public void GetSupportServiceLevelsAsync(object userState) + { + if ((this.GetSupportServiceLevelsOperationCompleted == null)) + { + this.GetSupportServiceLevelsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSupportServiceLevelsOperationCompleted); + } + this.InvokeAsync("GetSupportServiceLevels", new object[0], this.GetSupportServiceLevelsOperationCompleted, userState); + } + + private void OnGetSupportServiceLevelsOperationCompleted(object arg) + { + if ((this.GetSupportServiceLevelsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSupportServiceLevelsCompleted(this, new GetSupportServiceLevelsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateSupportServiceLevel", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void UpdateSupportServiceLevel(int levelID, string levelName, string levelDescription) + { + this.Invoke("UpdateSupportServiceLevel", new object[] { + levelID, + levelName, + levelDescription}); + } + + /// + public System.IAsyncResult BeginUpdateSupportServiceLevel(int levelID, string levelName, string levelDescription, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("UpdateSupportServiceLevel", new object[] { + levelID, + levelName, + levelDescription}, callback, asyncState); + } + + /// + public void EndUpdateSupportServiceLevel(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription) + { + this.UpdateSupportServiceLevelAsync(levelID, levelName, levelDescription, null); + } + + /// + public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription, object userState) + { + if ((this.UpdateSupportServiceLevelOperationCompleted == null)) + { + this.UpdateSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateSupportServiceLevelOperationCompleted); + } + this.InvokeAsync("UpdateSupportServiceLevel", new object[] { + levelID, + levelName, + levelDescription}, this.UpdateSupportServiceLevelOperationCompleted, userState); + } + + private void OnUpdateSupportServiceLevelOperationCompleted(object arg) + { + if ((this.UpdateSupportServiceLevelCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateSupportServiceLevelCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteSupportServiceLevel", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DeleteSupportServiceLevel(int levelId) + { + object[] results = this.Invoke("DeleteSupportServiceLevel", new object[] { + levelId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteSupportServiceLevel(int levelId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteSupportServiceLevel", new object[] { + levelId}, callback, asyncState); + } + + /// + public ResultObject EndDeleteSupportServiceLevel(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DeleteSupportServiceLevelAsync(int levelId) + { + this.DeleteSupportServiceLevelAsync(levelId, null); + } + + /// + public void DeleteSupportServiceLevelAsync(int levelId, object userState) + { + if ((this.DeleteSupportServiceLevelOperationCompleted == null)) + { + this.DeleteSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSupportServiceLevelOperationCompleted); + } + this.InvokeAsync("DeleteSupportServiceLevel", new object[] { + levelId}, this.DeleteSupportServiceLevelOperationCompleted, userState); + } + + private void OnDeleteSupportServiceLevelOperationCompleted(object arg) + { + if ((this.DeleteSupportServiceLevelCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteSupportServiceLevelCompleted(this, new DeleteSupportServiceLevelCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddSupportServiceLevel", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddSupportServiceLevel(string levelName, string levelDescription) + { + object[] results = this.Invoke("AddSupportServiceLevel", new object[] { + levelName, + levelDescription}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginAddSupportServiceLevel(string levelName, string levelDescription, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddSupportServiceLevel", new object[] { + levelName, + levelDescription}, callback, asyncState); + } + + /// + public int EndAddSupportServiceLevel(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void AddSupportServiceLevelAsync(string levelName, string levelDescription) + { + this.AddSupportServiceLevelAsync(levelName, levelDescription, null); + } + + /// + public void AddSupportServiceLevelAsync(string levelName, string levelDescription, object userState) + { + if ((this.AddSupportServiceLevelOperationCompleted == null)) + { + this.AddSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddSupportServiceLevelOperationCompleted); + } + this.InvokeAsync("AddSupportServiceLevel", new object[] { + levelName, + levelDescription}, this.AddSupportServiceLevelOperationCompleted, userState); + } + + private void OnAddSupportServiceLevelOperationCompleted(object arg) + { + if ((this.AddSupportServiceLevelCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddSupportServiceLevelCompleted(this, new AddSupportServiceLevelCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSupportServiceLevel", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ServiceLevel GetSupportServiceLevel(int levelID) + { + object[] results = this.Invoke("GetSupportServiceLevel", new object[] { + levelID}); + return ((ServiceLevel)(results[0])); + } + + /// + public System.IAsyncResult BeginGetSupportServiceLevel(int levelID, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetSupportServiceLevel", new object[] { + levelID}, callback, asyncState); + } + + /// + public ServiceLevel EndGetSupportServiceLevel(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ServiceLevel)(results[0])); + } + + /// + public void GetSupportServiceLevelAsync(int levelID) + { + this.GetSupportServiceLevelAsync(levelID, null); + } + + /// + public void GetSupportServiceLevelAsync(int levelID, object userState) + { + if ((this.GetSupportServiceLevelOperationCompleted == null)) + { + this.GetSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSupportServiceLevelOperationCompleted); + } + this.InvokeAsync("GetSupportServiceLevel", new object[] { + levelID}, this.GetSupportServiceLevelOperationCompleted, userState); + } + + private void OnGetSupportServiceLevelOperationCompleted(object arg) + { + if ((this.GetSupportServiceLevelCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSupportServiceLevelCompleted(this, new GetSupportServiceLevelCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { @@ -3791,4 +4078,128 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetDefaultOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void UpdateSupportServiceLevelCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void DeleteSupportServiceLevelCompletedEventHandler(object sender, DeleteSupportServiceLevelCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal DeleteSupportServiceLevelCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddSupportServiceLevelCompletedEventHandler(object sender, AddSupportServiceLevelCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddSupportServiceLevelCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetSupportServiceLevelsCompletedEventHandler(object sender, GetSupportServiceLevelsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSupportServiceLevelsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetSupportServiceLevelsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ServiceLevel[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ServiceLevel[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetSupportServiceLevelCompletedEventHandler(object sender, GetSupportServiceLevelCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetSupportServiceLevelCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ServiceLevel Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ServiceLevel)(this.results[0])); + } + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index ef79edce..7619168e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -2593,6 +2593,18 @@ namespace WebsitePanel.EnterpriseServer ); } + public static void UpdateExchangeAccountServiceLevelSettings(int accountId, int levelId, bool isVIP) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "UpdateExchangeAccountSLSettings", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@LevelID", (levelId == 0) ? (object)DBNull.Value : (object)levelId), + new SqlParameter("@IsVIP", isVIP) + ); + } + public static void UpdateExchangeAccountUserPrincipalName(int accountId, string userPrincipalName) { SqlHelper.ExecuteNonQuery( @@ -4357,5 +4369,71 @@ namespace WebsitePanel.EnterpriseServer } #endregion + + #region Support Service Levels + + public static IDataReader GetSupportServiceLevels() + { + return SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, + ObjectQualifier + "GetSupportServiceLevels"); + } + + public static int AddSupportServiceLevel(string levelName, string levelDescription) + { + SqlParameter outParam = new SqlParameter("@LevelID", SqlDbType.Int); + outParam.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddSupportServiceLevel", + outParam, + new SqlParameter("@LevelName", levelName), + new SqlParameter("@LevelDescription", levelDescription) + ); + + return Convert.ToInt32(outParam.Value); + } + + public static void UpdateSupportServiceLevel(int levelID, string levelName, string levelDescription) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "UpdateSupportServiceLevel", + new SqlParameter("@LevelID", levelID), + new SqlParameter("@LevelName", levelName), + new SqlParameter("@LevelDescription", levelDescription) + ); + } + + public static void DeleteSupportServiceLevel(int levelID) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteSupportServiceLevel", + new SqlParameter("@LevelID", levelID) + ); + } + + public static IDataReader GetSupportServiceLevel(int levelID) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetSupportServiceLevel", + new SqlParameter("@LevelID", levelID) + ); + } + + public static bool CheckServiceLevelUsage(int levelID) + { + int res = (int)SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "CheckServiceLevelUsage", + new SqlParameter("@LevelID", levelID)); + return res > 0; + } + + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index 52e1dc03..cd3cb5d5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -978,6 +978,31 @@ namespace WebsitePanel.EnterpriseServer List accounts = new List(); ObjectUtils.FillCollectionFromDataView(accounts, ds.Tables[1].DefaultView); + + Organization org = null; + try + { + org = GetOrganization(itemId); + + if (org != null) + { + Organizations orgProxy = OrganizationController.GetOrganizationProxy(org.ServiceId); + + OrganizationUser user = null; + string accountName = string.Empty; + foreach (var account in accounts) + { + accountName = OrganizationController.GetAccountName(account.AccountName); + + user = orgProxy.GetUserGeneralSettings(accountName, org.OrganizationId); + + account.Disabled = user.Disabled; + account.Locked = user.Locked; + } + } + } + catch { } + result.PageItems = accounts.ToArray(); return result; } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 0bde22d7..97f29adf 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1856,6 +1856,8 @@ namespace WebsitePanel.EnterpriseServer retUser.IsLyncUser = DataProvider.CheckLyncUserExists(accountId); retUser.IsBlackBerryUser = BlackBerryController.CheckBlackBerryUserExists(accountId); retUser.SubscriberNumber = account.SubscriberNumber; + retUser.LevelId = account.LevelId; + retUser.IsVIP = account.IsVIP; return retUser; } @@ -1873,7 +1875,7 @@ namespace WebsitePanel.EnterpriseServer string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes, string externalEmail, string subscriberNumber) + string webPage, string notes, string externalEmail, string subscriberNumber, int levelId, bool isVIP) { // check account @@ -1940,6 +1942,8 @@ namespace WebsitePanel.EnterpriseServer // update account account.DisplayName = displayName; account.SubscriberNumber = subscriberNumber; + account.LevelId = levelId; + account.IsVIP = isVIP; //account. if (!String.IsNullOrEmpty(password)) @@ -1948,6 +1952,7 @@ namespace WebsitePanel.EnterpriseServer account.AccountPassword = null; UpdateAccount(account); + UpdateAccountServiceLevelSettings(account); return 0; @@ -2114,7 +2119,10 @@ namespace WebsitePanel.EnterpriseServer } } - + private static void UpdateAccountServiceLevelSettings(ExchangeAccount account) + { + DataProvider.UpdateExchangeAccountServiceLevelSettings(account.AccountId, account.LevelId, account.IsVIP); + } private static void UpdateAccount(ExchangeAccount account) { @@ -2126,7 +2134,6 @@ namespace WebsitePanel.EnterpriseServer } - public static List SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) @@ -2941,5 +2948,122 @@ namespace WebsitePanel.EnterpriseServer //return accounts; } + + + #region Service Levels + + public static int AddSupportServiceLevel(string levelName, string levelDescription) + { + if (string.IsNullOrEmpty(levelName)) + throw new ArgumentNullException("levelName"); + + // place log record + TaskManager.StartTask("ORGANIZATION", "ADD_SUPPORT_SERVICE_LEVEL"); + + int levelID = 0; + + try + { + levelID = DataProvider.AddSupportServiceLevel(levelName, levelDescription); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + return levelID; + } + + public static ResultObject DeleteSupportServiceLevel(int levelId) + { + ResultObject res = TaskManager.StartResultTask("ORGANIZATION", "DELETE_SUPPORT_SERVICE_LEVEL", levelId); + + try + { + if (CheckServiceLevelUsage(levelId)) res.AddError("SERVICE_LEVEL_IN_USE", new ApplicationException("Service Level is being used")); + + if (res.IsSuccess) + DataProvider.DeleteSupportServiceLevel(levelId); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + TaskManager.CompleteResultTask(res); + res.AddError("", ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static void UpdateSupportServiceLevel(int levelID, string levelName, string levelDescription) + { + // place log record + TaskManager.StartTask("ORGANIZATION", "UPDATE_SUPPORT_SERVICE_LEVEL", levelID); + + try + { + DataProvider.UpdateSupportServiceLevel(levelID, levelName, levelDescription); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static ServiceLevel[] GetSupportServiceLevels() + { + // place log record + TaskManager.StartTask("ORGANIZATION", "GET_SUPPORT_SERVICE_LEVELS"); + + try + { + return ObjectUtils.CreateListFromDataReader(DataProvider.GetSupportServiceLevels()).ToArray(); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static ServiceLevel GetSupportServiceLevel(int levelID) + { + // place log record + TaskManager.StartTask("ORGANIZATION", "GET_SUPPORT_SERVICE_LEVEL", levelID); + + try + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetSupportServiceLevel(levelID)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + private static bool CheckServiceLevelUsage(int levelID) + { + return DataProvider.CheckServiceLevelUsage(levelID); + } + + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index 74098095..3f30bf31 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -31,6 +31,7 @@ using System.ComponentModel; using System.Data; using System.Web.Services; using WebsitePanel.EnterpriseServer.Base.HostedSolution; +using WebsitePanel.Providers.Common; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.ResultObjects; @@ -194,14 +195,14 @@ namespace WebsitePanel.EnterpriseServer string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes, string externalEmail, string subscriberNumber) + string webPage, string notes, string externalEmail, string subscriberNumber, int levelId, bool isVIP) { return OrganizationController.SetUserGeneralSettings(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, - webPage, notes, externalEmail, subscriberNumber); + webPage, notes, externalEmail, subscriberNumber, levelId, isVIP); } @@ -335,5 +336,39 @@ namespace WebsitePanel.EnterpriseServer #endregion + #region Service Levels + + [WebMethod] + public ServiceLevel[] GetSupportServiceLevels() + { + return OrganizationController.GetSupportServiceLevels(); + } + + [WebMethod] + public void UpdateSupportServiceLevel(int levelID, string levelName, string levelDescription) + { + OrganizationController.UpdateSupportServiceLevel(levelID, levelName, levelDescription); + } + + [WebMethod] + public ResultObject DeleteSupportServiceLevel(int levelId) + { + return OrganizationController.DeleteSupportServiceLevel(levelId); + } + + [WebMethod] + public int AddSupportServiceLevel(string levelName, string levelDescription) + { + return OrganizationController.AddSupportServiceLevel(levelName, levelDescription); + } + + [WebMethod] + public ServiceLevel GetSupportServiceLevel(int levelID) + { + return OrganizationController.GetSupportServiceLevel(levelID); + } + + #endregion + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs index ebcf44fa..f051a824 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs @@ -51,6 +51,8 @@ namespace WebsitePanel.Providers.HostedSolution string publicFolderPermission; string userPrincipalName; string notes; + int levelId; + bool isVip; public int AccountId { @@ -177,6 +179,20 @@ namespace WebsitePanel.Providers.HostedSolution set { this.enableArchiving = value; } } - + public bool IsVIP + { + get { return this.isVip; } + set { this.isVip = value; } + } + + public int LevelId + { + get { return this.levelId; } + set { this.levelId = value; } + } + + public bool Disabled { get; set; } + + public bool Locked { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs index 8c474b99..a98ba23d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs @@ -77,6 +77,8 @@ namespace WebsitePanel.Providers.HostedSolution private OrganizationUser manager; private Guid crmUserId; + private int levelId; + private bool isVip; public Guid CrmUserId { @@ -313,5 +315,17 @@ namespace WebsitePanel.Providers.HostedSolution } + public int LevelId + { + get { return levelId; } + set { levelId = value; } + } + + public bool IsVIP + { + get { return isVip; } + set { isVip = value; } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index 1976376c..72400db0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -3219,7 +3219,7 @@ Invalid recoverable items quota specified, should be greater or equal to 6144MB - + Calculate organization disk space @@ -5572,4 +5572,16 @@ Tasks + + Service Levels + + + Service Level with this name is already exists + + + Delete Service Level Error + + + Unable to remove Service Level because it is being used + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsServiceLevels.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsServiceLevels.ascx.resx new file mode 100644 index 00000000..e7b3fd67 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsServiceLevels.ascx.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add New + + + No service levels have been added yet. To add a new service level set params and click "Add New" button. + + + Please enter service level name + + + * + + + Update + + + Description: + + + Name: + + + Service Level + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserAccountPolicySettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserAccountPolicySettings.ascx.resx index 88e2ac28..69f57eb1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserAccountPolicySettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserAccountPolicySettings.ascx.resx @@ -150,4 +150,7 @@ WEB Policy + + Service Levels + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx index 6b4a1ba2..89372cb3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx @@ -177,4 +177,7 @@ Archiving Mailboxes + + Service Level + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx index fb511e76..b21e975e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx @@ -246,4 +246,13 @@ Update Services + + Service Level: + + + VIP: + + + Service Level Information + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx index 69a7581f..8be5e282 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx @@ -180,4 +180,7 @@ Login + + Service Level + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs index d0d54618..b91a1f73 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs @@ -213,7 +213,9 @@ namespace WebsitePanel.Portal.ExchangeServer null, null, user.ExternalEmail, - txtSubscriberNumber.Text); + txtSubscriberNumber.Text, + 0, + false); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx index c9738e64..9425e414 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx @@ -52,10 +52,16 @@ OnRowCommand="gvMailboxes_RowCommand" AllowPaging="True" AllowSorting="True" DataSourceID="odsAccountsPaged" PageSize="20"> + + + + + - + - + + <%# Eval("DisplayName") %> @@ -63,7 +69,7 @@ - + @@ -71,6 +77,14 @@ + + + + + <%# GetServiceLevel((int)Eval("LevelId")).LevelName%> + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs index 76a277a7..4764dd12 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs @@ -27,9 +27,11 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Linq; using System.Web.UI.WebControls; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.EnterpriseServer; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; namespace WebsitePanel.Portal.ExchangeServer { @@ -43,6 +45,8 @@ namespace WebsitePanel.Portal.ExchangeServer } } + private ServiceLevel[] ServiceLevels; + protected void Page_Load(object sender, EventArgs e) { locTitle.Text = ArchivingBoxes ? GetLocalizedString("locTitleArchiving.Text") : GetLocalizedString("locTitle.Text"); @@ -54,14 +58,23 @@ namespace WebsitePanel.Portal.ExchangeServer BindStats(); } + BindServiceLevels(); + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) { - gvMailboxes.Columns[3].Visible = false; + gvMailboxes.Columns[4].Visible = false; } } + + gvMailboxes.Columns[3].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); + } + + private void BindServiceLevels() + { + ServiceLevels = ES.Services.Organizations.GetSupportServiceLevels(); } private void BindStats() @@ -96,7 +109,7 @@ namespace WebsitePanel.Portal.ExchangeServer } } - public string GetAccountImage(int accountTypeId) + public string GetAccountImage(int accountTypeId, bool vip) { ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; string imgName = "mailbox_16.gif"; @@ -109,6 +122,21 @@ namespace WebsitePanel.Portal.ExchangeServer else if (accountType == ExchangeAccountType.Equipment) imgName = "equipment_16.gif"; + if (vip) imgName = "admin_16.png"; + + return GetThemedImage("Exchange/" + imgName); + } + + public string GetStateImage(bool locked, bool disabled) + { + string imgName = "enabled.png"; + + if (locked) + imgName = "locked.png"; + else + if (disabled) + imgName = "disabled.png"; + return GetThemedImage("Exchange/" + imgName); } @@ -166,5 +194,10 @@ namespace WebsitePanel.Portal.ExchangeServer { e.InputParameters["archiving"] = ArchivingBoxes; } + + public ServiceLevel GetServiceLevel(int levelId) + { + return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.designer.cs index a201e1c7..e9cf4b0a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2014, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs index a5b3832c..8550eab8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs @@ -167,7 +167,9 @@ namespace WebsitePanel.Portal.HostedSolution null, null, user.ExternalEmail, - txtSubscriberNumber.Text); + txtSubscriberNumber.Text, + 0, + false); } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx index c8c61523..44df243e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx @@ -117,12 +117,34 @@ - + + + + + + + + + + + + + + +
+ +
+ +
+
+ + @@ -207,6 +229,7 @@ +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index 18a5440b..b8c6c70c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -27,8 +27,11 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Collections.Generic; +using System.Linq; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.ResultObjects; @@ -40,6 +43,8 @@ namespace WebsitePanel.Portal.HostedSolution { if (!IsPostBack) { + BindServiceLevels(); + BindSettings(); MailboxTabsId.Visible = (PanelRequest.Context == "Mailbox"); @@ -81,6 +86,18 @@ namespace WebsitePanel.Portal.HostedSolution txtInitials.Text = user.Initials; txtLastName.Text = user.LastName; + if (user.LevelId > 0 && secServiceLevels.Visible) + { + ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); + + if (ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) == null) + ddlServiceLevels.Items.Add(new ListItem(serviceLevel.LevelName, serviceLevel.LevelId.ToString())); + + ddlServiceLevels.Items.FindByValue(string.Empty).Selected = false; + ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()).Selected = true; + } + chkVIP.Checked = user.IsVIP && secServiceLevels.Visible; + txtJobTitle.Text = user.JobTitle; txtCompany.Text = user.Company; txtDepartment.Text = user.Department; @@ -196,6 +213,51 @@ namespace WebsitePanel.Portal.HostedSolution } } + private void BindServiceLevels() + { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + if (cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) + { + List enabledServiceLevels = new List(); + + foreach (var quota in cntx.Quotas.Where(x => x.Key.Contains(Quotas.SERVICE_LEVELS))) + { + foreach (var serviceLevel in ES.Services.Organizations.GetSupportServiceLevels()) + { + if (quota.Key.Replace(Quotas.SERVICE_LEVELS, "") == serviceLevel.LevelName && CheckServiceLevelQuota(quota.Value, serviceLevel.LevelId)) + { + enabledServiceLevels.Add(serviceLevel); + } + } + } + + ddlServiceLevels.DataSource = enabledServiceLevels; + ddlServiceLevels.DataTextField = "LevelName"; + ddlServiceLevels.DataValueField = "LevelId"; + ddlServiceLevels.DataBind(); + + ddlServiceLevels.Items.Insert(0, new ListItem("
+ + + + + + + + +
+ + + + +
+ + +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.cs new file mode 100644 index 00000000..d353f97f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.cs @@ -0,0 +1,176 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +using System; +using System.IO; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Xml; +using System.Xml.Serialization; + +using System.Collections.Generic; +using System.Collections.ObjectModel; + +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using WebsitePanel.EnterpriseServer; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal +{ + public partial class SettingsServiceLevels : WebsitePanelControlBase, IUserSettingsEditorControl + { + + + public void BindSettings(UserSettings settings) + { + if (PanelSecurity.SelectedUser.Role == UserRole.Administrator) + BindServiceLevels(); + + txtStatus.Visible = false; + } + + + private void BindServiceLevels() + { + ServiceLevel[] array = ES.Services.Organizations.GetSupportServiceLevels(); + + gvServiceLevels.DataSource = array; + gvServiceLevels.DataBind(); + + btnAddServiceLevel.Enabled = (string.IsNullOrEmpty(txtServiceLevelName.Text)) ? true : false; + btnUpdateServiceLevel.Enabled = (string.IsNullOrEmpty(txtServiceLevelName.Text)) ? false : true; + } + + + public void btnAddServiceLevel_Click(object sender, EventArgs e) + { + Page.Validate("CreateServiceLevel"); + + if (!Page.IsValid) + return; + + ServiceLevel serviceLevel = new ServiceLevel(); + + int res = ES.Services.Organizations.AddSupportServiceLevel(txtServiceLevelName.Text, txtServiceLevelDescr.Text); + + if (res < 0) + { + messageBox.ShowErrorMessage("ADD_SERVICE_LEVEL"); + + return; + } + + txtServiceLevelName.Text = string.Empty; + txtServiceLevelDescr.Text = string.Empty; + + BindServiceLevels(); + } + + + protected void gvServiceLevels_RowCommand(object sender, GridViewCommandEventArgs e) + { + int levelID = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + switch (e.CommandName) + { + case "DeleteItem": + + ResultObject result = ES.Services.Organizations.DeleteSupportServiceLevel(levelID); + + if (!result.IsSuccess) + { + if (result.ErrorCodes.Contains("SERVICE_LEVEL_IN_USE:Service Level is being used; ")) messageBox.ShowErrorMessage("SERVICE_LEVEL_IN_USE"); + else messageBox.ShowMessage(result, "DELETE_SERVICE_LEVEL", null); + + return; + } + + ViewState["ServiceLevelID"] = null; + + txtServiceLevelName.Text = string.Empty; + txtServiceLevelDescr.Text = string.Empty; + + BindServiceLevels(); + break; + + case "EditItem": + ServiceLevel serviceLevel; + + ViewState["ServiceLevelID"] = levelID; + + serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(levelID); + + txtServiceLevelName.Text = serviceLevel.LevelName; + txtServiceLevelDescr.Text = serviceLevel.LevelDescription; + + btnUpdateServiceLevel.Enabled = (string.IsNullOrEmpty(txtServiceLevelName.Text)) ? false : true; + btnAddServiceLevel.Enabled = (string.IsNullOrEmpty(txtServiceLevelName.Text)) ? true : false; + break; + } + } + + + public void SaveSettings(UserSettings settings) + { + settings["ServiceLevels"] = ""; + } + + + protected void btnUpdateServiceLevel_Click(object sender, EventArgs e) + { + Page.Validate("CreateServiceLevel"); + + if (!Page.IsValid) + return; + + if (ViewState["ServiceLevelID"] == null) + return; + + int levelID = (int)ViewState["ServiceLevelID"]; + + ES.Services.Organizations.UpdateSupportServiceLevel(levelID, txtServiceLevelName.Text, txtServiceLevelDescr.Text); + + txtServiceLevelName.Text = string.Empty; + txtServiceLevelDescr.Text = string.Empty; + + BindServiceLevels(); + } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.designer.cs new file mode 100644 index 00000000..ad3fe950 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.designer.cs @@ -0,0 +1,132 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class SettingsServiceLevels { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// gvServiceLevels control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvServiceLevels; + + /// + /// secServiceLevel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secServiceLevel; + + /// + /// ServiceLevel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ServiceLevel; + + /// + /// lblServiceLevelName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblServiceLevelName; + + /// + /// txtServiceLevelName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtServiceLevelName; + + /// + /// valRequireServiceLevelName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireServiceLevelName; + + /// + /// lblServiceLevelDescr control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblServiceLevelDescr; + + /// + /// txtServiceLevelDescr control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtServiceLevelDescr; + + /// + /// btnAddServiceLevel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddServiceLevel; + + /// + /// btnUpdateServiceLevel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdateServiceLevel; + + /// + /// txtStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtStatus; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotasControl.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotasControl.ascx index dd82036b..2c94c5ff 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotasControl.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotasControl.ascx @@ -13,7 +13,7 @@
- <%# GetSharedLocalizedString("Quota." + (string)Eval("QuotaName"))%>: + <%# GetQuotaTitle((string)Eval("QuotaName"), (string)Eval("QuotaDescription"))%>:
// This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx index 4027111c..1ea55968 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx @@ -5,6 +5,10 @@ +
  • + +
  • diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx.designer.cs index 90082428..52a6d8b6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx.designer.cs @@ -1,32 +1,3 @@ -// Copyright (c) 2014, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -50,6 +21,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.HyperLink lnkWebsitePanelPolicy; + /// + /// lnkServiceLevels control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkServiceLevels; + /// /// lnkWebPolicy control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 3097e2bc..62d05d26 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -210,6 +210,13 @@ + + SettingsServiceLevels.ascx + ASPXCodeBehind + + + SettingsServiceLevels.ascx + CRMStorageSettings.ascx ASPXCodeBehind @@ -4138,6 +4145,7 @@ + @@ -5421,6 +5429,7 @@ + Designer From 323e6d7ad6b29bc18cc9b3c231ba6d3ce2b2272b Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Fri, 12 Sep 2014 13:40:19 +0400 Subject: [PATCH 02/28] fix MsDns2012 NS record bug --- .../DnsCommands.cs | 18 ++++++++++++++++++ .../MsDNS.cs | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.DNS.MsDNS2012/DnsCommands.cs b/WebsitePanel/Sources/WebsitePanel.Providers.DNS.MsDNS2012/DnsCommands.cs index 531895a9..61661007 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.DNS.MsDNS2012/DnsCommands.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.DNS.MsDNS2012/DnsCommands.cs @@ -365,7 +365,25 @@ namespace WebsitePanel.Providers.DNS cmd.addParam( "Force" ); ps.RunPipeline( cmd ); } + + public static void Remove_DnsServerResourceRecords(this PowerShellHelper ps, string zoneName, string type) + { + var cmd = new Command("Get-DnsServerResourceRecord"); + cmd.addParam("ZoneName", zoneName); + cmd.addParam("RRType", type); + Collection resourceRecords = ps.RunPipeline(cmd); + foreach (PSObject resourceRecord in resourceRecords) + { + cmd = new Command("Remove-DnsServerResourceRecord"); + cmd.addParam("ZoneName", zoneName); + cmd.addParam("InputObject", resourceRecord); + + cmd.addParam("Force"); + ps.RunPipeline(cmd); + } + } + public static void Update_DnsServerResourceRecordSOA(this PowerShellHelper ps, string zoneName, TimeSpan ExpireLimit, TimeSpan MinimumTimeToLive, string PrimaryServer, TimeSpan RefreshInterval, string ResponsiblePerson, TimeSpan RetryDelay, diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.DNS.MsDNS2012/MsDNS.cs b/WebsitePanel/Sources/WebsitePanel.Providers.DNS.MsDNS2012/MsDNS.cs index 27f99a07..153f7f58 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.DNS.MsDNS2012/MsDNS.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.DNS.MsDNS2012/MsDNS.cs @@ -98,12 +98,18 @@ namespace WebsitePanel.Providers.DNS public virtual void AddPrimaryZone( string zoneName, string[] secondaryServers ) { ps.Add_DnsServerPrimaryZone( zoneName, secondaryServers ); + + // remove ns records + ps.Remove_DnsServerResourceRecords(zoneName, "NS"); } public virtual void AddSecondaryZone( string zoneName, string[] masterServers ) { ps.Add_DnsServerSecondaryZone( zoneName, masterServers ); - } + + // remove ns records + ps.Remove_DnsServerResourceRecords(zoneName, "NS"); + } public virtual void DeleteZone( string zoneName ) { From bc46549393342bad83533abe42b46583af296bd3 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 12 Sep 2014 17:44:58 +0300 Subject: [PATCH 03/28] service levels fixes. --- WebsitePanel/Database/update_db.sql | 14 ++++---- .../ExchangeImport.cs | 4 +-- .../Default/Images/Exchange/vip_user_16.png | Bin 0 -> 353 bytes .../ExchangeServer/ExchangeMailboxes.ascx | 1 - .../ExchangeServer/ExchangeMailboxes.ascx.cs | 22 +++++++++++-- .../OrganizationUserGeneralSettings.ascx.cs | 30 ++++++++++++------ .../ExchangeServer/OrganizationUsers.ascx | 1 - .../ExchangeServer/OrganizationUsers.ascx.cs | 21 ++++++++++-- 8 files changed, 66 insertions(+), 27 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/vip_user_16.png diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 80899c0a..796722b9 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -4523,6 +4523,12 @@ CREATE TABLE SupportServiceLevels ) GO +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='LevelID') +ALTER TABLE [dbo].[ExchangeAccounts] ADD + [LevelID] [int] NULL, + [IsVIP] [bit] NOT NULL DEFAULT 0 +GO + IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetSupportServiceLevels') DROP PROCEDURE GetSupportServiceLevels GO @@ -4707,13 +4713,7 @@ END RETURN GO -IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='LevelID') -BEGIN -ALTER TABLE [dbo].[ExchangeAccounts] ADD - [LevelID] [int] NULL, - [IsVIP] [bit] NOT NULL DEFAULT 0 -END -GO + IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type IN ('FN', 'IF', 'TF') AND name = 'GetPackageServiceLevelResource') DROP FUNCTION GetPackageServiceLevelResource diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.CsvBulk/ExchangeImport.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.CsvBulk/ExchangeImport.cs index 35b5a7cb..4988105d 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.CsvBulk/ExchangeImport.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.CsvBulk/ExchangeImport.cs @@ -618,7 +618,7 @@ namespace WebsitePanel.Import.CsvBulk mailbox.JobTitle, mailbox.Company, mailbox.Department, mailbox.Office, null, mailbox.BusinessPhone, mailbox.Fax, mailbox.HomePhone, mailbox.MobilePhone, mailbox.Pager, mailbox.WebPage, mailbox.Notes, // these are new and not in csv ... - mailbox.ExternalEmail, mailbox.SubscriberNumber); + mailbox.ExternalEmail, mailbox.SubscriberNumber,mailbox.LevelId, mailbox.IsVIP); ret = true; } catch (Exception ex) @@ -762,7 +762,7 @@ namespace WebsitePanel.Import.CsvBulk null, false, user.Disabled, user.Locked, user.FirstName, user.Initials, user.LastName, user.Address, user.City, user.State, user.Zip, user.Country, user.JobTitle, user.Company, user.Department, user.Office, null, user.BusinessPhone, - user.Fax, user.HomePhone, user.MobilePhone, user.Pager, user.WebPage, user.Notes, user.ExternalEmail, user.SubscriberNumber); + user.Fax, user.HomePhone, user.MobilePhone, user.Pager, user.WebPage, user.Notes, user.ExternalEmail, user.SubscriberNumber, user.LevelId, user.IsVIP); ret = true; } catch (Exception ex) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/vip_user_16.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/vip_user_16.png new file mode 100644 index 0000000000000000000000000000000000000000..e470ca6ed0fb1f9e18d9adfa0eb894d7c7f553a1 GIT binary patch literal 353 zcmV-n0iOPeP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0QN~lK~y+Ty_B&L zgdh+_Da8^j!N3A2!OYYSOvxz0jMNfL$SuL40!!GN&mA0dAYkDAnVoT9eSCIT89gNS z5SK2&^E^}Awl$>LQT9v^~(^#Mrp0SpaQ6u$z zAH--6h#c?x?%jrj+#rvKK9&AO76X5 zTpu4sNyrK7f0ggSxGqMjCTi;a|DRB)B&GcqkfI9+xR9>U00000NkvXXu0mjfCIgJv literal 0 HcmV?d00001 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx index 9425e414..ee7a1c81 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx @@ -61,7 +61,6 @@ - <%# Eval("DisplayName") %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs index 4764dd12..6473cd61 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs @@ -45,6 +45,8 @@ namespace WebsitePanel.Portal.ExchangeServer } } + private PackageContext cntx; + private ServiceLevel[] ServiceLevels; protected void Page_Load(object sender, EventArgs e) @@ -60,7 +62,7 @@ namespace WebsitePanel.Portal.ExchangeServer BindServiceLevels(); - PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) @@ -122,7 +124,7 @@ namespace WebsitePanel.Portal.ExchangeServer else if (accountType == ExchangeAccountType.Equipment) imgName = "equipment_16.gif"; - if (vip) imgName = "admin_16.png"; + if (vip && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) imgName = "vip_user_16.png"; return GetThemedImage("Exchange/" + imgName); } @@ -197,7 +199,21 @@ namespace WebsitePanel.Portal.ExchangeServer public ServiceLevel GetServiceLevel(int levelId) { - return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); + ServiceLevel serviceLevel = ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); + + bool enable = !string.IsNullOrEmpty(serviceLevel.LevelName); + + enable = enable ? cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName) : false; + enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : false; + + if (!enable) + { + serviceLevel.LevelName = ""; + serviceLevel.LevelDescription = ""; + } + + //return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); + return serviceLevel; } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index b8c6c70c..1c04de23 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -86,17 +86,7 @@ namespace WebsitePanel.Portal.HostedSolution txtInitials.Text = user.Initials; txtLastName.Text = user.LastName; - if (user.LevelId > 0 && secServiceLevels.Visible) - { - ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); - if (ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) == null) - ddlServiceLevels.Items.Add(new ListItem(serviceLevel.LevelName, serviceLevel.LevelId.ToString())); - - ddlServiceLevels.Items.FindByValue(string.Empty).Selected = false; - ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()).Selected = true; - } - chkVIP.Checked = user.IsVIP && secServiceLevels.Visible; txtJobTitle.Text = user.JobTitle; txtCompany.Text = user.Company; @@ -136,6 +126,26 @@ namespace WebsitePanel.Portal.HostedSolution } } + if (user.LevelId > 0 && secServiceLevels.Visible) + { + ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); + + bool addLevel = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) == null; + + addLevel = addLevel && cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName); + + addLevel = addLevel ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : addLevel; + + if (addLevel) + { + ddlServiceLevels.Items.Add(new ListItem(serviceLevel.LevelName, serviceLevel.LevelId.ToString())); + + ddlServiceLevels.Items.FindByValue(string.Empty).Selected = false; + ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()).Selected = true; + } + } + chkVIP.Checked = user.IsVIP && secServiceLevels.Visible; + if (cntx.Quotas.ContainsKey(Quotas.ORGANIZATION_ALLOWCHANGEUPN)) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx index ea25b612..6b8ba886 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx @@ -62,7 +62,6 @@ - <%# Eval("DisplayName") %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs index 9ed6f6d7..ffe51701 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs @@ -39,6 +39,7 @@ namespace WebsitePanel.Portal.HostedSolution public partial class OrganizationUsers : WebsitePanelModuleBase { private ServiceLevel[] ServiceLevels; + private PackageContext cntx; protected void Page_Load(object sender, EventArgs e) { @@ -49,7 +50,7 @@ namespace WebsitePanel.Portal.HostedSolution BindServiceLevels(); - PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) @@ -191,7 +192,7 @@ namespace WebsitePanel.Portal.HostedSolution imgName = "admin_16.png"; break; } - if (vip) imgName = "admin_16.png"; + if (vip && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) imgName = "vip_user_16.png"; return GetThemedImage("Exchange/" + imgName); } @@ -311,7 +312,21 @@ namespace WebsitePanel.Portal.HostedSolution public ServiceLevel GetServiceLevel(int levelId) { - return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); + ServiceLevel serviceLevel = ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); + + bool enable = !string.IsNullOrEmpty(serviceLevel.LevelName); + + enable = enable ? cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName) : false; + enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : false; + + if (!enable) + { + serviceLevel.LevelName = ""; + serviceLevel.LevelDescription = ""; + } + + //return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); + return serviceLevel; } } } \ No newline at end of file From b9ef026b7e986b7726e08c11b2acdc02ebff17cb Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Sun, 14 Sep 2014 00:48:32 +0400 Subject: [PATCH 04/28] New Button "Save Changes and Exit" in User Edit and Mailbox Edit --- .../ExchangeMailboxGeneralSettings.ascx | 2 + .../ExchangeMailboxGeneralSettings.ascx.cs | 10 +++++ ...ngeMailboxGeneralSettings.ascx.designer.cs | 9 +++++ .../ExchangeMailboxMailFlowSettings.ascx | 4 +- .../ExchangeMailboxMailFlowSettings.ascx.cs | 10 +++++ ...geMailboxMailFlowSettings.ascx.designer.cs | 37 +++++-------------- .../ExchangeMailboxMemberOf.ascx | 2 + .../ExchangeMailboxMemberOf.ascx.cs | 10 +++++ .../ExchangeMailboxMemberOf.ascx.designer.cs | 37 +++++-------------- .../ExchangeMailboxPermissions.ascx | 2 + .../ExchangeMailboxPermissions.ascx.cs | 10 +++++ ...xchangeMailboxPermissions.ascx.designer.cs | 37 +++++-------------- .../OrganizationUserGeneralSettings.ascx | 2 + .../OrganizationUserGeneralSettings.ascx.cs | 9 +++++ ...zationUserGeneralSettings.ascx.designer.cs | 9 +++++ .../OrganizationUserMemberOf.ascx | 2 + .../OrganizationUserMemberOf.ascx.cs | 8 ++++ .../OrganizationUserMemberOf.ascx.designer.cs | 37 +++++-------------- 18 files changed, 124 insertions(+), 113 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx index 40324a81..225d2f8d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx @@ -157,6 +157,8 @@
    +
  • diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs index ed3b6b9c..b1b1b90d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs @@ -233,6 +233,16 @@ namespace WebsitePanel.Portal.ExchangeServer SaveSettings(); } + protected void btnSaveExit_Click(object sender, EventArgs e) + { + SaveSettings(); + + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + "mailboxes", + "SpaceID=" + PanelSecurity.PackageId)); + } + + protected void chkPmmAllowed_CheckedChanged(object sender, EventArgs e) { try diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs index 8f80245b..d1b0530d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs @@ -372,6 +372,15 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Button btnSave; + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; + /// /// ValidationSummary1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx index 31dc8d09..ed7b7c73 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx @@ -36,7 +36,7 @@ - @@ -111,6 +111,8 @@
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.cs index d5a78082..51c04f98 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.cs @@ -128,6 +128,16 @@ namespace WebsitePanel.Portal.ExchangeServer SaveSettings(); } + protected void btnSaveExit_Click(object sender, EventArgs e) + { + SaveSettings(); + + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + "mailboxes", + "SpaceID=" + PanelSecurity.PackageId)); + } + + private void ToggleControls() { ForwardSettingsPanel.Visible = chkEnabledForwarding.Checked; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.designer.cs index e9649987..1ed59e75 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2014, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -283,6 +255,15 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Button btnSave; + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; + /// /// ValidationSummary1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx index ceb36b27..452914dc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx @@ -45,6 +45,8 @@
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.cs index af828967..02c5735b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.cs @@ -185,5 +185,15 @@ namespace WebsitePanel.Portal.ExchangeServer { SaveSettings(); } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + SaveSettings(); + + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + "mailboxes", + "SpaceID=" + PanelSecurity.PackageId)); + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.designer.cs index f7ac12f4..03c07ca6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2014, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -139,6 +111,15 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Button btnSave; + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; + /// /// ValidationSummary1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx index 8efd9907..b296eac7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx @@ -45,6 +45,8 @@
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.cs index 7e03f6a8..171f26cd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.cs @@ -47,6 +47,16 @@ namespace WebsitePanel.Portal.ExchangeServer SavePermissions(); } + protected void btnSaveExit_Click(object sender, EventArgs e) + { + SavePermissions(); + + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + "mailboxes", + "SpaceID=" + PanelSecurity.PackageId)); + } + + private void BindPermissions() { try diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.designer.cs index 2173fca8..0c1e2494 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2014, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -174,5 +146,14 @@ namespace WebsitePanel.Portal.ExchangeServer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnSave; + + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx index 44df243e..626b45c7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx @@ -283,6 +283,8 @@
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index 1c04de23..27a541d6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -335,6 +335,15 @@ namespace WebsitePanel.Portal.HostedSolution SaveSettings(); } + protected void btnSaveExit_Click(object sender, EventArgs e) + { + SaveSettings(); + + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + (PanelRequest.Context == "Mailbox") ? "mailboxes" : "users", + "SpaceID=" + PanelSecurity.PackageId)); + } + protected void btnSetUserPrincipalName_Click(object sender, EventArgs e) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs index 4234f309..a68bb55e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs @@ -759,6 +759,15 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::System.Web.UI.WebControls.Button btnSave; + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; + /// /// ValidationSummary1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx index b4fcb4bc..a92bde4a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx @@ -56,6 +56,8 @@
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs index e4c5ed2f..6d12b63e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs @@ -208,6 +208,14 @@ namespace WebsitePanel.Portal.HostedSolution SaveSettings(); } + protected void btnSaveExit_Click(object sender, EventArgs e) + { + SaveSettings(); + + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + (PanelRequest.Context == "Mailbox") ? "mailboxes" : "users", + "SpaceID=" + PanelSecurity.PackageId)); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs index 873be80f..89567bb0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2014, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -148,6 +120,15 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::System.Web.UI.WebControls.Button btnSave; + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; + /// /// ValidationSummary1 control. /// From c15aff08b09673d2c723809a1e8db0d51d5b0429 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Mon, 15 Sep 2014 17:28:42 +0300 Subject: [PATCH 05/28] Change vip user icon, resize fields and change title in service levels policy page. --- .../Default/Images/Exchange/vip_user_16.png | Bin 353 -> 1128 bytes .../WebsitePanel/SettingsServiceLevels.ascx | 9 +++++---- .../WebsitePanel/SettingsServiceLevels.ascx.cs | 7 +++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/vip_user_16.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/vip_user_16.png index e470ca6ed0fb1f9e18d9adfa0eb894d7c7f553a1..05fb2d5d30ba3956eea1ba712d6d9196d4ead6b6 100644 GIT binary patch literal 1128 zcmaJ=TSyd97#>sXs#rl65t^pxA>6s_s_RZ}rZc-W(U`3ZE^tCr_X z$)7?HM2@sVjNv`cTa&W!f8OVx3f|_TNCMTs29#86KvZb39*~luG=dmVwAPISpo}0g zNj;uG33(N-LW5R34DA{gW)nnNxoatEGeBfLXw=Ox_2K*_iqy3*Ra-2xvL%2feMOrM zYTByeYFo1!(x~#KWSPrj0Rtd~bd3$B!@FT>RF}tR&&*KdC z)~B*1ELpK1pmSY*#&v1Sp7vuweo@L3gkHX$;t$~k;(J^267N(jIvUr9` zCX;kBKtsEc;Xipg5t)L_yXMawcTnGRA+6-Z*3!hBlSH9isva1l=M2L!Q{ z<03_+LNp+7L2MJF{>sWwiYr33#Q-KsakW3(Kw7Rh2!@3{i@?@50WE4ngB(qm*VD(s zrqvtcYUyL)(sCIb4CA%+uQsPlcy_$w_|W3Z_}Bvz&$^9=y76kBtOtzxkeLomox4>$~**#;FsX z_t#6t4}B4JXV2_c1CL&xD?Qo!c24Hq<8N-d%Z6_EKFsQPqQ0LqJDNF(t2o(J*|2$S z-AH0&*N%NNzlvM>KOSg5*7L6KRzcs|9aZv?&in^*$?j>{?d6^8cDD@gk(RBw_+k1H zPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0QN~lK~y+Ty_B&L zgdh+_Da8^j!N3A2!OYYSOvxz0jMNfL$SuL40!!GN&mA0dAYkDAnVoT9eSCIT89gNS z5SK2&^E^}Awl$>LQT9v^~(^#Mrp0SpaQ6u$z zAH--6h#c?x?%jrj+#rvKK9&AO76X5 zTpu4sNyrK7f0ggSxGqMjCTi;a|DRB)B&GcqkfI9+xR9>U00000NkvXXu0mjfCIgJv diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx index ddf3f04f..a7b5d67b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx @@ -46,8 +46,8 @@
    - @@ -56,8 +56,9 @@ - +
    +
    - + + - + +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.cs index d353f97f..be77f5e9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsServiceLevels.ascx.cs @@ -63,6 +63,13 @@ namespace WebsitePanel.Portal BindServiceLevels(); txtStatus.Visible = false; + + try + { + //Change container title + ((Label)this.Parent.Parent.Parent.Parent.Parent.FindControl(WebsitePanel.WebPortal.DefaultPage.MODULE_TITLE_CONTROL_ID)).Text = "Service Levels"; + } + catch { /*to do*/ } } From b8b62f71347db08fbbe2e17fe1df0f87453aa6de Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 15 Sep 2014 20:51:29 -0400 Subject: [PATCH 06/28] Added tag build-2.1.0.419 for changeset f50d982ab8c2 From 732f827e827c114b776890fbb01371fa900cb63f Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 16 Sep 2014 12:37:59 +0300 Subject: [PATCH 07/28] fix bug in SpaceQuotasControl. --- .../DesktopModules/WebsitePanel/SpaceQuotasControl.ascx | 2 +- .../WebsitePanel/SpaceQuotasControl.ascx.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotasControl.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotasControl.ascx index 2c94c5ff..004c1c4a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotasControl.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotasControl.ascx @@ -13,7 +13,7 @@
    - <%# GetQuotaTitle((string)Eval("QuotaName"), (string)Eval("QuotaDescription"))%>: + <%# GetQuotaTitle((string)Eval("QuotaName"), (object)Eval("QuotaDescription"))%>:
    Date: Tue, 16 Sep 2014 16:02:32 +0300 Subject: [PATCH 08/28] fix issue with "Service Level" DropDownList on UserGeneralSetings page. --- .../WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs | 3 +-- .../ExchangeServer/OrganizationUserGeneralSettings.ascx.cs | 7 ++++++- .../WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs index 6473cd61..b3fa7da7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs @@ -204,7 +204,7 @@ namespace WebsitePanel.Portal.ExchangeServer bool enable = !string.IsNullOrEmpty(serviceLevel.LevelName); enable = enable ? cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName) : false; - enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : false; + enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue != 0 : false; if (!enable) { @@ -212,7 +212,6 @@ namespace WebsitePanel.Portal.ExchangeServer serviceLevel.LevelDescription = ""; } - //return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); return serviceLevel; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index 27a541d6..7fe1cae5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -134,12 +134,17 @@ namespace WebsitePanel.Portal.HostedSolution addLevel = addLevel && cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName); - addLevel = addLevel ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : addLevel; + addLevel = addLevel ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue != 0 : addLevel; if (addLevel) { ddlServiceLevels.Items.Add(new ListItem(serviceLevel.LevelName, serviceLevel.LevelId.ToString())); + } + bool levelInDDL = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) != null; + + if (levelInDDL) + { ddlServiceLevels.Items.FindByValue(string.Empty).Selected = false; ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()).Selected = true; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs index ffe51701..1d9941bb 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs @@ -317,7 +317,7 @@ namespace WebsitePanel.Portal.HostedSolution bool enable = !string.IsNullOrEmpty(serviceLevel.LevelName); enable = enable ? cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName) : false; - enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : false; + enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue != 0 : false; if (!enable) { @@ -325,7 +325,6 @@ namespace WebsitePanel.Portal.HostedSolution serviceLevel.LevelDescription = ""; } - //return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); return serviceLevel; } } From 07dc31c51ecd1085a2305cbd34d9c67138160ec5 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 16 Sep 2014 12:05:46 -0400 Subject: [PATCH 09/28] Added tag build-2.1.0.420 for changeset ff475e68c6ec From 9b57f040b94cfb2483423a60d5d7ddd77d469400 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 19 Sep 2014 17:55:39 -0400 Subject: [PATCH 10/28] User Principal name should not update when changing primary email address. Comment out. --- .../Exchange2013.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs index 730de2fa..95cf2a6f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs @@ -2819,7 +2819,7 @@ namespace WebsitePanel.Providers.HostedSolution Command cmd = new Command("Set-Mailbox"); cmd.Parameters.Add("Identity", accountName); cmd.Parameters.Add("PrimarySmtpAddress", primaryEmail); - cmd.Parameters.Add("UserPrincipalName", primaryEmail); + //cmd.Parameters.Add("UserPrincipalName", primaryEmail); cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); ExecuteShellCommand(runSpace, cmd); From bc39c195767ae04515d186a62adf9543f9650669 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 19 Sep 2014 21:07:56 -0400 Subject: [PATCH 11/28] Protect UPN from Deletion when it's not the primary email address --- .../ExchangeServer/ExchangeServerController.cs | 3 +++ .../ExchangeServer/ExchangeMailboxEmailAddresses.ascx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index cd3cb5d5..025f4c50 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -1347,11 +1347,14 @@ namespace WebsitePanel.EnterpriseServer if (String.Compare(account.PrimaryEmailAddress, email.EmailAddress, true) == 0) { email.IsPrimary = true; + email.ProtectDelete = true; } if (String.Compare(account.UserPrincipalName, email.EmailAddress, true) == 0) { email.IsUserPrincipalName = true; + email.ProtectDelete = true; + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx index a71c2fa0..d056906f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx @@ -67,7 +67,7 @@ - + From e8b620107a60412d3fd030918620abbd06c5e745 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 19 Sep 2014 21:15:24 -0400 Subject: [PATCH 12/28] Revert Last Changeset --- .../ExchangeServer/ExchangeServerController.cs | 3 --- .../ExchangeServer/ExchangeMailboxEmailAddresses.ascx | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index 025f4c50..cd3cb5d5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -1347,14 +1347,11 @@ namespace WebsitePanel.EnterpriseServer if (String.Compare(account.PrimaryEmailAddress, email.EmailAddress, true) == 0) { email.IsPrimary = true; - email.ProtectDelete = true; } if (String.Compare(account.UserPrincipalName, email.EmailAddress, true) == 0) { email.IsUserPrincipalName = true; - email.ProtectDelete = true; - } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx index d056906f..a71c2fa0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx @@ -67,7 +67,7 @@ - + From bfa7a05944dc85fbd2fa702fde71a12026e6b15e Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 19 Sep 2014 21:27:24 -0400 Subject: [PATCH 13/28] Added tag build-2.1.0.424 for changeset 405d564d78e3 From 8994a8961186802025d77a8f56cec8a749c8871f Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Mon, 22 Sep 2014 14:40:58 +0400 Subject: [PATCH 14/28] CRM fix --- .../CRM/CRMOrganizationDetails.ascx | 1 + .../WebsitePanel/CRM/CRMStorageSettings.ascx | 12 ++++---- .../CRM/CRMStorageSettings.ascx.designer.cs | 28 ++++--------------- .../SkinControls/UserSpaceBreadcrumb.ascx.cs | 15 ++++++---- 4 files changed, 20 insertions(+), 36 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMOrganizationDetails.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMOrganizationDetails.ascx index 59a9ee9a..7506e532 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMOrganizationDetails.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMOrganizationDetails.ascx @@ -68,4 +68,5 @@
    + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMStorageSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMStorageSettings.ascx index abd05874..e8295116 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMStorageSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMStorageSettings.ascx @@ -16,20 +16,18 @@
    -
    - -
    - -
    +
    - - + +
    + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMStorageSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMStorageSettings.ascx.designer.cs index 8a2ab7c2..c4567469 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMStorageSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMStorageSettings.ascx.designer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2014, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -41,40 +41,22 @@ namespace WebsitePanel.Portal { public partial class CRMStorageSettings { /// - /// breadcrumb control. + /// Image2 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + protected global::System.Web.UI.WebControls.Image Image2; /// - /// menu control. + /// Localize1 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - - /// - /// Image1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image1; - - /// - /// locTitle control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locTitle; + protected global::System.Web.UI.WebControls.Localize Localize1; /// /// messageBox control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/UserSpaceBreadcrumb.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/UserSpaceBreadcrumb.ascx.cs index fd95d81b..fd3241e3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/UserSpaceBreadcrumb.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/UserSpaceBreadcrumb.ascx.cs @@ -142,13 +142,16 @@ namespace WebsitePanel.Portal.SkinControls ModuleControl control = null; if (!String.IsNullOrEmpty(ctrlKey) && definition.Controls.ContainsKey(ctrlKey)) control = definition.Controls[ctrlKey]; - - if (!String.IsNullOrEmpty(control.Src)) + + if (control != null) { - lnkOrgCurPage.Text = PortalUtils.GetLocalizedString(DM_FOLDER_VIRTUAL_PATH + control.Src, PAGE_NANE_KEY); - lnkOrgCurPage.NavigateUrl = PortalUtils.EditUrl( - "ItemID", PanelRequest.ItemID.ToString(), ctrlKey, - "SpaceID=" + PanelSecurity.PackageId.ToString()); + if (!String.IsNullOrEmpty(control.Src)) + { + lnkOrgCurPage.Text = PortalUtils.GetLocalizedString(DM_FOLDER_VIRTUAL_PATH + control.Src, PAGE_NANE_KEY); + lnkOrgCurPage.NavigateUrl = PortalUtils.EditUrl( + "ItemID", PanelRequest.ItemID.ToString(), ctrlKey, + "SpaceID=" + PanelSecurity.PackageId.ToString()); + } } } } From cf0092bc9f0be16990024f335c028f8f89b9a49b Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Mon, 22 Sep 2014 17:00:52 +0400 Subject: [PATCH 15/28] Exchange fix --- .../ExchangeMailboxGeneralSettings.ascx.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs index b1b1b90d..3559990d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs @@ -87,8 +87,16 @@ namespace WebsitePanel.Portal.ExchangeServer int.TryParse(mailboxPlanSelector.MailboxPlanId, out planId); ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, planId); - secArchiving.Visible = plan.EnableArchiving; - secLitigationHoldSettings.Visible = plan.AllowLitigationHold && Utils.CheckQouta(Quotas.EXCHANGE2007_ALLOWLITIGATIONHOLD, Cntx); + if (plan != null) + { + secArchiving.Visible = plan.EnableArchiving; + secLitigationHoldSettings.Visible = plan.AllowLitigationHold && Utils.CheckQouta(Quotas.EXCHANGE2007_ALLOWLITIGATIONHOLD, Cntx); + } + else + { + secArchiving.Visible = false; + secLitigationHoldSettings.Visible = false; + } } private void BindSettings() From 87638b08dd869d0787006675aa05ae8540c370e4 Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Mon, 22 Sep 2014 23:18:12 +0400 Subject: [PATCH 16/28] New Button "Save Changes and Exit" in Lync, Blackberry, CRM edit user --- .../BlackBerry/EditBlackBerryUser.ascx | 8 ++++- .../BlackBerry/EditBlackBerryUser.ascx.cs | 8 +++++ .../EditBlackBerryUser.ascx.designer.cs | 9 ++++++ .../WebsitePanel/CRM/CRMUserRoles.ascx | 5 ++- .../WebsitePanel/CRM/CRMUserRoles.ascx.cs | 24 ++++++++++++-- .../CRM/CRMUserRoles.ascx.designer.cs | 9 ++++++ .../WebsitePanel/Lync/LyncEditUser.ascx | 4 ++- .../WebsitePanel/Lync/LyncEditUser.ascx.cs | 31 ++++++++++++++++--- .../Lync/LyncEditUser.ascx.designer.cs | 9 ++++++ 9 files changed, 97 insertions(+), 10 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx index cf471fd5..a8656d0d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx @@ -79,7 +79,13 @@ -
    +
    + + +
    + +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx.cs index 75009c70..e2ebccb7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx.cs @@ -113,5 +113,13 @@ namespace WebsitePanel.Portal.BlackBerry messageBox.ShowWarningMessage(CANNOT_DELETE_BLACKBERRY_DATA); } } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + "blackberry_users", + "SpaceID=" + PanelSecurity.PackageId)); + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx.designer.cs index f5a8990f..0c2cd62b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BlackBerry/EditBlackBerryUser.ascx.designer.cs @@ -201,5 +201,14 @@ namespace WebsitePanel.Portal.BlackBerry { /// To modify move field declaration from designer file to code-behind file. ///
    protected global::System.Web.UI.WebControls.Button btnDeleteData; + + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx index c459e1e0..48e4eb9b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx @@ -74,7 +74,10 @@
    - + + +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx.cs index 42d8e322..3b0dce88 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx.cs @@ -111,7 +111,7 @@ namespace WebsitePanel.Portal.CRM } } - protected void btnUpdate_Click(object sender, EventArgs e) + protected bool SaveSettings() { try { @@ -143,13 +143,33 @@ namespace WebsitePanel.Portal.CRM messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM"); else messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM"); + + return res.IsSuccess && res2.IsSuccess; } - catch(Exception ex) + catch (Exception ex) { messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES", ex); + return false; + } + + } + + protected void btnUpdate_Click(object sender, EventArgs e) + { + SaveSettings(); + } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + if (SaveSettings()) + { + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + "CRMUsers", + "SpaceID=" + PanelSecurity.PackageId)); } } + private void ActivateUser() { ResultObject res = ES.Services.CRM.ChangeUserState(PanelRequest.ItemID, PanelRequest.AccountID, false); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx.designer.cs index daf2a410..5f239716 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/CRM/CRMUserRoles.ascx.designer.cs @@ -201,5 +201,14 @@ namespace WebsitePanel.Portal.CRM { /// To modify move field declaration from designer file to code-behind file. ///
    protected global::System.Web.UI.WebControls.Button btnUpdate; + + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx index 4fe26b8b..03bc7e38 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx @@ -76,8 +76,10 @@
    - +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs index 35caed3c..33301c5f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs @@ -120,10 +120,10 @@ namespace WebsitePanel.Portal.Lync Utils.SelectListItem(ddlPhoneNumber, lyncUser.LineUri); } - protected void btnSave_Click(object sender, EventArgs e) + protected bool SaveSettings() { if (!Page.IsValid) - return; + return false; try { PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); @@ -132,7 +132,7 @@ namespace WebsitePanel.Portal.Lync string lineUri = ""; if ((enterpriseVoiceQuota) & (ddlPhoneNumber.Items.Count != 0)) lineUri = ddlPhoneNumber.SelectedItem.Text + ":" + tbPin.Text; - LyncUserResult res = ES.Services.Lync.SetUserLyncPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(planSelector.planId)); + LyncUserResult res = ES.Services.Lync.SetUserLyncPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(planSelector.planId)); if (res.IsSuccess && res.ErrorCodes.Count == 0) { res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, lineUri); @@ -141,15 +141,36 @@ namespace WebsitePanel.Portal.Lync if (res.IsSuccess && res.ErrorCodes.Count == 0) { messageBox.ShowSuccessMessage("UPDATE_LYNC_USER"); - return; + return true; } else + { messageBox.ShowMessage(res, "UPDATE_LYNC_USER", "LYNC"); + return false; + } } - catch(Exception ex) + catch (Exception ex) { messageBox.ShowErrorMessage("UPDATE_LYNC_USER", ex); + return false; } } + + protected void btnSave_Click(object sender, EventArgs e) + { + SaveSettings(); + } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + if (SaveSettings()) + { + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + "lync_users", + "SpaceID=" + PanelSecurity.PackageId)); + } + } + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs index ab351ec6..b693419b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs @@ -201,5 +201,14 @@ namespace WebsitePanel.Portal.Lync { /// To modify move field declaration from designer file to code-behind file. ///
    protected global::System.Web.UI.WebControls.Button btnSave; + + /// + /// btnSaveExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveExit; } } From a99b5455cc29cd635e6121a9ffca603a07fff8dd Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 23 Sep 2014 08:54:02 -0400 Subject: [PATCH 17/28] Added tag build-2.1.0.425 for changeset e138869966a2 From b5444f10ec0f8f587124096f0c4ba9db9ee1c6bc Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 23 Sep 2014 18:15:36 +0300 Subject: [PATCH 18/28] Add service levels quota view to space stats & org stats pages. Change quota type. Expand collapsible panel when user have level id on user settings page. --- WebsitePanel/Database/update_db.sql | 169 ++++++++++++++++++ .../Packages/PackageController.cs | 1 + .../OrganizationHome.ascx.resx | 3 + .../ExchangeServer/OrganizationHome.ascx | 8 + .../ExchangeServer/OrganizationHome.ascx.cs | 45 +++++ .../OrganizationHome.ascx.designer.cs | 18 ++ .../OrganizationUserGeneralSettings.ascx.cs | 2 + .../WebsitePanel/SpaceQuotas.ascx | 10 +- .../WebsitePanel/SpaceQuotas.ascx.cs | 74 ++++++++ .../WebsitePanel/SpaceQuotas.ascx.designer.cs | 64 +------ 10 files changed, 334 insertions(+), 60 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 796722b9..bd6a1b00 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -5205,4 +5205,173 @@ FROM SupportServiceLevels AS SL INNER JOIN ExchangeAccounts AS EA ON SL.LevelID = EA.LevelID WHERE EA.LevelID = @LevelID RETURN +GO + +-- Service Level Quotas, change type +UPDATE Quotas +SET QuotaTypeID = 2 +WHERE QuotaName like 'ServiceLevel.%' +GO + +ALTER FUNCTION [dbo].[CalculateQuotaUsage] +( + @PackageID int, + @QuotaID int +) +RETURNS int +AS + BEGIN + + DECLARE @QuotaTypeID int + DECLARE @QuotaName nvarchar(50) + SELECT @QuotaTypeID = QuotaTypeID, @QuotaName = QuotaName FROM Quotas + WHERE QuotaID = @QuotaID + + IF @QuotaTypeID <> 2 + RETURN 0 + + DECLARE @Result int + + IF @QuotaID = 52 -- diskspace + SET @Result = dbo.CalculatePackageDiskspace(@PackageID) + ELSE IF @QuotaID = 51 -- bandwidth + SET @Result = dbo.CalculatePackageBandwidth(@PackageID) + ELSE IF @QuotaID = 53 -- domains + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsSubDomain = 0 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 54 -- sub-domains + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsSubDomain = 1 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 220 -- domain pointers + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsDomainPointer = 1 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 71 -- scheduled tasks + SET @Result = (SELECT COUNT(S.ScheduleID) FROM PackagesTreeCache AS PT + INNER JOIN Schedule AS S ON S.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 305 -- RAM of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 306 -- HDD of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 309 -- External IP addresses of VPS + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 100 -- Dedicated Web IP addresses + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 2) + ELSE IF @QuotaID = 350 -- RAM of VPSforPc + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'Memory' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 351 -- HDD of VPSforPc + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 354 -- External IP addresses of VPSforPc + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 319 -- BB Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea + INNER JOIN BlackBerryUsers bu ON ea.AccountID = bu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 320 -- OCS Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea + INNER JOIN OCSUsers ocs ON ea.AccountID = ocs.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 206 -- HostedSolution.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (1,5,6,7)) + ELSE IF @QuotaID = 78 -- Exchange2007.Mailboxes + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID + AND ea.AccountType IN (1) + AND ea.MailboxPlanId IS NOT NULL) + ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace + SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea + INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 370 -- Lync.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 376 -- Lync.EVUsers + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN LyncUserPlans lp ON lu.LyncUserPlanId = lp.LyncUserPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1) + ELSE IF @QuotaID = 381 -- Dedicated Lync Phone Numbers + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 5) + ELSE IF @QuotaID = 430 -- Enterprise Storage + SET @Result = (SELECT SUM(ESF.FolderQuota) FROM EnterpriseFolders AS ESF + INNER JOIN ServiceItems SI ON ESF.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache PT ON SI.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 431 -- Enterprise Storage Folders + SET @Result = (SELECT COUNT(ESF.EnterpriseFolderID) FROM EnterpriseFolders AS ESF + INNER JOIN ServiceItems SI ON ESF.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache PT ON SI.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 423 -- HostedSolution.SecurityGroups + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (8,9)) + ELSE IF @QuotaName like 'ServiceLevel.%' -- Support Service Level Quota + BEGIN + DECLARE @LevelID int + + SELECT @LevelID = LevelID FROM SupportServiceLevels + WHERE LevelName = REPLACE(@QuotaName,'ServiceLevel.','') + + IF (@LevelID IS NOT NULL) + SET @Result = (SELECT COUNT(EA.AccountID) + FROM SupportServiceLevels AS SL + INNER JOIN ExchangeAccounts AS EA ON SL.LevelID = EA.LevelID + INNER JOIN ServiceItems SI ON EA.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache PT ON SI.PackageID = PT.PackageID + WHERE EA.LevelID = @LevelID AND PT.ParentPackageID = @PackageID) + ELSE SET @Result = 0 + END + ELSE + SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q + INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID AND PT.ParentPackageID = @PackageID + WHERE Q.QuotaID = @QuotaID) + + RETURN @Result + END GO \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs index 17bef13f..e9f2f848 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs @@ -365,6 +365,7 @@ namespace WebsitePanel.EnterpriseServer quota.QuotaId = (int)dr["QuotaId"]; quota.GroupId = (int)dr["GroupId"]; quota.QuotaName = (string)dr["QuotaName"]; + quota.QuotaDescription = ((object)dr["QuotaDescription"]).GetType() == typeof(System.DBNull) ? string.Empty : (string)dr["QuotaDescription"]; quota.QuotaTypeId = (int)dr["QuotaTypeId"]; quota.QuotaAllocatedValue = (int)dr["QuotaValue"]; quota.QuotaUsedValue = (int)dr["QuotaUsedValue"]; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx index 0fa1a42f..c6347b42 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx @@ -219,4 +219,7 @@ Enterprise Storage + + Service Levels + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx index 4d7fa525..9f9e8388 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx @@ -315,6 +315,14 @@ + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs index cf461192..fdbf2648 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs @@ -27,6 +27,8 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.HostedSolution; @@ -279,6 +281,14 @@ namespace WebsitePanel.Portal.ExchangeServer } else enterpriseStorageStatsPanel.Visible = false; + + if (cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) + { + serviceLevelsStatsPanel.Visible = true; + BindServiceLevelsStats(cntx); + } + else + serviceLevelsStatsPanel.Visible = false; } private void BindCRMStats(OrganizationStatistics stats, OrganizationStatistics tenantStats) @@ -379,5 +389,40 @@ namespace WebsitePanel.Portal.ExchangeServer "SpaceID=" + PanelSecurity.PackageId.ToString()); } + private void BindServiceLevelsStats(PackageContext cntx) + { + foreach (var quota in Array.FindAll( + cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS))) + { + HtmlTableRow tr = new HtmlTableRow(); + tr.Attributes["class"] = "OrgStatsRow"; + HtmlTableCell col1 = new HtmlTableCell(); + col1.Attributes["class"] = "OrgStatsQuota"; + col1.Attributes["nowrap"] = "nowrap"; + HyperLink link = new HyperLink(); + link.ID = "lnk_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim(); + link.Text = quota.QuotaDescription; + + col1.Controls.Add(link); + + HtmlTableCell col2 = new HtmlTableCell(); + QuotaViewer quotaControl = (QuotaViewer)LoadControl("../UserControls/QuotaViewer.ascx"); + quotaControl.ID = quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim() + "Stats"; + quotaControl.QuotaTypeId = quota.QuotaTypeId; + quotaControl.DisplayGauge = true; + quotaControl.QuotaValue = quota.QuotaAllocatedValue; + quotaControl.QuotaUsedValue = quota.QuotaUsedValue; + if (quota.QuotaAllocatedValue != -1) + quotaControl.QuotaAvailable = quota.QuotaAllocatedValue - quota.QuotaUsedValue; + + col2.Controls.Add(quotaControl); + + + tr.Controls.Add(col1); + tr.Controls.Add(col2); + serviceLevelsStatsPanel.Controls.Add(tr); + } + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs index 5c686b8e..062c57df 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs @@ -740,5 +740,23 @@ namespace WebsitePanel.Portal.ExchangeServer { /// To modify move field declaration from designer file to code-behind file. ///
    protected global::WebsitePanel.Portal.QuotaViewer enterpriseStorageFoldersStats; + + /// + /// serviceLevelsStatsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel serviceLevelsStatsPanel; + + /// + /// locServiceLevels control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locServiceLevels; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index 7fe1cae5..ffc955e2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -128,6 +128,8 @@ namespace WebsitePanel.Portal.HostedSolution if (user.LevelId > 0 && secServiceLevels.Visible) { + secServiceLevels.IsCollapsed = false; + ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); bool addLevel = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) == null; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx index 2507167b..dc5567f1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx @@ -2,7 +2,7 @@ <%@ Register Src="UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %>
    - +
    - + --%> + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs index 4ce4bc2f..c6a1b520 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs @@ -131,6 +131,8 @@ namespace WebsitePanel.Portal protected override void OnPreRender(EventArgs e) { + // + AddServiceLevelsQuotas(); // SetVisibilityStatus4BriefQuotasBlock(); // @@ -175,5 +177,77 @@ namespace WebsitePanel.Portal } } } + + //private void AddServiceLevelsQuotas() + //{ + // foreach(var quota in Array.FindAll( + // cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS))) + // { + // HtmlGenericControl tr = new HtmlGenericControl(); + // tr.ID = "pnl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""); + // tr.TagName = "tr"; + + // HtmlGenericControl col1 = new HtmlGenericControl(); + // col1.TagName = "td"; + // col1.Attributes["class"] = "SubHead"; + // col1.Attributes["nowrap"] = "nowrap"; + // Label lbl = new Label(); + // lbl.ID = "lbl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""); + // lbl.Text = quota.QuotaDescription; + // col1.Controls.Add(lbl); + + // HtmlGenericControl col2 = new HtmlGenericControl(); + // col2.TagName = "td"; + // col2.Attributes["class"] = "Normal"; + // //Quota quotaControl = new Quota(); + // // quotaControl.ID = "quota_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""); + // // quotaControl.QuotaName = quota.QuotaName; + // // quotaControl.Viewer = new QuotaViewer(); + // // quotaControl.DisplayGauge = true; + // col2.InnerHtml = string.Format( + // "", + // "quota_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""), + // quota.QuotaName); + // //col2.Controls.Add(quotaControl); + + // tr.Controls.Add(col1); + // tr.Controls.Add(col2); + // tblQuotas.Controls.Add((Control)tr); + + // Control c1 = new Control(); + // } + //} + + private void AddServiceLevelsQuotas() + { + foreach (var quota in Array.FindAll( + cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS))) + { + HtmlTableRow tr = new HtmlTableRow(); + tr.ID = "pnl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim(); + HtmlTableCell col1 = new HtmlTableCell(); + col1.Attributes["class"] = "SubHead"; + col1.Attributes["nowrap"] = "nowrap"; + Label lbl = new Label(); + lbl.ID = "lbl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim(); + lbl.Text = quota.QuotaDescription; + + col1.Controls.Add(lbl); + + HtmlTableCell col2 = new HtmlTableCell(); + col2.Attributes["class"] = "Normal"; + Quota quotaControl = (Quota)LoadControl("UserControls/Quota.ascx"); + quotaControl.ID = "quota_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim(); + quotaControl.QuotaName = quota.QuotaName; + quotaControl.DisplayGauge = true; + + col2.Controls.Add(quotaControl); + + + tr.Controls.Add(col1); + tr.Controls.Add(col2); + tblQuotas.Controls.Add(tr); + } + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs index 6933af8b..e19a2d5f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2014, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -40,6 +12,15 @@ namespace WebsitePanel.Portal { public partial class SpaceQuotas { + /// + /// tblQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tblQuotas; + /// /// pnlDiskspace control. /// @@ -148,33 +129,6 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.Quota quotaSubDomains; - /// - /// pnlDomainPointers control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlDomainPointers; - - /// - /// lblDomainPointers control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblDomainPointers; - - /// - /// quotaDomainPointers control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.Quota quotaDomainPointers; - /// /// pnlOrganizations control. /// From 3ce38e5bb18c1046f5048b941d39269c760383fa Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Tue, 23 Sep 2014 22:32:55 +0400 Subject: [PATCH 19/28] fixing button "Create Organization" for user --- .../WebsitePanel/ExchangeServer/Organizations.ascx.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.cs index 8f8a9bcf..0636f77e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.cs @@ -57,12 +57,14 @@ namespace WebsitePanel.Portal.ExchangeServer btnCreate.Enabled = (!(cntx.Quotas[Quotas.ORGANIZATIONS].QuotaAllocatedValue <= gvOrgs.Rows.Count) || (cntx.Quotas[Quotas.ORGANIZATIONS].QuotaAllocatedValue == -1)); } + /* if (PanelSecurity.LoggedUser.Role == UserRole.User) { gvOrgs.Columns[2].Visible = gvOrgs.Columns[3].Visible = gvOrgs.Columns[5].Visible = false; btnCreate.Enabled = false; btnSetDefaultOrganization.Enabled = false; } + */ if (!Page.IsPostBack) { From 4da84dc0f21093a4155a744a32f3a249512d78b9 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Wed, 24 Sep 2014 10:17:50 +0300 Subject: [PATCH 20/28] change service level quota type when adding new service level --- WebsitePanel/Database/update_db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index bd6a1b00..fe2f171b 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -4623,7 +4623,7 @@ BEGIN @QuotaOrderInGroup + 1, @CurQuotaName, @CurQuotaDescription, - 3, + 2, 0, NULL) END From 7f75a1e6bce084df85021a5e41089795d5d2be3e Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 24 Sep 2014 11:07:33 -0400 Subject: [PATCH 21/28] Added tag build-2.1.0.426 for changeset 0bb2462b74e2 From cc68a9bb4de893d1e66da8319e9390d3ca9be543 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 25 Sep 2014 00:57:58 -0400 Subject: [PATCH 22/28] Added tag build-2.1.0.427 for changeset cdd33807b16c From 715b2c79b699b9821cc13cdb7f3738362d3ee9ce Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Thu, 25 Sep 2014 13:23:35 +0300 Subject: [PATCH 23/28] last updates for service levels. --- .../Packages/ServiceLevelQuotaValueInfo.cs | 44 +++++++++++++++++ .../WebsitePanel.EnterpriseServer.Base.csproj | 1 + .../App_Themes/Default/Icons.skin | 1 + .../ExchangeMailboxGeneralSettings.ascx | 2 + .../ExchangeMailboxGeneralSettings.ascx.cs | 11 +++++ ...ngeMailboxGeneralSettings.ascx.designer.cs | 18 +++++++ .../ExchangeServer/ExchangeMailboxes.ascx | 24 ++++++++-- .../ExchangeServer/ExchangeMailboxes.ascx.cs | 34 ++++++++++++- .../ExchangeMailboxes.ascx.designer.cs | 9 ++++ .../ExchangeServer/OrganizationHome.ascx.cs | 12 ++++- .../OrganizationUserGeneralSettings.ascx | 2 + .../OrganizationUserGeneralSettings.ascx.cs | 22 +++++++-- ...zationUserGeneralSettings.ascx.designer.cs | 18 +++++++ .../ExchangeServer/OrganizationUsers.ascx | 23 +++++++-- .../ExchangeServer/OrganizationUsers.ascx.cs | 29 ++++++++++- .../OrganizationUsers.ascx.designer.cs | 9 ++++ .../WebsitePanel/Lync/LyncEditUser.ascx | 2 + .../WebsitePanel/Lync/LyncEditUser.ascx.cs | 16 +++++++ .../Lync/LyncEditUser.ascx.designer.cs | 48 ++++++++----------- .../WebsitePanel/SpaceQuotas.ascx.cs | 40 ---------------- 20 files changed, 282 insertions(+), 83 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/ServiceLevelQuotaValueInfo.cs diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/ServiceLevelQuotaValueInfo.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/ServiceLevelQuotaValueInfo.cs new file mode 100644 index 00000000..02ef703a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/ServiceLevelQuotaValueInfo.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2014, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebsitePanel.EnterpriseServer +{ + public class ServiceLevelQuotaValueInfo + { + public int QuotaValue { get; set; } + public string QuotaDescription { get; set; } + public string QuotaName { get; set; } + public int QuotaTypeId { get; set; } + public int QuotaUsedValue { get; set; } + public int QuotaAvailable { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj index 7ce9ade3..c4c1bc7a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj @@ -121,6 +121,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Icons.skin b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Icons.skin index 0559387a..a6c5e672 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Icons.skin +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Icons.skin @@ -36,6 +36,7 @@ Default skin template. The following skins are provided as examples only. + <%-- Exchange Icons --%> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx index 225d2f8d..77f97218 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx @@ -21,6 +21,8 @@ - + +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs index b1b1b90d..aff1bcb7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs @@ -164,6 +164,17 @@ namespace WebsitePanel.Portal.ExchangeServer archivingQuotaViewer.QuotaValue = ArchivingMaxSize; rowArchiving.Visible = chkEnableArchiving.Checked; + if (account.LevelId > 0 && Cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) + { + WebsitePanel.EnterpriseServer.Base.HostedSolution.ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(account.LevelId); + + litServiceLevel.Visible = true; + litServiceLevel.Text = serviceLevel.LevelName; + litServiceLevel.ToolTip = serviceLevel.LevelDescription; + + } + imgVipUser.Visible = account.IsVIP && Cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); + } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs index d1b0530d..9f3029a2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs @@ -39,6 +39,24 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Literal litDisplayName; + /// + /// imgVipUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgVipUser; + + /// + /// litServiceLevel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label litServiceLevel; + /// /// tabs control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx index ee7a1c81..bbeb8e4f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx @@ -112,10 +112,26 @@
    - -     - - +
    + +     + +
    + + + +
    +
    + +     + +
    +
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs index b3fa7da7..1874f821 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs @@ -32,6 +32,7 @@ using System.Web.UI.WebControls; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.EnterpriseServer; using WebsitePanel.EnterpriseServer.Base.HostedSolution; +using System.Collections.Generic; namespace WebsitePanel.Portal.ExchangeServer { @@ -55,6 +56,8 @@ namespace WebsitePanel.Portal.ExchangeServer btnCreateMailbox.Visible = !ArchivingBoxes; + cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (!IsPostBack) { BindStats(); @@ -62,7 +65,7 @@ namespace WebsitePanel.Portal.ExchangeServer BindServiceLevels(); - cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) @@ -87,6 +90,35 @@ namespace WebsitePanel.Portal.ExchangeServer mailboxesQuota.QuotaUsedValue = stats.CreatedMailboxes; mailboxesQuota.QuotaValue = stats.AllocatedMailboxes; if (stats.AllocatedMailboxes != -1) mailboxesQuota.QuotaAvailable = tenantStats.AllocatedMailboxes - tenantStats.CreatedMailboxes; + + if (cntx != null && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) BindServiceLevelsStats(); + } + + private void BindServiceLevelsStats() + { + ServiceLevels = ES.Services.Organizations.GetSupportServiceLevels(); + OrganizationUser[] accounts = ES.Services.Organizations.SearchAccounts(PanelRequest.ItemID, "", "", "", true); + + List serviceLevelQuotas = new List(); + foreach (var quota in Array.FindAll( + cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS))) + { + int levelId = ServiceLevels.Where(x => x.LevelName == quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "")).FirstOrDefault().LevelId; + int usedInOrgCount = accounts.Where(x => x.LevelId == levelId).Count(); + + serviceLevelQuotas.Add(new ServiceLevelQuotaValueInfo + { + QuotaName = quota.QuotaName, + QuotaDescription = quota.QuotaDescription + " in this Organization:", + QuotaTypeId = quota.QuotaTypeId, + QuotaValue = quota.QuotaAllocatedValue, + QuotaUsedValue = usedInOrgCount, + //QuotaUsedValue = quota.QuotaUsedValue, + QuotaAvailable = quota.QuotaAllocatedValue - quota.QuotaUsedValue + }); + } + dlServiceLevelQuotas.DataSource = serviceLevelQuotas; + dlServiceLevelQuotas.DataBind(); } protected void btnCreateMailbox_Click(object sender, EventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.designer.cs index e9cf4b0a..6e9b50b4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.designer.cs @@ -137,5 +137,14 @@ namespace WebsitePanel.Portal.ExchangeServer { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaViewer mailboxesQuota; + + /// + /// dlServiceLevelQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater dlServiceLevelQuotas; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs index fdbf2648..1bc84bc7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs @@ -27,6 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Linq; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; @@ -391,6 +392,9 @@ namespace WebsitePanel.Portal.ExchangeServer private void BindServiceLevelsStats(PackageContext cntx) { + WebsitePanel.EnterpriseServer.Base.HostedSolution.ServiceLevel[] serviceLevels = ES.Services.Organizations.GetSupportServiceLevels(); + OrganizationUser[] accounts = ES.Services.Organizations.SearchAccounts(PanelRequest.ItemID, "", "", "", true); + foreach (var quota in Array.FindAll( cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS))) { @@ -401,17 +405,21 @@ namespace WebsitePanel.Portal.ExchangeServer col1.Attributes["nowrap"] = "nowrap"; HyperLink link = new HyperLink(); link.ID = "lnk_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim(); - link.Text = quota.QuotaDescription; + link.Text = quota.QuotaDescription.Replace(", users", " (users):"); col1.Controls.Add(link); + int levelId = serviceLevels.Where(x => x.LevelName == quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "")).FirstOrDefault().LevelId; + int usedInOrgCount = accounts.Where(x => x.LevelId == levelId).Count(); + HtmlTableCell col2 = new HtmlTableCell(); QuotaViewer quotaControl = (QuotaViewer)LoadControl("../UserControls/QuotaViewer.ascx"); quotaControl.ID = quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim() + "Stats"; quotaControl.QuotaTypeId = quota.QuotaTypeId; quotaControl.DisplayGauge = true; quotaControl.QuotaValue = quota.QuotaAllocatedValue; - quotaControl.QuotaUsedValue = quota.QuotaUsedValue; + quotaControl.QuotaUsedValue = usedInOrgCount; + //quotaControl.QuotaUsedValue = quota.QuotaUsedValue; if (quota.QuotaAllocatedValue != -1) quotaControl.QuotaAvailable = quota.QuotaAllocatedValue - quota.QuotaUsedValue; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx index 626b45c7..cd770aea 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx @@ -28,6 +28,8 @@ - + +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index ffc955e2..865e8665 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -132,6 +132,10 @@ namespace WebsitePanel.Portal.HostedSolution ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); + litServiceLevel.Visible = true; + litServiceLevel.Text = serviceLevel.LevelName; + litServiceLevel.ToolTip = serviceLevel.LevelDescription; + bool addLevel = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) == null; addLevel = addLevel && cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName); @@ -152,6 +156,7 @@ namespace WebsitePanel.Portal.HostedSolution } } chkVIP.Checked = user.IsVIP && secServiceLevels.Visible; + imgVipUser.Visible = user.IsVIP && secServiceLevels.Visible; if (cntx.Quotas.ContainsKey(Quotas.ORGANIZATION_ALLOWCHANGEUPN)) @@ -242,7 +247,7 @@ namespace WebsitePanel.Portal.HostedSolution { foreach (var serviceLevel in ES.Services.Organizations.GetSupportServiceLevels()) { - if (quota.Key.Replace(Quotas.SERVICE_LEVELS, "") == serviceLevel.LevelName && CheckServiceLevelQuota(quota.Value, serviceLevel.LevelId)) + if (quota.Key.Replace(Quotas.SERVICE_LEVELS, "") == serviceLevel.LevelName && CheckServiceLevelQuota(quota.Value)) { enabledServiceLevels.Add(serviceLevel); } @@ -263,9 +268,8 @@ namespace WebsitePanel.Portal.HostedSolution } - private bool CheckServiceLevelQuota(QuotaValueInfo quota, int levelID) + private bool CheckServiceLevelQuota(QuotaValueInfo quota) { - quota.QuotaUsedValue = ES.Services.Organizations.SearchAccounts(PanelRequest.ItemID, "", "", "", true).Where(x => x.LevelId == levelID).Count(); if (quota.QuotaAllocatedValue != -1) { @@ -329,6 +333,18 @@ namespace WebsitePanel.Portal.HostedSolution if (!chkLocked.Checked) chkLocked.Enabled = false; + litServiceLevel.Visible = !string.IsNullOrEmpty(ddlServiceLevels.SelectedValue) && secServiceLevels.Visible; + if (litServiceLevel.Visible) + { + ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(int.Parse(ddlServiceLevels.SelectedValue)); + + litServiceLevel.Text = serviceLevel.LevelName; + litServiceLevel.ToolTip = serviceLevel.LevelDescription; + } + + imgVipUser.Visible = chkVIP.Checked && secServiceLevels.Visible; + + messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_USER_SETTINGS"); } catch (Exception ex) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs index a68bb55e..fef1a739 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs @@ -48,6 +48,24 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::System.Web.UI.WebControls.Literal litDisplayName; + /// + /// imgVipUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgVipUser; + + /// + /// litServiceLevel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label litServiceLevel; + /// /// UserTabsId control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx index 6b8ba886..db8ee8fa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx @@ -109,9 +109,26 @@
    - -     - +
    + +     + +
    + + +
    +
    + +     + +
    +
    +
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs index 1d9941bb..6c15a98a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs @@ -43,6 +43,8 @@ namespace WebsitePanel.Portal.HostedSolution protected void Page_Load(object sender, EventArgs e) { + cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (!IsPostBack) { BindStats(); @@ -50,7 +52,6 @@ namespace WebsitePanel.Portal.HostedSolution BindServiceLevels(); - cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) @@ -74,6 +75,32 @@ namespace WebsitePanel.Portal.HostedSolution usersQuota.QuotaUsedValue = stats.CreatedUsers; usersQuota.QuotaValue = stats.AllocatedUsers; if (stats.AllocatedUsers != -1) usersQuota.QuotaAvailable = tenantStats.AllocatedUsers - tenantStats.CreatedUsers; + + if(cntx != null && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) BindServiceLevelsStats(); + } + + private void BindServiceLevelsStats() + { + ServiceLevels = ES.Services.Organizations.GetSupportServiceLevels(); + OrganizationUser[] accounts = ES.Services.Organizations.SearchAccounts(PanelRequest.ItemID, "", "", "", true); + + List serviceLevelQuotas = new List(); + foreach (var quota in Array.FindAll( + cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS))) + { + int levelId = ServiceLevels.Where(x => x.LevelName == quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "")).FirstOrDefault().LevelId; + int usedInOrgCount = accounts.Where(x => x.LevelId == levelId).Count(); + + serviceLevelQuotas.Add(new ServiceLevelQuotaValueInfo { QuotaName = quota.QuotaName, + QuotaDescription = quota.QuotaDescription + " in this Organization:", + QuotaTypeId = quota.QuotaTypeId, + QuotaValue = quota.QuotaAllocatedValue, + QuotaUsedValue = usedInOrgCount, + //QuotaUsedValue = quota.QuotaUsedValue, + QuotaAvailable = quota.QuotaAllocatedValue - quota.QuotaUsedValue }); + } + dlServiceLevelQuotas.DataSource = serviceLevelQuotas; + dlServiceLevelQuotas.DataBind(); } protected void btnCreateUser_Click(object sender, EventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.designer.cs index d23d75f5..e894471a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.designer.cs @@ -137,5 +137,14 @@ namespace WebsitePanel.Portal.HostedSolution { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaViewer usersQuota; + + /// + /// dlServiceLevelQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater dlServiceLevelQuotas; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx index 4fe26b8b..53352de4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx @@ -19,6 +19,8 @@ - + +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs index 35caed3c..71ea15d3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs @@ -118,6 +118,22 @@ namespace WebsitePanel.Portal.Lync lyncUserSettings.sipAddress = lyncUser.SipAddress; Utils.SelectListItem(ddlPhoneNumber, lyncUser.LineUri); + + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, + PanelRequest.AccountID); + + if (user.LevelId > 0 && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) + { + WebsitePanel.EnterpriseServer.Base.HostedSolution.ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); + + litServiceLevel.Visible = true; + litServiceLevel.Text = serviceLevel.LevelName; + litServiceLevel.ToolTip = serviceLevel.LevelDescription; + + } + imgVipUser.Visible = user.IsVIP && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); } protected void btnSave_Click(object sender, EventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs index ab351ec6..7b88f3a5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs @@ -1,32 +1,4 @@ -// Copyright (c) 2014, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -76,6 +48,24 @@ namespace WebsitePanel.Portal.Lync { /// protected global::System.Web.UI.WebControls.Literal litDisplayName; + /// + /// imgVipUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgVipUser; + + /// + /// litServiceLevel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label litServiceLevel; + /// /// messageBox control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs index c6a1b520..c2e0dc9e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs @@ -178,46 +178,6 @@ namespace WebsitePanel.Portal } } - //private void AddServiceLevelsQuotas() - //{ - // foreach(var quota in Array.FindAll( - // cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS))) - // { - // HtmlGenericControl tr = new HtmlGenericControl(); - // tr.ID = "pnl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""); - // tr.TagName = "tr"; - - // HtmlGenericControl col1 = new HtmlGenericControl(); - // col1.TagName = "td"; - // col1.Attributes["class"] = "SubHead"; - // col1.Attributes["nowrap"] = "nowrap"; - // Label lbl = new Label(); - // lbl.ID = "lbl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""); - // lbl.Text = quota.QuotaDescription; - // col1.Controls.Add(lbl); - - // HtmlGenericControl col2 = new HtmlGenericControl(); - // col2.TagName = "td"; - // col2.Attributes["class"] = "Normal"; - // //Quota quotaControl = new Quota(); - // // quotaControl.ID = "quota_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""); - // // quotaControl.QuotaName = quota.QuotaName; - // // quotaControl.Viewer = new QuotaViewer(); - // // quotaControl.DisplayGauge = true; - // col2.InnerHtml = string.Format( - // "", - // "quota_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""), - // quota.QuotaName); - // //col2.Controls.Add(quotaControl); - - // tr.Controls.Add(col1); - // tr.Controls.Add(col2); - // tblQuotas.Controls.Add((Control)tr); - - // Control c1 = new Control(); - // } - //} - private void AddServiceLevelsQuotas() { foreach (var quota in Array.FindAll( From f6c4fc8a9aead076032f4b023aaec54d53ed8309 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 25 Sep 2014 08:00:45 -0400 Subject: [PATCH 24/28] Added tag build-2.1.0.428 for changeset 8e97d6f5ffb5 From d2707aa974af07332c1bfcd86ff1de9d223d0894 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 26 Sep 2014 11:08:00 +0300 Subject: [PATCH 25/28] GUI Fixes --- .../WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx | 1 - .../WebsitePanel/ExchangeServer/OrganizationUsers.ascx | 1 - .../DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx index bbeb8e4f..40852b11 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx @@ -120,7 +120,6 @@ -
        diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx index db8ee8fa..0f3c717e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx @@ -116,7 +116,6 @@
    -
        diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs index c2e0dc9e..70f475c2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs @@ -190,7 +190,7 @@ namespace WebsitePanel.Portal col1.Attributes["nowrap"] = "nowrap"; Label lbl = new Label(); lbl.ID = "lbl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim(); - lbl.Text = quota.QuotaDescription; + lbl.Text = quota.QuotaDescription + ":"; col1.Controls.Add(lbl); From a9a08e1088655cdc71a22a7d0f7f1147ff7416c1 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 26 Sep 2014 11:20:36 -0400 Subject: [PATCH 26/28] Added tag build-2.1.0.429 for changeset 3b103f842f67 From 9b055347bae55764dfed0b3154be96f0d95023cd Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Fri, 26 Sep 2014 23:37:57 +0400 Subject: [PATCH 27/28] Exchange archive fix --- .../ExchangeServer/ExchangeServerController.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index cd3cb5d5..746d8234 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -3092,16 +3092,17 @@ namespace WebsitePanel.EnterpriseServer long archiveQuotaKB = 0; long archiveWarningQuotaKB = 0; string RetentionPolicy = ""; + + ExchangeMailboxPlan mailboxPlan = GetExchangeMailboxPlan(itemId, mailboxPlanId); + if ( mailboxPlan != null) + { + archiveQuotaKB = mailboxPlan.ArchiveSizeMB != -1 ? ((long)mailboxPlan.ArchiveSizeMB * 1024) : -1; + archiveWarningQuotaKB = mailboxPlan.ArchiveSizeMB != -1 ? (((long)mailboxPlan.ArchiveWarningPct * (long) mailboxPlan.ArchiveSizeMB * 1024) / 100) : -1; + } + + if (retentionPolicyId > 0) { - ExchangeMailboxPlan mailboxPlan = GetExchangeMailboxPlan(itemId, mailboxPlanId); - if ( mailboxPlan != null) - { - archiveQuotaKB = mailboxPlan.ArchiveSizeMB != -1 ? ((long)mailboxPlan.ArchiveSizeMB * 1024) : -1; - archiveWarningQuotaKB = mailboxPlan.ArchiveSizeMB != -1 ? (((long)mailboxPlan.ArchiveWarningPct * (long) mailboxPlan.ArchiveSizeMB * 1024) / 100) : -1; - } - - ExchangeMailboxPlan retentionPolicy = GetExchangeMailboxPlan(itemId, retentionPolicyId); if (retentionPolicy != null) { From 2d48b7fb33b4d67d4610c0df8b9003038e65a04e Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 26 Sep 2014 16:14:27 -0400 Subject: [PATCH 28/28] Added tag build-2.1.0.430 for changeset fd7d64c21f4f
      (