diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 6b47049c..5126597e 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -10848,7 +10848,8 @@ CREATE PROCEDURE [dbo].[GetSearchObject] @MaximumRows int = 0, @Recursive bit, @ColType nvarchar(50) = '', - @FullType nvarchar(50) = '' + @FullType nvarchar(50) = '', + @OnlyFind bit ) AS @@ -10886,8 +10887,12 @@ DECLARE @Users TABLE UserID int ) INSERT INTO @Users (UserID) -SELECT - U.UserID +SELECT ' + +IF @OnlyFind = 1 +SET @sqlUsers = @sqlUsers + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' ' + +SET @sqlUsers = @sqlUsers + 'U.UserID FROM UsersDetailed AS U WHERE U.UserID <> @UserID AND U.IsPeer = 0 AND @@ -10937,8 +10942,12 @@ SET @sqlSpace = ' ItemID int ) INSERT INTO @ItemsService (ItemID) - SELECT - SI.ItemID + SELECT ' + +IF @OnlyFind = 1 +SET @sqlSpace = @sqlSpace + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' ' + +SET @sqlSpace = @sqlSpace + 'SI.ItemID FROM ServiceItems AS SI INNER JOIN Packages AS P ON P.PackageID = SI.PackageID INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/PackagesProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/PackagesProxy.cs index 0791687f..04417d1e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/PackagesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/PackagesProxy.cs @@ -926,6 +926,22 @@ namespace WebsitePanel.EnterpriseServer { }); return ((System.Data.DataSet)(results[0])); } + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSearchObjectQuickFind", 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 GetSearchObjectQuickFind(int userId, string filterColumn, string filterValue, int statusId, int roleId, string sortColumn, int maximumRows, string colType, string fullType) + { + object[] results = this.Invoke("GetSearchObjectQuickFind", new object[] { + userId, + filterColumn, + filterValue, + statusId, + roleId, + sortColumn, + maximumRows, + colType, + fullType + }); + 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 1872124c..224ca09b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -141,7 +141,8 @@ namespace WebsitePanel.EnterpriseServer //TODO START public static DataSet GetSearchObject(int actorId, int userId, string filterColumn, string filterValue, - int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType, string fullType, bool recursive) + int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType, string fullType, + bool recursive, bool onlyFind) { return SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, ObjectQualifier + "GetSearchObject", @@ -156,7 +157,8 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@MaximumRows", maximumRows), new SqlParameter("@Recursive", recursive), new SqlParameter("@ColType", colType), - new SqlParameter("@FullType", fullType)); + new SqlParameter("@FullType", fullType), + new SqlParameter("@OnlyFind", onlyFind)); } //TODO END diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs index 1c920bda..ba78d84c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs @@ -319,10 +319,12 @@ namespace WebsitePanel.EnterpriseServer //TODO START public static DataSet GetSearchObject(int userId, string filterColumn, string filterValue, - int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType, string fullType) + int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType, + string fullType, bool onlyFind) { return DataProvider.GetSearchObject(SecurityContext.User.UserId, userId, - filterColumn, filterValue, statusId, roleId, sortColumn, startRow, maximumRows, colType, fullType, false); + filterColumn, filterValue, statusId, roleId, sortColumn, startRow, + maximumRows, colType, fullType, false, onlyFind); } //TODO END diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esPackages.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esPackages.asmx.cs index 36804d26..76c38fe1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esPackages.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esPackages.asmx.cs @@ -140,7 +140,14 @@ namespace WebsitePanel.EnterpriseServer public DataSet GetSearchObject(int userId, string filterColumn, string filterValue, int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType, string fullType) { - return PackageController.GetSearchObject(userId, filterColumn, filterValue, statusId, roleId, sortColumn, startRow, maximumRows, colType, fullType); + return PackageController.GetSearchObject(userId, filterColumn, filterValue, statusId, roleId, sortColumn, startRow, maximumRows, colType, fullType, false); + } + + [WebMethod] + public DataSet GetSearchObjectQuickFind(int userId, string filterColumn, string filterValue, + int statusId, int roleId, string sortColumn, int maximumRows, string colType, string fullType) + { + return PackageController.GetSearchObject(userId, filterColumn, filterValue, statusId, roleId, sortColumn, 0, maximumRows, colType, fullType, true); } //TODO END 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 0485356a..3c67a53e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5874,4 +5874,7 @@ Sms was not sent. + + Not found + \ No newline at end of file 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 9984e93d..114d03c5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/AjaxHandler.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/AjaxHandler.cs @@ -54,9 +54,8 @@ namespace WebsitePanel.WebPortal } else { - DataSet dsObjectItems = ES.Services.Packages.GetSearchObject(PanelSecurity.EffectiveUserId, null, - String.Format("%{0}%", filterValue), - 0, 0, "", 0, iNumResults, columnType, fullType); + DataSet dsObjectItems = ES.Services.Packages.GetSearchObjectQuickFind(PanelSecurity.EffectiveUserId, null, + String.Format("%{0}%", filterValue), 0, 0, "", iNumResults, columnType, fullType); DataTable dt = dsObjectItems.Tables[2]; List> dataList = new List>(); for (int i = 0; i < dt.Rows.Count; ++i) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SearchObject.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SearchObject.ascx index 315de47e..6913e88b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SearchObject.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SearchObject.ascx @@ -63,7 +63,7 @@ AllowPaging="True" AllowSorting="True" CssSelectorClass="NormalGridView" DataSourceID="odsObjectsPaged" EnableViewState="False" - EmptyDataText="gvObjects"> + EmptyDataText=<%# GetSharedLocalizedString("SearchObject.NOT_FOUND") %>> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/GlobalSearch.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/GlobalSearch.ascx index a7dde17a..936e6ac6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/GlobalSearch.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/GlobalSearch.ascx @@ -45,8 +45,9 @@ $("#<%= tbObjectId.ClientID %>").val(item.code.ItemID); $("#<%= tbPackageId.ClientID %>").val(item.code.PackageID); $("#<%= tbAccountId.ClientID %>").val(item.code.AccountID); - $("#<%= ImageButton1.ClientID %>").trigger("click"); - $("#<%= ImageButton1.ClientID %>").attr('disabled','disabled'); + var $ImgBtn = $("#<%= ImageButton1.ClientID %>"); + $ImgBtn.trigger("click"); + $ImgBtn.attr('disabled', 'disabled'); } }); });//]]>