diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 6602dae8..56174015 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -5462,6 +5462,16 @@ CREATE TABLE RDSCollections ) GO +IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'RDSCollections' AND COLUMN_NAME = 'DisplayName') +BEGIN + ALTER TABLE [dbo].[RDSCollections] + ADD DisplayName NVARCHAR(255) +END +GO + +UPDATE [dbo].[RDSCollections] SET DisplayName = [Name] WHERE DisplayName IS NULL + + ALTER TABLE [dbo].[RDSCollectionUsers] DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId] GO @@ -5744,7 +5754,8 @@ SELECT CR.ID, CR.ItemID, CR.Name, - CR.Description + CR.Description, + CR.DisplayName FROM @RDSCollections AS C INNER JOIN RDSCollections AS CR ON C.RDSCollectionId = CR.ID WHERE C.ItemPosition BETWEEN @StartRow AND @EndRow' @@ -5777,7 +5788,8 @@ SELECT Id, ItemId, Name, - Description + Description, + DisplayName FROM RDSCollections WHERE ItemID = @ItemID GO @@ -5796,9 +5808,10 @@ SELECT TOP 1 Id, Name, ItemId, - Description + Description, + DisplayName FROM RDSCollections - WHERE Name = @Name + WHERE DisplayName = @Name GO @@ -5815,7 +5828,8 @@ SELECT TOP 1 Id, ItemId, Name, - Description + Description, + DisplayName FROM RDSCollections WHERE ID = @ID GO @@ -5829,7 +5843,8 @@ CREATE PROCEDURE [dbo].[AddRDSCollection] @RDSCollectionID INT OUTPUT, @ItemID INT, @Name NVARCHAR(255), - @Description NVARCHAR(255) + @Description NVARCHAR(255), + @DisplayName NVARCHAR(255) ) AS @@ -5837,13 +5852,15 @@ INSERT INTO RDSCollections ( ItemID, Name, - Description + Description, + DisplayName ) VALUES ( @ItemID, @Name, - @Description + @Description, + @DisplayName ) SET @RDSCollectionID = SCOPE_IDENTITY() @@ -5860,7 +5877,8 @@ CREATE PROCEDURE [dbo].[UpdateRDSCollection] @ID INT, @ItemID INT, @Name NVARCHAR(255), - @Description NVARCHAR(255) + @Description NVARCHAR(255), + @DisplayName NVARCHAR(255) ) AS @@ -5868,7 +5886,8 @@ UPDATE RDSCollections SET ItemID = @ItemID, Name = @Name, - Description = @Description + Description = @Description, + DisplayName = @DisplayName WHERE ID = @Id GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 9e651565..03f345f3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -4498,7 +4498,7 @@ namespace WebsitePanel.EnterpriseServer ); } - public static int AddRDSCollection(int itemId, string name, string description) + public static int AddRDSCollection(int itemId, string name, string description, string displayName) { SqlParameter rdsCollectionId = new SqlParameter("@RDSCollectionID", SqlDbType.Int); rdsCollectionId.Direction = ParameterDirection.Output; @@ -4510,7 +4510,8 @@ namespace WebsitePanel.EnterpriseServer rdsCollectionId, new SqlParameter("@ItemID", itemId), new SqlParameter("@Name", name), - new SqlParameter("@Description", description) + new SqlParameter("@Description", description), + new SqlParameter("DisplayName", displayName) ); // read identity @@ -4533,10 +4534,10 @@ namespace WebsitePanel.EnterpriseServer public static void UpdateRDSCollection(RdsCollection collection) { - UpdateRDSCollection(collection.Id, collection.ItemId, collection.Name, collection.Description); + UpdateRDSCollection(collection.Id, collection.ItemId, collection.Name, collection.Description, collection.DisplayName); } - public static void UpdateRDSCollection(int id, int itemId, string name, string description) + public static void UpdateRDSCollection(int id, int itemId, string name, string description, string displayName) { SqlHelper.ExecuteNonQuery( ConnectionString, @@ -4545,7 +4546,8 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@Id", id), new SqlParameter("@ItemID", itemId), new SqlParameter("@Name", name), - new SqlParameter("@Description", description) + new SqlParameter("@Description", description), + new SqlParameter("@DisplayName", displayName) ); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index e0bbf5b9..f6dd9c39 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -271,10 +271,9 @@ namespace WebsitePanel.EnterpriseServer } var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); - - rds.CreateCollection(org.OrganizationId, collection); - - collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description); + collection.Name = GetFormattedCollectionName(collection.DisplayName, org.OrganizationId); + rds.CreateCollection(org.OrganizationId, collection); + collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description, collection.DisplayName); foreach (var server in collection.Servers) { @@ -1247,5 +1246,10 @@ namespace WebsitePanel.EnterpriseServer return rds; } + + private static string GetFormattedCollectionName(string displayName, string organizationId) + { + return string.Format("{0}-{1}", organizationId, displayName.Replace(" ", "_")); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs index dda297f9..7fcbbaa5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs @@ -15,7 +15,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public int ItemId { get; set; } public string Name { get; set; } public string Description { get; set; } + public string DisplayName { get; set; } public List Servers { get; set; } - } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index bfb230f0..ba3180cd 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -1123,7 +1123,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private string GetPolicyName(string organizationId, string collectionName, RdsPolicyTypes policyType) { - string policyName = string.Format("{0}-{1}-", organizationId, collectionName); + string policyName = string.Format("{0}-", collectionName); switch (policyType) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx index 6c77a487..30835282 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx @@ -45,10 +45,10 @@ OnRowCommand="gvRDSCollections_RowCommand" AllowPaging="True" AllowSorting="True" DataSourceID="odsRDSCollectionsPaged" PageSize="20"> - + - <%# Eval("Name").ToString() %> + <%# Eval("DisplayName").ToString() %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx.cs index e8ee55af..5f44ca90 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx.cs @@ -62,7 +62,7 @@ namespace WebsitePanel.Portal.RDS return; } - RdsCollection collection = new RdsCollection{ Name = txtCollectionName.Text, Servers = servers.GetServers(), Description = "" }; + RdsCollection collection = new RdsCollection{ Name = txtCollectionName.Text, DisplayName = txtCollectionName.Text, Servers = servers.GetServers(), Description = "" }; ES.Services.RDS.AddRdsCollection(PanelRequest.ItemID, collection); Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId)); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs index 371a1adb..6ae6fd78 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs @@ -472,13 +472,7 @@ namespace WebsitePanel.Portal.UserControls private void PrepareEnterpriseStorageMenu(MenuItemCollection enterpriseStorageItems) { - enterpriseStorageItems.Add(CreateMenuItem("EnterpriseStorageFolders", "enterprisestorage_folders", @"Icons/enterprisestorage_folders_48.png")); - - //if (ShortMenu) return; - - if (Utils.CheckQouta(Quotas.ENTERPRICESTORAGE_DRIVEMAPS, Cntx)) - enterpriseStorageItems.Add(CreateMenuItem("EnterpriseStorageDriveMaps", "enterprisestorage_drive_maps", @"Icons/enterprisestorage_drive_maps_48.png")); - + enterpriseStorageItems.Add(CreateMenuItem("EnterpriseStorageFolders", "enterprisestorage_folders", @"Icons/enterprisestorage_folders_48.png")); } private void PrepareRDSMenuRoot(MenuItemCollection items) @@ -507,7 +501,14 @@ namespace WebsitePanel.Portal.UserControls rdsItems.Add(CreateMenuItem("RDSCollections", "rds_collections", null)); if (Utils.CheckQouta(Quotas.RDS_SERVERS, Cntx) && (PanelSecurity.LoggedUser.Role != UserRole.User)) - rdsItems.Add(CreateMenuItem("RDSServers", "rds_servers", null)); + { + rdsItems.Add(CreateMenuItem("RDSServers", "rds_servers", null)); + } + + if (Utils.CheckQouta(Quotas.ENTERPRICESTORAGE_DRIVEMAPS, Cntx)) + { + rdsItems.Add(CreateMenuItem("EnterpriseStorageDriveMaps", "enterprisestorage_drive_maps", @"Icons/enterprisestorage_drive_maps_48.png")); + } } private MenuItem CreateMenuItem(string text, string key)