Global search autocomplete should open concrete object if selected from list.
This commit is contained in:
parent
bef8b22bbb
commit
23cce8216d
4 changed files with 118 additions and 13 deletions
|
@ -32,6 +32,8 @@ namespace WebsitePanel.WebPortal
|
||||||
Dictionary<string, string> obj = new Dictionary<string, string>();
|
Dictionary<string, string> obj = new Dictionary<string, string>();
|
||||||
obj["ColumnType"] = "PackageName";
|
obj["ColumnType"] = "PackageName";
|
||||||
obj["TextSearch"] = row["PackageName"].ToString();
|
obj["TextSearch"] = row["PackageName"].ToString();
|
||||||
|
obj["ItemID"] = row["ItemID"].ToString();
|
||||||
|
obj["PackageID"] = row["PackageID"].ToString();
|
||||||
obj["FullType"] = "Space";
|
obj["FullType"] = "Space";
|
||||||
dataList.Add(obj);
|
dataList.Add(obj);
|
||||||
}
|
}
|
||||||
|
@ -54,6 +56,8 @@ namespace WebsitePanel.WebPortal
|
||||||
Dictionary<string, string> obj = new Dictionary<string, string>();
|
Dictionary<string, string> obj = new Dictionary<string, string>();
|
||||||
obj["ColumnType"] = row["ColumnType"].ToString();
|
obj["ColumnType"] = row["ColumnType"].ToString();
|
||||||
obj["TextSearch"] = row["TextSearch"].ToString();
|
obj["TextSearch"] = row["TextSearch"].ToString();
|
||||||
|
obj["ItemID"] = row["ItemID"].ToString();
|
||||||
|
obj["PackageID"] = row["PackageID"].ToString();
|
||||||
obj["FullType"] = row["FullType"].ToString();
|
obj["FullType"] = row["FullType"].ToString();
|
||||||
dataList.Add(obj);
|
dataList.Add(obj);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,12 @@
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
|
$("#<%= tbSearch.ClientID %>").keypress(function () {
|
||||||
|
$("#<%= tbSearchText.ClientID %>").val('');
|
||||||
|
$("#<%= tbObjectId.ClientID %>").val('');
|
||||||
|
$("#<%= tbPackageId.ClientID %>").val('');
|
||||||
|
});
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#<%= tbSearch.ClientID %>").autocomplete({
|
$("#<%= tbSearch.ClientID %>").autocomplete({
|
||||||
zIndex: 100,
|
zIndex: 100,
|
||||||
|
@ -33,6 +39,8 @@
|
||||||
$("#<%= tbSearchColumnType.ClientID %>").val(item.code.ColumnType);
|
$("#<%= tbSearchColumnType.ClientID %>").val(item.code.ColumnType);
|
||||||
$("#<%= tbSearchFullType.ClientID %>").val(item.code.FullType);
|
$("#<%= tbSearchFullType.ClientID %>").val(item.code.FullType);
|
||||||
$("#<%= tbSearchText.ClientID %>").val(item.code.TextSearch);
|
$("#<%= tbSearchText.ClientID %>").val(item.code.TextSearch);
|
||||||
|
$("#<%= tbObjectId.ClientID %>").val(item.code.ItemID);
|
||||||
|
$("#<%= tbPackageId.ClientID %>").val(item.code.PackageID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});//]]>
|
});//]]>
|
||||||
|
@ -70,6 +78,18 @@
|
||||||
type="hidden"
|
type="hidden"
|
||||||
>
|
>
|
||||||
</asp:TextBox>
|
</asp:TextBox>
|
||||||
|
<asp:TextBox
|
||||||
|
ID="tbObjectId"
|
||||||
|
runat="server"
|
||||||
|
type="hidden"
|
||||||
|
>
|
||||||
|
</asp:TextBox>
|
||||||
|
<asp:TextBox
|
||||||
|
ID="tbPackageId"
|
||||||
|
runat="server"
|
||||||
|
type="hidden"
|
||||||
|
>
|
||||||
|
</asp:TextBox>
|
||||||
|
|
||||||
<asp:ImageButton
|
<asp:ImageButton
|
||||||
ID="ImageButton1"
|
ID="ImageButton1"
|
||||||
|
|
|
@ -44,6 +44,13 @@ namespace WebsitePanel.Portal.SkinControls
|
||||||
{
|
{
|
||||||
public partial class GlobalSearch : WebsitePanelControlBase
|
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
|
class Tab
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
|
@ -115,6 +122,41 @@ namespace WebsitePanel.Portal.SkinControls
|
||||||
"ItemTypeID=" + ddlItemType.SelectedValue)); */
|
"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
|
//TODO START
|
||||||
protected void btnSearchObject_Click(object sender, EventArgs e)
|
protected void btnSearchObject_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -125,25 +167,46 @@ namespace WebsitePanel.Portal.SkinControls
|
||||||
{
|
{
|
||||||
if (strFullType == "Users")
|
if (strFullType == "Users")
|
||||||
{
|
{
|
||||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetUsersSearchPageId(),
|
if (tbObjectId.Text.Length > 0)
|
||||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
{
|
||||||
"Query=" + Server.UrlEncode(strText),
|
Response.Redirect(PortalUtils.GetUserHomePageUrl(Int32.Parse(tbObjectId.Text)));
|
||||||
"Criteria=" + Server.UrlEncode(strColumnType)
|
}
|
||||||
));
|
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")
|
else if (strFullType == "Space")
|
||||||
{
|
{
|
||||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetSpacesSearchPageId(),
|
if (tbObjectId.Text.Length > 0)
|
||||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
{
|
||||||
"Query=" + Server.UrlEncode(strText),
|
Response.Redirect(GetItemPageUrl(strFullType,tbSearchColumnType.Text,Int32.Parse(tbObjectId.Text),Int32.Parse(tbPackageId.Text)));
|
||||||
"Criteria=" + Server.UrlEncode(strColumnType)
|
}
|
||||||
));
|
else
|
||||||
|
{
|
||||||
|
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetSpacesSearchPageId(),
|
||||||
|
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
||||||
|
"Query=" + Server.UrlEncode(strText),
|
||||||
|
"Criteria=" + Server.UrlEncode(strColumnType)
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetObjectSearchPageId(),
|
if (tbObjectId.Text.Length > 0)
|
||||||
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
|
{
|
||||||
"Query=" + Server.UrlEncode(strText)));
|
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
|
else
|
||||||
|
|
|
@ -57,6 +57,24 @@ namespace WebsitePanel.Portal.SkinControls {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.TextBox tbSearchText;
|
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>
|
/// <summary>
|
||||||
/// ImageButton1 control.
|
/// ImageButton1 control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue