From de801dcc33d1214c9ad0c9e8cf27c661c4030d77 Mon Sep 17 00:00:00 2001 From: doctogonzo Date: Mon, 18 May 2015 10:15:02 +0200 Subject: [PATCH] quick search: "Users" to "Account Home", Users in top --- .../WebsitePanel_SharedResources.ascx.resx | 3 +++ .../WebsitePanel/Code/Helpers/AjaxHandler.cs | 20 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) 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 3c67a53e..25d3ee9f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5289,6 +5289,9 @@ Exchange Account + + Account Home + Could not disable access to Web Publishing feature for the account specified diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/AjaxHandler.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/AjaxHandler.cs index 422755bf..9b3ae0f2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/AjaxHandler.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/AjaxHandler.cs @@ -101,7 +101,7 @@ namespace WebsitePanel.WebPortal obj["TextSearch"] = row["PackageName"].ToString(); obj["ItemID"] = row["ItemID"].ToString(); obj["PackageID"] = row["PackageID"].ToString(); - obj["FullType"] = "Space"; + obj["FullType"] = GetTypeDisplayName("Space"); obj["AccountID"] = row["AccountID"].ToString(); dataList.Add(obj); } @@ -117,17 +117,22 @@ namespace WebsitePanel.WebPortal String.Format("%{0}%", filterValue), 0, 0, "", iNumResults, columnType, fullType); DataTable dt = dsObjectItems.Tables[2]; List> dataList = new List>(); + int currUser = 0; for (int i = 0; i < dt.Rows.Count; ++i) { DataRow row = dt.Rows[i]; + string type = row["FullType"].ToString(); Dictionary obj = new Dictionary(); obj["ColumnType"] = row["ColumnType"].ToString(); obj["TextSearch"] = row["TextSearch"].ToString(); obj["ItemID"] = row["ItemID"].ToString(); obj["PackageID"] = row["PackageID"].ToString(); - obj["FullType"] = row["FullType"].ToString(); + obj["FullType"] = GetTypeDisplayName(type); obj["AccountID"] = row["AccountID"].ToString(); - dataList.Add(obj); + if (String.Equals(type, "Users")) + dataList.Insert(currUser++, obj); + else + dataList.Add(obj); } var jsonSerialiser = new JavaScriptSerializer(); @@ -136,5 +141,14 @@ namespace WebsitePanel.WebPortal context.Response.Write(json); } } + + protected const string ModuleName = "WebsitePanel"; + + protected string GetTypeDisplayName(string type) + { + return PortalUtils.GetSharedLocalizedString(ModuleName, "ServiceItemType." + type) + ?? PortalUtils.GetSharedLocalizedString(ModuleName, "UserItemType." + type) + ?? type; + } } }; \ No newline at end of file