From a060e139a1394ce87a806068b3cd028f61b526c7 Mon Sep 17 00:00:00 2001 From: doctogonzo Date: Fri, 15 May 2015 14:49:06 +0200 Subject: [PATCH] search autocomplite: tables search fix --- .../PackagesProxy.cs | 26 ++++++ .../Data/DataProvider.cs | 25 ++++++ .../Packages/PackageController.cs | 9 ++ .../esPackages.asmx.cs | 11 +++ .../Code/PortalControlBase.cs | 35 ++++---- .../WebsitePanel/Code/Helpers/AjaxHandler.cs | 61 +++++++++++++- .../WebsitePanel/Domains.ascx.cs | 24 +++++- .../WebsitePanel/IPAddresses.ascx.cs | 13 ++- .../WebsitePanel/IPAddresses.ascx.designer.cs | 31 +------ .../WebsitePanel/PhoneNumbers.ascx.cs | 13 ++- .../PhoneNumbers.ascx.designer.cs | 40 +-------- .../WebsitePanel/Schedules.ascx.cs | 12 +++ .../WebsitePanel/Schedules.ascx.designer.cs | 28 ------- .../WebsitePanel/SpaceNestedSpaces.ascx.cs | 15 ++++ .../SpaceNestedSpaces.ascx.designer.cs | 82 +++++++++++-------- .../UserControls/PackageIPAddresses.ascx.cs | 14 ++++ .../PackageIPAddresses.ascx.designer.cs | 31 +------ .../UserControls/PackagePhoneNumbers.ascx.cs | 14 ++++ .../PackagePhoneNumbers.ascx.designer.cs | 29 ------- .../WebsitePanel/UserControls/SearchBox.ascx | 30 ++++--- .../UserControls/SearchBox.ascx.cs | 14 ++++ .../UserControls/SpaceServiceItems.ascx.cs | 16 ++++ .../UserControls/UserLookup.ascx.cs | 13 +++ .../WebsitePanel/UserCustomers.ascx.cs | 18 +++- .../WebsitePanel/UserCustomersSummary.ascx | 4 +- .../WebsitePanel/UserCustomersSummary.ascx.cs | 4 +- .../UserCustomersSummary.ascx.designer.cs | 18 ---- .../WebsitePanel/VPS/VdcHome.ascx.cs | 13 +++ .../WebsitePanel/VPS/VdcHome.ascx.designer.cs | 40 +-------- .../VPS/VdcPrivateNetwork.ascx.cs | 12 +++ .../WebsitePanel/VPS2012/VdcHome.ascx.cs | 15 +++- .../VPS2012/VdcPrivateNetwork.ascx.cs | 12 +++ .../WebsitePanel/VPSForPC/VdcHome.ascx.cs | 13 +++ .../VPSForPC/VdcPrivateNetwork.ascx.cs | 12 +++ 34 files changed, 458 insertions(+), 289 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/PackagesProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/PackagesProxy.cs index 04417d1e..a5ffbef3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/PackagesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/PackagesProxy.cs @@ -943,6 +943,32 @@ namespace WebsitePanel.EnterpriseServer { return ((System.Data.DataSet)(results[0])); } + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSearchTableByColumns", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.Data.DataSet GetSearchTableByColumns(string PagedStored, string FilterValue, int MaximumRows, + bool Recursive, int PoolID, int ServerID, int StatusID, int PlanID, int OrgID, + string ItemTypeName, string GroupName, int PackageID, string VPSType, int RoleID, int UserID, + string FilterColumns) + { + object[] results = this.Invoke("GetSearchTableByColumns", new object[] { + PagedStored, + FilterValue, + MaximumRows, + Recursive, + PoolID, + ServerID, + StatusID, + PlanID, + OrgID, + ItemTypeName, + GroupName, + PackageID, + VPSType, + RoleID, + UserID, + FilterColumns + }); + return ((System.Data.DataSet)(results[0])); + } //TODO END /// diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 224ca09b..8c42edb9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -160,6 +160,31 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@FullType", fullType), new SqlParameter("@OnlyFind", onlyFind)); } + public static DataSet GetSearchTableByColumns(string PagedStored, string FilterValue, int MaximumRows, + bool Recursive, int PoolID, int ServerID, int ActorID, int StatusID, int PlanID, int OrgID, + string ItemTypeName, string GroupName, int PackageID, string VPSType, int RoleID, int UserID, + string FilterColumns) + { + return SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, + ObjectQualifier + "GetSearchTableByColumns", + new SqlParameter("@PagedStored", PagedStored), + new SqlParameter("@FilterValue", FilterValue), + new SqlParameter("@MaximumRows", MaximumRows), + new SqlParameter("@Recursive", Recursive), + new SqlParameter("@PoolID", PoolID), + new SqlParameter("@ServerID", ServerID), + new SqlParameter("@ActorID", ActorID), + new SqlParameter("@StatusID", StatusID), + new SqlParameter("@PlanID", PlanID), + new SqlParameter("@OrgID", OrgID), + new SqlParameter("@ItemTypeName", ItemTypeName), + new SqlParameter("@GroupName", GroupName), + new SqlParameter("@PackageID", PackageID), + new SqlParameter("@VPSType", VPSType), + new SqlParameter("@RoleID", RoleID), + new SqlParameter("@UserID", UserID), + new SqlParameter("@FilterColumns", FilterColumns)); + } //TODO END diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs index ba78d84c..fcb2b7e5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs @@ -326,6 +326,15 @@ namespace WebsitePanel.EnterpriseServer filterColumn, filterValue, statusId, roleId, sortColumn, startRow, maximumRows, colType, fullType, false, onlyFind); } + public static DataSet GetSearchTableByColumns(string PagedStored, string FilterValue, int MaximumRows, + bool Recursive, int PoolID, int ServerID, int StatusID, int PlanID, int OrgID, + string ItemTypeName, string GroupName, int PackageID, string VPSType, int RoleID, int UserID, + string FilterColumns) + { + return DataProvider.GetSearchTableByColumns(PagedStored, FilterValue, MaximumRows, + Recursive, PoolID, ServerID, SecurityContext.User.UserId, StatusID, PlanID, OrgID, ItemTypeName, GroupName, + PackageID, VPSType, RoleID, UserID, FilterColumns); + } //TODO END public static DataSet GetPackageQuotas(int packageId) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esPackages.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esPackages.asmx.cs index 76c38fe1..ebdf4406 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esPackages.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esPackages.asmx.cs @@ -149,6 +149,17 @@ namespace WebsitePanel.EnterpriseServer { return PackageController.GetSearchObject(userId, filterColumn, filterValue, statusId, roleId, sortColumn, 0, maximumRows, colType, fullType, true); } + + [WebMethod] + public DataSet GetSearchTableByColumns(string PagedStored, string FilterValue, int MaximumRows, + bool Recursive, int PoolID, int ServerID, int StatusID, int PlanID, int OrgID, + string ItemTypeName, string GroupName, int PackageID, string VPSType, int RoleID, int UserID, + string FilterColumns) + { + return PackageController.GetSearchTableByColumns(PagedStored, FilterValue, MaximumRows, + Recursive, PoolID, ServerID, StatusID, PlanID, OrgID, ItemTypeName, GroupName, + PackageID, VPSType, RoleID, UserID, FilterColumns); + } //TODO END [WebMethod] diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalControlBase.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalControlBase.cs index 7e8eaf5d..6c3f1582 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalControlBase.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalControlBase.cs @@ -73,28 +73,31 @@ namespace WebsitePanel.WebPortal public string EditUrl(string keyName, string keyValue, string controlKey, params string[] additionalParams) { - List url = new List(); + return EditUrlStat(Request[DefaultPage.PAGE_ID_PARAM], ModuleID, keyName, keyValue, controlKey, additionalParams); + } - string pageId = Request[DefaultPage.PAGE_ID_PARAM]; + public static string EditUrlStat(string pageId, int ModuleID, string keyName, string keyValue, string controlKey, string[] additionalParams) + { + List url = new List(); if (!String.IsNullOrEmpty(pageId)) - url.Add(String.Concat(DefaultPage.PAGE_ID_PARAM, "=", pageId)); + url.Add(String.Concat(DefaultPage.PAGE_ID_PARAM, "=", pageId)); - url.Add(String.Concat(DefaultPage.MODULE_ID_PARAM, "=", ModuleID)); - url.Add(String.Concat(DefaultPage.CONTROL_ID_PARAM, "=", controlKey)); + url.Add(String.Concat(DefaultPage.MODULE_ID_PARAM, "=", ModuleID)); + url.Add(String.Concat(DefaultPage.CONTROL_ID_PARAM, "=", controlKey)); - if (!String.IsNullOrEmpty(keyName) && !String.IsNullOrEmpty(keyValue)) - { - url.Add(String.Concat(keyName, "=", keyValue)); - } + if (!String.IsNullOrEmpty(keyName) && !String.IsNullOrEmpty(keyValue)) + { + url.Add(String.Concat(keyName, "=", keyValue)); + } - if (additionalParams != null) - { - foreach(string additionalParam in additionalParams) - url.Add(additionalParam); - } + if (additionalParams != null) + { + foreach (string additionalParam in additionalParams) + url.Add(additionalParam); + } - return "~/Default.aspx?" + String.Join("&", url.ToArray()); - } + return "~/Default.aspx?" + String.Join("&", url.ToArray()); + } } } 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 114d03c5..422755bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/AjaxHandler.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/AjaxHandler.cs @@ -9,12 +9,71 @@ namespace WebsitePanel.WebPortal { public class WebsitePanelAjaxHandler : IHttpHandler { + public bool IsReusable { get { return true; } } public void ProcessRequest(HttpContext context) { - String filterValue = context.Request.Params["term"]; String fullType = context.Request.Params["fullType"]; + if (fullType == "TableSearch") + { + JavaScriptSerializer serializer = new JavaScriptSerializer(); + string PagedStored = context.Request.Params["PagedStored"]; + string FilterValue = context.Request.Params["FilterValue"]; + string strMaximumRows = context.Request.Params["MaximumRows"]; + int MaximumRows = strMaximumRows != null ? Int32.Parse(strMaximumRows) : 15; + string strRecursive = context.Request.Params["Recursive"]; + bool Recursive = strRecursive != null ? serializer.Deserialize(strRecursive) : false; + string strPoolID = context.Request.Params["PoolID"]; + int PoolID = strPoolID != null ? Int32.Parse(strPoolID) : 0; + string strServerID = context.Request.Params["ServerID"]; + int ServerID = !String.IsNullOrEmpty(strServerID) ? Int32.Parse(strServerID) : 0; + string strStatusID = context.Request.Params["StatusID"]; + int StatusID = !String.IsNullOrEmpty(strStatusID) ? Int32.Parse(strStatusID) : 0; + string strPlanID = context.Request.Params["PlanID"]; + int PlanID = !String.IsNullOrEmpty(strPlanID) ? Int32.Parse(strPlanID) : 0; + string strOrgID = context.Request.Params["OrgID"]; + int OrgID = !String.IsNullOrEmpty(strOrgID) ? Int32.Parse(strOrgID) : 0; + string ItemTypeName = context.Request.Params["ItemTypeName"]; + string GroupName = context.Request.Params["GroupName"]; + string strPackageID = context.Request.Params["PackageID"]; + int PackageID = !String.IsNullOrEmpty(strPackageID) ? Int32.Parse(strPackageID) : -1; + string VPSType = context.Request.Params["VPSType"]; + string strRoleID = context.Request.Params["RoleID"]; + int RoleID = !String.IsNullOrEmpty(strRoleID) ? Int32.Parse(strRoleID) : 0; + string strUserID = context.Request.Params["UserID"]; + int UserID = !String.IsNullOrEmpty(strUserID) ? Int32.Parse(strUserID) : 0; + string FilterColumns = context.Request.Params["FilterColumns"]; + + string RedirectUrl = context.Request.Params["RedirectUrl"]; + + DataSet dsObjectItems = ES.Services.Packages.GetSearchTableByColumns(PagedStored, + String.Format("%{0}%", FilterValue), MaximumRows, Recursive, PoolID, ServerID, + StatusID, PlanID, OrgID, ItemTypeName, GroupName, PackageID, VPSType, RoleID, UserID, + FilterColumns); + + DataTable dt = dsObjectItems.Tables[0]; + List> dataList = new List>(); + string Redirect = context.Request.Params["Redirect"]; + for (int i = 0; i < dt.Rows.Count; ++i) + { + DataRow row = dt.Rows[i]; + Dictionary obj = new Dictionary(); + if (!String.IsNullOrEmpty(RedirectUrl) && ((int)row["Count"] == 1)) + obj["url"] = String.Format(RedirectUrl, row["ItemID"].ToString()); + obj["TextSearch"] = row["TextSearch"].ToString(); + obj["ColumnType"] = row["ColumnType"].ToString(); + dataList.Add(obj); + } + + var jsonSerialiser = new JavaScriptSerializer(); + var json = jsonSerialiser.Serialize(dataList); + context.Response.ContentType = "text/plain"; + context.Response.Write(json); + return; + } + + String filterValue = context.Request.Params["term"]; String columnType = context.Request.Params["columnType"]; String numResults = context.Request.Params["itemCount"]; int iNumResults = 15; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx.cs index 8bb0d637..65be549f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx.cs @@ -40,6 +40,7 @@ using System.Linq; using WebsitePanel.EnterpriseServer; using System.Collections.Generic; +using System.Text; namespace WebsitePanel.Portal { @@ -71,10 +72,14 @@ namespace WebsitePanel.Portal || PackagesHelper.CheckGroupQuotaEnabled(PanelSecurity.PackageId, ResourceGroups.Os, Quotas.OS_DOMAINPOINTERS); searchBox.AddCriteria("DomainName", GetLocalizedString("SearchField.DomainName")); - searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); - searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.FullName")); - searchBox.AddCriteria("Email", GetLocalizedString("SearchField.Email")); + if ((PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked) + { + searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); + searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.FullName")); + searchBox.AddCriteria("Email", GetLocalizedString("SearchField.Email")); + } } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } public string GetItemEditUrl(object packageId, object itemId) @@ -113,7 +118,7 @@ namespace WebsitePanel.Portal { var expirationDate = expirationDateObject as DateTime?; var lastUpdateDate = LastUpdateDateObject as DateTime?; - + if (expirationDate != null && expirationDate < DateTime.Now) { return GetLocalizedString("DomainExpirationDate.Expired"); @@ -239,5 +244,16 @@ namespace WebsitePanel.Portal //gvDomains.DataBind(); } } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'Domains'"); + res.Append(", RedirectUrl: '" + GetItemEditUrl(Request["SpaceID"] ?? "-1", "{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "-1" : Request["SpaceID"])); + res.Append(", ServerID: " + (String.IsNullOrEmpty(Request["ServerID"]) ? "0" : Request["ServerID"])); + res.Append(", Recursive: ($('#" + chkRecursive.ClientID + "').val() == 'on')"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/IPAddresses.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/IPAddresses.ascx.cs index 10757751..52b168e3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/IPAddresses.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/IPAddresses.ascx.cs @@ -65,8 +65,9 @@ namespace WebsitePanel.Portal searchBox.AddCriteria("DefaultGateway", GetLocalizedString("SearchField.DefaultGateway")); searchBox.AddCriteria("ServerName", GetLocalizedString("SearchField.Server")); searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); - searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); + searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); // toggle columns bool vps = ddlPools.SelectedIndex > 1; @@ -177,5 +178,15 @@ namespace WebsitePanel.Portal return items.ToArray(); } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'IPAddresses'"); + res.Append(", RedirectUrl: '" + EditUrl("AddressID", "{0}", "edit_ip", "ReturnUrl=" + GetReturnUrl()).Substring(2) + "'"); + res.Append(", PoolID: $('#" + ddlPools.ClientID + "').val()"); + res.Append(", ServerID: 0"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/IPAddresses.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/IPAddresses.ascx.designer.cs index af92c6c6..d1cc74ad 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/IPAddresses.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/IPAddresses.ascx.designer.cs @@ -1,38 +1,9 @@ -// Copyright (c) 2015, 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. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.cs index b119d3a8..0c2c5a5c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.cs @@ -58,8 +58,9 @@ namespace WebsitePanel.Portal searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP")); searchBox.AddCriteria("ServerName", GetLocalizedString("SearchField.Server")); searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); - searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); + searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } protected void odsIPAddresses_Selected(object sender, ObjectDataSourceStatusEventArgs e) @@ -153,5 +154,15 @@ namespace WebsitePanel.Portal return items.ToArray(); } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'IPAddresses'"); + res.Append(", RedirectUrl: '" + EditUrl("AddressID", "{0}", "edit_phone").Substring(2) + "'"); + res.Append(", PoolID: 'PhoneNumbers'"); + res.Append(", ServerID: 0"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs index 2beefe5e..5971984b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs @@ -1,38 +1,9 @@ -// Copyright (c) 2015, 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. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -47,7 +18,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; @@ -57,7 +27,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::System.Web.UI.WebControls.Button btnAddItem; @@ -67,7 +36,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::WebsitePanel.Portal.SearchBox searchBox; @@ -77,7 +45,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::System.Web.UI.WebControls.GridView gvIPAddresses; @@ -87,7 +54,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::System.Web.UI.WebControls.ObjectDataSource odsIPAddresses; @@ -97,7 +63,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::System.Web.UI.WebControls.Button btnEditSelected; @@ -107,7 +72,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::System.Web.UI.WebControls.Button btnDeleteSelected; @@ -117,7 +81,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::System.Web.UI.WebControls.Label lblItemsPerPage; @@ -127,7 +90,6 @@ namespace WebsitePanel.Portal { /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. - /// protected global::System.Web.UI.WebControls.DropDownList ddlItemsPerPage; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.cs index fcfb853a..b8f47685 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.cs @@ -38,6 +38,7 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.EnterpriseServer; +using System.Text; namespace WebsitePanel.Portal { @@ -67,6 +68,7 @@ namespace WebsitePanel.Portal gvSchedules.Columns[gvSchedules.Columns.Count - 1].Visible = !isUser; gvSchedules.Columns[gvSchedules.Columns.Count - 2].Visible = !isUser; } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } protected void odsSchedules_Selected(object sender, ObjectDataSourceStatusEventArgs e) @@ -163,5 +165,15 @@ namespace WebsitePanel.Portal { RedirectToBrowsePage(); } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'Schedules'"); + res.Append(", RedirectUrl: '" + EditUrl("ScheduleID", "{0}", "edit", "SpaceID=" + PanelSecurity.PackageId).Substring(2) + "'"); + res.Append(", PackageID: " + PanelSecurity.PackageId.ToString()); + res.Append(", Recursive: ($('#" + chkRecursive.ClientID + "').val() == 'on')"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.designer.cs index 99a5f446..f7cffb9e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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/SpaceNestedSpaces.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpaces.ascx.cs index 5b568bc7..b528e1ce 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpaces.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpaces.ascx.cs @@ -36,6 +36,7 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; +using System.Text; namespace WebsitePanel.Portal { @@ -60,6 +61,7 @@ namespace WebsitePanel.Portal if (Request["StatusID"] != null) Utils.SelectListItem(ddlStatus, Request["StatusID"]); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } public string GetUserHomePageUrl(int userId) @@ -87,5 +89,18 @@ namespace WebsitePanel.Portal e.ExceptionHandled = true; } } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'NestedPackages'"); + res.Append(", RedirectUrl: '" + NavigateURL(PortalUtils.SPACE_ID_PARAM, "{0}").Substring(2) + "'"); + + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", StatusID: $('#" + ddlStatus.ClientID + "').val()"); + res.Append(", PlanID: " + (String.IsNullOrEmpty(Request["PlanID"]) ? "0" : Request["PlanID"])); + res.Append(", ServerID: " + (String.IsNullOrEmpty(Request["ServerID"]) ? "0" : Request["ServerID"])); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpaces.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpaces.ascx.designer.cs index 71bfc6b6..897efef2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpaces.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpaces.ascx.designer.cs @@ -1,48 +1,60 @@ -// Copyright (c) 2015, 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. -// Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { + public partial class SpaceNestedSpaces { - protected WebsitePanel.Portal.SearchBox searchBox; - protected System.Web.UI.WebControls.Label lblStatus; - protected System.Web.UI.WebControls.DropDownList ddlStatus; - protected System.Web.UI.WebControls.GridView gvPackages; - protected System.Web.UI.WebControls.ObjectDataSource odsNestedPackages; + + /// + /// searchBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.SearchBox searchBox; + + /// + /// lblStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblStatus; + + /// + /// ddlStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlStatus; + + /// + /// gvPackages control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPackages; + + /// + /// odsNestedPackages control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsNestedPackages; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackageIPAddresses.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackageIPAddresses.ascx.cs index 37444de3..4142127d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackageIPAddresses.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackageIPAddresses.ascx.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; +using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; @@ -87,6 +88,7 @@ namespace WebsitePanel.Portal.UserControls searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); bool isUserSelected = PanelSecurity.SelectedUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; bool isUserLogged = PanelSecurity.EffectiveUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; @@ -177,5 +179,17 @@ namespace WebsitePanel.Portal.UserControls { e.InputParameters["pool"] = Pool; } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'PackageIPAddresses'"); + res.Append(", RedirectUrl: '" + GetItemEditUrl("{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", OrgID: 0"); + res.Append(", PoolID: " + Pool != null ? Pool.ToString() : "0"); + res.Append(", Recursive: true"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackageIPAddresses.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackageIPAddresses.ascx.designer.cs index f8633371..e01acbfe 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackageIPAddresses.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackageIPAddresses.ascx.designer.cs @@ -1,38 +1,9 @@ -// Copyright (c) 2015, 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. -// Runtime Version:2.0.50727.1434 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.cs index 92d49220..2b290107 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; +using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; @@ -82,6 +83,7 @@ namespace WebsitePanel.Portal.UserControls searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); bool isUserSelected = PanelSecurity.SelectedUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; bool isUserLogged = PanelSecurity.EffectiveUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; @@ -169,5 +171,17 @@ namespace WebsitePanel.Portal.UserControls { e.InputParameters["pool"] = Pool; } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'PackageIPAddresses'"); + res.Append(", RedirectUrl: '" + GetItemEditUrl("{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", OrgID: " + (String.IsNullOrEmpty(Request["ItemID"]) ? "0" : Request["ItemID"])); + res.Append(", PoolID: " + Pool != null ? Pool.ToString() : "0"); + res.Append(", Recursive: true"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.designer.cs index 37e22504..0ed28815 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. @@ -35,7 +7,6 @@ // //------------------------------------------------------------------------------ - namespace WebsitePanel.Portal.UserControls { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx index fec886fd..59c3fb28 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx @@ -19,15 +19,21 @@ type: "post", dataType: "json", data: { - term: request.term, - fullType: 'Users' -// columnType: "'" + $("#ddlFilterColumn").val() + "'" + fullType: "TableSearch", + FilterValue: request.term, + FilterColumns: "<%= GetCriterias() %>", + <%= AjaxData %> }, url: "AjaxHandler.ashx", success: function (data) { response($.map(data, function (item) { + var type = $('#<%= ddlFilterColumn.ClientID %> option[value="' + item.ColumnType + '"]').text(); + if (type == null) { + type = item.ColumnType; + } + $('#<%= ddlFilterColumn.ClientID %> :selected').removeAttr('selected') return { - label: item.TextSearch + " [" + item.ColumnType + "]", + label: item.TextSearch + " [" + type + "]", code: item }; })); @@ -36,13 +42,13 @@ }, select: function (event, ui) { var item = ui.item; - $("#ddlFilterColumn").val(item.code.ColumnType); - $("#tbSearchFullType").val(item.code.FullType); - $("#tbSearchText").val(item.code.TextSearch); - $("#tbObjectId").val(item.code.ItemID); - $("#tbPackageId").val(item.code.PackageID); - $("#tbAccountId").val(item.code.AccountID); - $("#<%= cmdSearch.ClientID %>").trigger("click"); + if (item.code.url != null) + window.location.href = item.code.url; + else { + $("#ddlFilterColumn").val(item.code.ColumnType); + $("#tbSearchText").val(item.code.TextSearch); + $("#<%= cmdSearch.ClientID %>").trigger("click"); + } } }); });//]]> @@ -111,8 +117,8 @@ runat="server" SkinID="SearchButton" CausesValidation="false" - OnClick="cmdSearch_Click" style="vertical-align: middle;" + meta:resourcekey="cmdSearch" /> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx.cs index fe641c3e..48b68456 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx.cs @@ -41,6 +41,8 @@ namespace WebsitePanel.Portal { public partial class SearchBox : WebsitePanelControlBase { + public string AjaxData { get; set; } + public string FilterColumn { get @@ -90,6 +92,18 @@ namespace WebsitePanel.Portal ddlFilterColumn.Items.Add(new ListItem(columnTitle, columnName)); } + public string GetCriterias() + { + string res = null; + foreach (ListItem itm in ddlFilterColumn.Items) + { + if (res != null) + res += ", "; + res = res + "'" + itm.Value + "'"; + } + return res; + } + public override void Focus() { base.Focus(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs index 87abb4ac..68d95c28 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs @@ -38,6 +38,7 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.EnterpriseServer; +using System.Text; namespace WebsitePanel.Portal.UserControls { @@ -130,6 +131,7 @@ namespace WebsitePanel.Portal.UserControls searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.FullName")); searchBox.AddCriteria("Email", GetLocalizedString("SearchField.EMail")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } public string GetUrl(object param1, object param2) @@ -236,5 +238,19 @@ namespace WebsitePanel.Portal.UserControls } } + public string GetSearchBoxAjaxData() + { + String spaceId = (String.IsNullOrEmpty(Request["SpaceID"]) ? "-1" : Request["SpaceID"]); + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'ServiceItems'"); + res.Append(", RedirectUrl: '" + GetItemEditUrl(spaceId, "{0}").Substring(2) + "'"); + res.Append(", PackageID: " + spaceId); + res.Append(", ItemTypeName: $('#" + litTypeName.ClientID + "').val()"); + res.Append(", GroupName: $('#" + litGroupName.ClientID + "').val()"); + res.Append(", ServerID: " + (String.IsNullOrEmpty(Request["ServerID"]) ? "0" : Request["ServerID"])); + res.Append(", Recursive: ($('#" + chkRecursive.ClientID + "').val() == 'on')"); + return res.ToString(); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UserLookup.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UserLookup.ascx.cs index de183967..06cf8aad 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UserLookup.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UserLookup.ascx.cs @@ -36,6 +36,7 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; +using System.Text; namespace WebsitePanel.Portal { @@ -71,6 +72,7 @@ namespace WebsitePanel.Portal if (!AllowEmptySelection) RemoveMenuItem("switch_empty"); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } private void RemoveMenuItem(string name) @@ -140,5 +142,16 @@ namespace WebsitePanel.Portal { ToggleSearchPanel(false); } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'Users'"); + res.Append(", UserID: " + PanelSecurity.EffectiveUserId.ToString()); + res.Append(", StatusID: 0"); + res.Append(", RoleID: 0"); + res.Append(", Recursive: true"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx.cs index dcff1658..9e2570d7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx.cs @@ -38,6 +38,8 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.EnterpriseServer; +using WebsitePanel.WebPortal; +using System.Text; namespace WebsitePanel.Portal { @@ -68,7 +70,8 @@ namespace WebsitePanel.Portal gvUsers.Sort("Username", System.Web.UI.WebControls.SortDirection.Ascending); - } + } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); searchBox.Focus(); } @@ -125,5 +128,18 @@ namespace WebsitePanel.Portal return GetThemedImage("Exchange/" + imgName); } + public string GetSearchBoxAjaxData() + { + string userHomePageId = PortalConfiguration.SiteSettings["UserHomePage"]; + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'Users'"); + res.Append(", RedirectUrl: '" + NavigatePageURL(userHomePageId, PortalUtils.USER_ID_PARAM, "{0}").Substring(2) + "'"); + res.Append(", UserID: " + (String.IsNullOrEmpty(Request["UserID"]) ? "0" : Request["UserID"])); + res.Append(", StatusID: $('#" + ddlStatus.ClientID + "').val()"); + res.Append(", RoleID: $('#" + ddlRole.ClientID + "').val()"); + res.Append(", Recursive: false"); + return res.ToString(); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx index 6e1cfa8f..32d63557 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx @@ -9,9 +9,9 @@ runat="server" CssClass="Button1">
- + <%-- - + --%>
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs index ba879d62..385b5159 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs @@ -47,11 +47,11 @@ namespace WebsitePanel.Portal if (!IsPostBack) { - searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); + /*searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.Name")); searchBox.AddCriteria("Email", GetLocalizedString("SearchField.EMail")); searchBox.AddCriteria("CompanyName", GetLocalizedString("SearchField.CompanyName")); - searchBox.Focus(); + searchBox.Focus();*/ } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.designer.cs index bb552025..23343195 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.designer.cs @@ -21,24 +21,6 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.Button btnCreate; - /// - /// tblSearch control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel tblSearch; - - /// - /// searchBox control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.SearchBox searchBox; - /// /// allCustomers control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcHome.ascx.cs index ba37b8e8..b39fdc8d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcHome.ascx.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; +using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; @@ -46,6 +47,7 @@ namespace WebsitePanel.Portal.VPS searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP")); searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); // toggle columns bool isUserSelected = PanelSecurity.SelectedUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; @@ -134,5 +136,16 @@ namespace WebsitePanel.Portal.VPS "ItemID=" + itemId)); } } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'VirtualMachines'"); + res.Append(", RedirectUrl: '" + GetServerEditUrl("{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", Recursive: true"); + res.Append(", VPSTypeID: 'VPS'"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcHome.ascx.designer.cs index 680bd21c..3a1cde30 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcHome.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcHome.ascx.designer.cs @@ -1,38 +1,9 @@ -// Copyright (c) 2015, 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. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -202,14 +173,5 @@ namespace WebsitePanel.Portal.VPS { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.Quota hddQuota; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcPrivateNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcPrivateNetwork.ascx.cs index 9d85b3cf..3d805787 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcPrivateNetwork.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcPrivateNetwork.ascx.cs @@ -34,6 +34,7 @@ using System.Web.UI.WebControls; using WebsitePanel.Providers.Virtualization; using WebsitePanel.WebPortal; using WebsitePanel.EnterpriseServer; +using System.Text; namespace WebsitePanel.Portal.VPS { @@ -46,6 +47,7 @@ namespace WebsitePanel.Portal.VPS searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } public string GetServerEditUrl(string itemID) @@ -62,5 +64,15 @@ namespace WebsitePanel.Portal.VPS e.ExceptionHandled = true; } } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'PackagePrivateIPAddresses'"); + res.Append(", RedirectUrl: '" + GetServerEditUrl("{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", VPSTypeID: 'VPS'"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs index a8f8e024..7a69ee9b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs @@ -28,9 +28,10 @@ using System; using System.Linq; +using System.Text; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; -using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Virtualization; namespace WebsitePanel.Portal.VPS2012 { @@ -45,6 +46,7 @@ namespace WebsitePanel.Portal.VPS2012 searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP")); searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); // toggle columns bool isUserSelected = PanelSecurity.SelectedUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; @@ -153,5 +155,16 @@ namespace WebsitePanel.Portal.VPS2012 "ItemID=" + itemId)); } } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'VirtualMachines'"); + res.Append(", RedirectUrl: '" + GetServerEditUrl("{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", Recursive: true"); + res.Append(", VPSTypeID: 'VPS2012'"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs index 62f0076e..85f2492b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs @@ -34,6 +34,7 @@ using System.Web.UI.WebControls; using WebsitePanel.Providers.Virtualization; using WebsitePanel.WebPortal; using WebsitePanel.EnterpriseServer; +using System.Text; namespace WebsitePanel.Portal.VPS2012 { @@ -46,6 +47,7 @@ namespace WebsitePanel.Portal.VPS2012 searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } public string GetServerEditUrl(string itemID) @@ -62,5 +64,15 @@ namespace WebsitePanel.Portal.VPS2012 e.ExceptionHandled = true; } } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'PackagePrivateIPAddresses'"); + res.Append(", RedirectUrl: '" + GetServerEditUrl("{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", VPSTypeID: 'VPS2012'"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcHome.ascx.cs index f80b86df..f869bd84 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcHome.ascx.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; +using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; @@ -46,6 +47,7 @@ namespace WebsitePanel.Portal.VPSForPC searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP")); searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); // toggle columns bool isUserSelected = PanelSecurity.SelectedUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; @@ -138,5 +140,16 @@ namespace WebsitePanel.Portal.VPSForPC "ItemID=" + itemId)); } } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'VirtualMachines'"); + res.Append(", RedirectUrl: '" + GetServerEditUrl("{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", Recursive: true"); + res.Append(", VPSTypeID: 'VPSForPC'"); + return res.ToString(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcPrivateNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcPrivateNetwork.ascx.cs index 6ebf3d77..a0127670 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcPrivateNetwork.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcPrivateNetwork.ascx.cs @@ -34,6 +34,7 @@ using System.Web.UI.WebControls; using WebsitePanel.Providers.Virtualization; using WebsitePanel.WebPortal; using WebsitePanel.EnterpriseServer; +using System.Text; namespace WebsitePanel.Portal.VPSForPC { @@ -46,6 +47,7 @@ namespace WebsitePanel.Portal.VPSForPC searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); } + searchBox.AjaxData = this.GetSearchBoxAjaxData(); } public string GetServerEditUrl(string itemID) @@ -62,5 +64,15 @@ namespace WebsitePanel.Portal.VPSForPC e.ExceptionHandled = true; } } + + public string GetSearchBoxAjaxData() + { + StringBuilder res = new StringBuilder(); + res.Append("PagedStored: 'PackagePrivateIPAddresses'"); + res.Append(", RedirectUrl: '" + GetServerEditUrl("{0}").Substring(2) + "'"); + res.Append(", PackageID: " + (String.IsNullOrEmpty(Request["SpaceID"]) ? "0" : Request["SpaceID"])); + res.Append(", VPSTypeID: 'VPSForPC'"); + return res.ToString(); + } } }