private void BindToolbar() { string title = ""; if (mc != null) { if (mc.IsCard) title = "CardCustomization"; else if (mc.IsBridge) title = "BridgeCustomization"; else title = "InfoCustomization"; } BlockHeaderMain.Title = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", title).ToString(); // Menu ComponentArt.Web.UI.MenuItem topMenuItem; ComponentArt.Web.UI.MenuItem subItem; // O.R. [2008-11-12]: New Field is in the Fields tab /* // New Field topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Look.LeftIconUrl = "~/images/IbnFramework/newitem.gif"; topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.Look.LeftIconHeight = Unit.Pixel(16); topMenuItem.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "NewField").ToString(); topMenuItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/MetaDataBase/Pages/Admin/MetaFieldEdit.aspx?class={0}", mc.Name); topMenuItem.LookId = "TopItemLook"; BlockHeaderMain.ActionsMenu.Items.Add(topMenuItem); */ // O.R.: IBN 4.7 fix /* // New Link topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Look.LeftIconUrl = "~/images/IbnFramework/newitem.gif"; topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.Look.LeftIconHeight = Unit.Pixel(16); topMenuItem.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "NewLink").ToString(); topMenuItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/MetaDataBase/Pages/Admin/MetaFieldEdit.aspx?class={0}", mc.Name); topMenuItem.LookId = "TopItemLook"; BlockHeaderMain.ActionsMenu.Items.Add(topMenuItem); */ // Actions topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = GetGlobalResourceObject("IbnFramework.ListInfo", "tActions").ToString(); topMenuItem.DefaultSubGroupExpandDirection = ComponentArt.Web.UI.GroupExpandDirection.BelowRight; topMenuItem.Look.LeftIconUrl = "~/Layouts/Images/downbtn1.gif"; topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; if (mc.Attributes.ContainsKey(MetaClassAttribute.IsBridge)) { // Edit Bridge subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/images/IbnFramework/edit.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Edit").ToString(); subItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/MetaDataBase/Pages/Admin/MetaBridgeEdit.aspx?class={0}&back=view", mc.Name); topMenuItem.Items.Add(subItem); } else if (mc.Attributes.ContainsKey(MetaClassAttribute.IsCard)) { // Edit Card subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/images/IbnFramework/edit.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Edit").ToString(); subItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/MetaDataBase/Pages/Admin/MetaCardEdit.aspx?class={0}&back=view", mc.Name); topMenuItem.Items.Add(subItem); } else { if (mc.SupportsCards) { // Add Card subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/images/IbnFramework/metainfo/card.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "NewCard").ToString(); subItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/MetaDataBase/Pages/Admin/MetaCardEdit.aspx?owner={0}&back=owner", mc.Name); topMenuItem.Items.Add(subItem); } // Edit subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/images/IbnFramework/edit.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Edit").ToString(); subItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/MetaDataBase/Pages/Admin/MetaClassEdit.aspx?class={0}&back=view", mc.Name); topMenuItem.Items.Add(subItem); } // O.R.: IBN 4.7 fix /* // Back subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/images/IbnFramework/cancel.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "BackToList").ToString(); subItem.NavigateUrl = "~/Apps/MetaDataBase/Pages/Admin/MetaClassList.aspx"; topMenuItem.Items.Add(subItem); */ BlockHeaderMain.ActionsMenu.Items.Add(topMenuItem); }
private void BindToolBar() { if (this.Parent.Parent is IToolbarLight) { BlockHeaderLightWithMenu secHeader = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar(); ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM2.GetString("FullScreenView"); topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/task1.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(16); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.ClientSideCommand = String.Format("javascript:{{OpenWindow('{0}', 800, 600, false);}}", this.Page.ResolveUrl("~/Projects/GanttChart.aspx?ProjectId=") + _projectId); topMenuItem.LookId = "TopItemLook"; secHeader.ActionsMenu.Items.Add(topMenuItem); topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM2.GetString("tView"); topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.Value = _viewValue; topMenuItem.LookId = "TopItemLook"; ComponentArt.Web.UI.MenuItem subItem; subItem = new ComponentArt.Web.UI.MenuItem(); if (_pc["GanttView"] == "1") { subItem.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); } subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeView, "1"); subItem.Text = LocRM2.GetString("DateView"); topMenuItem.Items.Add(subItem); subItem = new ComponentArt.Web.UI.MenuItem(); if (_pc["GanttView"] == "0") { subItem.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); } subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeView, "0"); subItem.Text = LocRM2.GetString("WithoutDateView"); topMenuItem.Items.Add(subItem); secHeader.ActionsMenu.Items.Add(topMenuItem); if (_projectId != null && Task.CanCreate(int.Parse(_projectId))) { topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM.GetString("AddTask"); topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/task1_create.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(16); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; topMenuItem.NavigateUrl = "~/Tasks/TaskEdit.aspx?ProjectID=" + _projectId + "&Back=Gantt"; secHeader.ActionsMenu.Items.Add(topMenuItem); //secHeader.AddRightLink("<img alt='' src='../Layouts/Images/icons/task1_create.gif'/> " + LocRM.GetString("AddTask"), "../Tasks/TaskEdit.aspx?ProjectID=" + _projectId + "&Back=Gantt"); } topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM.GetString("tLegend"); topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/pin_off.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(16); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; topMenuItem.ClientSideCommand = String.Format("javascript:ShowLegend('{0}');", secHeader.RightCornerClientId); secHeader.ActionsMenu.Items.Add(topMenuItem); } }
private void BindToolbar() { CommandManager cm = CommandManager.GetCurrent(this.Page); secHeader.Title = LocRM.GetString("QuickTools"); bool canUpdate = Project.CanUpdate(ProjectId); bool canViewFinances = Project.CanViewFinances(ProjectId); bool canDelete = Project.CanDelete(ProjectId); bool isExternal = Mediachase.IBN.Business.Security.CurrentUser.IsExternal; ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM.GetString("Actions"); topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; ComponentArt.Web.UI.MenuItem subItem; #region Quick Add Tasks / To-dos if (Mediachase.IBN.Business.ToDo.CanCreate(ProjectId) || Task.CanCreate(ProjectId)) { ComponentArt.Web.UI.MenuItem listToDo = new ComponentArt.Web.UI.MenuItem(); listToDo.Look.LeftIconUrl = "~/Layouts/Images/rulesnew.gif"; listToDo.Look.LeftIconWidth = Unit.Pixel(16); listToDo.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpQT = new CommandParameters("MC_MetaUI_CreateTaskTodoGrid"); string cmdQT = cm.AddCommand("Project", "", "ProjectView", cpQT); cmdQT = cmdQT.Replace("\"", """); listToDo.ClientSideCommand = "javascript:" + cmdQT; listToDo.Text = GetGlobalResourceObject("IbnFramework.Project", "CreateTaskTodoGrid").ToString(); secHeader.ActionsMenu.Items.Add(listToDo); } if (Mediachase.IBN.Business.ToDo.CanCreate(ProjectId)) { ComponentArt.Web.UI.MenuItem quickToDo = new ComponentArt.Web.UI.MenuItem(); quickToDo.Look.LeftIconUrl = "~/Layouts/Images/icons/task_create.gif"; quickToDo.Look.LeftIconWidth = Unit.Pixel(16); quickToDo.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpQT = new CommandParameters("MC_MetaUI_CreateTodoQuick"); string cmdQT = cm.AddCommand("Project", "", "ProjectView", cpQT); cmdQT = cmdQT.Replace("\"", """); quickToDo.ClientSideCommand = "javascript:" + cmdQT; quickToDo.Text = LocRM.GetString("CreateToDo"); secHeader.ActionsMenu.Items.Add(quickToDo); } #endregion #region Create: Task, CalendarEntry, ToDo, Incident, Document ComponentArt.Web.UI.MenuItem createItem = new ComponentArt.Web.UI.MenuItem(); createItem.Text = LocRM.GetString("Create"); createItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); createItem.Look.LeftIconHeight = Unit.Pixel(5); createItem.Look.LeftIconWidth = Unit.Pixel(16); createItem.LookId = "TopItemLook"; #region Create Task if (!isMSProject && Task.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task1_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/Tasks/TaskEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateTask"); createItem.Items.Add(subItem); } #endregion #region Create ToDo if (Mediachase.IBN.Business.ToDo.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/ToDo/ToDoEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateToDo"); createItem.Items.Add(subItem); } #endregion #region Create CalendarEntry if (CalendarEntry.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/event_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/Events/EventEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateEvent"); createItem.Items.Add(subItem); } #endregion #region Create Incident if (Configuration.HelpDeskEnabled && Incident.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/incident_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/Incidents/IncidentEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateIncident"); createItem.Items.Add(subItem); } #endregion #region Create Document if (Document.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/document_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/Documents/DocumentEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateDocument"); createItem.Items.Add(subItem); } #endregion if (createItem.Items.Count > 0) { secHeader.ActionsMenu.Items.Add(createItem); } // topMenuItem.Items.Add(createItem); #endregion if (canUpdate) { #region Edit: Project, Timeline, GeneralInfo, ConfigurationInfo, Categories, Managers, Client ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem(); editItem.Text = LocRM.GetString("Edit"); editItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); editItem.Look.LeftIconHeight = Unit.Pixel(5); editItem.Look.LeftIconWidth = Unit.Pixel(16); editItem.LookId = "TopItemLook"; #region Edit Project subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/project_edit.gif"; subItem.NavigateUrl = "~/Projects/ProjectEdit.aspx?ProjectId=" + ProjectId + "&Back=project"; subItem.Text = LocRM.GetString("Project"); editItem.Items.Add(subItem); #endregion #region Participants: Team, Sponsors, Stakeholders, Managers ComponentArt.Web.UI.MenuItem participantsItem = new ComponentArt.Web.UI.MenuItem(); participantsItem.Text = LocRM.GetString("tParticipants"); participantsItem.Look.RightIconUrl = "~/Layouts/Images/arrow_right.gif"; #region Modify Team subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/newgroup.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpTeam = new CommandParameters("MC_PM_TeamEdit"); string cmdTeam = cm.AddCommand("Project", "", "ProjectView", cpTeam); subItem.ClientSideCommand = "javascript:" + cmdTeam; subItem.Text = LocRM.GetString("ModifyTeam"); participantsItem.Items.Add(subItem); #endregion #region Modify Sponsors subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/sponsors.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpSpons = new CommandParameters("MC_PM_SponsorsEdit"); string cmdSpons = cm.AddCommand("Project", "", "ProjectView", cpSpons); subItem.ClientSideCommand = "javascript:" + cmdSpons; subItem.Text = LocRM.GetString("ModifySponsors"); participantsItem.Items.Add(subItem); #endregion #region Modify Stakeholders subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/stakeholders.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpSt = new CommandParameters("MC_PM_StakesEdit"); string cmdSt = cm.AddCommand("Project", "", "ProjectView", cpSt); subItem.ClientSideCommand = "javascript:" + cmdSt; subItem.Text = LocRM.GetString("ModifyStakeholders"); participantsItem.Items.Add(subItem); #endregion editItem.Items.Add(participantsItem); #endregion #region Edit Target Timileme subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 400, 250);", ResolveClientUrl("~/Projects/EditTargetTimeline.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditTargetTimeline"); editItem.Items.Add(subItem); #endregion #region Edit Actual Timileme subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 400, 250);", ResolveClientUrl("~/Projects/EditActualTimeline.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditActualTimeline"); editItem.Items.Add(subItem); #endregion #region Edit State Info subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 350, 265);", ResolveClientUrl("~/Projects/EditStateInfo.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditStateInfo"); editItem.Items.Add(subItem); #endregion #region Edit General Info subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 550, 450);", ResolveClientUrl("~/Projects/EditGeneralInfo.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditGeneralInfo"); editItem.Items.Add(subItem); #endregion #region Edit Configuration Info subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 380, 270);", ResolveClientUrl("~/Projects/EditConfigurationInfo.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditConfigurationInfo"); editItem.Items.Add(subItem); #endregion #region Edit Categories subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 300, 450);", ResolveClientUrl("~/Projects/EditCategories.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditCategories"); editItem.Items.Add(subItem); #endregion #region Edit Managers subItem = new ComponentArt.Web.UI.MenuItem(); CommandParameters cpMan = new CommandParameters("MC_PM_Managers"); string cmdMan = cm.AddCommand("Project", "", "ProjectView", cpMan); subItem.ClientSideCommand = "javascript:" + cmdMan; subItem.Text = LocRM.GetString("EditManagers"); editItem.Items.Add(subItem); #endregion #region Edit Security subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 650, 280);", ResolveClientUrl("~/Projects/EditSecurity.aspx"), ProjectId); subItem.Text = LocRM2.GetString("SecuritySettings"); editItem.Items.Add(subItem); #endregion secHeader.ActionsMenu.Items.Add(editItem); // topMenuItem.Items.Add(editItem); #endregion } #region Copy to Clipboard subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/xp-copy.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = "javascript:try{_XMLReqForClip('AddClip=Prj&ProjectId=" + ProjectId.ToString() + "', '" + LocRM.GetString("tXMLError") + "')}catch(e){}"; subItem.Text = LocRM.GetString("tCopyPrjToClipboard"); topMenuItem.Items.Add(subItem); #endregion #region Add from Clipboard if (canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/xp-paste.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandManager cm1 = CommandManager.GetCurrent(this.Page); CommandParameters cp1 = new CommandParameters("MC_PM_RelatedPrjClipboard"); string cmd1 = cm1.AddCommand("Project", "", "ProjectView", cp1); cmd1 = cmd1.Replace("\"", """); subItem.ClientSideCommand = "javascript:" + cmd1; subItem.Text = LocRM.GetString("tPastePrjFromClipboard"); topMenuItem.Items.Add(subItem); } #endregion #region Clear Clipboard if (canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/clearbuffer.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = "javascript:try{_XMLReqForClip('ClearClip=Prj', '" + LocRM.GetString("tXMLError") + "')}catch(e){}"; subItem.Text = LocRM.GetString("tClearClipboard"); topMenuItem.Items.Add(subItem); } #endregion #region --- Separator --- subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "BreakItem"; topMenuItem.Items.Add(subItem); #endregion #region Add Related Project if (canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/relprojects.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandManager cm1 = CommandManager.GetCurrent(this.Page); CommandParameters cp1 = new CommandParameters("MC_PM_RelatedPrj"); string cmd1 = cm1.AddCommand("Project", "", "ProjectView", cp1); cmd1 = cmd1.Replace("\"", """); subItem.ClientSideCommand = "javascript:" + cmd1; subItem.Text = LocRM.GetString("AddRelated"); topMenuItem.Items.Add(subItem); } #endregion #region Add Comments subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/comments.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:OpenWindow('{0}?ProjectId={1}',520,270,false);", ResolveClientUrl("~/Common/CommentAdd.aspx"), ProjectId); subItem.Text = LocRM.GetString("CreateComment"); topMenuItem.Items.Add(subItem); #endregion #region Delete if (canDelete) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/project_delete.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = "javascript:DeleteProject()"; subItem.Text = LocRM2.GetString("Delete"); topMenuItem.Items.Add(subItem); } #endregion #region --- Separator --- subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "BreakItem"; topMenuItem.Items.Add(subItem); #endregion #region Snapshot if (canViewFinances) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/report.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard2('{0}?ProjectId={1}', 750, 466, true);", ResolveClientUrl("~/Reports/OverallProjectSnapshot.aspx"), ProjectId); subItem.Text = LocRM.GetString("Snapshot"); topMenuItem.Items.Add(subItem); } #endregion #region CreateTemplate2 //DV if (canUpdate && !isMSProject) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/newtemplate.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 640, 600);", ResolveClientUrl("~/Projects/EditProjectTemplate2.aspx"), ProjectId); subItem.Text = LocRM.GetString("CreateTemplate"); topMenuItem.Items.Add(subItem); } #endregion #region SaveBasePlan if (canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/SAVEITEM.GIF"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 380, 100);", ResolveClientUrl("~/Projects/SaveBasePlanPopUp.aspx"), ProjectId); subItem.Text = LocRM.GetString("SaveBasePlan"); topMenuItem.Items.Add(subItem); } #endregion if (canUpdate && ProjectSpreadSheet.IsActive(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/card-delete.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = string.Format("if (confirm('{0}')) {{ {1} }}", LocRM4.GetString("ReactivateMsg"), this.Page.ClientScript.GetPostBackEventReference(btnDeactivateFinance, string.Empty)); subItem.Text = LocRM4.GetString("ReactivateText"); topMenuItem.Items.Add(subItem); } #region Export/Import if (canUpdate && Project.IsMSProjectSynchronizationEnabled() && !Project.GetIsMSProject(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/Synch.png"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "OpenWindow('{0}?ToMSPrj=1&ProjectId={1}',600,400);", ResolveClientUrl("~/Projects/ProjectExportImportNew.aspx"), ProjectId); subItem.Text = LocRM.GetString("ToMSProjSync"); topMenuItem.Items.Add(subItem); } if (canUpdate && ( (Project.IsMSProjectIntegrationEnabled() && !Project.GetIsMSProject(ProjectId)) || (Project.IsMSProjectSynchronizationEnabled() && Project.GetIsMSProject(ProjectId)) ) ) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/export.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "OpenWindow('{0}?ProjectId={1}',600,410);", ResolveClientUrl("~/Projects/ProjectExportImportNew.aspx"), ProjectId); subItem.Text = LocRM.GetString("MSProjectExchange"); topMenuItem.Items.Add(subItem); } #endregion #region --- Separator --- if (canViewFinances || canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "BreakItem"; topMenuItem.Items.Add(subItem); } #endregion #region UpdateHistory subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ObjectId={1}&ObjectTypeId={1}', 750, 466);", ResolveClientUrl("~/Common/SystemEventsByObject.aspx"), ProjectId, (int)ObjectTypes.Project); subItem.Text = LocRM3.GetString("UpdateHistory"); topMenuItem.Items.Add(subItem); #endregion #region Latest Visitors subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ObjectId={1}&ObjectTypeId={2}', 450, 266);", ResolveClientUrl("~/Common/LatestVisitors.aspx"), ProjectId, (int)ObjectTypes.Project); subItem.Text = LocRM3.GetString("LatestVisitors"); topMenuItem.Items.Add(subItem); #endregion #region System Notifications subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", ProjectId, ((int)ObjectTypes.Project).ToString()); subItem.Text = LocRM.GetString("SystemNotifications"); topMenuItem.Items.Add(subItem); #endregion #region System Reminder Project.ProjectSecurity ps = Project.GetSecurity(ProjectId); if (ps.IsManager || ps.IsManager || ps.IsTeamMember || ps.IsSponsor || ps.IsStakeHolder) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/reminder.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ObjectTypeId={1}&ObjectId={2}', 420, 150)", ResolveClientUrl("~/Directory/SystemRemindersForObject.aspx"), (int)ObjectTypes.Project, ProjectId); subItem.Text = LocRM.GetString("EditReminder"); topMenuItem.Items.Add(subItem); } #endregion #region Favorites if (!Project.CheckFavorites(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/Favorites.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnAddToFavorites, ""); subItem.Text = LocRM.GetString("AddToFavorites"); topMenuItem.Items.Add(subItem); } #endregion secHeader.ActionsMenu.Items.Add(topMenuItem); }
protected void Page_PreRender(object sender, System.EventArgs e) { if (String.IsNullOrEmpty(ClassName)) return; MetaClass mc = MetaDataWrapper.GetMetaClassByName(ClassName); try { object obj = pT.CurrentControl.GetType().BaseType.GetProperty("SectionHeader").GetValue(pT.CurrentControl, null); if (obj is PageViewMenu) { PageViewMenu BlockHeaderMain = obj as PageViewMenu; ListInfo li = ListManager.GetListInfoByMetaClass(mc); BlockHeaderMain.Title = GetGlobalResourceObject("IbnFramework.ListInfo", "ListManagement").ToString(); // Menu ComponentArt.Web.UI.MenuItem topMenuItem; ComponentArt.Web.UI.MenuItem subItem; // New Field /* topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Look.LeftIconUrl = "~/images/IbnFramework/newitem.gif"; topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.Look.LeftIconHeight = Unit.Pixel(16); topMenuItem.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "NewField").ToString(); topMenuItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/ListApp/Pages/MetaFieldEdit.aspx?class={0}", mc.Name); topMenuItem.LookId = "TopItemLook"; BlockHeaderMain.ActionsMenu.Items.Add(topMenuItem); */ // Actions topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = GetGlobalResourceObject("IbnFramework.ListInfo", "tActions").ToString(); topMenuItem.DefaultSubGroupExpandDirection = ComponentArt.Web.UI.GroupExpandDirection.BelowRight; topMenuItem.Look.LeftIconUrl = "~/Layouts/Images/downbtn1.gif"; topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; // Edit subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/images/IbnFramework/edit.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.ListInfo", "Edit").ToString(); subItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/ListApp/Pages/ListInfoEdit.aspx?class={0}", ClassName); topMenuItem.Items.Add(subItem); if (!li.IsTemplate) { // Publish if (Mediachase.IBN.Business.Security.IsUserInGroup(Mediachase.IBN.Business.InternalSecureGroups.Administrator)) { ListFolder folder = new ListFolder(li.FolderId.Value); if (folder.FolderType == ListFolderType.Public) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Images/IbnFramework/PublishList.png"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.ListInfo", "Publish").ToString(); subItem.ClientSideCommand = CommandManager.GetCurrent(this.Page).AddCommand("", "", "ListInfoView", "MC_ListApp_Publish", new Dictionary<string, string>()); topMenuItem.Items.Add(subItem); } } // Security subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icon-key.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.ListInfo", "Security").ToString(); subItem.ClientSideCommand = CommandManager.GetCurrent(this.Page).AddCommand("", "", "ListInfoView", "MC_ListApp_Security", new Dictionary<string, string>()); topMenuItem.Items.Add(subItem); } // Delete subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/images/IbnFramework/delete.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.ListInfo", "Delete").ToString(); if(li.IsTemplate) subItem.ClientSideCommand = CommandManager.GetCurrent(this.Page).AddCommand("", "", "ListInfoView", "MC_ListApp_DeleteTemplateList", new Dictionary<string, string>()); else subItem.ClientSideCommand = CommandManager.GetCurrent(this.Page).AddCommand("", "", "ListInfoView", "MC_ListApp_DeleteList", new Dictionary<string, string>()); topMenuItem.Items.Add(subItem); // Delimeter subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "BreakItem"; topMenuItem.Items.Add(subItem); // Back subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/images/IbnFramework/cancel.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Text = GetGlobalResourceObject("IbnFramework.ListInfo", "BackToListInfoList").ToString(); if(li.IsTemplate) subItem.NavigateUrl = "~/Apps/ListApp/Pages/ListTemplates.aspx"; else subItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Apps/ListApp/Pages/ListInfoList.aspx?ListFolderId={0}", li.FolderId); topMenuItem.Items.Add(subItem); BlockHeaderMain.ActionsMenu.Items.Add(topMenuItem); } } catch { } }
private void BindToolbar2() { if (!(pc["Calendar1_CurrentTab"] == "SharedCalendars") || Mediachase.IBN.Business.CalendarView.GetSharingLevel(int.Parse(ddlPerson.SelectedItem.Value)) == 1) { string SharedId = String.Empty; if (pc["Calendar1_CurrentTab"] == "SharedCalendars" && ViewState["SharedId"] != null) SharedId = "?SharedId=" + ViewState["SharedId"]; ComponentArt.Web.UI.MenuItem subItem; #region Create Calendar Entry subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "TopItemLook"; subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/event_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = String.Format("../Events/EventEdit.aspx{0}", SharedId); subItem.Text = LocRM3.GetString("AddEvent"); secHeader.ActionsMenu.Items.Add(subItem); #endregion #region Create ToDo if (pc["Calendar1_CurrentTab"] != "SharedCalendars") { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "TopItemLook"; subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = String.Format("../ToDo/ToDoEdit.aspx{0}", SharedId); subItem.Text = LocRM3.GetString("AddToDo"); secHeader.ActionsMenu.Items.Add(subItem); } #endregion } }
private void BindToolbar() { if (this.Parent.Parent is IToolbarLight || this.Parent is IToolbarLight) { BlockHeaderLightWithMenu secHeader; if (this.Parent.Parent is IToolbarLight) secHeader = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar(); else secHeader = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent).GetToolBar(); secHeader.ActionsMenu.Items.Clear(); secHeader.ClearRightItems(); #region Menu Items ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM2.GetString("tView"); topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; ComponentArt.Web.UI.MenuItem subItem; string sCurrentView = _pc["fs_Search_ViewStyle"]; subItem = new ComponentArt.Web.UI.MenuItem(); if (sCurrentView == "ListView") { subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); } subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeViewTable, ""); subItem.Text = LocRM2.GetString("tListView"); topMenuItem.Items.Add(subItem); subItem = new ComponentArt.Web.UI.MenuItem(); if (sCurrentView == "DetailsView") { subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); } subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeViewDet, ""); subItem.Text = LocRM2.GetString("tDetailsView"); topMenuItem.Items.Add(subItem); #endregion secHeader.ActionsMenu.Items.Add(topMenuItem); if (_containerKey == "Workspace") secHeader.AddText(LocRM.GetString("tbTitle")); secHeader.EnsureRender(); } }
private void BindToolbar() { //DV: Esli netu userskih row v spreadshhete proekta to dobavit actual finansy nevozmozhno if (ProjectSpreadSheet.GetFactAvailableRows(Util.CommonHelper.GetProjectIdByObjectIdObjectType(ObjectId, ObjectTypeId)).Length == 0) { return; } if (this.Parent.Parent is IToolbarLight) { BlockHeaderLightWithMenu secHeaderLight = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar(); secHeaderLight.ActionsMenu.Items.Clear(); secHeaderLight.ClearRightItems(); if (ProjectId < 0) { secHeaderLight.AddText(LocRM.GetString("tActFinances")); } ComponentArt.Web.UI.MenuItem subItem; #region New Item string command = String.Empty; if (ProjectId > 0 && Project.CanEditFinances(ProjectId)) { command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), ProjectId, (int)ObjectTypes.Project, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); } if (TaskId > 0 && Task.CanViewFinances(TaskId)) { command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), TaskId, (int)ObjectTypes.Task, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); } if (IncidentId > 0 && Incident.CanViewFinances(IncidentId)) { command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), IncidentId, (int)ObjectTypes.Issue, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); } if (DocumentId > 0 && Document.CanViewFinances(DocumentId)) { command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), DocumentId, (int)ObjectTypes.Document, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); } if (EventId > 0 && CalendarEntry.CanViewFinances(EventId)) { command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), EventId, (int)ObjectTypes.CalendarEntry, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); } if (ToDoId > 0 && Mediachase.IBN.Business.ToDo.CanViewFinances(ToDoId)) { command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), ToDoId, (int)ObjectTypes.ToDo, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); } if (command != String.Empty) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "TopItemLook"; subItem.Look.LeftIconUrl = "~/Layouts/Images/newitem.gif"; subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.ClientSideCommand = command; subItem.Text = LocRM.GetString("tbAdd"); secHeaderLight.ActionsMenu.Items.Add(subItem); } #endregion #region Export subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "TopItemLook"; subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/xlsexport.gif"; subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.ClientSideCommand = Page.ClientScript.GetPostBackEventReference(ExportButton, ""); subItem.Text = LocRM2.GetString("ExcelExport"); secHeaderLight.ActionsMenu.Items.Add(subItem); #endregion } else if (this.Parent is IToolbarLight) { BlockHeaderLightWithMenu secHeaderLight = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent).GetToolBar(); secHeaderLight.AddText(LocRM.GetString("tActFinances")); if (Project.CanEditFinances(ProjectId) && ProjectId > 0) { secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../projects/AddFinanceActual.aspx?ObjectId=" + ProjectId.ToString() + "&ObjectTypeId=" + (int)ObjectTypes.Project + "',520,270,false);"); } if (TaskId > 0 && Task.CanViewFinances(TaskId)) { secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + TaskId + "&ObjectTypeId=" + (int)ObjectTypes.Task + "',520,270,false);"); } if (IncidentId > 0 && Incident.CanViewFinances(IncidentId)) { secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + IncidentId + "&ObjectTypeId=" + (int)ObjectTypes.Issue + "',520,270,false);"); } if (DocumentId > 0 && Document.CanViewFinances(DocumentId)) { secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + DocumentId + "&ObjectTypeId=" + (int)ObjectTypes.Document + "',520,270,false);"); } if (EventId > 0 && CalendarEntry.CanViewFinances(EventId)) { secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + EventId + "&ObjectTypeId=" + (int)ObjectTypes.CalendarEntry + "',520,270,false);"); } if (ToDoId > 0 && Mediachase.IBN.Business.ToDo.CanViewFinances(ToDoId)) { secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + ToDoId + "&ObjectTypeId=" + (int)ObjectTypes.ToDo + "',520,270,false);"); } } }
/// <summary> /// Creates the item. /// </summary> /// <param name="lookId">The look id.</param> /// <returns></returns> private ComponentArt.Web.UI.MenuItem CreateItem(string lookId) { ComponentArt.Web.UI.MenuItem breakItem = new ComponentArt.Web.UI.MenuItem(); breakItem.LookId = lookId; return(breakItem); }
private void RenderMenu(ComponentArt.Web.UI.Menu actionsMenu) { ComponentArt.Web.UI.MenuItem topMenuItem; actionsMenu.Items.Clear(); #region Legend Item topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = GetGlobalResourceObject("IbnFramework.Calendar", "tLegend").ToString(); // topMenuItem.Look.LeftIconUrl = ResolveClientUrl("~/Layouts/Images/downbtn1.gif"); // topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); // topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; topMenuItem.ClientSideCommand = "ShowLegend()"; actionsMenu.Items.Add(topMenuItem); #endregion #region View Menu Items topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM.GetString("tView"); topMenuItem.Look.LeftIconUrl = ResolveClientUrl("~/Layouts/Images/downbtn1.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; ComponentArt.Web.UI.MenuItem subItem; string graphPeriod = _pc["MV_Weeks"]; subItem = new ComponentArt.Web.UI.MenuItem(); if (graphPeriod == "1") // 1 week { subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); } subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(ViewButton, "1"); subItem.Text = LocRM.GetString("Week1"); topMenuItem.Items.Add(subItem); subItem = new ComponentArt.Web.UI.MenuItem(); if (graphPeriod == "3") // 3 week { subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); } subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(ViewButton, "3"); subItem.Text = LocRM.GetString("Week3"); topMenuItem.Items.Add(subItem); actionsMenu.Items.Add(topMenuItem); #endregion }
private static ComponentArt.Web.UI.MenuItem LoadCmdItem(DirectoryInfo subdir) { ComponentArt.Web.UI.MenuItem retVal = new ComponentArt.Web.UI.MenuItem(); retVal.Text = subdir.Name; return(retVal); }
protected void Page_Load(object sender, EventArgs e) { try { StreamReader reader = new StreamReader(Server.MapPath(Request.QueryString["url"])); lblog.Text = reader.ReadToEnd(); reader.Close(); lblog.Visible = true; } catch { lblog.Visible = false; } if (IsPostBack) { return; } //mnuHeader = new Menu(); //Menu mnuHeader = new Menu(); ComponentArt.Web.UI.MenuItem item = new ComponentArt.Web.UI.MenuItem(); ComponentArt.Web.UI.MenuItem subItem = new ComponentArt.Web.UI.MenuItem(); ComponentArt.Web.UI.MenuItem subsubitem = new ComponentArt.Web.UI.MenuItem(); ComponentArt.Web.UI.MenuItem subsubsubitem = new ComponentArt.Web.UI.MenuItem(); DirectoryInfo dir = new DirectoryInfo(Server.MapPath("/Temp/")); if (dir.GetDirectories().Length > 0) { //mnuHeader = new Menu(); foreach (DirectoryInfo dinfo in dir.GetDirectories()) { item = LoadCmdItem(dinfo); item.LookId = "home"; if (dinfo.GetDirectories().Length > 0) { foreach (DirectoryInfo subdinfo in dinfo.GetDirectories()) { subItem = LoadCmdItem(subdinfo); subItem.LookId = "child"; item.Items.Add(subItem); if (subdinfo.GetDirectories().Length > 0) { foreach (DirectoryInfo subsubinfo in subdinfo.GetDirectories()) { subsubitem = LoadCmdItem(subsubinfo); subsubitem.LookId = "child1"; subItem.Items.Add(subsubitem); if (subsubinfo.GetFiles().Length > 0) { foreach (FileInfo finfo in subsubinfo.GetFiles()) { subsubsubitem = LoadCmdsubItem(subdinfo, subsubinfo, finfo); subsubsubitem.LookId = "child2"; subsubitem.Items.Add(subsubsubitem); } } } } item.Attributes.Add("Style", "cursor:hand"); subItem.Attributes.Add("Style", "cursor:hand"); subsubitem.Attributes.Add("Style", "cursor:hand"); subsubsubitem.Attributes.Add("Style", "cursor:hand"); } } //mnuHeader.Items.Add(item); mnuCommands.Items.Add(item); } } }
private void BindToolbar() { //DV: Esli netu userskih row v spreadshhete proekta to dobavit actual finansy nevozmozhno if (ProjectSpreadSheet.GetFactAvailableRows(Util.CommonHelper.GetProjectIdByObjectIdObjectType(ObjectId, ObjectTypeId)).Length == 0) return; if (this.Parent.Parent is IToolbarLight) { BlockHeaderLightWithMenu secHeaderLight = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar(); secHeaderLight.ActionsMenu.Items.Clear(); secHeaderLight.ClearRightItems(); if (ProjectId < 0) secHeaderLight.AddText(LocRM.GetString("tActFinances")); ComponentArt.Web.UI.MenuItem subItem; #region New Item string command = String.Empty; if (ProjectId > 0 && Project.CanEditFinances(ProjectId)) command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), ProjectId, (int)ObjectTypes.Project, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); if (TaskId > 0 && Task.CanViewFinances(TaskId)) command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), TaskId, (int)ObjectTypes.Task, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); if (IncidentId > 0 && Incident.CanViewFinances(IncidentId)) command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), IncidentId, (int)ObjectTypes.Issue, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); if (DocumentId > 0 && Document.CanViewFinances(DocumentId)) command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), DocumentId, (int)ObjectTypes.Document, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); if (EventId > 0 && CalendarEntry.CanViewFinances(EventId)) command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), EventId, (int)ObjectTypes.CalendarEntry, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); if (ToDoId > 0 && Mediachase.IBN.Business.ToDo.CanViewFinances(ToDoId)) command = String.Format(CultureInfo.InvariantCulture, "OpenWindow(\"{0}?ObjectId={1}&ObjectTypeId={2}&btn={3}\",520,220,false);", ResolveClientUrl("~/projects/AddFinanceActual.aspx"), ToDoId, (int)ObjectTypes.ToDo, Page.ClientScript.GetPostBackEventReference(RefreshButton, "")); if (command != String.Empty) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "TopItemLook"; subItem.Look.LeftIconUrl = "~/Layouts/Images/newitem.gif"; subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.ClientSideCommand = command; subItem.Text = LocRM.GetString("tbAdd"); secHeaderLight.ActionsMenu.Items.Add(subItem); } #endregion #region Export subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "TopItemLook"; subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/xlsexport.gif"; subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.ClientSideCommand = Page.ClientScript.GetPostBackEventReference(ExportButton, ""); subItem.Text = LocRM2.GetString("ExcelExport"); secHeaderLight.ActionsMenu.Items.Add(subItem); #endregion } else if (this.Parent is IToolbarLight) { BlockHeaderLightWithMenu secHeaderLight = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent).GetToolBar(); secHeaderLight.AddText(LocRM.GetString("tActFinances")); if (Project.CanEditFinances(ProjectId) && ProjectId > 0) secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../projects/AddFinanceActual.aspx?ObjectId=" + ProjectId.ToString() + "&ObjectTypeId=" + (int)ObjectTypes.Project + "',520,270,false);"); if (TaskId > 0 && Task.CanViewFinances(TaskId)) secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + TaskId + "&ObjectTypeId=" + (int)ObjectTypes.Task + "',520,270,false);"); if (IncidentId > 0 && Incident.CanViewFinances(IncidentId)) secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + IncidentId + "&ObjectTypeId=" + (int)ObjectTypes.Issue + "',520,270,false);"); if (DocumentId > 0 && Document.CanViewFinances(DocumentId)) secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + DocumentId + "&ObjectTypeId=" + (int)ObjectTypes.Document + "',520,270,false);"); if (EventId > 0 && CalendarEntry.CanViewFinances(EventId)) secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + EventId + "&ObjectTypeId=" + (int)ObjectTypes.CalendarEntry + "',520,270,false);"); if (ToDoId > 0 && Mediachase.IBN.Business.ToDo.CanViewFinances(ToDoId)) secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/> " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddFinanceActual.aspx?ObjectId=" + ToDoId + "&ObjectTypeId=" + (int)ObjectTypes.ToDo + "',520,270,false);"); } }
private void BindToolbar() { tbTasks.Title = LocRM.GetString("GanttChartTitle"); ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM.GetString("tView"); topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.Value = _viewValue; topMenuItem.LookId = "TopItemLook"; ComponentArt.Web.UI.MenuItem subItem; subItem = new ComponentArt.Web.UI.MenuItem(); if (_pc["GanttView"] == "1") { subItem.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); } subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeView, "1"); subItem.Text = LocRM.GetString("DateView"); topMenuItem.Items.Add(subItem); subItem = new ComponentArt.Web.UI.MenuItem(); if (_pc["GanttView"] == "0") { subItem.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); } subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeView, "0"); subItem.Text = LocRM.GetString("WithoutDateView"); topMenuItem.Items.Add(subItem); tbTasks.ActionsMenu.Items.Add(topMenuItem); }
private void BindToolbar() { CommandManager cm = CommandManager.GetCurrent(this.Page); secHeader.Title = LocRM.GetString("QuickTools"); bool canUpdate = Project.CanUpdate(ProjectId); bool canViewFinances = Project.CanViewFinances(ProjectId); bool canDelete = Project.CanDelete(ProjectId); bool isExternal = Mediachase.IBN.Business.Security.CurrentUser.IsExternal; ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem(); topMenuItem.Text = LocRM.GetString("Actions"); topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); topMenuItem.Look.LeftIconHeight = Unit.Pixel(5); topMenuItem.Look.LeftIconWidth = Unit.Pixel(16); topMenuItem.LookId = "TopItemLook"; ComponentArt.Web.UI.MenuItem subItem; #region Quick Add Tasks / To-dos if (Mediachase.IBN.Business.ToDo.CanCreate(ProjectId) || Task.CanCreate(ProjectId)) { ComponentArt.Web.UI.MenuItem listToDo = new ComponentArt.Web.UI.MenuItem(); listToDo.Look.LeftIconUrl = "~/Layouts/Images/rulesnew.gif"; listToDo.Look.LeftIconWidth = Unit.Pixel(16); listToDo.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpQT = new CommandParameters("MC_MetaUI_CreateTaskTodoGrid"); string cmdQT = cm.AddCommand("Project", "", "ProjectView", cpQT); cmdQT = cmdQT.Replace("\"", """); listToDo.ClientSideCommand = "javascript:" + cmdQT; listToDo.Text = GetGlobalResourceObject("IbnFramework.Project", "CreateTaskTodoGrid").ToString(); secHeader.ActionsMenu.Items.Add(listToDo); } if (Mediachase.IBN.Business.ToDo.CanCreate(ProjectId)) { ComponentArt.Web.UI.MenuItem quickToDo = new ComponentArt.Web.UI.MenuItem(); quickToDo.Look.LeftIconUrl = "~/Layouts/Images/icons/task_create.gif"; quickToDo.Look.LeftIconWidth = Unit.Pixel(16); quickToDo.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpQT = new CommandParameters("MC_MetaUI_CreateTodoQuick"); string cmdQT = cm.AddCommand("Project", "", "ProjectView", cpQT); cmdQT = cmdQT.Replace("\"", """); quickToDo.ClientSideCommand = "javascript:" + cmdQT; quickToDo.Text = LocRM.GetString("CreateToDo"); secHeader.ActionsMenu.Items.Add(quickToDo); } #endregion #region Create: Task, CalendarEntry, ToDo, Incident, Document ComponentArt.Web.UI.MenuItem createItem = new ComponentArt.Web.UI.MenuItem(); createItem.Text = LocRM.GetString("Create"); createItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); createItem.Look.LeftIconHeight = Unit.Pixel(5); createItem.Look.LeftIconWidth = Unit.Pixel(16); createItem.LookId = "TopItemLook"; #region Create Task if (!isMSProject && Task.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task1_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/Tasks/TaskEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateTask"); createItem.Items.Add(subItem); } #endregion #region Create ToDo if (Mediachase.IBN.Business.ToDo.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/ToDo/ToDoEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateToDo"); createItem.Items.Add(subItem); } #endregion #region Create CalendarEntry if (CalendarEntry.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/event_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/Events/EventEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateEvent"); createItem.Items.Add(subItem); } #endregion #region Create Incident if (Configuration.HelpDeskEnabled && Incident.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/incident_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/Incidents/IncidentEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateIncident"); createItem.Items.Add(subItem); } #endregion #region Create Document if (Document.CanCreate(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/document_create.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = "~/Documents/DocumentEdit.aspx?ProjectId=" + ProjectId; subItem.Text = LocRM.GetString("CreateDocument"); createItem.Items.Add(subItem); } #endregion if (createItem.Items.Count > 0) secHeader.ActionsMenu.Items.Add(createItem); // topMenuItem.Items.Add(createItem); #endregion if (canUpdate) { #region Edit: Project, Timeline, GeneralInfo, ConfigurationInfo, Categories, Managers, Client ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem(); editItem.Text = LocRM.GetString("Edit"); editItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif"); editItem.Look.LeftIconHeight = Unit.Pixel(5); editItem.Look.LeftIconWidth = Unit.Pixel(16); editItem.LookId = "TopItemLook"; #region Edit Project subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/project_edit.gif"; subItem.NavigateUrl = "~/Projects/ProjectEdit.aspx?ProjectId=" + ProjectId + "&Back=project"; subItem.Text = LocRM.GetString("Project"); editItem.Items.Add(subItem); #endregion #region Participants: Team, Sponsors, Stakeholders, Managers ComponentArt.Web.UI.MenuItem participantsItem = new ComponentArt.Web.UI.MenuItem(); participantsItem.Text = LocRM.GetString("tParticipants"); participantsItem.Look.RightIconUrl = "~/Layouts/Images/arrow_right.gif"; #region Modify Team subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/newgroup.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpTeam = new CommandParameters("MC_PM_TeamEdit"); string cmdTeam = cm.AddCommand("Project", "", "ProjectView", cpTeam); subItem.ClientSideCommand = "javascript:" + cmdTeam; subItem.Text = LocRM.GetString("ModifyTeam"); participantsItem.Items.Add(subItem); #endregion #region Modify Sponsors subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/sponsors.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpSpons = new CommandParameters("MC_PM_SponsorsEdit"); string cmdSpons = cm.AddCommand("Project", "", "ProjectView", cpSpons); subItem.ClientSideCommand = "javascript:" + cmdSpons; subItem.Text = LocRM.GetString("ModifySponsors"); participantsItem.Items.Add(subItem); #endregion #region Modify Stakeholders subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/stakeholders.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandParameters cpSt = new CommandParameters("MC_PM_StakesEdit"); string cmdSt = cm.AddCommand("Project", "", "ProjectView", cpSt); subItem.ClientSideCommand = "javascript:" + cmdSt; subItem.Text = LocRM.GetString("ModifyStakeholders"); participantsItem.Items.Add(subItem); #endregion editItem.Items.Add(participantsItem); #endregion #region Edit Target Timileme subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 400, 250);", ResolveClientUrl("~/Projects/EditTargetTimeline.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditTargetTimeline"); editItem.Items.Add(subItem); #endregion #region Edit Actual Timileme subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 400, 250);", ResolveClientUrl("~/Projects/EditActualTimeline.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditActualTimeline"); editItem.Items.Add(subItem); #endregion #region Edit State Info subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 350, 265);", ResolveClientUrl("~/Projects/EditStateInfo.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditStateInfo"); editItem.Items.Add(subItem); #endregion #region Edit General Info subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 550, 450);", ResolveClientUrl("~/Projects/EditGeneralInfo.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditGeneralInfo"); editItem.Items.Add(subItem); #endregion #region Edit Configuration Info subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 380, 270);", ResolveClientUrl("~/Projects/EditConfigurationInfo.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditConfigurationInfo"); editItem.Items.Add(subItem); #endregion #region Edit Categories subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 300, 450);", ResolveClientUrl("~/Projects/EditCategories.aspx"), ProjectId); subItem.Text = LocRM.GetString("EditCategories"); editItem.Items.Add(subItem); #endregion #region Edit Managers subItem = new ComponentArt.Web.UI.MenuItem(); CommandParameters cpMan = new CommandParameters("MC_PM_Managers"); string cmdMan = cm.AddCommand("Project", "", "ProjectView", cpMan); subItem.ClientSideCommand = "javascript:" + cmdMan; subItem.Text = LocRM.GetString("EditManagers"); editItem.Items.Add(subItem); #endregion #region Edit Security subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 650, 280);", ResolveClientUrl("~/Projects/EditSecurity.aspx"), ProjectId); subItem.Text = LocRM2.GetString("SecuritySettings"); editItem.Items.Add(subItem); #endregion secHeader.ActionsMenu.Items.Add(editItem); // topMenuItem.Items.Add(editItem); #endregion } #region Copy to Clipboard subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/xp-copy.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = "javascript:try{_XMLReqForClip('AddClip=Prj&ProjectId=" + ProjectId.ToString() + "', '" + LocRM.GetString("tXMLError") + "')}catch(e){}"; subItem.Text = LocRM.GetString("tCopyPrjToClipboard"); topMenuItem.Items.Add(subItem); #endregion #region Add from Clipboard if (canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/xp-paste.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandManager cm1 = CommandManager.GetCurrent(this.Page); CommandParameters cp1 = new CommandParameters("MC_PM_RelatedPrjClipboard"); string cmd1 = cm1.AddCommand("Project", "", "ProjectView", cp1); cmd1 = cmd1.Replace("\"", """); subItem.ClientSideCommand = "javascript:" + cmd1; subItem.Text = LocRM.GetString("tPastePrjFromClipboard"); topMenuItem.Items.Add(subItem); } #endregion #region Clear Clipboard if (canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/clearbuffer.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = "javascript:try{_XMLReqForClip('ClearClip=Prj', '" + LocRM.GetString("tXMLError") + "')}catch(e){}"; subItem.Text = LocRM.GetString("tClearClipboard"); topMenuItem.Items.Add(subItem); } #endregion #region --- Separator --- subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "BreakItem"; topMenuItem.Items.Add(subItem); #endregion #region Add Related Project if (canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/relprojects.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); CommandManager cm1 = CommandManager.GetCurrent(this.Page); CommandParameters cp1 = new CommandParameters("MC_PM_RelatedPrj"); string cmd1 = cm1.AddCommand("Project", "", "ProjectView", cp1); cmd1 = cmd1.Replace("\"", """); subItem.ClientSideCommand = "javascript:" + cmd1; subItem.Text = LocRM.GetString("AddRelated"); topMenuItem.Items.Add(subItem); } #endregion #region Add Comments subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/comments.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:OpenWindow('{0}?ProjectId={1}',520,270,false);", ResolveClientUrl("~/Common/CommentAdd.aspx"), ProjectId); subItem.Text = LocRM.GetString("CreateComment"); topMenuItem.Items.Add(subItem); #endregion #region Delete if (canDelete) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/project_delete.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = "javascript:DeleteProject()"; subItem.Text = LocRM2.GetString("Delete"); topMenuItem.Items.Add(subItem); } #endregion #region --- Separator --- subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "BreakItem"; topMenuItem.Items.Add(subItem); #endregion #region Snapshot if (canViewFinances) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/report.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard2('{0}?ProjectId={1}', 750, 466, true);", ResolveClientUrl("~/Reports/OverallProjectSnapshot.aspx"), ProjectId); subItem.Text = LocRM.GetString("Snapshot"); topMenuItem.Items.Add(subItem); } #endregion #region CreateTemplate2 //DV if (canUpdate && !isMSProject) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/newtemplate.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 640, 600);", ResolveClientUrl("~/Projects/EditProjectTemplate2.aspx"), ProjectId); subItem.Text = LocRM.GetString("CreateTemplate"); topMenuItem.Items.Add(subItem); } #endregion #region SaveBasePlan if (canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/SAVEITEM.GIF"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ProjectId={1}', 380, 100);", ResolveClientUrl("~/Projects/SaveBasePlanPopUp.aspx"), ProjectId); subItem.Text = LocRM.GetString("SaveBasePlan"); topMenuItem.Items.Add(subItem); } #endregion if (canUpdate && ProjectSpreadSheet.IsActive(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/card-delete.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = string.Format("if (confirm('{0}')) {{ {1} }}", LocRM4.GetString("ReactivateMsg"), this.Page.ClientScript.GetPostBackEventReference(btnDeactivateFinance, string.Empty)); subItem.Text = LocRM4.GetString("ReactivateText"); topMenuItem.Items.Add(subItem); } #region Export/Import if (canUpdate && Project.IsMSProjectSynchronizationEnabled() && !Project.GetIsMSProject(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/Synch.png"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "OpenWindow('{0}?ToMSPrj=1&ProjectId={1}',600,400);", ResolveClientUrl("~/Projects/ProjectExportImportNew.aspx"), ProjectId); subItem.Text = LocRM.GetString("ToMSProjSync"); topMenuItem.Items.Add(subItem); } if (canUpdate && ( (Project.IsMSProjectIntegrationEnabled() && !Project.GetIsMSProject(ProjectId)) || (Project.IsMSProjectSynchronizationEnabled() && Project.GetIsMSProject(ProjectId)) ) ) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/export.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "OpenWindow('{0}?ProjectId={1}',600,410);", ResolveClientUrl("~/Projects/ProjectExportImportNew.aspx"), ProjectId); subItem.Text = LocRM.GetString("MSProjectExchange"); topMenuItem.Items.Add(subItem); } #endregion #region --- Separator --- if (canViewFinances || canUpdate) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.LookId = "BreakItem"; topMenuItem.Items.Add(subItem); } #endregion #region UpdateHistory subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ObjectId={1}&ObjectTypeId={1}', 750, 466);", ResolveClientUrl("~/Common/SystemEventsByObject.aspx"), ProjectId, (int)ObjectTypes.Project); subItem.Text = LocRM3.GetString("UpdateHistory"); topMenuItem.Items.Add(subItem); #endregion #region Latest Visitors subItem = new ComponentArt.Web.UI.MenuItem(); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ObjectId={1}&ObjectTypeId={2}', 450, 266);", ResolveClientUrl("~/Common/LatestVisitors.aspx"), ProjectId, (int)ObjectTypes.Project); subItem.Text = LocRM3.GetString("LatestVisitors"); topMenuItem.Items.Add(subItem); #endregion #region System Notifications subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", ProjectId, ((int)ObjectTypes.Project).ToString()); subItem.Text = LocRM.GetString("SystemNotifications"); topMenuItem.Items.Add(subItem); #endregion #region System Reminder Project.ProjectSecurity ps = Project.GetSecurity(ProjectId); if (ps.IsManager || ps.IsManager || ps.IsTeamMember || ps.IsSponsor || ps.IsStakeHolder) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/reminder.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = String.Format(CultureInfo.InvariantCulture, "javascript:ShowWizard('{0}?ObjectTypeId={1}&ObjectId={2}', 420, 150)", ResolveClientUrl("~/Directory/SystemRemindersForObject.aspx"), (int)ObjectTypes.Project, ProjectId); subItem.Text = LocRM.GetString("EditReminder"); topMenuItem.Items.Add(subItem); } #endregion #region Favorites if (!Project.CheckFavorites(ProjectId)) { subItem = new ComponentArt.Web.UI.MenuItem(); subItem.Look.LeftIconUrl = "~/Layouts/Images/Favorites.gif"; subItem.Look.LeftIconWidth = Unit.Pixel(16); subItem.Look.LeftIconHeight = Unit.Pixel(16); subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnAddToFavorites, ""); subItem.Text = LocRM.GetString("AddToFavorites"); topMenuItem.Items.Add(subItem); } #endregion secHeader.ActionsMenu.Items.Add(topMenuItem); }