Ejemplo n.º 1
0
        protected void lbChangeView_Click(object sender, EventArgs e)
        {
            string arg = Request["__EVENTARGUMENT"];

            if (!String.IsNullOrEmpty(arg))
            {
                BlockHeaderLightWithMenu secHeader = null;
                if (this.Parent.Parent is IToolbarLight)
                {
                    secHeader = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar();
                }
                ComponentArt.Web.UI.MenuItem subItem;
                ComponentArt.Web.UI.MenuItem topItem = null;
                if (secHeader.ActionsMenu.Items.Count > 0)
                {
                    foreach (ComponentArt.Web.UI.MenuItem mi in secHeader.ActionsMenu.Items)
                    {
                        if (mi.Value == _viewValue)
                        {
                            topItem = mi;
                            break;
                        }
                    }
                }
                if (topItem == null)
                {
                    return;
                }
                if (arg == "0")
                {
                    _pc["GanttView"] = "0";
                    if (secHeader != null)
                    {
                        subItem = topItem.Items[0];
                        subItem.Look.LeftIconUrl    = String.Empty;
                        subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        subItem = topItem.Items[1];
                        subItem.Look.LeftIconUrl    = "~/Layouts/Images/accept_1.gif";
                        subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    }
                }
                else if (arg == "1")
                {
                    _pc["GanttView"] = "1";
                    if (secHeader != null)
                    {
                        subItem = topItem.Items[1];
                        subItem.Look.LeftIconUrl    = String.Empty;
                        subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        subItem = topItem.Items[0];
                        subItem.Look.LeftIconUrl    = "~/Layouts/Images/accept_1.gif";
                        subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void BindToolbar()
 {
     if (this.Parent.Parent is IToolbarLight)
     {
         bool projectSpreadSheetIsActive = ProjectSpreadSheet.IsActive(int.Parse(this.Request["ProjectId"]));
         if (projectSpreadSheetIsActive)
         {
             BlockHeaderLightWithMenu secHeaderLight = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar();
             secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/icons/xlsexport.gif'/> " + LocRM2.GetString("ExcelExport"), "../Projects/ProjectBSExport.aspx?" +
                                         "ProjectId=" + ProjectId.ToString() + "&BasePlan1=" + pc["SpreadSheet_dd1" + ProjectId.ToString()] +
                                         "&BasePlan2=" + pc["SpreadSheet_dd2" + ProjectId.ToString()] + "&FromYear=" + pc["SpreadSheet_From" + ProjectId.ToString()] +
                                         "&ToYear=" + pc["SpreadSheet_To" + ProjectId.ToString()] + "&FinanceType=" + pc["SpreadSheet_DocumentType" + ProjectId.ToString()]);
         }
     }
 }
Ejemplo n.º 3
0
        private void BindToolBar()
        {
            if (this.Parent is IPageViewMenu)
            {
                PageViewMenu secHeader = (PageViewMenu)((IPageViewMenu)this.Parent).GetToolBar();
                secHeader.Title = LocRM.GetString("tbDocumentsList");

                GenerateMenu(secHeader.ActionsMenu);
            }
            else if (this.Parent is IToolbarLight)
            {
                BlockHeaderLightWithMenu secHeader = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent).GetToolBar();
                secHeader.AddText(LocRM.GetString("tbDocumentsList"));

                GenerateMenu(secHeader.ActionsMenu);
            }

            else if (this.Parent.Parent is IToolbarLight)
            {
                BlockHeaderLightWithMenu secHeader = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar();
                GenerateMenu(secHeader.ActionsMenu);
            }
        }
Ejemplo n.º 4
0
        private void BindToolbar()
        {
            if (this.Parent.Parent is IToolbarLight)
            {
                BlockHeaderLightWithMenu secHeaderLight = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar();
                if (ProjectId > 0 && Project.CanEditFinances(ProjectId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>&nbsp;" + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../projects/AddActualItem.aspx?ProjectId=" + ProjectId.ToString() + "',520,270,false);");
                }
                if (TaskId > 0 && Task.CanViewFinances(TaskId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>  " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddActualItem.aspx?TaskID=" + TaskId + "',520,270,false);");
                }
                if (IncidentId > 0 && Incident.CanViewFinances(IncidentId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>  " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddActualItem.aspx?IncidentId=" + IncidentId + "',520,270,false);");
                }
                if (DocumentId > 0 && Document.CanViewFinances(DocumentId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>  " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddActualItem.aspx?DocumentId=" + DocumentId + "',520,270,false);");
                }
                if (EventId > 0 && CalendarEntry.CanViewFinances(EventId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>  " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddActualItem.aspx?EventId=" + EventId + "',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/AddActualItem.aspx?ToDoId=" + ToDoId + "',520,270,false);");
                }
            }
            else
            if (this.Parent is IToolbarLight)
            {
                BlockHeaderLightWithMenu secHeaderLight = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent).GetToolBar();
                secHeaderLight.AddText(LocRM.GetString("tActFinances"));


                if (ProjectId > 0 && Project.CanEditFinances(ProjectId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>&nbsp;" + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../projects/AddActualItem.aspx?ProjectId=" + ProjectId.ToString() + "',520,270,false);");
                }
                if (TaskId > 0 && Task.CanViewFinances(TaskId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>  " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddActualItem.aspx?TaskID=" + TaskId + "',520,270,false);");
                }
                if (IncidentId > 0 && Incident.CanViewFinances(IncidentId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>  " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddActualItem.aspx?IncidentId=" + IncidentId + "',520,270,false);");
                }
                if (DocumentId > 0 && Document.CanViewFinances(DocumentId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>  " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddActualItem.aspx?DocumentId=" + DocumentId + "',520,270,false);");
                }
                if (EventId > 0 && CalendarEntry.CanViewFinances(EventId))
                {
                    secHeaderLight.AddRightLink("<img alt='' src='../Layouts/Images/newitem.gif'/>  " + LocRM.GetString("tbAdd"), "javascript:OpenWindow('../Projects/AddActualItem.aspx?EventId=" + EventId + "',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/AddActualItem.aspx?ToDoId=" + ToDoId + "',520,270,false);");
                }
            }
        }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
        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'/>&nbsp;" + 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);");
                }
            }
        }