7/1/2025 7:35:10 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
How to Hide / Show Groups dropdown ?
Posted: 30 Oct 09 12:06 PM
|
Hi there does anyone know how to hide the Groups dropdown (the one that allows to Add, Manage, Edit groups, on the right upper side). Currently I have the code below to hide / show items from the toolbar based on the user team, however I am not able to see the Groups dropdown while debugging the code, I think this Groupsd ropdown is not part of the ToolbarWorkspace. Any Ideas?
Thanks in advance.
User user = (_userService as SLXUserService).GetUser(); if (user.Id.ToLower().Trim() == "admin") return; if (!IsOnTeam("Midwest", user)) { ToolbarWorkspace toolbar = _parentWorkItem.Workspaces["ToolBar"] as ToolbarWorkspace; IMenuService menusvc = toolbar.WorkItem.Services.Get(); NavItemCollection navcol = menusvc.FindMenu("mnuTools") as NavItemCollection; if (navcol != null) { navcol.RemoveItem("tools_ImportLeads"); } } |
|
|
|
Re: How to Hide / Show Groups dropdown ?
Posted: 30 Oct 09 12:40 PM
|
Not sure how to do it from the server side, it may be possible. Never the less, a quick review of the HTML objects reveals that that menu is wrapped on a division called "GroupMenuSpace", so you could use some quick javascript to hide it:
var obj = document.getElementById('GroupMenuSpace'); obj.style.display = 'none';
|
|
|
|
Re: How to Hide / Show Groups dropdown ?
Posted: 03 Feb 10 2:31 PM
|
Add the following to the C# code of your base.master:
protected void Page_PreRender(object sender, EventArgs e) { if (EsManager() == "F") {
this.Label_mostrarGrupo.Text = "<script type='text/javascript'>xzHideGroup();" + "script>"; } else { this.Label_mostrarGrupo.Text = "BUSCADO"; } } protected string EsManager() { if(this.Label_mostrarGrupo.Text == "INICIAL") { Sage.SalesLogix.Security.SLXUserService currentuser = Sage.Platform.Application.ApplicationContext.Current.Services.Get() as Sage.SalesLogix.Security.SLXUserService; Sage.Platform.Data.IDataService service = Sage.Platform.Application.ApplicationContext.Current.Services.Get(); System.Data.IDbConnection cnn = service.GetConnection(); cnn.Open(); System.Data.IDbCommand cmd = cnn.CreateCommand(); string sql_Reglas = "select IsManager from usersecurity where userid='" + currentuser.GetUser().Id + "'"; cmd.CommandText = sql_Reglas; System.Data.IDataReader MyDataReader = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection); MyDataReader.Read(); string esono = MyDataReader["IsManager"].ToString(); MyDataReader.Close(); cnn.Close(); cmd.Dispose(); return esono; } else { if(this.Label_mostrarGrupo.Text =="BUSCADO") { return "T"; } else { return "F"; } } }
then add the following to your javascripts on base.master:
function xzHideGroup() { var obj = document.getElementById('ToolBar_GroupEditorMenu'); obj.style.display = 'none'; }
finally, locate the mainworkarea DIV and insert the following just before the DIV TAG:
<asp:Label ID="Label_mostrarGrupo" Runat="server" Width="410px" Text= "INICIAL" style="display:none"/>
If the user have the "Is Manager" checked, will see the groups button. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|