private void BindDG() { Project.ProjectSecurity ps = Project.GetSecurity(projectID); if (!(ps.IsManager || ps.IsExecutiveManager || Security.IsUserInGroup(InternalSecureGroups.PowerProjectManager) || Security.IsUserInGroup(InternalSecureGroups.ExecutiveManager))) { dgPredecessors.Columns[7].Visible = false; } if (dgPredecessors.EditItemIndex >= 0) { dgPredecessors.Columns[6].ItemStyle.Width = Unit.Pixel(130); } else { dgPredecessors.Columns[6].ItemStyle.Width = Unit.Pixel(60); } dgPredecessors.Columns[3].HeaderText = LocRM.GetString("ID"); dgPredecessors.Columns[4].HeaderText = LocRM.GetString("Title"); dgPredecessors.Columns[5].HeaderText = LocRM.GetString("EndDate"); dgPredecessors.Columns[6].HeaderText = LocRM.GetString("Lag"); dgPredecessors.DataSource = Task.GetListPredecessorsDetails(BaseTaskID); dgPredecessors.DataBind(); foreach (DataGridItem dgi in dgPredecessors.Items) { ImageButton ib = (ImageButton)dgi.FindControl("ibDelete"); if (ib != null) { ib.Attributes.Add("onclick", "return confirm('" + LocRM.GetString("Warning") + "')"); } } }
public static bool CheckSecurityForObject(ObjectTypes objectType, int ObjectId, int UserId) { bool isValid = false; if (objectType == ObjectTypes.Project) { Project.ProjectSecurity sec = Project.GetSecurity(ObjectId, UserId); isValid = sec.IsManager || sec.IsExecutiveManager || sec.IsTeamMember || sec.IsSponsor || sec.IsStakeHolder; } else if (objectType == ObjectTypes.Task) { Task.TaskSecurity sec = Task.GetSecurity(ObjectId, UserId); isValid = sec.IsManager || sec.IsRealTaskResource; } else if (objectType == ObjectTypes.ToDo) { ToDo.ToDoSecurity sec = ToDo.GetSecurity(ObjectId, UserId); isValid = sec.IsManager || sec.IsResource || sec.IsCreator; } else if (objectType == ObjectTypes.CalendarEntry) { CalendarEntry.EventSecurity sec = CalendarEntry.GetSecurity(ObjectId, UserId); isValid = sec.IsManager || sec.IsResource; } else if (objectType == ObjectTypes.Document) { Document.DocumentSecurity sec = Document.GetSecurity(ObjectId, UserId); isValid = sec.IsManager || sec.IsResource || sec.IsCreator; } return(isValid); }
private void BindDD() { // Group GroupingList.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.TimeTracking", "GroupingWeekUser").ToString(), GroupingWeekUser)); GroupingList.Items.Add(new ListItem(GetGlobalResourceObject("IbnFramework.TimeTracking", "GroupingUserWeek").ToString(), GroupingUserWeek)); // Projects bool isPpmExec = Mediachase.IBN.Business.Security.IsUserInGroup(InternalSecureGroups.PowerProjectManager) || Mediachase.IBN.Business.Security.IsUserInGroup(InternalSecureGroups.ExecutiveManager); string titledFieldName = TimeTrackingManager.GetBlockTypeInstanceMetaClass().TitleFieldName; foreach (TimeTrackingBlockTypeInstance bo in TimeTrackingManager.GetProjectBlockTypeInstances()) { // Условия для того, чтобы BlockTypeInstances попал в список: // - он должен быть связан с проектом // - у него должны быть активны финансы // - текущий пользователь - либо PPM/Exec, либо менеджер/исп.менеджер проекта if (bo.ProjectId.HasValue) { int projectId = bo.ProjectId.Value; if (ProjectSpreadSheet.IsActive(projectId)) { bool add = false; if (isPpmExec) { add = true; } else { Project.ProjectSecurity ps = Project.GetSecurity(projectId); if (ps.IsManager || ps.IsExecutiveManager) { add = true; } } if (add) { ListItem li = new ListItem(bo.Properties[titledFieldName].Value.ToString(), bo.PrimaryKeyId.ToString()); ProjectList.Items.Add(li); } } } } if (ProjectList.Items.Count <= 0) { NoProjectsDiv.Visible = true; PanelFilters.Visible = false; return; } else { NoProjectsDiv.Visible = false; } // Users UserList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.Global:_mc_All}"), "0")); Principal[] mas = Principal.List(new FilterElementCollection(FilterElement.EqualElement("Card", "User"), FilterElement.EqualElement("Activity", 3)), new SortingElementCollection(new SortingElement("Name", SortingElementType.Asc))); foreach (Principal pl in mas) { UserList.Items.Add(new ListItem(pl.Name, pl.PrimaryKeyId.ToString())); } // Dates PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_Any}"), "[DateTimeThisAny]")); PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_ThisWeek}"), "[DateTimeThisWeek]")); PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_LastWeek}"), "[DateTimeLastWeek]")); PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_ThisMonth}"), "[DateTimeThisMonth]")); PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_LastMonth}"), "[DateTimeLastMonth]")); PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_ThisYear}"), "[DateTimeThisYear]")); PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_LastYear}"), "[DateTimeLastYear]")); PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_CustomWeek}"), "0")); PeriodList.Items.Add(new ListItem(CHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_CustomPeriod}"), "-1")); Dtc1.SelectedDate = CHelper.GetRealWeekStartByDate(DateTime.Today); Dtc2.SelectedDate = CHelper.GetRealWeekStartByDate(DateTime.Today); }
private void BindReminders() { Project.ProjectSecurity ps = Project.GetSecurity(ProjectId); IsMember = ps.IsManager || ps.IsManager || ps.IsTeamMember || ps.IsSponsor || ps.IsStakeHolder; if (IsMember && TargetStartDate > DateTime.UtcNow) { int Lag = -1; bool IsActive = false; using (IDataReader reader = Schedule.GetReminderSubscriptionPersonalForObject(DateTypes.Project_StartDate, ProjectId)) { if (reader.Read()) { Lag = (int)reader["Lag"]; IsActive = (bool)reader["IsActive"]; } } if (IsActive) { imgReminderStart.ToolTip = String.Format("{0}: {1}", LocRM3.GetString("Start"), CommonHelper.GetIntervalString(Lag)); } else { imgReminderStart.ToolTip = CommonHelper.GetIntervalString(-1); if (imgReminderStart.ToolTip.StartsWith("[")) { imgReminderStart.ToolTip = imgReminderStart.ToolTip.Substring(1); } if (imgReminderStart.ToolTip.EndsWith("]")) { imgReminderStart.ToolTip = imgReminderStart.ToolTip.Substring(0, imgReminderStart.ToolTip.Length - 1); } imgReminderStart.ImageUrl = "~/Layouts/Images/reminder2.gif"; } } else { imgReminderStart.Visible = false; } if (IsMember && TargetFinishDate > DateTime.UtcNow) { int Lag = -1; bool IsActive = false; using (IDataReader reader = Schedule.GetReminderSubscriptionPersonalForObject(DateTypes.Project_FinishDate, ProjectId)) { if (reader.Read()) { Lag = (int)reader["Lag"]; IsActive = (bool)reader["IsActive"]; } } if (IsActive) { imgReminderFinish.ToolTip = String.Format("{0}: {1}", LocRM3.GetString("Finish"), CommonHelper.GetIntervalString(Lag)); } else { imgReminderFinish.ToolTip = CommonHelper.GetIntervalString(-1); if (imgReminderFinish.ToolTip.StartsWith("[")) { imgReminderFinish.ToolTip = imgReminderFinish.ToolTip.Substring(1); } if (imgReminderFinish.ToolTip.EndsWith("]")) { imgReminderFinish.ToolTip = imgReminderFinish.ToolTip.Substring(0, imgReminderFinish.ToolTip.Length - 1); } imgReminderFinish.ImageUrl = "~/Layouts/Images/reminder2.gif"; } } else { imgReminderFinish.Visible = false; } }
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); }