Merge
This commit is contained in:
commit
bc673d852c
15 changed files with 227 additions and 49 deletions
|
@ -32,6 +32,8 @@ namespace WebsitePanel.WebPortal
|
|||
Dictionary<string, string> obj = new Dictionary<string, string>();
|
||||
obj["ColumnType"] = "PackageName";
|
||||
obj["TextSearch"] = row["PackageName"].ToString();
|
||||
obj["ItemID"] = row["ItemID"].ToString();
|
||||
obj["PackageID"] = row["PackageID"].ToString();
|
||||
obj["FullType"] = "Space";
|
||||
dataList.Add(obj);
|
||||
}
|
||||
|
@ -45,17 +47,22 @@ namespace WebsitePanel.WebPortal
|
|||
{
|
||||
DataSet dsObjectItems = ES.Services.Packages.GetSearchObject(PanelSecurity.EffectiveUserId, null,
|
||||
String.Format("%{0}%", filterValue),
|
||||
0, 0, "", 0, 100, columnType);
|
||||
0, 0, "", 0, 100, columnType,fullType);
|
||||
DataTable dt = dsObjectItems.Tables[2];
|
||||
List<Dictionary<string, string>> dataList = new List<Dictionary<string, string>>();
|
||||
for (int i = 0; i < dt.Rows.Count; ++i)
|
||||
{
|
||||
DataRow row = dt.Rows[i];
|
||||
Dictionary<string, string> obj = new Dictionary<string, string>();
|
||||
obj["ColumnType"] = row["ColumnType"].ToString();
|
||||
obj["TextSearch"] = row["TextSearch"].ToString();
|
||||
obj["FullType"] = row["FullType"].ToString();
|
||||
dataList.Add(obj);
|
||||
if ((fullType == null) || (fullType.Length == 0) || (fullType == row["FullType"].ToString()))
|
||||
{
|
||||
Dictionary<string, string> obj = new Dictionary<string, string>();
|
||||
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();
|
||||
dataList.Add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
var jsonSerialiser = new JavaScriptSerializer();
|
||||
|
|
|
@ -250,25 +250,25 @@ namespace WebsitePanel.Portal
|
|||
#region Service Items Paged Search
|
||||
DataSet dsObjectItemsPaged;
|
||||
|
||||
public int SearchObjectItemsPagedCount(string filterColumn, string filterValue, string colType)
|
||||
public int SearchObjectItemsPagedCount(string filterColumn, string filterValue, string fullType, string colType)
|
||||
{
|
||||
return (int)dsObjectItemsPaged.Tables[0].Rows[0][0];
|
||||
}
|
||||
|
||||
public DataTable SearchObjectItemsPaged(int maximumRows, int startRowIndex, string sortColumn,
|
||||
string filterColumn, string filterValue, string colType)
|
||||
string filterColumn, string filterValue, string colType, string fullType)
|
||||
{
|
||||
dsObjectItemsPaged = ES.Services.Packages.GetSearchObject(PanelSecurity.EffectiveUserId, filterColumn,
|
||||
String.Format("%{0}%", filterValue),
|
||||
0, 0, sortColumn, startRowIndex, maximumRows, colType);
|
||||
0, 0, sortColumn, startRowIndex, maximumRows, colType, fullType);
|
||||
return dsObjectItemsPaged.Tables[2];
|
||||
}
|
||||
|
||||
public DataTable SearchObjectTypes(string filterColumn, string filterValue, string sortColumn)
|
||||
public DataTable SearchObjectTypes(string filterColumn, string filterValue, string fullType, string sortColumn)
|
||||
{
|
||||
dsObjectItemsPaged = ES.Services.Packages.GetSearchObject(PanelSecurity.EffectiveUserId, filterColumn,
|
||||
String.Format("%{0}%", filterValue),
|
||||
0, 0, sortColumn, 0, 0, "");
|
||||
0, 0, sortColumn, 0, 0, "",fullType);
|
||||
return dsObjectItemsPaged.Tables[1];
|
||||
}
|
||||
//TODO END
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
<SelectParameters>
|
||||
<asp:QueryStringParameter Name="filterColumn" QueryStringField="Criteria" />
|
||||
<asp:QueryStringParameter Name="filterValue" QueryStringField="Query" />
|
||||
<asp:QueryStringParameter Name="fullType" QueryStringField="FullType" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
|
||||
|
@ -99,6 +100,7 @@
|
|||
<SelectParameters>
|
||||
<asp:QueryStringParameter Name="filterColumn" QueryStringField="Criteria" />
|
||||
<asp:QueryStringParameter Name="filterValue" QueryStringField="Query" />
|
||||
<asp:QueryStringParameter Name="fullType" QueryStringField="FullType" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
|
||||
|
|
|
@ -6,6 +6,14 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$("#<%= tbSearch.ClientID %>").keypress(function (e) {
|
||||
if (e.keyCode != 13) { // VK_RETURN
|
||||
$("#<%= tbSearchText.ClientID %>").val('');
|
||||
$("#<%= tbObjectId.ClientID %>").val('');
|
||||
$("#<%= tbPackageId.ClientID %>").val('');
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#<%= tbSearch.ClientID %>").autocomplete({
|
||||
zIndex: 100,
|
||||
|
@ -33,12 +41,15 @@
|
|||
$("#<%= tbSearchColumnType.ClientID %>").val(item.code.ColumnType);
|
||||
$("#<%= tbSearchFullType.ClientID %>").val(item.code.FullType);
|
||||
$("#<%= tbSearchText.ClientID %>").val(item.code.TextSearch);
|
||||
$("#<%= tbObjectId.ClientID %>").val(item.code.ItemID);
|
||||
$("#<%= tbPackageId.ClientID %>").val(item.code.PackageID);
|
||||
$("#<%= ImageButton1.ClientID %>").trigger("click");
|
||||
}
|
||||
});
|
||||
});//]]>
|
||||
</script>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="updatePanelUsers" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||
<asp:Panel runat="server" ID="updatePanelUsers" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||
<ContentTemplate>
|
||||
<table cellpadding="0" cellspacing="0" align="right">
|
||||
<tr>
|
||||
|
@ -70,6 +81,18 @@
|
|||
type="hidden"
|
||||
>
|
||||
</asp:TextBox>
|
||||
<asp:TextBox
|
||||
ID="tbObjectId"
|
||||
runat="server"
|
||||
type="hidden"
|
||||
>
|
||||
</asp:TextBox>
|
||||
<asp:TextBox
|
||||
ID="tbPackageId"
|
||||
runat="server"
|
||||
type="hidden"
|
||||
>
|
||||
</asp:TextBox>
|
||||
|
||||
<asp:ImageButton
|
||||
ID="ImageButton1"
|
||||
|
@ -84,4 +107,4 @@
|
|||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Panel>
|
||||
|
|
|
@ -44,6 +44,13 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
{
|
||||
public partial class GlobalSearch : WebsitePanelControlBase
|
||||
{
|
||||
const string TYPE_WEBSITE = "WebSite";
|
||||
const string TYPE_DOMAIN = "Domain";
|
||||
const string TYPE_ORGANIZATION = "Organization";
|
||||
const string PID_SPACE_WEBSITES = "SpaceWebSites";
|
||||
const string PID_SPACE_DIMAINS = "SpaceDomains";
|
||||
const string PID_SPACE_EXCHANGESERVER = "SpaceExchangeServer";
|
||||
|
||||
class Tab
|
||||
{
|
||||
int index;
|
||||
|
@ -115,6 +122,41 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
"ItemTypeID=" + ddlItemType.SelectedValue)); */
|
||||
}
|
||||
|
||||
public string GetItemPageUrl(string fullType, string itemType, int itemId, int spaceId)
|
||||
{
|
||||
string res = "";
|
||||
if (fullType.Equals("Users"))
|
||||
{
|
||||
res = PortalUtils.GetUserHomePageUrl(itemId);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (itemType)
|
||||
{
|
||||
case TYPE_WEBSITE:
|
||||
res = PortalUtils.NavigatePageURL(PID_SPACE_WEBSITES, "ItemID", itemId.ToString(),
|
||||
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, "ctl=edit_item",
|
||||
"moduleDefId=websites");
|
||||
break;
|
||||
case TYPE_DOMAIN:
|
||||
res = PortalUtils.NavigatePageURL(PID_SPACE_DIMAINS, "DomainID", itemId.ToString(),
|
||||
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, "ctl=edit_item",
|
||||
"moduleDefId=domains");
|
||||
break;
|
||||
case TYPE_ORGANIZATION:
|
||||
res = PortalUtils.NavigatePageURL(PID_SPACE_EXCHANGESERVER, "ItemID", itemId.ToString(),
|
||||
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, "ctl=edit_item",
|
||||
"moduleDefId=ExchangeServer");
|
||||
break;
|
||||
default:
|
||||
res = PortalUtils.GetSpaceHomePageUrl(itemId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
//TODO START
|
||||
protected void btnSearchObject_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -125,25 +167,46 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
{
|
||||
if (strFullType == "Users")
|
||||
{
|
||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetUsersSearchPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"Query=" + Server.UrlEncode(strText),
|
||||
"Criteria=" + Server.UrlEncode(strColumnType)
|
||||
));
|
||||
if (tbObjectId.Text.Length > 0)
|
||||
{
|
||||
Response.Redirect(PortalUtils.GetUserHomePageUrl(Int32.Parse(tbObjectId.Text)));
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetUsersSearchPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"Query=" + Server.UrlEncode(strText),
|
||||
"Criteria=" + Server.UrlEncode(strColumnType)
|
||||
));
|
||||
}
|
||||
}
|
||||
else if (strFullType == "Space")
|
||||
{
|
||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetSpacesSearchPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"Query=" + Server.UrlEncode(strText),
|
||||
"Criteria=" + Server.UrlEncode(strColumnType)
|
||||
));
|
||||
if (tbObjectId.Text.Length > 0)
|
||||
{
|
||||
Response.Redirect(GetItemPageUrl(strFullType,tbSearchColumnType.Text,Int32.Parse(tbObjectId.Text),Int32.Parse(tbPackageId.Text)));
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetSpacesSearchPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"Query=" + Server.UrlEncode(strText),
|
||||
"Criteria=" + Server.UrlEncode(strColumnType)
|
||||
));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetObjectSearchPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"Query=" + Server.UrlEncode(strText)));
|
||||
if (tbObjectId.Text.Length > 0)
|
||||
{
|
||||
Response.Redirect(GetItemPageUrl(strFullType, tbSearchColumnType.Text, Int32.Parse(tbObjectId.Text), Int32.Parse(tbPackageId.Text)));
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetObjectSearchPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"Query=" + Server.UrlEncode(strText)));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace WebsitePanel.Portal.SkinControls {
|
|||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdatePanel updatePanelUsers;
|
||||
protected global::System.Web.UI.WebControls.Panel updatePanelUsers;
|
||||
|
||||
/// <summary>
|
||||
/// tbSearch control.
|
||||
|
@ -57,6 +57,24 @@ namespace WebsitePanel.Portal.SkinControls {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tbSearchText;
|
||||
|
||||
/// <summary>
|
||||
/// tbObjectId control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tbObjectId;
|
||||
|
||||
/// <summary>
|
||||
/// tbPackageId control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tbPackageId;
|
||||
|
||||
/// <summary>
|
||||
/// ImageButton1 control.
|
||||
/// </summary>
|
||||
|
|
|
@ -3,8 +3,12 @@
|
|||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$(document).ready(function () {
|
||||
$("#tbSearch").keypress(function () {
|
||||
$("#tbSearchText").val('');
|
||||
$("#tbSearch").keypress(function (e) {
|
||||
if (e.keyCode != 13) { // VK_RETURN
|
||||
$("#tbSearchText").val('');
|
||||
$("#tbObjectId").val('');
|
||||
$("#tbPackageId").val('');
|
||||
}
|
||||
});
|
||||
|
||||
$("#tbSearch").autocomplete({
|
||||
|
@ -15,14 +19,14 @@
|
|||
dataType: "json",
|
||||
data: {
|
||||
term: request.term,
|
||||
fullType: '',
|
||||
columnType: "'" + $("#ddlFilterColumn").val() + "'"
|
||||
fullType: 'Users'
|
||||
// columnType: "'" + $("#ddlFilterColumn").val() + "'"
|
||||
},
|
||||
url: "AjaxHandler.ashx",
|
||||
success: function (data) {
|
||||
response($.map(data, function (item) {
|
||||
return {
|
||||
label: item.TextSearch,
|
||||
label: item.TextSearch + " [" + item.ColumnType + "]",
|
||||
code: item
|
||||
};
|
||||
}));
|
||||
|
@ -34,6 +38,9 @@
|
|||
$("#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);
|
||||
$("#<%= cmdSearch.ClientID %>").trigger("click");
|
||||
}
|
||||
});
|
||||
});//]]>
|
||||
|
@ -45,7 +52,7 @@
|
|||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:DropDownList ClientIDMode="Static" ID="ddlFilterColumn" runat="server" CssClass="NormalTextBox" resourcekey="ddlFilterColumn">
|
||||
<asp:DropDownList ClientIDMode="Static" ID="ddlFilterColumn" runat="server" CssClass="NormalTextBox" resourcekey="ddlFilterColumn" style="display:none">
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -76,7 +83,20 @@
|
|||
type="hidden"
|
||||
>
|
||||
</asp:TextBox>
|
||||
|
||||
<asp:TextBox
|
||||
ID="tbObjectId"
|
||||
ClientIDMode="Static"
|
||||
runat="server"
|
||||
type="hidden"
|
||||
>
|
||||
</asp:TextBox>
|
||||
<asp:TextBox
|
||||
ID="tbPackageId"
|
||||
ClientIDMode="Static"
|
||||
runat="server"
|
||||
type="hidden"
|
||||
>
|
||||
</asp:TextBox>
|
||||
<asp:ImageButton
|
||||
ID="cmdSearch"
|
||||
runat="server"
|
||||
|
|
|
@ -98,10 +98,27 @@ namespace WebsitePanel.Portal
|
|||
|
||||
protected void cmdSearch_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
Response.Redirect(NavigatePageURL(PortalUtils.GetUserCustomersPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"FilterColumn=" + ddlFilterColumn.SelectedValue,
|
||||
"FilterValue=" + Server.UrlEncode(FilterValue)));
|
||||
if (tbObjectId.Text.Length > 0)
|
||||
{
|
||||
Response.Redirect(PortalUtils.GetUserHomePageUrl(Int32.Parse(tbObjectId.Text)));
|
||||
}
|
||||
else
|
||||
{
|
||||
String strText = tbSearchText.Text;
|
||||
if (strText.Length > 0)
|
||||
{
|
||||
Response.Redirect(NavigatePageURL(PortalUtils.GetUserCustomersPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"FilterColumn=" + ddlFilterColumn.SelectedValue,
|
||||
"FilterValue=" + Server.UrlEncode(FilterValue)));
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetObjectSearchPageId(),
|
||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||
"Query=" + Server.UrlEncode(tbSearch.Text),"FullType=Users"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,24 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tbSearchText;
|
||||
|
||||
/// <summary>
|
||||
/// tbObjectId control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tbObjectId;
|
||||
|
||||
/// <summary>
|
||||
/// tbPackageId control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tbPackageId;
|
||||
|
||||
/// <summary>
|
||||
/// cmdSearch control.
|
||||
/// </summary>
|
||||
|
|
|
@ -4898,7 +4898,6 @@
|
|||
<Content Include="ProviderControls\HyperV2012R2_Settings.ascx" />
|
||||
<Content Include="SearchObject.ascx" />
|
||||
<Content Include="ScheduleTaskControls\UserPasswordExpirationNotificationView.ascx" />
|
||||
<Content Include="SearchObject.ascx" />
|
||||
<Content Include="SettingsUserPasswordExpirationLetter.ascx" />
|
||||
<Content Include="SettingsUserPasswordResetLetter.ascx" />
|
||||
<Content Include="VPS2012\RemoteDesktop\Connect.aspx" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue