Exemplo n.º 1
0
 private void BindChildNodes(XmlNode xmlNode, ComponentArt.Web.UI.MenuItem MenuItem)
 {
     ComponentArt.Web.UI.MenuItem subItem;
     foreach (XmlNode xmlItem in xmlNode.ChildNodes)
     {
         subItem = new ComponentArt.Web.UI.MenuItem();
         if (xmlItem.Attributes["PictureUrl"] != null)
         {
             string sUrl = xmlItem.Attributes["PictureUrl"].Value;
             subItem.Look.LeftIconUrl    = sUrl;
             subItem.Look.LeftIconWidth  = Unit.Pixel(16);
             subItem.Look.LeftIconHeight = Unit.Pixel(16);
         }
         if (xmlItem.Attributes["NavigateUrl"] != null)
         {
             string sUrl = xmlItem.Attributes["NavigateUrl"].Value;
             if (sUrl.IndexOf("IncidentId=") >= 0)
             {
                 sUrl += Request["IncidentId"].ToString();
             }
             subItem.NavigateUrl = sUrl;
         }
         if (xmlItem.Attributes["ClientCommand"] != null)
         {
             subItem.ClientSideCommand = xmlItem.Attributes["ClientCommand"].Value;
         }
         subItem.Text = xmlItem.Attributes["Name"].Value;
         if (xmlItem.HasChildNodes)
         {
             BindChildNodes(xmlItem, subItem);
         }
         MenuItem.Items.Add(subItem);
     }
 }
Exemplo n.º 2
0
        private void recurseSelection(ComponentArt.Web.UI.MenuItem menuItem)
        {
            string id = _clipID.ToString();

            if (menuItem.ID == id)
            {
                _menu.SelectedItem = menuItem;
            }
            else
            {
                for (int x = 0; x < menuItem.Items.Count; x++)
                {
                    recurseSelection(menuItem.Items[x]);
                }
            }
        }
Exemplo n.º 3
0
        public void SetLeftLook(ComponentArt.Web.UI.MenuItem item)
        {
            if (_empty)
            {
                return;
            }

            item.Look.LeftIconUrl       = _defaultUrl;
            item.Look.LeftIconHeight    = _height;
            item.Look.LeftIconWidth     = _width;
            item.Look.HoverLeftIconUrl  = _defaultHoverUrl;
            item.Look.ActiveLeftIconUrl = _defaultActiveUrl;


            if (_selectUrl != string.Empty)
            {
                item.SelectedLook.LeftIconUrl = _selectUrl;
            }
            else
            {
                item.SelectedLook.LeftIconUrl = _defaultUrl;
            }

            item.SelectedLook.LeftIconWidth  = _width;
            item.SelectedLook.LeftIconHeight = _height;

            if (_selectHoverUrl != string.Empty)
            {
                item.SelectedLook.HoverLeftIconUrl = _selectHoverUrl;
            }
            else
            {
                item.SelectedLook.HoverLeftIconUrl = _defaultHoverUrl;
            }

            if (_selectActiveUrl != string.Empty)
            {
                item.SelectedLook.ActiveLeftIconUrl = _selectActiveUrl;
            }
            else
            {
                item.SelectedLook.ActiveLeftIconUrl = _defaultActiveUrl;
            }
        }
Exemplo n.º 4
0
        private void BindToolbar()
        {
            secHeader.AddText(LocRM.GetString("tRelProjects"));

            if (Project.CanUpdate(ProjectId))
            {
                ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
                topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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;

                CommandManager    cm  = CommandManager.GetCurrent(this.Page);
                CommandParameters cp  = new CommandParameters();
                string            cmd = String.Empty;

                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);
                cp  = new CommandParameters("MC_PM_RelatedPrjClipboard");
                cmd = cm.AddCommand("Project", "", "ProjectView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM2.GetString("tPastePrjFromClipboard");
                topMenuItem.Items.Add(subItem);

                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);
                cp  = new CommandParameters("MC_PM_RelatedPrj");
                cmd = cm.AddCommand("Project", "", "ProjectView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM2.GetString("AddRelated");
                topMenuItem.Items.Add(subItem);

                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Exemplo n.º 5
0
        private void BindToolbar()
        {
            secHeader.AddText(LocRM.GetString("timeline_info"));

            if (Project.CanUpdate(ProjectId) || imgReminderStart.Visible)
            {
                ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
                topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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;

                if (Project.CanUpdate(ProjectId))
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = String.Format("javascript:ShowWizard('EditTargetTimeline.aspx?ProjectId={0}', 400, 250)", ProjectId);
                    subItem.Text = LocRM2.GetString("EditTargetTimeline");
                    topMenuItem.Items.Add(subItem);

                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = String.Format("javascript:ShowWizard('EditActualTimeline.aspx?ProjectId={0}', 400, 250)", ProjectId);
                    subItem.Text = LocRM2.GetString("EditActualTimeline");
                    topMenuItem.Items.Add(subItem);
                }

                if (IsMember)
                {
                    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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (int)ObjectTypes.Project, ProjectId);
                    subItem.Text = LocRM2.GetString("EditReminder");
                    topMenuItem.Items.Add(subItem);
                }

                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Exemplo n.º 6
0
    /// <summary>
    /// 加载子菜单
    /// </summary>
    private void LoadChildMenus(ComponentArt.Web.UI.MenuItem parentItem, MenuCategory parentMenu)
    {
        foreach (MenuCategory menu in parentMenu.ChildMenus)
        {
            ComponentArt.Web.UI.MenuItem item = new ComponentArt.Web.UI.MenuItem();
            item.Text    = menu.MenuText;
            item.ToolTip = menu.MenuText;
            item.LookId  = "TopItemLook";
            parentItem.Items.Add(item);

            string webAction = menu.MenuURL;
            if (!String.IsNullOrEmpty(webAction))
            {
                item.NavigateUrl = webAction;
            }

            if (menu.ChildMenus.Count > 0)
            {
                LoadChildMenus(item, menu);
            }
        }
    }
Exemplo n.º 7
0
        private void GenerateMenu(ComponentArt.Web.UI.Menu menu)
        {
            ComponentArt.Web.UI.MenuItem subItem;

            subItem                     = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId              = "TopItemLook";
            subItem.NavigateUrl         = "../Documents/DocumentEdit.aspx?ProjectID=" + ProjectID;
            subItem.Text                = LocRM.GetString("tDocumentAdd");
            subItem.Look.LeftIconUrl    = ResolveUrl("~/Layouts/Images/icons/document_create.gif");
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.Look.LeftIconWidth  = Unit.Pixel(16);
            menu.Items.Add(subItem);

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = LocRM2.GetString("Export");
            topMenuItem.Look.LeftIconUrl    = ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth  = Unit.Pixel(16);
            topMenuItem.LookId              = "TopItemLook";

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/xlsexport.gif";
            subItem.Look.LeftIconWidth  = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl         = "../Documents/default.aspx?Export=1&ProjectID=" + ProjectID;
            subItem.Text = LocRM.GetString("Export");
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/xmlexport.gif";
            subItem.Look.LeftIconWidth  = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl         = "../Documents/default.aspx?Export=2&ProjectID=" + ProjectID;
            subItem.Text = LocRM.GetString("XMLExport");
            topMenuItem.Items.Add(subItem);

            menu.Items.Add(topMenuItem);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Binds the sites.
        /// </summary>
        private void BindSites()
        {
            SiteDto sites = CMSContext.Current.GetSitesDto(CmsConfiguration.Instance.ApplicationId);

            if (sites.Site.Count > 1)
            {
                ca.MenuItem sitesRoot = new ca.MenuItem();
                sitesRoot.Text   = "Sites";
                sitesRoot.LookId = "TopItemLook";

                foreach (SiteDto.SiteRow row in sites.Site.Rows)
                {
                    ca.MenuItem siteItem = new ca.MenuItem();
                    siteItem.Text = row.Name;
                    string url = GlobalVariable.GetVariable("url", row.SiteId);
                    siteItem.NavigateUrl               = url;
                    siteItem.ClientTemplateId          = "DescriptionTemplate";
                    siteItem.Attributes["Description"] = row.Description;
                    sitesRoot.Items.Add(siteItem);
                }

                LoginMenu.Items.Insert(1, sitesRoot);
            }
        }
Exemplo n.º 9
0
        protected override void Render(HtmlTextWriter writer)
        {
            if (menuXML != "")
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(menuXML);
                XmlNodeList xmlTopItems = doc.SelectNodes("Menus/Menu");
                ComponentArt.Web.UI.MenuItem newItem;
                foreach (XmlNode xmlTopItem in xmlTopItems)
                {
                    newItem = new ComponentArt.Web.UI.MenuItem();
                    string sTitle = "";
                    if (xmlTopItem.Attributes["PictureUrl"] != null)
                    {
                        string sUrl = xmlTopItem.Attributes["PictureUrl"].Value;
                        if (sUrl.IndexOf("~") == 0)
                        {
                            sUrl = Request.ApplicationPath + "/" + sUrl.Substring(2);
                        }
                        sTitle = "<img border='0' src='" + sUrl + "' align='absmiddle'/>&nbsp;";
                    }
                    newItem.Text   = sTitle + xmlTopItem.Attributes["Name"].Value;
                    newItem.LookId = "TopItemLook";
                    if (xmlTopItem.HasChildNodes)
                    {
                        BindChildNodes(xmlTopItem, newItem);
                    }
                    AcMenu.Items.Add(newItem);
                }
            }

/*			else
 *                              AcMenu.Visible = false;
 */
            base.Render(writer);
        }
Exemplo n.º 10
0
        private void GenerateMenu(ComponentArt.Web.UI.Menu menu)
        {
            ComponentArt.Web.UI.MenuItem subItem;

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "TopItemLook";
            subItem.NavigateUrl = "../Documents/DocumentEdit.aspx?ProjectID=" + ProjectID;
            subItem.Text = LocRM.GetString("tDocumentAdd");
            subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/document_create.gif");
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            menu.Items.Add(subItem);

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM2.GetString("Export");
            topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
            topMenuItem.LookId = "TopItemLook";

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/xlsexport.gif";
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl = "../Documents/default.aspx?Export=1&ProjectID=" + ProjectID;
            subItem.Text = LocRM.GetString("Export");
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/xmlexport.gif";
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl = "../Documents/default.aspx?Export=2&ProjectID=" + ProjectID;
            subItem.Text = LocRM.GetString("XMLExport");
            topMenuItem.Items.Add(subItem);

            menu.Items.Add(topMenuItem);
        }
Exemplo n.º 11
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tTitle");

            bool canUpdate = Mediachase.IBN.Business.ToDo.CanUpdate(ToDoID);
            bool canViewFinances = Mediachase.IBN.Business.ToDo.CanViewFinances(ToDoID);
            bool canDelete = Mediachase.IBN.Business.ToDo.CanDelete(ToDoID);
            bool isExternal = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */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;

            CommandManager cm = CommandManager.GetCurrent(this.Page);
            CommandParameters cp = null;
            string cmd = String.Empty;

            #region Create
            if (canUpdate)
            {
                #region Create: Predecessor, Successor
                ComponentArt.Web.UI.MenuItem createItem = new ComponentArt.Web.UI.MenuItem();
                createItem.Text = LocRM.GetString("Create");
                createItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                createItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                createItem.Look.RightIconWidth = Unit.Pixel(15);
                createItem.Look.RightIconHeight = Unit.Pixel(10);

                #region Create Predecessor
                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?SuccID=" + ToDoID;
                subItem.Text = LocRM.GetString("Predecessor");
                createItem.Items.Add(subItem);
                #endregion

                #region Create Successor
                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?PredID=" + ToDoID;
                subItem.Text = LocRM.GetString("Successor");
                createItem.Items.Add(subItem);
                #endregion

                topMenuItem.Items.Add(createItem);
                #endregion
            }
            #endregion

            #region Edit
            if (canUpdate)
            {
                #region Edit: ToDo, Categories
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("Edit");
                editItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth = Unit.Pixel(15);
                editItem.Look.RightIconHeight = Unit.Pixel(10);

                #region Edit ToDo
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_edit.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "../ToDo/ToDoEdit.aspx?ToDoID=" + ToDoID;
                subItem.Text = LocRM.GetString("ToDo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonToDoAllowEditGeneralCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.ClientSideCommand = "javascript:ShowWizard('../ToDo/EditCategories.aspx?ToDoID=" + ToDoID + "', 300, 250);";
                    subItem.Text = LocRM.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion

                topMenuItem.Items.Add(editItem);
                #endregion
            }
            #endregion

            #region Add Resources
            if (canUpdate && !isExternal)
            {
                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);
                cp = new CommandParameters("MC_PM_ToDoResEdit");
                cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ModifyResources2(" + ToDoID + ")";
                subItem.Text = LocRM.GetString("AddResources");
                topMenuItem.Items.Add(subItem);
                if (!IsPostBack && Request["Assign"] == "1")
                {
                    ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(),
                     "function Assign(){" + cmd + "} setTimeout('Assign()', 400);", true);
                }
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_delete.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand = "javascript:DeleteToDoModal2()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (canUpdate || canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Add Predecessors and Successors
            if (canUpdate)
            {
                #region Add Predecessors
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_predecessors.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);

                cp = new CommandParameters("MC_ToDo_AddPred");
                cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;

                subItem.Text = LocRM.GetString("AddPredecessors");
                topMenuItem.Items.Add(subItem);
                #endregion

                #region Add Successors
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_sucessors.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);

                cp = new CommandParameters("MC_ToDo_AddSucc");
                cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;

                subItem.Text = LocRM.GetString("AddSuccessors");
                topMenuItem.Items.Add(subItem);
                #endregion

            /*				using (IDataReader rdr = ToDo.GetListVacantPredecessors(ToDoID))
                {
                    if (rdr.Read())
                    {
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_predecessors.gif";
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        cp = new CommandParameters("MC_PM_AddPredTodo");
                        cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
                        cmd = cmd.Replace("\"", "&quot;");
                        subItem.ClientSideCommand = "javascript:" + cmd;
                        subItem.Text = LocRM4.GetString("Add");
                        topMenuItem.Items.Add(subItem);
                    }
                }

                using (IDataReader rdr = ToDo.GetListVacantSuccessors(ToDoID))
                {
                    if (rdr.Read())
                    {
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_sucessors.gif";
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        cp = new CommandParameters("MC_PM_AddSuccTodo");
                        cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
                        cmd = cmd.Replace("\"", "&quot;");
                        subItem.ClientSideCommand = "javascript:" + cmd;
                        subItem.Text = LocRM4.GetString("AddSuc");
                        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);
            string commentaddlink = "../Common/CommentAdd.aspx?";
            if (isExternal)
                commentaddlink = "../External/ExternalCommentAdd.aspx?";
            subItem.ClientSideCommand = String.Format("javascript:OpenWindow('{0}ToDoID={1}',{2},false);",
            commentaddlink, ToDoID, (Security.CurrentUser.IsExternal) ? "800,600" : "520,270");
            subItem.Text = LocRM.GetString("CreateComment");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking
            /*
            if (Configuration.ProjectManagementEnabled)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?ToDoID={1}', {2});",
                  sPath, ToDoID, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
                subItem.Text = LocRM.GetString("AddTimeSheet");
                topMenuItem.Items.Add(subItem);
            }
             */
            #endregion

            #region Update History
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", ToDoID, (int)ObjectTypes.ToDo);
                subItem.Text = LocRM3.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", ToDoID, (int)ObjectTypes.ToDo);
                subItem.Text = LocRM3.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!isExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", ToDoID, ((int)ObjectTypes.ToDo).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Reminder
            if (!isExternal)
            {
                Mediachase.IBN.Business.ToDo.ToDoSecurity sec = Mediachase.IBN.Business.ToDo.GetSecurity(ToDoID);
                if (sec.IsManager || sec.IsResource || sec.IsCreator)
                {
                    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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (int)ObjectTypes.ToDo, ToDoID);
                    subItem.Text = LocRM2.GetString("EditReminder");
                    topMenuItem.Items.Add(subItem);
                }
            }
            #endregion

            #region Favorites
            if (!Mediachase.IBN.Business.ToDo.CheckFavorites(ToDoID) && !isExternal)
            {
                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);
        }
Exemplo n.º 12
0
        private void BindToolbar()
        {
            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM2.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 Create/Clone
            if (IMGroup.CanCreate())
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                if (GroupID == 0)
                {
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/ibngroup_create.gif";
                    subItem.NavigateUrl = "~/Directory/AddIMGroup.aspx";
                    subItem.Text = LocRM.GetString("AddGroup");
                }
                else
                {
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/ibngroupclone.gif";
                    subItem.NavigateUrl = "~/Directory/AddIMGroup.aspx?CloneGroupID=" + GroupID;
                    subItem.Text = LocRM.GetString("Clone");
                }
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit
            if (GroupID > 0 && IMGroup.CanUpdate())
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/ibngroup_edit.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "~/Directory/AddIMGroup.aspx?GroupID=" + GroupID;
                subItem.Text = LocRM.GetString("EditGroup");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Delete
            if (GroupID > 0 && IMGroup.CanDelete(GroupID))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/ibngroup_delete.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand = "javascript:DeleteGroup(" + GroupID.ToString() + ")";
                subItem.Text = LocRM.GetString("DeleteGroup");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region new user
            if (GroupID > 0 && IMGroup.CanUpdate())
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/newuser.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "~/Directory/MultipleUserEdit.aspx";
                subItem.Text = LocRM.GetString("AddUser");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            if (topMenuItem.Items.Count > 0)
                secHeader.ActionsMenu.Items.Add(topMenuItem);

            if (GroupID > 0)
            {
                string imGroupName = IMGroup.GetIMGroupName(GroupID, null);
                if (imGroupName != null)
                    secHeader.Title = imGroupName;
            }
            else
                secHeader.Title = LocRM.GetString("tContactGroups");
        }
Exemplo n.º 13
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tTitle");

            bool canUpdateConfigurationInfo = Task.CanUpdateConfigurationInfo(TaskId);
            bool canUpdate = Task.CanUpdate(TaskId);
            bool canAddTodo = Task.CanAddToDo(TaskId);
            bool canDelete = Task.CanDelete(TaskId);
            bool canModifyResources = Task.CanModifyResources(TaskId);
            canViewFinances = Task.CanViewFinances(TaskId);

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM2.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;

            CommandManager cm = CommandManager.GetCurrent(this.Page);
            CommandParameters cp = new CommandParameters();
            string cmd = String.Empty;

            #region Add ToDo
            if (canAddTodo && !Security.CurrentUser.IsExternal)
            {
                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?TaskId=" + TaskId;
                subItem.Text = LocRM.GetString("tbAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit
            if (canUpdate && !Security.CurrentUser.IsExternal)
            {
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("Edit");
                editItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth = Unit.Pixel(15);
                editItem.Look.RightIconHeight = Unit.Pixel(10);

                #region Edit Task
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task1_edit.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "../Tasks/TaskEdit.aspx?TaskId=" + TaskId;
                subItem.Text = LocRM.GetString("EditTask");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonTaskAllowViewGeneralCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = "javascript:ShowWizard('../Tasks/EditCategories.aspx?TaskId=" + TaskId + "', 300, 250);";
                    subItem.Text = LocRM2.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion

                /*
                #region Edit General Info
                                subItem = new ComponentArt.Web.UI.MenuItem();
                                subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?IncidentId=" + IncidentId + "', 500, 400);";
                                subItem.Text = LocRM2.GetString("EditGeneralInfo");
                                editItem.Items.Add(subItem);
                #endregion
                */
                topMenuItem.Items.Add(editItem);
            }
            #endregion

            #region Modyfy Resources
            if (canModifyResources && !Security.CurrentUser.IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_PM_TaskResEdit");
                cmd = cm.AddCommand("Task", "", "TaskView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('AddResources.aspx?TaskId=" + TaskId + "', 650, 350);";
                subItem.Text = LocRM.GetString("AssignWizard");
                topMenuItem.Items.Add(subItem);

                if (!IsPostBack && Request["Assign"] == "1")
                {
                    ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(),
                     "function Assign(){" + cmd + "} setTimeout('Assign()', 400);", true);
                }
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task1_delete.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand = "javascript:DeleteTask()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "BreakItem";
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Add Predecessors
            if (canUpdateConfigurationInfo && !isMSProject)
            {
                using (IDataReader rdr = Task.GetListVacantPredecessors(TaskId))
                {
                    if (rdr.Read())
                    {
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_predecessors.gif";
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        cp = new CommandParameters("MC_PM_AddPredTask");
                        cmd = cm.AddCommand("Task", "", "TaskView", cp);
                        cmd = cmd.Replace("\"", "&quot;");
                        subItem.ClientSideCommand = "javascript:" + cmd;
                        //subItem.NavigateUrl = "~/Tasks/AddPredecessor.aspx?BaseTaskID=" + TaskId;
                        subItem.Text = LocRM4.GetString("Add");
                        topMenuItem.Items.Add(subItem);
                    }
                }
            }
            #endregion

            #region Add Successors
            if (canUpdateConfigurationInfo && !isMSProject)
            {
                using (IDataReader rdr = Task.GetListVacantSuccessors(TaskId))
                {
                    if (rdr.Read())
                    {
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_sucessors.gif";
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        cp = new CommandParameters("MC_PM_AddSuccTask");
                        cmd = cm.AddCommand("Task", "", "TaskView", cp);
                        cmd = cmd.Replace("\"", "&quot;");
                        subItem.ClientSideCommand = "javascript:" + cmd;
                        //subItem.NavigateUrl = "~/Tasks/AddSuccessor.aspx?BaseTaskID=" + TaskId;
                        subItem.Text = LocRM4.GetString("AddSuc");
                        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);
            string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalCommentAdd.aspx" : "../Common/CommentAdd.aspx";
            subItem.ClientSideCommand = String.Format("javascript:OpenWindow('{0}?TaskId={1}',{2},false);",
            sPath, TaskId, (Security.CurrentUser.IsExternal) ? "800,600" : "520,270");
            subItem.Text = LocRM2.GetString("CreateComment");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking
            /*
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
            subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?TaskId={1}', {2});",
                sPath, TaskId, (Security.CurrentUser.IsExternal)? "800,600" : "450, 200");
            subItem.Text = LocRM2.GetString("AddTimeSheet");
            topMenuItem.Items.Add(subItem);
             */
            #endregion

            #region UpdateHistory
            if (!Security.CurrentUser.IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", TaskId, (int)ObjectTypes.Task);
                subItem.Text = LocRM6.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!Security.CurrentUser.IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", TaskId, (int)ObjectTypes.Task);
                subItem.Text = LocRM6.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!Security.CurrentUser.IsExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", TaskId, ((int)ObjectTypes.Task).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Reminder
            if (!Security.CurrentUser.IsExternal)
            {
                Task.TaskSecurity sec = Task.GetSecurity(TaskId);
                if (sec.IsManager || sec.IsRealTaskResource)
                {
                    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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (int)ObjectTypes.Task, TaskId);
                    subItem.Text = LocRM2.GetString("EditReminder");
                    topMenuItem.Items.Add(subItem);
                }
            }
            #endregion

            #region Favorites
            if (!Task.CheckFavorites(TaskId) && !Security.CurrentUser.IsExternal)
            {
                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);
        }
Exemplo n.º 14
0
        private void BindToolbar()
        {
            secHeader.AddText(LocRM.GetString("timeline_info"));

            if (Project.CanUpdate(ProjectId) || imgReminderStart.Visible)
            {
                ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
                topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM2.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;

                if (Project.CanUpdate(ProjectId))
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = String.Format("javascript:ShowWizard('EditTargetTimeline.aspx?ProjectId={0}', 400, 250)", ProjectId);
                    subItem.Text = LocRM2.GetString("EditTargetTimeline");
                    topMenuItem.Items.Add(subItem);

                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = String.Format("javascript:ShowWizard('EditActualTimeline.aspx?ProjectId={0}', 400, 250)", ProjectId);
                    subItem.Text = LocRM2.GetString("EditActualTimeline");
                    topMenuItem.Items.Add(subItem);
                }

                if (IsMember)
                {
                    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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (int)ObjectTypes.Project, ProjectId);
                    subItem.Text = LocRM2.GetString("EditReminder");
                    topMenuItem.Items.Add(subItem);
                }

                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Exemplo n.º 15
0
        private void BindToolbar()
        {
            if (this.Parent.Parent is IToolbarLight || this.Parent is IToolbarLight)
            {
                DirectoryInfo diCur = _fs.GetDirectory(_folderId);
                if (diCur == null)
                    throw new Mediachase.Ibn.AccessDeniedException();

                BlockHeaderLightWithMenu secHeader;
                if (this.Parent.Parent is IToolbarLight)
                    secHeader = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar();
                else
                    secHeader = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent).GetToolBar();

                if (_containerKey.ToLower().StartsWith("workspace"))
                    secHeader.AddText(LocRM.GetString("tGlobal"));
                secHeader.ActionsMenu.Items.Clear();
                secHeader.ClearRightItems();

                ComponentArt.Web.UI.MenuItem subItem;

                #region MenuItems
                bool isExternal = Security.CurrentUser.IsExternal;
                bool canWrite = _fs.CanUserWrite(diCur.Id);
                bool canAdmin = _fs.CanUserAdmin(diCur.Id);

                if (canWrite)
                {
                    #region New File
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.LookId = "TopItemLook";
                    string commandLink = (Security.CurrentUser.IsExternal) ? "~/External/FileUpload.aspx" : "~/FileStorage/FileUpload.aspx";
                    subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?ParentFolderId={1}&ContainerKey={2}&ContainerName={3}{4}', 470, 270);",
                      ResolveUrl(commandLink), _folderId, _containerKey, _containerName,
                      (Security.CurrentUser.IsExternal) ? ("&ExternalId=" + Security.CurrentUser.UserID) : "");
                    subItem.Text = /*"<img border='0' src='../Layouts/Images/icons/newfile.gif' width='16px' height='16px' align='absmiddle'/> " + */LocRM.GetString("tAddD");
                    subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/newfile.gif");
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    secHeader.ActionsMenu.Items.Add(subItem);
                    #endregion

                    if (!isExternal)
                    {
                        #region New Folder
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.LookId = "TopItemLook";
                        subItem.ClientSideCommand = "javascript:ShowWizard('" + ResolveUrl("~/FileStorage/DirectoryEdit.aspx") + "?ParentFolderId=" + _folderId + "&ContainerKey=" + _containerKey + "&ContainerName=" + _containerName + "', 500, 130);";
                        subItem.Text = /*"<img border='0' src='../Layouts/Images/nfolder.gif' width='16px' height='16px' align='absmiddle'/> " + */LocRM.GetString("tAdd");
                        subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/nfolder.gif");
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        secHeader.ActionsMenu.Items.Add(subItem);
                        #endregion
                    }
                }

                ComponentArt.Web.UI.MenuItem topMenuItem;

                #region Table-Details-Thumbnails
                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.LookId = "TopItemLook";

                string sCurrentView = _pc["fs_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 = LocRM.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 = LocRM.GetString("tDetailsView");
                topMenuItem.Items.Add(subItem);

                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == "Thumbnails")
                {
                    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(lbChangeViewThumb, "");
                subItem.Text = LocRM.GetString("tThumbnails");
                topMenuItem.Items.Add(subItem);
                #endregion

                secHeader.ActionsMenu.Items.Add(topMenuItem);

                topMenuItem = new ComponentArt.Web.UI.MenuItem();
                topMenuItem.Text = LocRM.GetString("tActions");
                topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
                topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
                topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
                topMenuItem.LookId = "TopItemLook";

                if (canWrite)
                {
                    #region New File2
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/newfile.gif";
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    string commandLink = (Security.CurrentUser.IsExternal) ? "~/External/FileUpload.aspx" : "~/FileStorage/FileUpload.aspx";
                    subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?ParentFolderId={1}&ContainerKey={2}&ContainerName={3}{4}', 470, 270);",
                      ResolveUrl(commandLink), _folderId, _containerKey, _containerName,
                      (Security.CurrentUser.IsExternal) ? ("&ExternalId=" + Security.CurrentUser.UserID) : "");
                    subItem.Text = LocRM.GetString("tAddD");
                    topMenuItem.Items.Add(subItem);
                    #endregion

                    if (!isExternal)
                    {
                        #region New Link
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl = "~/Layouts/Images/FileTypes/link.gif";
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        subItem.ClientSideCommand = "javascript:ShowWizard('" + ResolveUrl("~/FileStorage/FileEdit.aspx") + "?LinkId=0&ParentFolderId=" + _folderId + "&ContainerKey=" + _containerKey + "&ContainerName=" + _containerName + "', 470, 230);";
                        subItem.Text = LocRM.GetString("tAddL");
                        topMenuItem.Items.Add(subItem);
                        #endregion

                        #region New Folder2
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl = "~/Layouts/Images/nfolder.gif";
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        subItem.ClientSideCommand = "javascript:ShowWizard('" + ResolveUrl("~/FileStorage/DirectoryEdit.aspx") + "?ParentFolderId=" + _folderId + "&ContainerKey=" + _containerKey + "&ContainerName=" + _containerName + "', 500, 130);";
                        subItem.Text = LocRM.GetString("tAdd");
                        topMenuItem.Items.Add(subItem);
                        #endregion
                    }

                    if (!isExternal)
                    {
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.LookId = "BreakItem";
                        topMenuItem.Items.Add(subItem);

                        #region Move Selected
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl = "~/Layouts/Images/moveto.gif";
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        subItem.ClientSideCommand = "javascript:MoveChecked('" + _containerName + "','" + _containerKey + "')";
                        subItem.Text = LocRM.GetString("MoveCheck");
                        topMenuItem.Items.Add(subItem);
                        #endregion

                        #region Delete Selected
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl = "~/Layouts/Images/delete.gif";
                        subItem.Look.LeftIconWidth = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        subItem.ClientSideCommand = "javascript:DeleteChecked()";
                        subItem.Text = LocRM.GetString("DelCheck");
                        topMenuItem.Items.Add(subItem);
                        #endregion
                    }
                }

                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);

                if (!isExternal)
                {
                    #region Send Selected
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/mail.gif";
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.ClientSideCommand = "javascript:SendChecked('" + _containerName + "','" + _containerKey + "')";
                    subItem.Text = LocRM.GetString("tSendFiles");
                    topMenuItem.Items.Add(subItem);
                    #endregion

                    #region Copy Selected
                    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:CopyChecked()";
                    subItem.Text = LocRM.GetString("CopyToClipboard");
                    topMenuItem.Items.Add(subItem);
                    #endregion

                    if (canWrite)
                    {
                        #region Paste From Clip
                        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);
                        subItem.ClientSideCommand = "javascript:PasteFromClip('" + _containerName + "','" + _containerKey + "'," + _folderId + ")";
                        subItem.Text = LocRM.GetString("tPasteFromClip");
                        topMenuItem.Items.Add(subItem);
                        #endregion
                    }
                }

                if (canAdmin && !isExternal)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.LookId = "BreakItem";
                    topMenuItem.Items.Add(subItem);

                    #region 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.ClientSideCommand = "javascript:FolderSecurity('" + _containerName + "','" + _containerKey + "'," + _folderId + ")";
                    subItem.Text = LocRM.GetString("tFolderSec");
                    topMenuItem.Items.Add(subItem);
                    #endregion
                }
                #endregion

                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Exemplo n.º 16
0
        private void BindToolbar()
        {
            if (this.Parent.Parent is IToolbarLight)
            {
                BlockHeaderLightWithMenu secHeaderLight = (BlockHeaderLightWithMenu)((IToolbarLight)this.Parent.Parent).GetToolBar();

                secHeaderLight.ActionsMenu.Items.Clear();
                secHeaderLight.ClearRightItems();

                ComponentArt.Web.UI.MenuItem subItem;

                #region Issue Create
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "TopItemLook";
                subItem.NavigateUrl = String.Format("~/Incidents/IncidentEdit.aspx?ProjectId={0}", ProjectID);
                subItem.Text = /*"<img border='0' src='../Layouts/Images/icons/incident_create.gif' width='16px' height='16px' align='absmiddle'/>&nbsp;" + */LocRM2.GetString("tbIncidentAdd");
                subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/incident_create.gif");
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                secHeaderLight.ActionsMenu.Items.Add(subItem);
                #endregion

                ComponentArt.Web.UI.MenuItem topMenuItem;

                if (Request.QueryString["IssGroup"] == null)
                {
                    #region View Menu Items
                    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.LookId = "TopItemLook";

                    string sCurrentView = _pc["IncidentList_ViewStyle"];

                    subItem = new ComponentArt.Web.UI.MenuItem();
                    if (sCurrentView == FieldSetName.tIncidentsDefault.ToString())
                    {
                        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(lbChangeViewDef, "");
                    subItem.Text = LocRM.GetString(FieldSetName.tIncidentsDefault.ToString());
                    topMenuItem.Items.Add(subItem);

                    subItem = new ComponentArt.Web.UI.MenuItem();
                    if (sCurrentView == FieldSetName.tIncidentsLight.ToString())
                    {
                        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(lbChangeViewDates, "");
                    subItem.Text = LocRM.GetString(FieldSetName.tIncidentsLight.ToString());
                    topMenuItem.Items.Add(subItem);
                    #endregion

                    secHeaderLight.ActionsMenu.Items.Add(topMenuItem);
                }

                topMenuItem = new ComponentArt.Web.UI.MenuItem();
                topMenuItem.Text = LocRM2.GetString("ImportExport");
                topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
                topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
                topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
                topMenuItem.LookId = "TopItemLook";

                #region Excel Export
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/xlsexport.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = String.Format("~/Incidents/default.aspx?Export=1&ProjectId={0}", ProjectID);
                subItem.Text = LocRM2.GetString("Export");
                topMenuItem.Items.Add(subItem);
                #endregion

                #region XML Export
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/xmlexport.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = String.Format("~/Incidents/default.aspx?Export=2&ProjectId={0}", ProjectID);
                subItem.Text = LocRM2.GetString("XMLExport");
                topMenuItem.Items.Add(subItem);
                #endregion

                secHeaderLight.ActionsMenu.Items.Add(topMenuItem);

                secHeaderLight.EnsureRender();
            }
            else if (this.Parent.Parent is Incidents)
            {
                PageViewMenu secHeader = ((Incidents)this.Parent.Parent).ToolBar;
                if (secHeader != null)
                {
                    secHeader.Title = LocRM2.GetString("tbIncidentsList");

                    ComponentArt.Web.UI.MenuItem subItem;

                    #region Issue Create
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.LookId = "TopItemLook";
                    subItem.NavigateUrl = String.Format("~/Incidents/IncidentEdit.aspx?ProjectId={0}", ProjectID);
                    subItem.Text = /*"<img border='0' src='../Layouts/Images/icons/incident_create.gif' width='16px' height='16px' align='absmiddle'/>&nbsp;" + */LocRM2.GetString("tbIncidentAdd");
                    subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/incident_create.gif");
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    secHeader.ActionsMenu.Items.Add(subItem);
                    #endregion

                    ComponentArt.Web.UI.MenuItem topMenuItem;

                    if (Request.QueryString["IssGroup"] == null)
                    {
                        #region View Menu Items
                        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.LookId = "TopItemLook";

                        string sCurrentView = _pc["IncidentList_ViewStyle"];

                        subItem = new ComponentArt.Web.UI.MenuItem();
                        if (sCurrentView == FieldSetName.tIncidentsDefault.ToString())
                        {
                            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(lbChangeViewDef, "");
                        subItem.Text = LocRM.GetString(FieldSetName.tIncidentsDefault.ToString());
                        topMenuItem.Items.Add(subItem);

                        subItem = new ComponentArt.Web.UI.MenuItem();
                        if (sCurrentView == FieldSetName.tIncidentsLight.ToString())
                        {
                            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(lbChangeViewDates, "");
                        subItem.Text = LocRM.GetString(FieldSetName.tIncidentsLight.ToString());
                        topMenuItem.Items.Add(subItem);
                        #endregion

                        secHeader.ActionsMenu.Items.Add(topMenuItem);
                    }

                    topMenuItem = new ComponentArt.Web.UI.MenuItem();
                    topMenuItem.Text = LocRM2.GetString("ImportExport");
                    topMenuItem.DefaultSubGroupExpandDirection = GroupExpandDirection.BelowRight;
                    topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
                    topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
                    topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
                    topMenuItem.LookId = "TopItemLook";

                    #region Import
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/import.gif";
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.ClientSideCommand = "javascript:ImportWizard();";
                    subItem.Text = LocRM2.GetString("tImport");
                    topMenuItem.Items.Add(subItem);
                    #endregion

                    #region xlsexport
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/xlsexport.gif";
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.NavigateUrl = "~/Incidents/default.aspx?Export=1";
                    subItem.Text = LocRM2.GetString("Export");
                    topMenuItem.Items.Add(subItem);
                    #endregion

                    #region xmlexport
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/xmlexport.gif";
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.NavigateUrl = "~/Incidents/default.aspx?Export=2";
                    subItem.Text = LocRM2.GetString("XMLExport");
                    topMenuItem.Items.Add(subItem);
                    #endregion

                    secHeader.ActionsMenu.Items.Add(topMenuItem);
                }
            }
        }
Exemplo n.º 17
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tUserView");

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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";

            bool isExternal     = false;
            bool isAlertService = false;

            using (IDataReader reader = User.GetUserInfo(UserID, false))
            {
                if (reader.Read())
                {
                    isExternal = (bool)reader["IsExternal"];

                    if (reader["login"].ToString().ToLower() == "alert")
                    {
                        isAlertService = true;
                    }
                }
            }

            ComponentArt.Web.UI.MenuItem subItem;

            bool canUpdate  = User.CanUpdateUserInfo(UserID);
            bool canConvert = isExternal && Security.IsUserInGroup(InternalSecureGroups.Administrator);
            bool canDelete  = Security.IsUserInGroup(InternalSecureGroups.Administrator) && UserID != Security.CurrentUser.UserID && !isAlertService;

            #region Edit
            if (canUpdate)
            {
                string sURL = String.Format("~/Directory/UserEdit.aspx?Back=View&UserID={0}", UserID);
                if (isExternal)
                {
                    sURL = String.Format("~/Directory/ExternalEdit.aspx?Back=View&UserID={0}", UserID);
                }

                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/edit.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = sURL;
                subItem.Text = LocRM3.GetString("tbEditEdit");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Convert
            if (canConvert)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/upload.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "~/Directory/UserEdit.aspx?UserId=" + UserID;
                subItem.Text = LocRM3.GetString("tbConvert");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/delete.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = String.Format("javascript:ShowWizard('UserDelete.aspx?UserId={0}',450,250)", UserID);
                subItem.Text = LocRM3.GetString("tDelete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (canUpdate || canConvert || canDelete)
            {
                subItem        = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Favorites
            if (!Common.CheckFavorites(UserID, ObjectTypes.User) && !isExternal)
            {
                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(AddToFavoritesButton, "");
                subItem.Text = LocRM2.GetString("AddToFavorites");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Back
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl    = "~/Layouts/Images/cancel.gif";
            subItem.Look.LeftIconWidth  = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl         = "~/Directory/Directory.aspx";
            subItem.Text = LocRM3.GetString("tbBack");
            topMenuItem.Items.Add(subItem);
            #endregion

            secHeader.ActionsMenu.Items.Add(topMenuItem);
        }
Exemplo n.º 18
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tbView");

            bool canUpdate       = Incident.CanUpdate(IncidentId);
            bool canAddToDoBox   = Incident.CanAddToDo(IncidentId);
            bool canAddResBox    = Incident.CanModifyResources(IncidentId);
            bool canViewFinances = Incident.CanViewFinances(IncidentId);
            bool canDelete       = Incident.CanDelete(IncidentId);
            bool isExternal      = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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;

            CommandManager cm = null;

            if (!Security.CurrentUser.IsExternal)
            {
                cm = CommandManager.GetCurrent(this.Page);
            }
            CommandParameters cp  = new CommandParameters();
            string            cmd = String.Empty;

            #region Create ToDo
            if (canAddToDoBox && !isExternal)
            {
                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?IncidentId=" + IncidentId;
                subItem.Text = LocRM.GetString("tbAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit: Incident, GeneralInfo, ResolutionInfo, Status
            if (canUpdate)
            {
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("tbViewEdit");
                editItem.Look.RightIconUrl      = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth    = Unit.Pixel(15);
                editItem.Look.RightIconHeight   = Unit.Pixel(10);

                #region Edit Incident
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/incident_edit.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "../Incidents/IncidentEdit.aspx?IncidentId=" + IncidentId + "&Back=incident";
                subItem.Text = LocRM.GetString("EditIssue");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit General Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?IncidentId=" + IncidentId + "', 500, 400);";
                subItem.Text = LocRM2.GetString("EditGeneralInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonIncidentAllowEditGeneralCategoriesField ||
                    PortalConfig.IncidentAllowEditIncidentCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = "javascript:ShowWizard('EditCategories.aspx?IncidentId=" + IncidentId + "', 300, 350);";
                    subItem.Text = LocRM2.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion

                /*
                 #region Edit State Info
                 * subItem = new ComponentArt.Web.UI.MenuItem();
                 * subItem.ClientSideCommand = "javascript:ShowWizard('EditStateInfo.aspx?ProjectId=" + ProjectId + "', 350, 250);";
                 * subItem.Text = LocRM.GetString("EditStateInfo");
                 * editItem.Items.Add(subItem);
                 #endregion
                 *
                 */
                topMenuItem.Items.Add(editItem);
            }
            #endregion

            #region Modyfy Recipients
            if (!isExternal && Mediachase.IBN.Business.Incident.CanUpdateExternalRecipients(IncidentId))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp  = new CommandParameters("MC_HDM_RecipEdit");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('RecipientsEditor.aspx?IncidentId=" + IncidentId + "', 450, 350);";
                subItem.Text = LocRM.GetString("AddRecipients");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Modyfy Resources
            if (canAddResBox && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp  = new CommandParameters("MC_HDM_ResEdit");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('ResourcesEditor.aspx?IncidentId=" + IncidentId + "', 650, 350);";
                subItem.Text = LocRM.GetString("AddResources");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/incident_delete.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:DeleteIncident()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region MarkAsSpam
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/red_denied.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp  = new CommandParameters("MC_HDM_MarkAsSpam");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = GetGlobalResourceObject("IbnFramework.Incident", "MarkAsSpam").ToString();
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (topMenuItem.Items.Count > 0)
            {
                subItem        = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Copy to Clipboard
            if (!isExternal)
            {
                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=Issue&IncidentId=" + IncidentId.ToString() + "', '" + LocRM2.GetString("tXMLError") + "')}catch(e){}";
                subItem.Text = LocRM.GetString("tCopyToClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Add from Clipboard
            if (canUpdate && !isExternal)
            {
                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);
                cp  = new CommandParameters("MC_HDM_RelatedIssClip");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("tPasteFromClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Clear Clipboard
            if (canUpdate && !isExternal)
            {
                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=Issue', '" + LocRM2.GetString("tXMLError") + "')}catch(e){}";
                subItem.Text = LocRM2.GetString("tClearClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (topMenuItem.Items.Count > 0)
            {
                subItem        = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Add Related Issue
            if (canUpdate && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/relincidents.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);

                cp  = new CommandParameters("MC_HDM_RelatedIss");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = String.Format("javascript:OpenPopUpNoScrollWindow(\"../Common/SelectIncident.aspx?btn={0}&exclude={1}\", 640, 480);",
                //    Page.ClientScript.GetPostBackEventReference(btnAddRelatedIss, "xxxtypeid;xxxid"), IncidentId.ToString());
                subItem.Text = LocRM.GetString("tAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking

            /*
             * if (Configuration.ProjectManagementEnabled)
             * {
             *      subItem = new ComponentArt.Web.UI.MenuItem();
             *      subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
             *      subItem.Look.LeftIconWidth = Unit.Pixel(16);
             *      subItem.Look.LeftIconHeight = Unit.Pixel(16);
             *      string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
             *      subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?IncidentId={1}', {2});",
             *        sPath, IncidentId, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
             *      subItem.Text = LocRM.GetString("tbAddTimeSheet");
             *      topMenuItem.Items.Add(subItem);
             * }
             */
            #endregion

            #region UpdateHistory
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", IncidentId, (int)ObjectTypes.Issue);
                subItem.Text = LocRM3.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", IncidentId, (int)ObjectTypes.Issue);
                subItem.Text = LocRM3.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!isExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", IncidentId, ((int)ObjectTypes.Issue).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Favorites
            if (!Incident.CheckFavorites(IncidentId) && !isExternal)
            {
                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

            #region PrintPreviewSettings
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/printPreviewButton.png";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_PrintPreviewSettings");
                cp.CommandArguments = new System.Collections.Generic.Dictionary <string, string>();
                cp.AddCommandArgument("IncidentId", IncidentId.ToString());
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("PrintSettings");
                topMenuItem.Items.Add(subItem);

                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/print.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_PrintIssue");
                cp.CommandArguments = new System.Collections.Generic.Dictionary <string, string>();
                cp.AddCommandArgument("IncidentId", IncidentId.ToString());
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("PrintIssue");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            if (topMenuItem.Items.Count > 0)
            {
                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Exemplo n.º 19
0
        private void BindToolbar()
        {
            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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 Create/Clone
            if (IMGroup.CanCreate())
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                if (GroupID == 0)
                {
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/ibngroup_create.gif";
                    subItem.NavigateUrl      = "~/Directory/AddIMGroup.aspx";
                    subItem.Text             = LocRM.GetString("AddGroup");
                }
                else
                {
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/ibngroupclone.gif";
                    subItem.NavigateUrl      = "~/Directory/AddIMGroup.aspx?CloneGroupID=" + GroupID;
                    subItem.Text             = LocRM.GetString("Clone");
                }
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit
            if (GroupID > 0 && IMGroup.CanUpdate())
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/ibngroup_edit.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "~/Directory/AddIMGroup.aspx?GroupID=" + GroupID;
                subItem.Text = LocRM.GetString("EditGroup");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Delete
            if (GroupID > 0 && IMGroup.CanDelete(GroupID))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/ibngroup_delete.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:DeleteGroup(" + GroupID.ToString() + ")";
                subItem.Text = LocRM.GetString("DeleteGroup");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region new user
            if (GroupID > 0 && IMGroup.CanUpdate())
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/newuser.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "~/Directory/MultipleUserEdit.aspx";
                subItem.Text = LocRM.GetString("AddUser");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            if (topMenuItem.Items.Count > 0)
            {
                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }

            if (GroupID > 0)
            {
                string imGroupName = IMGroup.GetIMGroupName(GroupID, null);
                if (imGroupName != null)
                {
                    secHeader.Title = imGroupName;
                }
            }
            else
            {
                secHeader.Title = LocRM.GetString("tContactGroups");
            }
        }
Exemplo n.º 20
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tTitle");

            bool canUpdate       = Mediachase.IBN.Business.ToDo.CanUpdate(ToDoID);
            bool canViewFinances = Mediachase.IBN.Business.ToDo.CanViewFinances(ToDoID);
            bool canDelete       = Mediachase.IBN.Business.ToDo.CanDelete(ToDoID);
            bool isExternal      = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ 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;

            CommandManager    cm  = CommandManager.GetCurrent(this.Page);
            CommandParameters cp  = null;
            string            cmd = String.Empty;

            #region Create
            if (canUpdate)
            {
                #region Create: Predecessor, Successor
                ComponentArt.Web.UI.MenuItem createItem = new ComponentArt.Web.UI.MenuItem();
                createItem.Text = LocRM.GetString("Create");
                createItem.Look.RightIconUrl      = "../Layouts/Images/arrow_right.gif";
                createItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                createItem.Look.RightIconWidth    = Unit.Pixel(15);
                createItem.Look.RightIconHeight   = Unit.Pixel(10);

                #region Create Predecessor
                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?SuccID=" + ToDoID;
                subItem.Text = LocRM.GetString("Predecessor");
                createItem.Items.Add(subItem);
                #endregion

                #region Create Successor
                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?PredID=" + ToDoID;
                subItem.Text = LocRM.GetString("Successor");
                createItem.Items.Add(subItem);
                #endregion

                topMenuItem.Items.Add(createItem);
                #endregion
            }
            #endregion

            #region Edit
            if (canUpdate)
            {
                #region Edit: ToDo, Categories
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("Edit");
                editItem.Look.RightIconUrl      = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth    = Unit.Pixel(15);
                editItem.Look.RightIconHeight   = Unit.Pixel(10);

                #region Edit ToDo
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task_edit.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "../ToDo/ToDoEdit.aspx?ToDoID=" + ToDoID;
                subItem.Text = LocRM.GetString("ToDo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonToDoAllowEditGeneralCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.ClientSideCommand   = "javascript:ShowWizard('../ToDo/EditCategories.aspx?ToDoID=" + ToDoID + "', 300, 250);";
                    subItem.Text = LocRM.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion

                topMenuItem.Items.Add(editItem);
                #endregion
            }
            #endregion

            #region Add Resources
            if (canUpdate && !isExternal)
            {
                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);
                cp  = new CommandParameters("MC_PM_ToDoResEdit");
                cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ModifyResources2(" + ToDoID + ")";
                subItem.Text = LocRM.GetString("AddResources");
                topMenuItem.Items.Add(subItem);
                if (!IsPostBack && Request["Assign"] == "1")
                {
                    ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(),
                                                       "function Assign(){" + cmd + "} setTimeout('Assign()', 400);", true);
                }
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task_delete.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:DeleteToDoModal2()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (canUpdate || canDelete)
            {
                subItem        = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Add Predecessors and Successors
            if (canUpdate)
            {
                #region Add Predecessors
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task_predecessors.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);

                cp  = new CommandParameters("MC_ToDo_AddPred");
                cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;

                subItem.Text = LocRM.GetString("AddPredecessors");
                topMenuItem.Items.Add(subItem);
                #endregion

                #region Add Successors
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task_sucessors.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);

                cp  = new CommandParameters("MC_ToDo_AddSucc");
                cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;

                subItem.Text = LocRM.GetString("AddSuccessors");
                topMenuItem.Items.Add(subItem);
                #endregion

/*				using (IDataReader rdr = ToDo.GetListVacantPredecessors(ToDoID))
 *                              {
 *                                      if (rdr.Read())
 *                                      {
 *                                              subItem = new ComponentArt.Web.UI.MenuItem();
 *                                              subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_predecessors.gif";
 *                                              subItem.Look.LeftIconWidth = Unit.Pixel(16);
 *                                              subItem.Look.LeftIconHeight = Unit.Pixel(16);
 *                                              cp = new CommandParameters("MC_PM_AddPredTodo");
 *                                              cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
 *                                              cmd = cmd.Replace("\"", "&quot;");
 *                                              subItem.ClientSideCommand = "javascript:" + cmd;
 *                                              subItem.Text = LocRM4.GetString("Add");
 *                                              topMenuItem.Items.Add(subItem);
 *                                      }
 *                              }
 *
 *                              using (IDataReader rdr = ToDo.GetListVacantSuccessors(ToDoID))
 *                              {
 *                                      if (rdr.Read())
 *                                      {
 *                                              subItem = new ComponentArt.Web.UI.MenuItem();
 *                                              subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/task_sucessors.gif";
 *                                              subItem.Look.LeftIconWidth = Unit.Pixel(16);
 *                                              subItem.Look.LeftIconHeight = Unit.Pixel(16);
 *                                              cp = new CommandParameters("MC_PM_AddSuccTodo");
 *                                              cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
 *                                              cmd = cmd.Replace("\"", "&quot;");
 *                                              subItem.ClientSideCommand = "javascript:" + cmd;
 *                                              subItem.Text = LocRM4.GetString("AddSuc");
 *                                              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);
            string commentaddlink = "../Common/CommentAdd.aspx?";
            if (isExternal)
            {
                commentaddlink = "../External/ExternalCommentAdd.aspx?";
            }
            subItem.ClientSideCommand = String.Format("javascript:OpenWindow('{0}ToDoID={1}',{2},false);",
                                                      commentaddlink, ToDoID, (Security.CurrentUser.IsExternal) ? "800,600" : "520,270");
            subItem.Text = LocRM.GetString("CreateComment");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking

            /*
             * if (Configuration.ProjectManagementEnabled)
             * {
             *      subItem = new ComponentArt.Web.UI.MenuItem();
             *      subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
             *      subItem.Look.LeftIconWidth = Unit.Pixel(16);
             *      subItem.Look.LeftIconHeight = Unit.Pixel(16);
             *      string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
             *      subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?ToDoID={1}', {2});",
             *        sPath, ToDoID, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
             *      subItem.Text = LocRM.GetString("AddTimeSheet");
             *      topMenuItem.Items.Add(subItem);
             * }
             */
            #endregion

            #region Update History
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", ToDoID, (int)ObjectTypes.ToDo);
                subItem.Text = LocRM3.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", ToDoID, (int)ObjectTypes.ToDo);
                subItem.Text = LocRM3.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!isExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", ToDoID, ((int)ObjectTypes.ToDo).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Reminder
            if (!isExternal)
            {
                Mediachase.IBN.Business.ToDo.ToDoSecurity sec = Mediachase.IBN.Business.ToDo.GetSecurity(ToDoID);
                if (sec.IsManager || sec.IsResource || sec.IsCreator)
                {
                    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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (int)ObjectTypes.ToDo, ToDoID);
                    subItem.Text = LocRM2.GetString("EditReminder");
                    topMenuItem.Items.Add(subItem);
                }
            }
            #endregion

            #region Favorites
            if (!Mediachase.IBN.Business.ToDo.CheckFavorites(ToDoID) && !isExternal)
            {
                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);
        }
Exemplo n.º 21
0
        private void BindMenu()
        {
            bool _CanUpdate            = Document.CanUpdate(DocumentId);
            bool _CanAddToDo_ModifyRes = Document.CanAddToDo(DocumentId);
            bool _CanDelete            = Document.CanDelete(DocumentId);
            bool _IsExternal           = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM.GetString("tActions");
            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 AddToDo
            if (_CanAddToDo_ModifyRes && !_IsExternal)
            {
                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?DocumentId=" + DocumentId;
                subItem.Text = LocRM.GetString("tbAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit
            if (_CanUpdate && !_IsExternal)
            {
                #region Edit: Document, Categories
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("tbViewEdit");
                editItem.Look.RightIconUrl      = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth    = Unit.Pixel(15);
                editItem.Look.RightIconHeight   = Unit.Pixel(10);

                #region Edit Document
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/document_edit.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "../Documents/DocumentEdit.aspx?DocumentId=" + DocumentId + "&Back=document";
                subItem.Text = LocRM.GetString("Document");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonDocumentAllowEditGeneralCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.ClientSideCommand   = "javascript:ShowWizard('../Documents/EditCategories.aspx?DocumentId=" + DocumentId + "', 300, 250);";
                    subItem.Text = LocRM.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion

                topMenuItem.Items.Add(editItem);
                #endregion
            }
            #endregion

            #region Add Resources
            if (_CanAddToDo_ModifyRes && !_IsExternal)
            {
                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);
                CommandManager    cm  = CommandManager.GetCurrent(this.Page);
                CommandParameters cp  = new CommandParameters("MC_DM_DocRes");
                string            cmd = cm.AddCommand("Document", "", "DocumentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ModifyResources2(" + DocumentId + ")";
                subItem.Text = LocRM.GetString("AddResources");
                topMenuItem.Items.Add(subItem);

                frManageResources.Attributes.Add("src", "ResourcesEditor.aspx?DocumentID=" + DocumentId + "&FrameId=" + frManageResources.ClientID);
                if (!IsPostBack)
                {
                    if (Request["Assign"] == "1")
                    {
                        ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(),
                                                           "function Assign(){" + cmd + "} setTimeout('Assign()', 400);", true);
                    }
//                        Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
//                                        @"OpenAssignWizard(" + DocumentId + @");
//					      function OpenAssignWizard(DocumentId)
//					      {
//						      var obj = document.getElementById('" + frManageResources.ClientID + @"');
//						      if(obj!=null)
//						      {
//							      obj.style.display = '';
//						      }
//					      }",
//                        true);
                }
            }
            #endregion

            #region Delete
            if (_CanDelete && !_IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/document_delete.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                string sUrl = "DeleteDocument2()";
                subItem.ClientSideCommand = sUrl;
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (_CanAddToDo_ModifyRes || _CanDelete || _CanUpdate)
            {
                subItem        = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                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);
            string commentaddlink = "../Common/CommentAdd.aspx?";
            if (_IsExternal)
            {
                commentaddlink = "../External/ExternalCommentAdd.aspx?";
            }
            subItem.ClientSideCommand = String.Format("javascript:OpenWindow('{0}DocumentId={1}',{2},false);",
                                                      commentaddlink, DocumentId, _IsExternal ? "800,600" : "520,270");
            subItem.Text = LocRM.GetString("tbAddCom");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking

            /*
             * if(Configuration.ProjectManagementEnabled)
             * {
             *      subItem = new ComponentArt.Web.UI.MenuItem();
             *      subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
             *      subItem.Look.LeftIconWidth = Unit.Pixel(16);
             *      subItem.Look.LeftIconHeight = Unit.Pixel(16);
             *      string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
             *      subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?DocumentId={1}', {2});",
             *              sPath, DocumentId, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
             *      subItem.Text = LocRM.GetString("tbAddTimeSheet");
             *      topMenuItem.Items.Add(subItem);
             * }*/
            #endregion

            #region UpdateHistory
            if (!_IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", DocumentId, (int)ObjectTypes.Document);
                subItem.Text = LocRM3.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!_IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", DocumentId, (int)ObjectTypes.Document);
                subItem.Text = LocRM3.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!_IsExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", DocumentId, ((int)ObjectTypes.Document).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Favorites
            if (!Document.CheckFavorites(DocumentId) && !_IsExternal)
            {
                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

            /*
             #region DocumentBack
             * if (!_IsExternal)
             * {
             *      subItem = new ComponentArt.Web.UI.MenuItem();
             *      subItem.Look.LeftIconUrl = "~/Layouts/Images/cancel.gif";
             *      subItem.Look.LeftIconWidth = Unit.Pixel(16);
             *      subItem.Look.LeftIconHeight = Unit.Pixel(16);
             *      subItem.NavigateUrl = "../Documents/default.aspx";
             *      subItem.Text = LocRM.GetString("tbDocumentBack");
             *      topMenuItem.Items.Add(subItem);
             * }
             #endregion
             */

            secHeader.ActionsMenu.Items.Add(topMenuItem);
        }
Exemplo n.º 22
0
        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      = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ 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 TTBlock

            /*
             * ComponentArt.Web.UI.MenuItem ttItem = new ComponentArt.Web.UI.MenuItem();
             *
             * ttItem.Text = CommonHelper.GetResFileString("{IbnFramework.Global:_mc_TimeManagement}");
             * ttItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
             * ttItem.Look.LeftIconHeight = Unit.Pixel(5);
             * ttItem.Look.LeftIconWidth = Unit.Pixel(16);
             * ttItem.LookId = "TopItemLook";
             *
             * //DV: 2007-10-19
             * subItem = new ComponentArt.Web.UI.MenuItem();
             * subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/timesheet.gif");
             * subItem.Look.LeftIconWidth = Unit.Pixel(16);
             * subItem.Look.LeftIconHeight = Unit.Pixel(16);
             * subItem.NavigateUrl = "~/IbnNext/TimeTracking/ListTimeTrackingPopupEdit.aspx?ViewName=TT_MyGroupByWeek&ProjectId=" + ProjectId;
             * subItem.Text = CommonHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_TT_MyGroupByWeek}");// +" new";
             * ttItem.Items.Add(subItem);
             *
             * subItem = new ComponentArt.Web.UI.MenuItem();
             * subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/timesheet.gif");
             * subItem.Look.LeftIconWidth = Unit.Pixel(16);
             * subItem.Look.LeftIconHeight = Unit.Pixel(16);
             * subItem.NavigateUrl = "~/IbnNext/TimeTracking/ListTimeTrackingNew.aspx?ViewName=TT_MyGroupByWeek&ProjectId=" + ProjectId;
             * subItem.Text = CommonHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_TT_MyGroupByWeek}") + " new";
             * ttItem.Items.Add(subItem);
             *
             * if (Security.IsUserInGroup(InternalSecureGroups.PowerProjectManager) ||
             *                      Security.IsUserInGroup(InternalSecureGroups.ProjectManager) ||
             *                      Security.IsUserInGroup(InternalSecureGroups.TimeManager))
             * {
             * //DV: 2007-10-19
             * subItem = new ComponentArt.Web.UI.MenuItem();
             * subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/timesheet.gif");
             * subItem.Look.LeftIconWidth = Unit.Pixel(16);
             * subItem.Look.LeftIconHeight = Unit.Pixel(16);
             * subItem.NavigateUrl = "~/IbnNext/TimeTracking/ListTimeTrackingPopupEdit.aspx?ViewName=TT_CurrentProjectGroupByWeekUser&ProjectId=" + ProjectId;
             * subItem.Text = subItem.Text = CommonHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_TT_CurrentProjectGroupByWeekUser}");// +" new";
             * ttItem.Items.Add(subItem);
             *
             * subItem = new ComponentArt.Web.UI.MenuItem();
             * subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/timesheet.gif");
             * subItem.Look.LeftIconWidth = Unit.Pixel(16);
             * subItem.Look.LeftIconHeight = Unit.Pixel(16);
             * subItem.NavigateUrl = "~/IbnNext/TimeTracking/ListTimeTrackingNew.aspx?ViewName=TT_CurrentProjectGroupByWeekUser&ProjectId=" + ProjectId;
             * subItem.Text = subItem.Text = CommonHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_TT_CurrentProjectGroupByWeekUser}") + " new";// +" new";
             * ttItem.Items.Add(subItem);
             * }
             *
             * secHeader.ActionsMenu.Items.Add(ttItem);
             */
            #endregion

            #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("\"", "&quot;");
                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("\"", "&quot;");
                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                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ 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";

            /*			createItem.Text = LocRM.GetString("Create");
             *                      createItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
             *                      createItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
             *                      createItem.Look.RightIconWidth = Unit.Pixel(15);
             *                      createItem.Look.RightIconHeight = Unit.Pixel(10);
             */

            #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                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ 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";

                /*				editItem.Text = LocRM.GetString("Edit");
                 *                              editItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                 *                              editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                 *                              editItem.Look.RightIconWidth = Unit.Pixel(15);
                 *                              editItem.Look.RightIconHeight = Unit.Pixel(10);
                 */

                #region Edit Project
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/project_edit.gif";
                //subItem.Look.LeftIconWidth = Unit.Pixel(16);
                //subItem.Look.LeftIconHeight = Unit.Pixel(16);
                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";
                //participantsItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                //participantsItem.Look.RightIconWidth = Unit.Pixel(15);
                //participantsItem.Look.RightIconHeight = Unit.Pixel(10);

                #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 = "javascript:ShowWizard('EditTargetTimeline.aspx?ProjectId=" + ProjectId + "', 400, 250);";
                subItem.Text = LocRM.GetString("EditTargetTimeline");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Actual Timileme
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditActualTimeline.aspx?ProjectId=" + ProjectId + "', 400, 250);";
                subItem.Text = LocRM.GetString("EditActualTimeline");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit State Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditStateInfo.aspx?ProjectId=" + ProjectId + "', 350, 265);";
                subItem.Text = LocRM.GetString("EditStateInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit General Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?ProjectId=" + ProjectId + "', 550, 450);";
                subItem.Text = LocRM.GetString("EditGeneralInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Configuration Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditConfigurationInfo.aspx?ProjectId=" + ProjectId + "', 380, 270);";
                subItem.Text = LocRM.GetString("EditConfigurationInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditCategories.aspx?ProjectId=" + ProjectId + "', 300, 450);";
                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 = "javascript:ShowWizard('EditSecurity.aspx?ProjectId=" + ProjectId + "', 650, 280);";
                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("\"", "&quot;");
                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("\"", "&quot;");
                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   = "javascript:OpenWindow('../Common/CommentAdd.aspx?ProjectId=" + ProjectId + "',520,270,false);";
            subItem.Text = LocRM.GetString("CreateComment");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking

            /*
             * subItem = new ComponentArt.Web.UI.MenuItem();
             * subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
             * subItem.Look.LeftIconWidth = Unit.Pixel(16);
             * subItem.Look.LeftIconHeight = Unit.Pixel(16);
             * subItem.NavigateUrl = "~/TimeTracking/AddTimesheet.aspx?ProjectId=" + ProjectId;
             * subItem.Text = LocRM.GetString("AddTimeSheet");
             * 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   = "javascript:ShowWizard2('../Reports/OverallProjectSnapshot.aspx?ProjectId=" + ProjectId + "', 750, 466, true);";
                subItem.Text = LocRM.GetString("Snapshot");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region SaveToHistory - deleted
            if (canViewFinances)
            {
                /*
                 * 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 = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnSaveSnapshot, "");
                 * subItem.Text = LocRM.GetString("tSaveSnapshot");
                 * topMenuItem.Items.Add(subItem);
                 */
            }
            #endregion

            #region CreateTemplate OLD From 4.1             //DV

            /*if (canUpdate)
             * {
             *      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 = "javascript:ShowWizard('EditProjectTemplate.aspx?ProjectId=" + ProjectId + "', 640, 480);";
             *      subItem.Text = LocRM.GetString("CreateTemplate");
             *      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   = "javascript:ShowWizard('EditProjectTemplate2.aspx?ProjectId=" + ProjectId + "', 640, 600);";
                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   = "javascript:ShowWizard('SaveBasePlanPopUp.aspx?ProjectId=" + ProjectId + "', 380, 100);";
                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);
                //StringBuilder sb = new StringBuilder();
                //sb.AppendFormat("javascript:{{if(confirm('{0}')) {1};}}",
                //    LocRM.GetString("ToMSProjSyncWarning"), Page.ClientScript.GetPostBackEventReference(btnToMSPrjSynch, ""));
                //subItem.ClientSideCommand = sb.ToString();
                subItem.ClientSideCommand = "OpenWindow('../Projects/ProjectExportImportNew.aspx?ToMSPrj=1&ProjectId=" + ProjectId.ToString() + "',600,400);";
                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   = "OpenWindow('../Projects/ProjectExportImportNew.aspx?ProjectId=" + ProjectId.ToString() + "',600,410);";
                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("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", 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("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", 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("../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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (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);
        }
Exemplo n.º 23
0
    /// <summary>
    /// 门户菜单集成
    /// </summary>
    private void PortalMenuIntegration()
    {
        #region 门户菜单集成

        string IRPMenuName = string.Empty;

        if (Request.QueryString["PortalMenuName"] != null)
        {
            IRPMenuName = Request.QueryString["PortalMenuName"].Trim();

            if (IRPMenuName.Equals("MainPageMenu", StringComparison.OrdinalIgnoreCase))//项目综合信息菜单
            {
                List <MenuCategory> listMenu = new List <MenuCategory>();
                MenuCategory        cate1    = new MenuCategory();
                cate1.MenuText = "综合信息";
                cate1.MenuURL  = Request.ApplicationPath + "/MainPage/IntegratedInfoMng.aspx" + GetPageQueryString().Replace("targetPageType=projectMap", "");

                MenuCategory cate2 = new MenuCategory();
                cate2.MenuText = "项目全景图";
                cate2.MenuURL  = Request.ApplicationPath + "/MainPage/IntegratedInfoMng.aspx?targetPageType=projectMap" + GetPageQueryString().Replace("?", "&");

                MenuCategory cate3 = new MenuCategory();
                cate3.MenuText = "项目预警查询";
                cate3.MenuURL  = Request.ApplicationPath + "/MainPage/ProjectWarnQuery.aspx" + GetPageQueryString().Replace("targetPageType=projectMap", "");

                //测试
                MenuCategory cate4 = new MenuCategory();
                cate4.MenuText = "付款单信息";
                cate4.MenuURL  = Request.ApplicationPath + "/PaymentOrder/PaymentOrderMaster.aspx";

                MenuCategory cate5 = new MenuCategory();
                cate5.MenuText = "公司树信息";
                cate5.MenuURL  = Request.ApplicationPath + "/CompanyMng/CompanyMng.aspx";
                listMenu.Add(cate1);
                listMenu.Add(cate2);
                listMenu.Add(cate3);
                //测试
                listMenu.Add(cate4);
                listMenu.Add(cate5);
                foreach (MenuCategory menu in listMenu)
                {
                    ComponentArt.Web.UI.MenuItem item = new ComponentArt.Web.UI.MenuItem();
                    item.Text    = menu.MenuText;
                    item.ToolTip = menu.MenuText;
                    item.LookId  = "TopItemLook";
                    ubsMenu1.Items.Add(item);

                    string webAction = menu.MenuURL;
                    if (!String.IsNullOrEmpty(webAction))
                    {
                        item.NavigateUrl = webAction;
                    }

                    if (menu.ChildMenus.Count > 0)
                    {
                        LoadChildMenus(item, menu);
                    }

                    ////add a spacer item
                    //ComponentArt.Web.UI.MenuItem itemS = new ComponentArt.Web.UI.MenuItem();
                    //itemS.LookId = "SpacerItemLook";
                    //itemS.Width = Unit.Pixel(1500);
                    //ubsMenu1.Items.Add(itemS);
                }
            }
        }

        if (ubsMenu1.Visible && ubsMenu1.Items.Count == 0)
        {
            ubsMenu1.Visible = false;
        }

        #endregion
    }
Exemplo n.º 24
0
        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 = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */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 TTBlock
            /*
            ComponentArt.Web.UI.MenuItem ttItem = new ComponentArt.Web.UI.MenuItem();

            ttItem.Text = CommonHelper.GetResFileString("{IbnFramework.Global:_mc_TimeManagement}");
            ttItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
            ttItem.Look.LeftIconHeight = Unit.Pixel(5);
            ttItem.Look.LeftIconWidth = Unit.Pixel(16);
            ttItem.LookId = "TopItemLook";

            //DV: 2007-10-19
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/timesheet.gif");
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl = "~/IbnNext/TimeTracking/ListTimeTrackingPopupEdit.aspx?ViewName=TT_MyGroupByWeek&ProjectId=" + ProjectId;
            subItem.Text = CommonHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_TT_MyGroupByWeek}");// +" new";
            ttItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/timesheet.gif");
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl = "~/IbnNext/TimeTracking/ListTimeTrackingNew.aspx?ViewName=TT_MyGroupByWeek&ProjectId=" + ProjectId;
            subItem.Text = CommonHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_TT_MyGroupByWeek}") + " new";
            ttItem.Items.Add(subItem);

            if (Security.IsUserInGroup(InternalSecureGroups.PowerProjectManager) ||
                        Security.IsUserInGroup(InternalSecureGroups.ProjectManager) ||
                        Security.IsUserInGroup(InternalSecureGroups.TimeManager))
            {
                //DV: 2007-10-19
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/timesheet.gif");
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "~/IbnNext/TimeTracking/ListTimeTrackingPopupEdit.aspx?ViewName=TT_CurrentProjectGroupByWeekUser&ProjectId=" + ProjectId;
                subItem.Text = subItem.Text = CommonHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_TT_CurrentProjectGroupByWeekUser}");// +" new";
                ttItem.Items.Add(subItem);

                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/timesheet.gif");
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "~/IbnNext/TimeTracking/ListTimeTrackingNew.aspx?ViewName=TT_CurrentProjectGroupByWeekUser&ProjectId=" + ProjectId;
                subItem.Text = subItem.Text = CommonHelper.GetResFileString("{IbnFramework.TimeTracking:_mc_TT_CurrentProjectGroupByWeekUser}") + " new";// +" new";
                ttItem.Items.Add(subItem);
            }

            secHeader.ActionsMenu.Items.Add(ttItem);
             */
            #endregion

            #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("\"", "&quot;");
                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("\"", "&quot;");
                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 = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */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";
            /*			createItem.Text = LocRM.GetString("Create");
                        createItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                        createItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                        createItem.Look.RightIconWidth = Unit.Pixel(15);
                        createItem.Look.RightIconHeight = Unit.Pixel(10);
            */

            #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 = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */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";
                /*				editItem.Text = LocRM.GetString("Edit");
                                editItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                                editItem.Look.RightIconWidth = Unit.Pixel(15);
                                editItem.Look.RightIconHeight = Unit.Pixel(10);
                */

                #region Edit Project
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/project_edit.gif";
                //subItem.Look.LeftIconWidth = Unit.Pixel(16);
                //subItem.Look.LeftIconHeight = Unit.Pixel(16);
                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";
                //participantsItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                //participantsItem.Look.RightIconWidth = Unit.Pixel(15);
                //participantsItem.Look.RightIconHeight = Unit.Pixel(10);

                #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 = "javascript:ShowWizard('EditTargetTimeline.aspx?ProjectId=" + ProjectId + "', 400, 250);";
                subItem.Text = LocRM.GetString("EditTargetTimeline");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Actual Timileme
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditActualTimeline.aspx?ProjectId=" + ProjectId + "', 400, 250);";
                subItem.Text = LocRM.GetString("EditActualTimeline");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit State Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditStateInfo.aspx?ProjectId=" + ProjectId + "', 350, 265);";
                subItem.Text = LocRM.GetString("EditStateInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit General Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?ProjectId=" + ProjectId + "', 550, 450);";
                subItem.Text = LocRM.GetString("EditGeneralInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Configuration Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditConfigurationInfo.aspx?ProjectId=" + ProjectId + "', 380, 270);";
                subItem.Text = LocRM.GetString("EditConfigurationInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditCategories.aspx?ProjectId=" + ProjectId + "', 300, 450);";
                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 = "javascript:ShowWizard('EditSecurity.aspx?ProjectId=" + ProjectId + "', 650, 280);";
                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("\"", "&quot;");
                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("\"", "&quot;");
                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 = "javascript:OpenWindow('../Common/CommentAdd.aspx?ProjectId=" + ProjectId + "',520,270,false);";
            subItem.Text = LocRM.GetString("CreateComment");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking
            /*
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl = "~/TimeTracking/AddTimesheet.aspx?ProjectId=" + ProjectId;
            subItem.Text = LocRM.GetString("AddTimeSheet");
            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 = "javascript:ShowWizard2('../Reports/OverallProjectSnapshot.aspx?ProjectId=" + ProjectId + "', 750, 466, true);";
                subItem.Text = LocRM.GetString("Snapshot");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region SaveToHistory - deleted
            if (canViewFinances)
            {
                /*
                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 = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnSaveSnapshot, "");
                subItem.Text = LocRM.GetString("tSaveSnapshot");
                topMenuItem.Items.Add(subItem);
                */
            }
            #endregion

            #region CreateTemplate OLD From 4.1 //DV
            /*if (canUpdate)
            {
                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 = "javascript:ShowWizard('EditProjectTemplate.aspx?ProjectId=" + ProjectId + "', 640, 480);";
                subItem.Text = LocRM.GetString("CreateTemplate");
                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 = "javascript:ShowWizard('EditProjectTemplate2.aspx?ProjectId=" + ProjectId + "', 640, 600);";
                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 = "javascript:ShowWizard('SaveBasePlanPopUp.aspx?ProjectId=" + ProjectId + "', 380, 100);";
                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);
                //StringBuilder sb = new StringBuilder();
                //sb.AppendFormat("javascript:{{if(confirm('{0}')) {1};}}",
                //    LocRM.GetString("ToMSProjSyncWarning"), Page.ClientScript.GetPostBackEventReference(btnToMSPrjSynch, ""));
                //subItem.ClientSideCommand = sb.ToString();
                subItem.ClientSideCommand = "OpenWindow('../Projects/ProjectExportImportNew.aspx?ToMSPrj=1&ProjectId=" + ProjectId.ToString() + "',600,400);";
                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 = "OpenWindow('../Projects/ProjectExportImportNew.aspx?ProjectId=" + ProjectId.ToString() + "',600,410);";
                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("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", 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("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", 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("../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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (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);
        }
Exemplo n.º 25
0
        private void BindValues()
        {
            int DocumentID = -1;

            using (IDataReader reader = ToDo.GetToDo(ToDoID))
            {
                if (reader.Read())
                {
                    if (reader["DocumentID"] != DBNull.Value)
                    {
                        DocumentID = (int)reader["DocumentID"];
                    }
                }
            }

            if (DocumentID < 0)
            {
                this.Visible = false;
                return;
            }

            using (IDataReader reader = Document.GetDocument(DocumentID))
            {
                if (reader.Read())
                {
                    ///  DocumentId, ProjectId, ProjectTitle, CreatorId, ManagerId,
                    ///  Title, Description, CreationDate, PriorityId, PriorityName,
                    ///  StatusId, StatusName, StateId

                    bool IsExternal = Security.CurrentUser.IsExternal;
                    if (!IsExternal)
                    {
                        lblTitle.Text = "<a href='../Documents/DocumentView.aspx?DocumentID=" + ((int)reader["DocumentID"]).ToString() + "'>" + reader["Title"].ToString() + "</a>";
                    }
                    else
                    {
                        lblTitle.Text = reader["Title"].ToString();
                    }

                    //					lblState.ForeColor = Util.CommonHelper.GetStateColor((int)reader["StateId"]);
                    lblState.Text = reader["StateName"].ToString();
                    if ((int)reader["StateId"] == (int)ObjectStates.Active || (int)reader["StateId"] == (int)ObjectStates.Overdue)
                    {
                        lblState.Text += String.Format(" ({0})", reader["StatusName"].ToString());
                    }

                    lblPriority.Text = reader["PriorityName"].ToString();
                    //					lblPriority.ForeColor = Util.CommonHelper.GetPriorityColor((int)reader["PriorityId"]);
                    lblPriority.Visible = PortalConfig.CommonDocumentAllowViewPriorityField;

                    if (reader["Description"] != DBNull.Value)
                    {
                        string txt = CommonHelper.parsetext(reader["Description"].ToString(), false);
                        if (PortalConfig.ShortInfoDescriptionLength > 0 && txt.Length > PortalConfig.ShortInfoDescriptionLength)
                        {
                            txt = txt.Substring(0, PortalConfig.ShortInfoDescriptionLength) + "...";
                        }
                        lblDescription.Text = txt;
                    }
                }
            }

            string           ContainerKey  = "DocumentVers_" + DocumentID.ToString();
            string           ContainerName = "FileLibrary";
            BaseIbnContainer bic           = BaseIbnContainer.Create(ContainerName, ContainerKey);

            Mediachase.IBN.Business.ControlSystem.FileStorage fs = (Mediachase.IBN.Business.ControlSystem.FileStorage)bic.LoadControl("FileStorage");
            FileInfo[] _fi           = fs.GetFiles(fs.Root.Id);
            FileInfo   LatestVersion = null;

            foreach (FileInfo fi in _fi)
            {
                if (LatestVersion == null || LatestVersion.Created < fi.Created)
                {
                    LatestVersion = fi;
                }
            }

            if (LatestVersion == null)
            {
                lblLatestVersion.Text = LocRM.GetString("None");
            }
            else
            {
                string Icon = String.Format("<img src='{0}' width='16' height='16' align='absmiddle' border='0'>", ResolveUrl("~/Common/ContentIcon.aspx?IconID=" + LatestVersion.FileBinaryContentTypeId));
                //string Link = String.Format("{0}?Id={1}&CName={2}&CKey={3}", ResolveUrl("~/FileStorage/DownloadFile.aspx"), LatestVersion.Id, ContainerName, ContainerKey);
                string Link        = Util.CommonHelper.GetAbsoluteDownloadFilePath(LatestVersion.Id, LatestVersion.Name, ContainerName, ContainerKey);
                string sNameLocked = CommonHelper.GetLockerText(Link);

                lblLatestVersion.Text = String.Format("<a href=\"{0}\">{1} {2}</a> (#{3}) {4}",
                                                      Link, Icon,
                                                      LatestVersion.Name, _fi.Length,
                                                      sNameLocked);
            }


            // Toolbar
            tbView.AddText(LocRM.GetString("tbDocView"));

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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;

            if (!Security.CurrentUser.IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icon-search.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = String.Format("~/Documents/DocumentView.aspx?DocumentID={0}", DocumentID);
                subItem.Text = LocRM.GetString("View");
                topMenuItem.Items.Add(subItem);
            }

            if (Document.CanAddVersion(DocumentID))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/FileTypes/common.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                string commandLink = (Security.CurrentUser.IsExternal) ? "~/External/FileUpload.aspx" : "~/FileStorage/FileUpload.aspx";
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?ParentFolderId={1}&ContainerKey={2}&ContainerName={3}{4}', 470, 270);",
                                                          ResolveUrl(commandLink), fs.Root.Id, ContainerKey, ContainerName,
                                                          (Security.CurrentUser.IsExternal) ? ("&ExternalId=" + Security.CurrentUser.UserID) : "");
                subItem.Text = LocRM3.GetString("tAddVersion");
                topMenuItem.Items.Add(subItem);
            }

            if (topMenuItem.Items.Count > 0)
            {
                tbView.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Exemplo n.º 26
0
        private void BindMenu()
        {
            bool _CanUpdate = Document.CanUpdate(DocumentId);
            bool _CanAddToDo_ModifyRes = Document.CanAddToDo(DocumentId);
            bool _CanDelete = Document.CanDelete(DocumentId);
            bool _IsExternal = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM.GetString("tActions");
            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 AddToDo
            if (_CanAddToDo_ModifyRes && !_IsExternal)
            {
                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?DocumentId=" + DocumentId;
                subItem.Text = LocRM.GetString("tbAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit
            if (_CanUpdate && !_IsExternal)
            {
                #region Edit: Document, Categories
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("tbViewEdit");
                editItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth = Unit.Pixel(15);
                editItem.Look.RightIconHeight = Unit.Pixel(10);

                #region Edit Document
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/document_edit.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "../Documents/DocumentEdit.aspx?DocumentId=" + DocumentId + "&Back=document";
                subItem.Text = LocRM.GetString("Document");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonDocumentAllowEditGeneralCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.ClientSideCommand = "javascript:ShowWizard('../Documents/EditCategories.aspx?DocumentId=" + DocumentId + "', 300, 250);";
                    subItem.Text = LocRM.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion

                topMenuItem.Items.Add(editItem);
                #endregion
            }
            #endregion

            #region Add Resources
            if (_CanAddToDo_ModifyRes && !_IsExternal)
            {
                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);
                CommandManager cm = CommandManager.GetCurrent(this.Page);
                CommandParameters cp = new CommandParameters("MC_DM_DocRes");
                string cmd = cm.AddCommand("Document", "", "DocumentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ModifyResources2(" + DocumentId + ")";
                subItem.Text = LocRM.GetString("AddResources");
                topMenuItem.Items.Add(subItem);

                frManageResources.Attributes.Add("src", "ResourcesEditor.aspx?DocumentID=" + DocumentId + "&FrameId=" + frManageResources.ClientID);
                if (!IsPostBack)
                {
                    if (Request["Assign"] == "1")
                        ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(),
                     "function Assign(){" + cmd + "} setTimeout('Assign()', 400);", true);
            //                        Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
            //                                        @"OpenAssignWizard(" + DocumentId + @");
            //					      function OpenAssignWizard(DocumentId)
            //					      {
            //						      var obj = document.getElementById('" + frManageResources.ClientID + @"');
            //						      if(obj!=null)
            //						      {
            //							      obj.style.display = '';
            //						      }
            //					      }",
            //                        true);
                }
            }
            #endregion

            #region Delete
            if (_CanDelete && !_IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/document_delete.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                string sUrl = "DeleteDocument2()";
                subItem.ClientSideCommand = sUrl;
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (_CanAddToDo_ModifyRes || _CanDelete || _CanUpdate)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                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);
            string commentaddlink = "../Common/CommentAdd.aspx?";
            if (_IsExternal)
                commentaddlink = "../External/ExternalCommentAdd.aspx?";
            subItem.ClientSideCommand = String.Format("javascript:OpenWindow('{0}DocumentId={1}',{2},false);",
            commentaddlink, DocumentId, _IsExternal ? "800,600" : "520,270");
            subItem.Text = LocRM.GetString("tbAddCom");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking
            /*
            if(Configuration.ProjectManagementEnabled)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?DocumentId={1}', {2});",
                    sPath, DocumentId, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
                subItem.Text = LocRM.GetString("tbAddTimeSheet");
                topMenuItem.Items.Add(subItem);
            }*/
            #endregion

            #region UpdateHistory
            if (!_IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", DocumentId, (int)ObjectTypes.Document);
                subItem.Text = LocRM3.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!_IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", DocumentId, (int)ObjectTypes.Document);
                subItem.Text = LocRM3.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!_IsExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", DocumentId, ((int)ObjectTypes.Document).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Favorites
            if (!Document.CheckFavorites(DocumentId) && !_IsExternal)
            {
                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

            /*
            #region DocumentBack
            if (!_IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/cancel.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "../Documents/default.aspx";
                subItem.Text = LocRM.GetString("tbDocumentBack");
                topMenuItem.Items.Add(subItem);
            }
            #endregion
            */

            secHeader.ActionsMenu.Items.Add(topMenuItem);
        }
Exemplo n.º 27
0
        private void BindToolbar()
        {
            if (Top > 0 && this.Parent is Mediachase.UI.Web.Common.Modules.LatestFiles)
            {
                ((IToolbarLight)this.Parent).GetToolBar().AddRightLink(
                    String.Format("<img src='{0}' border='0' width='16' height='16' align='absmiddle' />&nbsp;{1}",
                    ResolveUrl("~/Layouts/Images/icon-search.gif"), LocRM.GetString("tViewAll")), GetCurrentLink() + "&Tab=FileLibrary");
                return;
            }

            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_List_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("tFilesList"));
            }
        }
Exemplo n.º 28
0
        private void BindToolbar()
        {
            secHeader.AddText(LocRM.GetString("ForumMessages"));
            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM.GetString("tSettings");
            topMenuItem.Look.LeftIconUrl    = ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth  = Unit.Pixel(16);
            topMenuItem.LookId              = "TopItemLook";

            #region Sort By Date
            ComponentArt.Web.UI.MenuItem subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbSort, "date");
            subItem.Text = LocRM.GetString("tSort");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region --- Seperator ---
            subItem        = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "BreakItem";
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Questions on Top
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_Quests458"] == "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(lbSort, "quests");
            subItem.Text = LocRM.GetString("tQuests");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Resolutions on Top
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_Resol458"] == "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(lbSort, "resol");
            subItem.Text = LocRM.GetString("tResolutions");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Workarounds on Top
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_Work458"] == "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(lbSort, "work");
            subItem.Text = LocRM.GetString("tWorkarounds");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region --- Seperator ---
            subItem        = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "BreakItem";
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Show info messages
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_Info"] == "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(lbSort, "info");
            subItem.Text = LocRM.GetString("tShowInfo");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Show Numbers
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_ShowNums"] == "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(lbSort, "nums");
            subItem.Text = LocRM.GetString("tShowNums");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Full Message
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_FullMess"] == "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(lbSort, "full");
            subItem.Text = LocRM.GetString("ShowFullMessage");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region --- Seperator ---
            subItem        = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "BreakItem";
            topMenuItem.Items.Add(subItem);
            #endregion

            subItem      = new ComponentArt.Web.UI.MenuItem();
            subItem.Text = LocRM.GetString("tMenuReply");
            subItem.Look.RightIconUrl      = "../Layouts/Images/arrow_right.gif";
            subItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
            subItem.Look.RightIconWidth    = Unit.Pixel(15);
            subItem.Look.RightIconHeight   = Unit.Pixel(10);
            topMenuItem.Items.Add(subItem);

            #region Outlook Reply
            ComponentArt.Web.UI.MenuItem sub2Item = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_ReplyOutlook"] == "1")
            {
                sub2Item.Look.LeftIconUrl    = "~/Layouts/Images/accept_1.gif";
                sub2Item.Look.LeftIconWidth  = Unit.Pixel(16);
                sub2Item.Look.LeftIconHeight = Unit.Pixel(16);
            }
            else
            {
                sub2Item.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbSort, "reply");
            }
            sub2Item.Text = LocRM.GetString("tOutlookReply");
            subItem.Items.Add(sub2Item);
            #endregion

            #region EML Reply
            sub2Item = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_ReplyEML"] == "1")
            {
                sub2Item.Look.LeftIconUrl    = "~/Layouts/Images/accept_1.gif";
                sub2Item.Look.LeftIconWidth  = Unit.Pixel(16);
                sub2Item.Look.LeftIconHeight = Unit.Pixel(16);
            }
            else
            {
                sub2Item.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbSort, "replyEML");
            }
            sub2Item.Text = LocRM.GetString("tEMLReply");
            subItem.Items.Add(sub2Item);
            #endregion

            #region Web Reply
            sub2Item = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_ReplyEML"] == "0" && pc["IncForum_ReplyOutlook"] == "0")
            {
                sub2Item.Look.LeftIconUrl    = "~/Layouts/Images/accept_1.gif";
                sub2Item.Look.LeftIconWidth  = Unit.Pixel(16);
                sub2Item.Look.LeftIconHeight = Unit.Pixel(16);
            }
            else
            {
                sub2Item.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbSort, "replyWeb");
            }
            sub2Item.Text = LocRM.GetString("tWebReply");
            subItem.Items.Add(sub2Item);
            #endregion

            secHeader.ActionsMenu.Items.Add(topMenuItem);
        }
Exemplo n.º 29
0
        private void BindToolbar()
        {
            secHeader.AddText(LocRM.GetString("tRelProjects"));

            if (Project.CanUpdate(ProjectId))
            {
                ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
                topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM2.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;

                CommandManager cm = CommandManager.GetCurrent(this.Page);
                CommandParameters cp = new CommandParameters();
                string cmd = String.Empty;

                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);
                cp = new CommandParameters("MC_PM_RelatedPrjClipboard");
                cmd = cm.AddCommand("Project", "", "ProjectView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM2.GetString("tPastePrjFromClipboard");
                topMenuItem.Items.Add(subItem);

                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);
                cp = new CommandParameters("MC_PM_RelatedPrj");
                cmd = cm.AddCommand("Project", "", "ProjectView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM2.GetString("AddRelated");
                topMenuItem.Items.Add(subItem);

                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Exemplo n.º 30
0
        private void BindToolbar()
        {
            string sharedreq = "";
            if (SharedID > 0)
                sharedreq = "&SharedId=" + SharedID;

            secHeader.Title = LocRM.GetString("tTitle");

            bool canUpdate = CalendarEntry.CanUpdate(EventId);
            bool canDelete = CalendarEntry.CanDelete(EventId);
            bool isExternal = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM2.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 Edit: Event
            if (canUpdate && !isExternal)
            {
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("Edit");
                editItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth = Unit.Pixel(15);
                editItem.Look.RightIconHeight = Unit.Pixel(10);

                #region Edit Event
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/event_edit.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "../Events/EventEdit.aspx?EventId=" + EventId + sharedreq;
                subItem.Text = LocRM.GetString("EditEvent");
                editItem.Items.Add(subItem);
                #endregion

                #region Reccurence
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/recurrence.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "../Events/RecEditor.aspx?EventId=" + EventId + sharedreq;
                subItem.Text = LocRM4.GetString("Recurrence");
                editItem.Items.Add(subItem);
                #endregion
                /*
                #region Edit General Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?IncidentId=" + IncidentId + "', 500, 400);";
                subItem.Text = LocRM2.GetString("EditGeneralInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditCategories.aspx?IncidentId=" + IncidentId + "', 300, 350);";
                subItem.Text = LocRM2.GetString("EditCategories");
                editItem.Items.Add(subItem);
                #endregion
            */
                topMenuItem.Items.Add(editItem);
            }
            #endregion

            #region Modyfy Resources
            if (canUpdate && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                CommandManager cm = CommandManager.GetCurrent(this.Page);
                CommandParameters cp = new CommandParameters("MC_PM_EventParticipants");
                string cmd = cm.AddCommand("Event", "", "EventView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('ParticipantsEditor.aspx?EventId=" + EventId + "', 650, 350);";
                subItem.Text = LocRM.GetString("EventParticipants");
                topMenuItem.Items.Add(subItem);

                if (!IsPostBack && Request["Assign"] == "1")
                {
                    ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(),
                     "function Assign(){" + cmd + "} setTimeout('Assign()', 400);", true);
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "<script language='javascript'>ShowWizard('ParticipantsEditor.aspx?EventId=" + EventId + "', 650, 350);</script>");
                }
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/event_delete.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand = "javascript:DeleteEvent()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (canUpdate || canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                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);
            string commentaddlink = "../Common/CommentAdd.aspx?";
            if (Security.CurrentUser.IsExternal)
                commentaddlink = "../External/ExternalCommentAdd.aspx?";
            subItem.ClientSideCommand = String.Format("javascript:OpenWindow('{0}EventId={1}',{2},false);",
              commentaddlink, EventId, (Security.CurrentUser.IsExternal) ? "800,600" : "520,270");
            subItem.Text = LocRM2.GetString("CreateComment");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking
            /*
            if(Configuration.ProjectManagementEnabled)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?EventId={1}', {2});",
                    sPath, EventId, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
                subItem.Text = LocRM2.GetString("AddTimeSheet");
                topMenuItem.Items.Add(subItem);
            }
             */
            #endregion

            #region UpdateHistory
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", EventId, (int)ObjectTypes.CalendarEntry);
                subItem.Text = LocRM5.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", EventId, (int)ObjectTypes.CalendarEntry);
                subItem.Text = LocRM5.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!isExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", EventId, ((int)ObjectTypes.CalendarEntry).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Reminder
            if (!isExternal)
            {
                CalendarEntry.EventSecurity sec = CalendarEntry.GetSecurity(EventId);
                if (sec.IsManager || sec.IsResource)
                {
                    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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (int)ObjectTypes.CalendarEntry, EventId);
                    subItem.Text = LocRM2.GetString("EditReminder");
                    topMenuItem.Items.Add(subItem);
                }
            }
            #endregion

            #region Favorites
            if (!CalendarEntry.CheckFavorites(EventId) && !isExternal)
            {
                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);
        }
Exemplo n.º 31
0
        private void BindToolbar()
        {
            if (Top > 0 && this.Parent is Mediachase.UI.Web.Common.Modules.LatestFiles)
            {
                ((IToolbarLight)this.Parent).GetToolBar().AddRightLink(
                    String.Format("<img src='{0}' border='0' width='16' height='16' align='absmiddle' />&nbsp;{1}",
                                  ResolveUrl("~/Layouts/Images/icon-search.gif"), LocRM.GetString("tViewAll")), GetCurrentLink() + "&Tab=FileLibrary");
                return;
            }

            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_List_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("tFilesList"));
                }
            }
        }
Exemplo n.º 32
0
        private void BindValues()
        {
            int DocumentID = -1;
            using (IDataReader reader = ToDo.GetToDo(ToDoID))
            {
                if (reader.Read())
                {
                    if (reader["DocumentID"] != DBNull.Value)
                        DocumentID = (int)reader["DocumentID"];
                }
            }

            if (DocumentID < 0)
            {
                this.Visible = false;
                return;
            }

            using (IDataReader reader = Document.GetDocument(DocumentID))
            {
                if (reader.Read())
                {
                    ///  DocumentId, ProjectId, ProjectTitle, CreatorId, ManagerId,
                    ///  Title, Description, CreationDate, PriorityId, PriorityName,
                    ///  StatusId, StatusName, StateId

                    bool IsExternal = Security.CurrentUser.IsExternal;
                    if (!IsExternal)
                        lblTitle.Text = "<a href='../Documents/DocumentView.aspx?DocumentID=" + ((int)reader["DocumentID"]).ToString() + "'>" + reader["Title"].ToString() + "</a>";
                    else
                        lblTitle.Text = reader["Title"].ToString();

                    //					lblState.ForeColor = Util.CommonHelper.GetStateColor((int)reader["StateId"]);
                    lblState.Text = reader["StateName"].ToString();
                    if ((int)reader["StateId"] == (int)ObjectStates.Active || (int)reader["StateId"] == (int)ObjectStates.Overdue)
                        lblState.Text += String.Format(" ({0})", reader["StatusName"].ToString());

                    lblPriority.Text = reader["PriorityName"].ToString();
                    //					lblPriority.ForeColor = Util.CommonHelper.GetPriorityColor((int)reader["PriorityId"]);
                    lblPriority.Visible = PortalConfig.CommonDocumentAllowViewPriorityField;

                    if (reader["Description"] != DBNull.Value)
                    {
                        string txt = CommonHelper.parsetext(reader["Description"].ToString(), false);
                        if (PortalConfig.ShortInfoDescriptionLength > 0 && txt.Length > PortalConfig.ShortInfoDescriptionLength)
                            txt = txt.Substring(0, PortalConfig.ShortInfoDescriptionLength) + "...";
                        lblDescription.Text = txt;
                    }
                }
            }

            string ContainerKey = "DocumentVers_" + DocumentID.ToString();
            string ContainerName = "FileLibrary";
            BaseIbnContainer bic = BaseIbnContainer.Create(ContainerName, ContainerKey);
            Mediachase.IBN.Business.ControlSystem.FileStorage fs = (Mediachase.IBN.Business.ControlSystem.FileStorage)bic.LoadControl("FileStorage");
            FileInfo[] _fi = fs.GetFiles(fs.Root.Id);
            FileInfo LatestVersion = null;
            foreach (FileInfo fi in _fi)
            {
                if (LatestVersion == null || LatestVersion.Created < fi.Created)
                    LatestVersion = fi;
            }

            if (LatestVersion == null)
                lblLatestVersion.Text = LocRM.GetString("None");
            else
            {
                string Icon = String.Format("<img src='{0}' width='16' height='16' align='absmiddle' border='0'>", ResolveUrl("~/Common/ContentIcon.aspx?IconID=" + LatestVersion.FileBinaryContentTypeId));
                //string Link = String.Format("{0}?Id={1}&CName={2}&CKey={3}", ResolveUrl("~/FileStorage/DownloadFile.aspx"), LatestVersion.Id, ContainerName, ContainerKey);
                string Link = Util.CommonHelper.GetAbsoluteDownloadFilePath(LatestVersion.Id, LatestVersion.Name, ContainerName, ContainerKey);
                string sNameLocked = CommonHelper.GetLockerText(Link);

                lblLatestVersion.Text = String.Format("<a href=\"{0}\">{1} {2}</a> (#{3}) {4}",
                    Link, Icon,
                    LatestVersion.Name, _fi.Length,
                    sNameLocked);
            }

            // Toolbar
            tbView.AddText(LocRM.GetString("tbDocView"));

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM2.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;

            if (!Security.CurrentUser.IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icon-search.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = String.Format("~/Documents/DocumentView.aspx?DocumentID={0}", DocumentID);
                subItem.Text = LocRM.GetString("View");
                topMenuItem.Items.Add(subItem);
            }

            if (Document.CanAddVersion(DocumentID))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/FileTypes/common.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                string commandLink = (Security.CurrentUser.IsExternal) ? "~/External/FileUpload.aspx" : "~/FileStorage/FileUpload.aspx";
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?ParentFolderId={1}&ContainerKey={2}&ContainerName={3}{4}', 470, 270);",
                  ResolveUrl(commandLink), fs.Root.Id, ContainerKey, ContainerName,
                  (Security.CurrentUser.IsExternal) ? ("&ExternalId=" + Security.CurrentUser.UserID) : "");
                subItem.Text = LocRM3.GetString("tAddVersion");
                topMenuItem.Items.Add(subItem);
            }

            if (topMenuItem.Items.Count > 0)
                tbView.ActionsMenu.Items.Add(topMenuItem);
        }
Exemplo n.º 33
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tTitle");

            bool canUpdateConfigurationInfo = Task.CanUpdateConfigurationInfo(TaskId);
            bool canUpdate          = Task.CanUpdate(TaskId);
            bool canAddTodo         = Task.CanAddToDo(TaskId);
            bool canDelete          = Task.CanDelete(TaskId);
            bool canModifyResources = Task.CanModifyResources(TaskId);

            canViewFinances = Task.CanViewFinances(TaskId);

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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;

            CommandManager    cm  = CommandManager.GetCurrent(this.Page);
            CommandParameters cp  = new CommandParameters();
            string            cmd = String.Empty;

            #region Add ToDo
            if (canAddTodo && !Security.CurrentUser.IsExternal)
            {
                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?TaskId=" + TaskId;
                subItem.Text = LocRM.GetString("tbAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit
            if (canUpdate && !Security.CurrentUser.IsExternal)
            {
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("Edit");
                editItem.Look.RightIconUrl      = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth    = Unit.Pixel(15);
                editItem.Look.RightIconHeight   = Unit.Pixel(10);

                #region Edit Task
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task1_edit.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "../Tasks/TaskEdit.aspx?TaskId=" + TaskId;
                subItem.Text = LocRM.GetString("EditTask");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonTaskAllowViewGeneralCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = "javascript:ShowWizard('../Tasks/EditCategories.aspx?TaskId=" + TaskId + "', 300, 250);";
                    subItem.Text = LocRM2.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion

                /*
                 #region Edit General Info
                 *                              subItem = new ComponentArt.Web.UI.MenuItem();
                 *                              subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?IncidentId=" + IncidentId + "', 500, 400);";
                 *                              subItem.Text = LocRM2.GetString("EditGeneralInfo");
                 *                              editItem.Items.Add(subItem);
                 #endregion
                 */
                topMenuItem.Items.Add(editItem);
            }
            #endregion

            #region Modyfy Resources
            if (canModifyResources && !Security.CurrentUser.IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp  = new CommandParameters("MC_PM_TaskResEdit");
                cmd = cm.AddCommand("Task", "", "TaskView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('AddResources.aspx?TaskId=" + TaskId + "', 650, 350);";
                subItem.Text = LocRM.GetString("AssignWizard");
                topMenuItem.Items.Add(subItem);

                if (!IsPostBack && Request["Assign"] == "1")
                {
                    ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(),
                                                       "function Assign(){" + cmd + "} setTimeout('Assign()', 400);", true);
                }
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task1_delete.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:DeleteTask()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            subItem        = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "BreakItem";
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Add Predecessors
            if (canUpdateConfigurationInfo && !isMSProject)
            {
                using (IDataReader rdr = Task.GetListVacantPredecessors(TaskId))
                {
                    if (rdr.Read())
                    {
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task_predecessors.gif";
                        subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        cp  = new CommandParameters("MC_PM_AddPredTask");
                        cmd = cm.AddCommand("Task", "", "TaskView", cp);
                        cmd = cmd.Replace("\"", "&quot;");
                        subItem.ClientSideCommand = "javascript:" + cmd;
                        //subItem.NavigateUrl = "~/Tasks/AddPredecessor.aspx?BaseTaskID=" + TaskId;
                        subItem.Text = LocRM4.GetString("Add");
                        topMenuItem.Items.Add(subItem);
                    }
                }
            }
            #endregion

            #region Add Successors
            if (canUpdateConfigurationInfo && !isMSProject)
            {
                using (IDataReader rdr = Task.GetListVacantSuccessors(TaskId))
                {
                    if (rdr.Read())
                    {
                        subItem = new ComponentArt.Web.UI.MenuItem();
                        subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task_sucessors.gif";
                        subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                        subItem.Look.LeftIconHeight = Unit.Pixel(16);
                        cp  = new CommandParameters("MC_PM_AddSuccTask");
                        cmd = cm.AddCommand("Task", "", "TaskView", cp);
                        cmd = cmd.Replace("\"", "&quot;");
                        subItem.ClientSideCommand = "javascript:" + cmd;
                        //subItem.NavigateUrl = "~/Tasks/AddSuccessor.aspx?BaseTaskID=" + TaskId;
                        subItem.Text = LocRM4.GetString("AddSuc");
                        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);
            string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalCommentAdd.aspx" : "../Common/CommentAdd.aspx";
            subItem.ClientSideCommand = String.Format("javascript:OpenWindow('{0}?TaskId={1}',{2},false);",
                                                      sPath, TaskId, (Security.CurrentUser.IsExternal) ? "800,600" : "520,270");
            subItem.Text = LocRM2.GetString("CreateComment");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking

            /*
             * subItem = new ComponentArt.Web.UI.MenuItem();
             * subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
             * subItem.Look.LeftIconWidth = Unit.Pixel(16);
             * subItem.Look.LeftIconHeight = Unit.Pixel(16);
             * sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
             * subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?TaskId={1}', {2});",
             *      sPath, TaskId, (Security.CurrentUser.IsExternal)? "800,600" : "450, 200");
             * subItem.Text = LocRM2.GetString("AddTimeSheet");
             * topMenuItem.Items.Add(subItem);
             */
            #endregion

            #region UpdateHistory
            if (!Security.CurrentUser.IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", TaskId, (int)ObjectTypes.Task);
                subItem.Text = LocRM6.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!Security.CurrentUser.IsExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", TaskId, (int)ObjectTypes.Task);
                subItem.Text = LocRM6.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!Security.CurrentUser.IsExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", TaskId, ((int)ObjectTypes.Task).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Reminder
            if (!Security.CurrentUser.IsExternal)
            {
                Task.TaskSecurity sec = Task.GetSecurity(TaskId);
                if (sec.IsManager || sec.IsRealTaskResource)
                {
                    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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (int)ObjectTypes.Task, TaskId);
                    subItem.Text = LocRM2.GetString("EditReminder");
                    topMenuItem.Items.Add(subItem);
                }
            }
            #endregion

            #region Favorites
            if (!Task.CheckFavorites(TaskId) && !Security.CurrentUser.IsExternal)
            {
                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);
        }
Exemplo n.º 34
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tbView");

            bool canUpdate = Incident.CanUpdate(IncidentId);
            bool canAddToDoBox = Incident.CanAddToDo(IncidentId);
            bool canAddResBox = Incident.CanModifyResources(IncidentId);
            bool canViewFinances = Incident.CanViewFinances(IncidentId);
            bool canDelete = Incident.CanDelete(IncidentId);
            bool isExternal = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM2.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;

            CommandManager cm = null;
            if(!Security.CurrentUser.IsExternal)
                cm = CommandManager.GetCurrent(this.Page);
            CommandParameters cp = new CommandParameters();
            string cmd = String.Empty;

            #region Create ToDo
            if (canAddToDoBox && !isExternal)
            {
                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?IncidentId=" + IncidentId;
                subItem.Text = LocRM.GetString("tbAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit: Incident, GeneralInfo, ResolutionInfo, Status
            if (canUpdate)
            {
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("tbViewEdit");
                editItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth = Unit.Pixel(15);
                editItem.Look.RightIconHeight = Unit.Pixel(10);

                #region Edit Incident
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/incident_edit.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "../Incidents/IncidentEdit.aspx?IncidentId=" + IncidentId + "&Back=incident";
                subItem.Text = LocRM.GetString("EditIssue");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit General Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?IncidentId=" + IncidentId + "', 500, 400);";
                subItem.Text = LocRM2.GetString("EditGeneralInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonIncidentAllowEditGeneralCategoriesField ||
                    PortalConfig.IncidentAllowEditIncidentCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = "javascript:ShowWizard('EditCategories.aspx?IncidentId=" + IncidentId + "', 300, 350);";
                    subItem.Text = LocRM2.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion
                /*
                #region Edit State Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditStateInfo.aspx?ProjectId=" + ProjectId + "', 350, 250);";
                subItem.Text = LocRM.GetString("EditStateInfo");
                editItem.Items.Add(subItem);
                #endregion

            */
                topMenuItem.Items.Add(editItem);
            }
            #endregion

            #region Modyfy Recipients
            if (!isExternal && Mediachase.IBN.Business.Incident.CanUpdateExternalRecipients(IncidentId))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_RecipEdit");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('RecipientsEditor.aspx?IncidentId=" + IncidentId + "', 450, 350);";
                subItem.Text = LocRM.GetString("AddRecipients");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Modyfy Resources
            if (canAddResBox && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_ResEdit");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('ResourcesEditor.aspx?IncidentId=" + IncidentId + "', 650, 350);";
                subItem.Text = LocRM.GetString("AddResources");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/incident_delete.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand = "javascript:DeleteIncident()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region MarkAsSpam
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/red_denied.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_MarkAsSpam");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = GetGlobalResourceObject("IbnFramework.Incident", "MarkAsSpam").ToString();
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (topMenuItem.Items.Count > 0)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Copy to Clipboard
            if (!isExternal)
            {
                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=Issue&IncidentId=" + IncidentId.ToString() + "', '" + LocRM2.GetString("tXMLError") + "')}catch(e){}";
                subItem.Text = LocRM.GetString("tCopyToClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Add from Clipboard
            if (canUpdate && !isExternal)
            {
                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);
                cp = new CommandParameters("MC_HDM_RelatedIssClip");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("tPasteFromClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Clear Clipboard
            if (canUpdate && !isExternal)
            {
                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=Issue', '" + LocRM2.GetString("tXMLError") + "')}catch(e){}";
                subItem.Text = LocRM2.GetString("tClearClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (topMenuItem.Items.Count > 0)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Add Related Issue
            if (canUpdate && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/relincidents.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);

                cp = new CommandParameters("MC_HDM_RelatedIss");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = String.Format("javascript:OpenPopUpNoScrollWindow(\"../Common/SelectIncident.aspx?btn={0}&exclude={1}\", 640, 480);",
                //    Page.ClientScript.GetPostBackEventReference(btnAddRelatedIss, "xxxtypeid;xxxid"), IncidentId.ToString());
                subItem.Text = LocRM.GetString("tAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking
            /*
            if (Configuration.ProjectManagementEnabled)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?IncidentId={1}', {2});",
                  sPath, IncidentId, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
                subItem.Text = LocRM.GetString("tbAddTimeSheet");
                topMenuItem.Items.Add(subItem);
            }
             */
            #endregion

            #region UpdateHistory
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", IncidentId, (int)ObjectTypes.Issue);
                subItem.Text = LocRM3.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", IncidentId, (int)ObjectTypes.Issue);
                subItem.Text = LocRM3.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!isExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", IncidentId, ((int)ObjectTypes.Issue).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Favorites
            if (!Incident.CheckFavorites(IncidentId) && !isExternal)
            {
                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

            #region PrintPreviewSettings
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/printPreviewButton.png";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_PrintPreviewSettings");
                cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
                cp.AddCommandArgument("IncidentId", IncidentId.ToString());
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("PrintSettings");
                topMenuItem.Items.Add(subItem);

                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/print.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_PrintIssue");
                cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
                cp.AddCommandArgument("IncidentId", IncidentId.ToString());
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("PrintIssue");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            if (topMenuItem.Items.Count > 0)
                secHeader.ActionsMenu.Items.Add(topMenuItem);
        }
Exemplo n.º 35
0
        private void BindToolbar()
        {
            using (IDataReader reader = SecureGroup.GetGroup(GroupID))
            {
                if (reader.Read())
                {
                    secHeader.Title = CommonHelper.GetResFileString((string)reader["GroupName"]);
                }
            }

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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 new group
            if (SecureGroup.CanCreate(GroupID))
            {
                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);
                subItem.NavigateUrl         = "~/Directory/AddGroup.aspx?Type=0&GroupID=" + GroupID.ToString();
                subItem.Text = LocRM.GetString("AddGroup");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region edit group
            if (SecureGroup.CanUpdate() && GroupID > 9)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "~/Directory/AddGroup.aspx?Type=0&Edit=1&GroupID=" + GroupID.ToString();
                subItem.Text = LocRM.GetString("EditGroup");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region move
            if (SecureGroup.CanMove(GroupID))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/movegroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "~/Directory/MoveGroup.aspx?GroupID=" + GroupID.ToString();
                subItem.Text = LocRM.GetString("MoveGroup");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region delete
            if (SecureGroup.CanDelete(GroupID))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/deletegroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:DeleteGroup()";
                subItem.Text = LocRM.GetString("DeleteGroup");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region new user
            if (User.CanCreateExternal() || User.CanCreatePending() || User.CanCreate())
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/newuser.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "~/Directory/MultipleUserEdit.aspx?GroupID=" + GroupID;
                subItem.Text = LocRM.GetString("AddUser");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            if (topMenuItem.Items.Count > 0)
            {
                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Exemplo n.º 36
0
        private void BindToolbar()
        {
            Projects prj = (Projects)this.Parent.Parent;
            Mediachase.UI.Web.Modules.PageViewMenu secHeader = prj.ToolBar;
            if (secHeader != null)
            {
                secHeader.Title = LocRM.GetString("Projects");

                ComponentArt.Web.UI.MenuItem subItem;
                #region Create
                if (_hasMyProj)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.LookId = "TopItemLook";
                    //					subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/Project_Create.gif";
                    //					subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    //					subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.NavigateUrl = "~/Projects/ProjectEdit.aspx";
                    subItem.Text = /*"<img border='0' src='../Layouts/Images/Icons/Project_Create.gif' width='16px' height='16px' align='absmiddle'/>&nbsp;" + */LocRM.GetString("AddProject");
                    subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/Project_Create.gif");
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    secHeader.ActionsMenu.Items.Add(subItem);
                }
                #endregion

                ComponentArt.Web.UI.MenuItem topMenuItem;

                #region View Menu Items
                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.LookId = "TopItemLook";

                string sCurrentView = _pc["pl_ViewStyle"];

                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == FieldSetName.tProjectsDefault.ToString())
                {
                    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(lbChangeViewDef, "");
                subItem.Text = LocRM.GetString(FieldSetName.tProjectsDefault.ToString());
                topMenuItem.Items.Add(subItem);

                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == FieldSetName.tProjectsLight.ToString())
                {
                    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(lbChangeViewDates, "");
                subItem.Text = LocRM.GetString(FieldSetName.tProjectsLight.ToString());
                topMenuItem.Items.Add(subItem);
                #endregion

                secHeader.ActionsMenu.Items.Add(topMenuItem);

                topMenuItem = new ComponentArt.Web.UI.MenuItem();
                topMenuItem.Text = LocRM.GetString("Export");
                topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
                topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
                topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
                topMenuItem.LookId = "TopItemLook";

                #region xlsexport
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/xlsexport.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "~/Projects/default.aspx?Export=1";
                subItem.Text = LocRM.GetString("ExcelExport");
                topMenuItem.Items.Add(subItem);
                #endregion

                #region xmlexport
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/Icons/xmlexport.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "~/Projects/default.aspx?Export=2";
                subItem.Text = LocRM.GetString("XMLExport");
                topMenuItem.Items.Add(subItem);
                #endregion

                secHeader.ActionsMenu.Items.Add(topMenuItem);

            }
        }
Exemplo n.º 37
0
        private void addCatalogToMenu(ComponentArt.Web.UI.MenuItemCollection parentItemCollection,
                                      DbContentCatalog rootCatalog, DbContentCatalog catalog)
        {
            if (!catalog.Enabled || !catalog.MenuEnabled)
            {
                return;
            }

            DbContentClipCollection clips;

            ComponentArt.Web.UI.MenuItem catalogMenuItem;
            IconInfo leftIconInfo, rightIconInfo;
            CssInfo  catalogCssInfo;

            clips = catalog.GetMenuEnabledClips();
            clips.Sort(ContentCompareKey.MenuOrder);

            catalogMenuItem = new ComponentArt.Web.UI.MenuItem();
            parentItemCollection.Add(catalogMenuItem);

            catalogMenuItem.Text    = catalog.MenuLabel;
            catalogMenuItem.ToolTip = catalog.MenuTooltip;

            if (catalog.DefaultClip != null)
            {
                if (catalog.DefaultClip.OverrideUrl != string.Empty)
                {
                    catalogMenuItem.NavigateUrl = catalog.DefaultClip.OverrideUrl;
                }
                else
                {
                    catalogMenuItem.NavigateUrl = string.Format(_linkFormat, catalog.DefaultClip.ID);
                }

                catalogMenuItem.ID = catalog.DefaultClip.ID.ToString();
            }

            if (catalog.MenuCssClass == "[rootcatalog]" |
                catalog.MenuCssClass == "")
            {
                catalogCssInfo = new CssInfo(rootCatalog.MenuCssClass);
            }
            else
            {
                catalogCssInfo = new CssInfo(catalog.MenuCssClass);
            }

            if (catalog.MenuLeftIcon == "[rootcatalog]" |
                catalog.MenuCssClass == "")
            {
                leftIconInfo = new IconInfo(rootCatalog.MenuLeftIcon);
            }
            else
            {
                leftIconInfo = new IconInfo(catalog.MenuLeftIcon);
            }

            if (catalog.MenuRightIcon == "[rootcatalog]" |
                catalog.MenuCssClass == "")
            {
                rightIconInfo = new IconInfo(rootCatalog.MenuRightIcon);
            }
            else
            {
                rightIconInfo = new IconInfo(catalog.MenuRightIcon);
            }

            catalogCssInfo.SetLook(catalogMenuItem);
            leftIconInfo.SetLeftLook(catalogMenuItem);
            rightIconInfo.SetRightLook(catalogMenuItem);

            DbContentCatalogCollection childCatalogs = catalog.GetCatalogs();;

            childCatalogs.Sort(ContentCompareKey.SortOrder);

            foreach (DbContentCatalog childCatalog in childCatalogs)
            {
                addCatalogToMenu(catalogMenuItem.Items, rootCatalog, childCatalog);
            }

            addClipsToMenu(catalogMenuItem.Items, rootCatalog, catalog, clips);
        }
Exemplo n.º 38
0
        private void addClipsToMenu(ComponentArt.Web.UI.MenuItemCollection parentItems, DbContentCatalog rootCatalog,
                                    DbContentCatalog catalog, DbContentClipCollection clips)
        {
            foreach (DbContentClip clip in clips)
            {
                if (!clip.MenuEnabled | clip.ExpirationDate <= DateTime.Now | clip.PublishDate > DateTime.Now)
                {
                    continue;
                }

                // Check for a break and use the current catalog's _menu break system
                if (clip.MenuBreak)
                {
                    ComponentArt.Web.UI.MenuItem menuBreak =
                        new ComponentArt.Web.UI.MenuItem();
                    menuBreak.Look.ImageUrl    = rootCatalog.MenuBreakImage;
                    menuBreak.Look.CssClass    = rootCatalog.MenuBreakCssClass;
                    menuBreak.Look.ImageHeight = Unit.Pixel(2);
                    menuBreak.Look.ImageWidth  = Unit.Percentage(100);
                    parentItems.Add(menuBreak);
                }

                ComponentArt.Web.UI.MenuItem clipMenuItem =
                    new ComponentArt.Web.UI.MenuItem();
                IconInfo leftIconInfo, rightIconInfo;
                CssInfo  clipCssInfo;

                clipMenuItem.ID = clip.ID.ToString();

#if DEBUG
                clipMenuItem.Text = clip.MenuLabel + " (" + clip.MenuOrder.ToString() + ")";
#else
                clipMenuItem.Text = clip.MenuLabel;
#endif

                if (clip.OverrideUrl != string.Empty)
                {
                    clipMenuItem.NavigateUrl = clip.OverrideUrl;
                }
                else
                {
                    clipMenuItem.NavigateUrl = Page.ResolveUrl(string.Format(_linkFormat, clip.ID.ToString()));
                }
                clipMenuItem.ToolTip = clip.MenuTooltip;

                if (catalog.MenuCssClass == "[rootcatalog]" |
                    catalog.MenuCssClass == "")
                {
                    clipCssInfo = new CssInfo(rootCatalog.MenuCssClass);
                }
                else
                {
                    clipCssInfo = new CssInfo(catalog.MenuCssClass);
                }
                clipCssInfo.SetLook(clipMenuItem);

                if (clip.MenuLeftIcon == "[rootcatalog]")
                {
                    leftIconInfo = new IconInfo(rootCatalog.MenuLeftIcon);
                }
                else if (clip.MenuLeftIcon == "[catalog]")
                {
                    leftIconInfo = new IconInfo(catalog.MenuLeftIcon);
                }
                else
                {
                    leftIconInfo = new IconInfo(clip.MenuLeftIcon);
                }

                leftIconInfo.SetLeftLook(clipMenuItem);

                if (clip.MenuRightIcon == "[rootcatalog]")
                {
                    rightIconInfo = new IconInfo(rootCatalog.MenuRightIcon);
                }
                else if (clip.MenuRightIcon == "[catalog]")
                {
                    rightIconInfo = new IconInfo(catalog.MenuRightIcon);
                }
                else
                {
                    rightIconInfo = new IconInfo(clip.MenuRightIcon);
                }

                rightIconInfo.SetRightLook(clipMenuItem);

                parentItems.Add(clipMenuItem);
            }
        }
Exemplo n.º 39
0
        private void BindToolbar()
        {
            secHeader.AddText(LocRM.GetString("ForumMessages"));
            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM.GetString("tSettings");
            topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
            topMenuItem.LookId = "TopItemLook";

            #region Sort By Date
            ComponentArt.Web.UI.MenuItem subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbSort, "date");
            subItem.Text = LocRM.GetString("tSort");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region --- Seperator ---
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "BreakItem";
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Questions on Top
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_Quests458"] == "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(lbSort, "quests");
            subItem.Text = LocRM.GetString("tQuests");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Resolutions on Top
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_Resol458"] == "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(lbSort, "resol");
            subItem.Text = LocRM.GetString("tResolutions");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Workarounds on Top
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_Work458"] == "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(lbSort, "work");
            subItem.Text = LocRM.GetString("tWorkarounds");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region --- Seperator ---
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "BreakItem";
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Show info messages
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_Info"] == "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(lbSort, "info");
            subItem.Text = LocRM.GetString("tShowInfo");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Show Numbers
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_ShowNums"] == "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(lbSort, "nums");
            subItem.Text = LocRM.GetString("tShowNums");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Full Message
            subItem = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_FullMess"] == "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(lbSort, "full");
            subItem.Text = LocRM.GetString("ShowFullMessage");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region --- Seperator ---
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "BreakItem";
            topMenuItem.Items.Add(subItem);
            #endregion

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Text = LocRM.GetString("tMenuReply");
            subItem.Look.RightIconUrl = "../Layouts/Images/arrow_right.gif";
            subItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
            subItem.Look.RightIconWidth = Unit.Pixel(15);
            subItem.Look.RightIconHeight = Unit.Pixel(10);
            topMenuItem.Items.Add(subItem);

            #region Outlook Reply
            ComponentArt.Web.UI.MenuItem sub2Item = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_ReplyOutlook"] == "1")
            {
                sub2Item.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif";
                sub2Item.Look.LeftIconWidth = Unit.Pixel(16);
                sub2Item.Look.LeftIconHeight = Unit.Pixel(16);
            }
            else
                sub2Item.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbSort, "reply");
            sub2Item.Text = LocRM.GetString("tOutlookReply");
            subItem.Items.Add(sub2Item);
            #endregion

            #region EML Reply
            sub2Item = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_ReplyEML"] == "1")
            {
                sub2Item.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif";
                sub2Item.Look.LeftIconWidth = Unit.Pixel(16);
                sub2Item.Look.LeftIconHeight = Unit.Pixel(16);
            }
            else
                sub2Item.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbSort, "replyEML");
            sub2Item.Text = LocRM.GetString("tEMLReply");
            subItem.Items.Add(sub2Item);
            #endregion

            #region Web Reply
            sub2Item = new ComponentArt.Web.UI.MenuItem();
            if (pc["IncForum_ReplyEML"] == "0" && pc["IncForum_ReplyOutlook"] == "0")
            {
                sub2Item.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif";
                sub2Item.Look.LeftIconWidth = Unit.Pixel(16);
                sub2Item.Look.LeftIconHeight = Unit.Pixel(16);
            }
            else
                sub2Item.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbSort, "replyWeb");
            sub2Item.Text = LocRM.GetString("tWebReply");
            subItem.Items.Add(sub2Item);
            #endregion

            secHeader.ActionsMenu.Items.Add(topMenuItem);
        }
Exemplo n.º 40
0
        private void RenderMenu(ComponentArt.Web.UI.Menu actionsMenu)
        {
            ComponentArt.Web.UI.MenuItem topMenuItem;
            actionsMenu.Items.Clear();

            #region Print
            topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM.GetString("Export");
            topMenuItem.LookId = "TopItemLook";
            topMenuItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbExport, "");
            actionsMenu.Items.Add(topMenuItem);
            #endregion

            #region View Menu Items
            topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM.GetString("tView");
            topMenuItem.Look.LeftIconUrl = Page.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["RV_ViewStyle"];

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == FieldSetName.tWorkResourcesDefault.ToString())
            {
                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(lbChangeViewDef, "");
            subItem.Text = LocRM.GetString(FieldSetName.tWorkResourcesDefault.ToString());
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == FieldSetName.tWorkResourcesDates.ToString())
            {
                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(lbChangeViewDates, "");
            subItem.Text = LocRM.GetString(FieldSetName.tWorkResourcesDates.ToString());
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == FieldSetName.tWorkResourcesWorkTime.ToString())
            {
                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(lbChangeViewTimes, "");
            subItem.Text = LocRM.GetString(FieldSetName.tWorkResourcesWorkTime.ToString());
            topMenuItem.Items.Add(subItem);
            #endregion

            actionsMenu.Items.Add(topMenuItem);

            if (_projectId > 0)
                return;

            #region Grouping Menu Items
            topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM.GetString("tGroupBy");
            topMenuItem.Look.LeftIconUrl = Page.ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
            topMenuItem.LookId = "TopItemLook";

            sCurrentView = _pc["RV_Grouping"];

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == "0")
            {
                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(btnApplyG, "0");
            subItem.Text = LocRM.GetString("tNoGrouping");
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == "2")
            {
                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(btnApplyG, "2");
            subItem.Text = LocRM.GetString("tByManager");
            topMenuItem.Items.Add(subItem);

            if (Configuration.ProjectManagementEnabled)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == "3")
                {
                    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(btnApplyG, "3");
                subItem.Text = LocRM.GetString("tByProject");
                topMenuItem.Items.Add(subItem);
            }

            // Clients
            if (PortalConfig.GeneralAllowClientField)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == "4")
                {
                    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(btnApplyG, "4");
                subItem.Text = LocRM.GetString("tByClient");
                topMenuItem.Items.Add(subItem);
            }

            // Categories
            if (PortalConfig.GeneralAllowGeneralCategoriesField)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == "5")
                {
                    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(btnApplyG, "5");
                subItem.Text = LocRM.GetString("tByCategory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            actionsMenu.Items.Add(topMenuItem);
        }
Exemplo n.º 41
0
        private void BindToolbar()
        {
            string sharedreq = "";

            if (SharedID > 0)
            {
                sharedreq = "&SharedId=" + SharedID;
            }

            secHeader.Title = LocRM.GetString("tTitle");

            bool canUpdate  = CalendarEntry.CanUpdate(EventId);
            bool canDelete  = CalendarEntry.CanDelete(EventId);
            bool isExternal = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.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 Edit: Event
            if (canUpdate && !isExternal)
            {
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("Edit");
                editItem.Look.RightIconUrl      = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth    = Unit.Pixel(15);
                editItem.Look.RightIconHeight   = Unit.Pixel(10);

                #region Edit Event
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/event_edit.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "../Events/EventEdit.aspx?EventId=" + EventId + sharedreq;
                subItem.Text = LocRM.GetString("EditEvent");
                editItem.Items.Add(subItem);
                #endregion

                #region Reccurence
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/recurrence.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "../Events/RecEditor.aspx?EventId=" + EventId + sharedreq;
                subItem.Text = LocRM4.GetString("Recurrence");
                editItem.Items.Add(subItem);
                #endregion

                /*
                 #region Edit General Info
                 * subItem = new ComponentArt.Web.UI.MenuItem();
                 * subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?IncidentId=" + IncidentId + "', 500, 400);";
                 * subItem.Text = LocRM2.GetString("EditGeneralInfo");
                 * editItem.Items.Add(subItem);
                 #endregion
                 *
                 #region Edit Categories
                 * subItem = new ComponentArt.Web.UI.MenuItem();
                 * subItem.ClientSideCommand = "javascript:ShowWizard('EditCategories.aspx?IncidentId=" + IncidentId + "', 300, 350);";
                 * subItem.Text = LocRM2.GetString("EditCategories");
                 * editItem.Items.Add(subItem);
                 #endregion
                 */
                topMenuItem.Items.Add(editItem);
            }
            #endregion

            #region Modyfy Resources
            if (canUpdate && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                CommandManager    cm  = CommandManager.GetCurrent(this.Page);
                CommandParameters cp  = new CommandParameters("MC_PM_EventParticipants");
                string            cmd = cm.AddCommand("Event", "", "EventView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('ParticipantsEditor.aspx?EventId=" + EventId + "', 650, 350);";
                subItem.Text = LocRM.GetString("EventParticipants");
                topMenuItem.Items.Add(subItem);

                if (!IsPostBack && Request["Assign"] == "1")
                {
                    ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(),
                                                       "function Assign(){" + cmd + "} setTimeout('Assign()', 400);", true);
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "<script language='javascript'>ShowWizard('ParticipantsEditor.aspx?EventId=" + EventId + "', 650, 350);</script>");
                }
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/event_delete.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:DeleteEvent()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (canUpdate || canDelete)
            {
                subItem        = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                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);
            string commentaddlink = "../Common/CommentAdd.aspx?";
            if (Security.CurrentUser.IsExternal)
            {
                commentaddlink = "../External/ExternalCommentAdd.aspx?";
            }
            subItem.ClientSideCommand = String.Format("javascript:OpenWindow('{0}EventId={1}',{2},false);",
                                                      commentaddlink, EventId, (Security.CurrentUser.IsExternal) ? "800,600" : "520,270");
            subItem.Text = LocRM2.GetString("CreateComment");
            topMenuItem.Items.Add(subItem);
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking

            /*
             * if(Configuration.ProjectManagementEnabled)
             * {
             *      subItem = new ComponentArt.Web.UI.MenuItem();
             *      subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
             *      subItem.Look.LeftIconWidth = Unit.Pixel(16);
             *      subItem.Look.LeftIconHeight = Unit.Pixel(16);
             *      string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
             *      subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?EventId={1}', {2});",
             *              sPath, EventId, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
             *      subItem.Text = LocRM2.GetString("AddTimeSheet");
             *      topMenuItem.Items.Add(subItem);
             * }
             */
            #endregion

            #region UpdateHistory
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", EventId, (int)ObjectTypes.CalendarEntry);
                subItem.Text = LocRM5.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", EventId, (int)ObjectTypes.CalendarEntry);
                subItem.Text = LocRM5.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!isExternal)
            {
                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("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", EventId, ((int)ObjectTypes.CalendarEntry).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Reminder
            if (!isExternal)
            {
                CalendarEntry.EventSecurity sec = CalendarEntry.GetSecurity(EventId);
                if (sec.IsManager || sec.IsResource)
                {
                    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("javascript:ShowWizard('../Directory/SystemRemindersForObject.aspx?ObjectTypeId={0}&ObjectId={1}', 420, 150)", (int)ObjectTypes.CalendarEntry, EventId);
                    subItem.Text = LocRM2.GetString("EditReminder");
                    topMenuItem.Items.Add(subItem);
                }
            }
            #endregion

            #region Favorites
            if (!CalendarEntry.CheckFavorites(EventId) && !isExternal)
            {
                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);
        }
Exemplo n.º 42
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tUserView");

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */LocRM2.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";

            bool isExternal = false;
            bool isAlertService = false;
            using (IDataReader reader = User.GetUserInfo(UserID, false))
            {
                if (reader.Read())
                {
                    isExternal = (bool)reader["IsExternal"];

                    if (reader["login"].ToString().ToLower() == "alert")
                        isAlertService = true;
                }
            }

            ComponentArt.Web.UI.MenuItem subItem;

            bool canUpdate = User.CanUpdateUserInfo(UserID);
            bool canConvert = isExternal && Security.IsUserInGroup(InternalSecureGroups.Administrator);
            bool canDelete = Security.IsUserInGroup(InternalSecureGroups.Administrator) && UserID != Security.CurrentUser.UserID && !isAlertService;

            #region Edit
            if (canUpdate)
            {
                string sURL = String.Format("~/Directory/UserEdit.aspx?Back=View&UserID={0}", UserID);
                if (isExternal)
                    sURL = String.Format("~/Directory/ExternalEdit.aspx?Back=View&UserID={0}", UserID);

                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/edit.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = sURL;
                subItem.Text = LocRM3.GetString("tbEditEdit");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Convert
            if (canConvert)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/upload.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl = "~/Directory/UserEdit.aspx?UserId=" + UserID;
                subItem.Text = LocRM3.GetString("tbConvert");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl = "~/Layouts/Images/delete.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('UserDelete.aspx?UserId={0}',450,250)", UserID);
                subItem.Text = LocRM3.GetString("tDelete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (canUpdate || canConvert || canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Favorites
            if (!Common.CheckFavorites(UserID, ObjectTypes.User) && !isExternal)
            {
                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(AddToFavoritesButton, "");
                subItem.Text = LocRM2.GetString("AddToFavorites");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Back
            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = "~/Layouts/Images/cancel.gif";
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl = "~/Directory/Directory.aspx";
            subItem.Text = LocRM3.GetString("tbBack");
            topMenuItem.Items.Add(subItem);
            #endregion

            secHeader.ActionsMenu.Items.Add(topMenuItem);
        }