Exemplo n.º 1
0
 private System.Web.UI.WebControls.BoundColumn GetColumn(string dataField, string headerText, System.Web.UI.WebControls.HorizontalAlign alignment)
 {
     System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
     colBound.DataField = dataField;
     colBound.HeaderText = headerText;
     colBound.Initialize();
     colBound.HeaderStyle.CssClass = "ektronTitlebar";
     colBound.ItemStyle.Wrap = true;
     colBound.ItemStyle.HorizontalAlign = alignment;
     colBound.ItemStyle.CssClass = "history-list";
     colBound.HeaderStyle.Height = Unit.Empty;
     return colBound;
 }
Exemplo n.º 2
0
    protected void LoadGrid()
    {
        System.Web.UI.WebControls.BoundColumn cb = new System.Web.UI.WebControls.BoundColumn();
            cb.DataField = "fDelete";
            cb.HeaderText = "<input type=\"checkbox\" onclick=\"MsgInboxToggleAllCB(this);\" name=\"MsgInboxMasterCB\" value=\"" + "ID" + "\" runat=\"Server\"/>";
            cb.Initialize();
            cb.HeaderStyle.CssClass = "center checkBoxColumn";
            cb.ItemStyle.CssClass = "center checkBoxColumn";
            _dg.Columns.Add(cb);

            cb = new System.Web.UI.WebControls.BoundColumn();
            cb.DataField = "fFrom";
            if (SentMode)
            {
                cb.HeaderText = GetMessage("lbl generic to");
            }
            else
            {
                cb.HeaderText = GetMessage("lbl generic from");
            }
            cb.Initialize();
            _dg.Columns.Add(cb);

            cb = new System.Web.UI.WebControls.BoundColumn();
            cb.DataField = "fSubject";
            cb.HeaderText = GetMessage("lbl generic subject");
            cb.Initialize();
            _dg.Columns.Add(cb);

            cb = new System.Web.UI.WebControls.BoundColumn();
            cb.DataField = "fDate";
            cb.HeaderText = GetMessage("lbl generic date");
            cb.Initialize();
            _dg.Columns.Add(cb);

            _dg.DataSource = CreateMsgData();
            _dg.DataBind();
    }
Exemplo n.º 3
0
    private void Populate_ViewFriendsGrid(FriendInvitation[] data)
    {
        System.Web.UI.WebControls.BoundColumn colBound;

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "CHECKL";
        colBound.HeaderText = "<input type=\"checkbox\" onclick=\"checkAll(this);\" name=\"FriendsMasterCB\" value=\"" + "ID" + "\" runat=\"Server\"/>";
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(1);
        colBound.Initialize();
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_AVATAR";
        colBound.HeaderText = this.GetMessage("lbl avatar");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_DISPLAYNAME";
        colBound.HeaderText = this.GetMessage("generic display name");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(25);
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_FIRSTNAME";
        colBound.HeaderText = this.GetMessage("generic first name");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(25);
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        colBound.ItemStyle.Wrap = false;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_LASTNAME";
        colBound.HeaderText = this.GetMessage("generic last name");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(25);
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        colBound.ItemStyle.Wrap = false;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_SENTDATE";
        colBound.HeaderText = this.GetMessage("lbl generic date");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(10);
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        colBound.ItemStyle.Wrap = false;
        FriendGrid.Columns.Add(colBound);

        PageSettings();

        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("CHECKL", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_AVATAR", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_DISPLAYNAME", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_FIRSTNAME", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_LASTNAME", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_SENTDATE", typeof(string)));
        int i = 0;

        if (!(data == null))
        {
            for (i = 0; i <= data.Length - 1; i++)
            {
                dr = dt.NewRow();
                dr["CHECKL"] = "<input type=\"checkbox\" name=\"req_selected_users\" value=\"" + ((data[i].Recipient.IsUser) ? (data[i].Recipient.UserId.ToString()) : (data[i].Recipient.Email)) + "\" >";
                dr["COL_AVATAR"] = "<img class=\"friendsAvatar\" align=\"left\" src=\"" + ((data[i].Recipient.Avatar != "") ? (AppendSitePathIfNone(data[i].Recipient.Avatar)) : this.m_refContentApi.AppImgPath + "user.gif") + "\" width=\"32\" height=\"32\"/>";
                if (data[i].Recipient.IsUser)
                {
                    dr["COL_DISPLAYNAME"] = data[i].Recipient.DisplayName;
                    dr["COL_FIRSTNAME"] = data[i].Recipient.FirstName;
                    dr["COL_LASTNAME"] = data[i].Recipient.LastName;
                }
                else
                {
                    dr["COL_DISPLAYNAME"] = data[i].Recipient.Email;
                    dr["COL_FIRSTNAME"] = "";
                    dr["COL_LASTNAME"] = "";
                }

                dr["COL_SENTDATE"] = data[i].RequestDate.ToString("g");

                dt.Rows.Add(dr);
            }
        }

        DataView dv = new DataView(dt);
        FriendGrid.DataSource = dv;
        FriendGrid.DataBind();
    }
Exemplo n.º 4
0
    private void Populate_ViewForm(FormData form_data)
    {
        ViewFormPropertiesGrid.AutoGenerateColumns = false;
            System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "NAME";
            colBound.Initialize();
            colBound.ItemStyle.CssClass = "label";
            colBound.HeaderStyle.Height = Unit.Empty;
            ViewFormPropertiesGrid.Columns.Add(colBound);

            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TITLE";
            ViewFormPropertiesGrid.Columns.Add(colBound);
            ViewFormPropertiesGrid.BackColor = System.Drawing.Color.White;
            DataTable dt = new DataTable();
            DataRow dr;

            dt.Columns.Add(new DataColumn("NAME", typeof(string)));
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("lbl form title") + ":";
            dr[1] = form_data.Title;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("lbl formid") + ":";
            dr[1] = form_data.Id;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("tab linkcheck status") + ":";
            switch (form_data.Status.ToLower())
            {
                case "a":
                    dr[1] = m_refMsg.GetMessage("status:Approved (Published)");
                    break;
                case "o":
                    dr[1] = m_refMsg.GetMessage("status:Checked Out");
                    break;
                case "i":
                    dr[1] = m_refMsg.GetMessage("status:Checked In");
                    break;
                case "p":
                    dr[1] = m_refMsg.GetMessage("status:Approved (PGLD)");
                    break;
                case "m":
                    dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Deletion") + "</font>";
                    break;
                case "s":
                    dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Approval") + "</font>";
                    break;
                case "t":
                    dr[1] = m_refMsg.GetMessage("status:Waiting Approval");
                    break;
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("description label");
            dr[1] = form_data.Description;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("lbl form data") + ":";
            bool bMail = false;
            bool bDatabase = false;
            bool bAutofillForm = false;
            int lPos = 0;
            string strFormData = "";
            string strFormSubmission = "";

            bAutofillForm = form_data.Autofill;
            lPos = form_data.StoreDataTo.IndexOf(",$");
            if (lPos > -1)
            {
                strFormData = m_refModule.IsEmailOrDb(form_data.StoreDataTo);
                strFormSubmission = form_data.StoreDataTo.Substring(lPos + 2);
            }
            else
            {
                strFormData = form_data.StoreDataTo;
            }

            //If (strFormData = "") Then
            //    bMail = True
            //End If
            if (strFormData == "mail")
            {
                bMail = true;
            }
            if (strFormData == "db")
            {
                bDatabase = true;
            }
            if (strFormData == "both")
            {
                bMail = true;
                bDatabase = true;
            }

            if (bMail == true)
            {
                dr[1] = VerifyTrue;
            }
            else
            {
                dr[1] = VerifyFalse;
            }

            dr[1] += "" + m_refMsg.GetMessage("lbl mail") + "&nbsp;&nbsp;&nbsp;";

            if (bDatabase == true)
            {
                dr[1] += VerifyTrue;
            }
            else
            {
                dr[1] += VerifyFalse;
            }
            dr[1] += m_refMsg.GetMessage("lbl database");

            if (bDatabase == true)
            {
                dr[1] += "&nbsp;&nbsp;&nbsp;";
                if (bAutofillForm == true)
                {
                    dr[1] += VerifyTrue;
                }
                else
                {
                    dr[1] += VerifyFalse;
                }
                dr[1] += m_refMsg.GetMessage("lbl autofill form values");
            }

            dt.Rows.Add(dr);

            // Display Limit submission information if there is any
            if (strFormSubmission != "")
            {
                dr = dt.NewRow();
                dr[0] = m_refMsg.GetMessage("lbl form submission");
                dr[1] = strFormSubmission;
                dt.Rows.Add(dr);
            }

            EkTasks objTasks;
            EkTask cTask;
            cTask = m_refContentApi.EkTaskRef;

            Ektron.Cms.PageRequestData null_EktronCmsPageRequestData = null;
            objTasks = cTask.GetTasks(form_data.Id, Convert.ToInt64(EkEnumeration.TaskState.Prototype), -1, Convert.ToInt32(EkEnumeration.CMSTaskItemType.TasksByStateAndContentID), "", 0, ref null_EktronCmsPageRequestData, "");
            if (objTasks != null&& objTasks.Count > 0)
            {
                cTask = objTasks.get_Item(1);
            }

            string strAssignTaskTo;
            if (cTask.AssignToUserGroupID == 0)
            {
                strAssignTaskTo = m_refMsg.GetMessage("lbl all authors");
            }
            else if (!string.IsNullOrEmpty(cTask.AssignedToUser))
            {
                strAssignTaskTo = "<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/user.png\" align=\"absbottom\" />";
                strAssignTaskTo += m_refMailMsg.MakeUserTaskEmailLink(cTask, false);
            }
            else if (!string.IsNullOrEmpty(cTask.AssignedToUserGroup))
            {
                strAssignTaskTo = "<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/users.png\" align=\"absbottom\" />";
                strAssignTaskTo += m_refMailMsg.MakeUserGroupTaskEmailLink(cTask);
            }
            else
            {
                strAssignTaskTo = m_refMsg.GetMessage("lbl unassigned");
            }
            if (strAssignTaskTo.Length > 0)
            {
                dr = dt.NewRow();
                dr[0] = m_refMsg.GetMessage("lbl assign task to") + ":";
                dr[1] = strAssignTaskTo;
                dt.Rows.Add(dr);
            }

            if (strFormData == "mail" || strFormData == "both")
            {
                dr = dt.NewRow();
                dr[0] = "<hr />";
                dr[1] = "info-header";
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = " " + m_refMsg.GetMessage("lbl mailproperties"); //"<span class=""info-header""> Mail Properties</span>"
                dr[1] = "info-header";
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("generic to label");
                dr[1] = form_data.MailTo;
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("generic from label");
                dr[1] = form_data.MailFrom;
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("generic cc label");
                dr[1] = form_data.MailCc;
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("generic subject label");
                dr[1] = form_data.MailSubject;
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl preamble") + ":";
                dr[1] = form_data.MailPreamble;
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("alt send data in xml format") + ":";
                if (form_data.SendXmlPacket)
                {
                    dr[1] = m_refMsg.GetMessage("generic yes");
                }
                else
                {
                    dr[1] = m_refMsg.GetMessage("generic no");
                }
                dt.Rows.Add(dr);
            }

            dr = dt.NewRow();
            dr[0] = "<hr />";
            dr[1] = "info-header";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = " " + m_refMsg.GetMessage("btn content properties"); //"<span class=""info-header""> Content Properties</span>"
            dr[1] = "info-header";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("content title label");
            dr[1] = form_data.Title;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("content id label");
            dr[1] = form_data.Id;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("tab linkcheck status") + ":";
            switch (form_data.Status.ToLower())
            {
                case "a":
                    dr[1] = m_refMsg.GetMessage("status:Approved (Published)");
                    break;
                case "o":
                    dr[1] = m_refMsg.GetMessage("status:Checked Out");
                    break;
                case "i":
                    dr[1] = m_refMsg.GetMessage("status:Checked In");
                    break;
                case "p":
                    dr[1] = m_refMsg.GetMessage("status:Approved (PGLD)");
                    break;
                case "m":
                    dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Deletion") + "</font>";
                    break;
                case "s":
                    dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Approval") + "</font>";
                    break;
                case "t":
                    dr[1] = m_refMsg.GetMessage("status:Waiting Approval");
                    break;
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("generic last editor") + ":";
            dr[1] = form_data.EditorFirstName + " " + form_data.EditorLastName;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("generic start date label");
            if (string.IsNullOrEmpty(form_data.DisplayGoLive))
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            else
            {
                dr[1] = form_data.DisplayGoLive;
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("generic end date label");
            if (string.IsNullOrEmpty(form_data.DisplayEndDate))
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            else
            {
                dr[1] = form_data.DisplayEndDate;
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("End Date Action Title") + ":";
            if (content_data != null)
            {
                if (content_data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_archive_display)
                {
                    dr[1] = m_refMsg.GetMessage("Archive display descrp");
                }
                else if (content_data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_refresh)
                {
                    dr[1] = m_refMsg.GetMessage("Refresh descrp");
                }
                else
                {
                    dr[1] = m_refMsg.GetMessage("Archive expire descrp");
                }
            }
            else if (form_data.DisplayEndDate.Length > 0)
            {

                if (form_data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_archive_display)
                {
                    dr[1] = m_refMsg.GetMessage("Archive display descrp");
                }
                else if (form_data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_refresh)
                {
                    dr[1] = m_refMsg.GetMessage("Refresh descrp");
                }
                else
                {
                    dr[1] = m_refMsg.GetMessage("Archive expire descrp");
                }
            }
            else
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "&nbsp;&nbsp;&nbsp;" + m_refMsg.GetMessage("content dc label");
            if (string.IsNullOrEmpty(form_data.DisplayDateCreated))
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            else
            {
                dr[1] = form_data.DisplayDateCreated;
            }
            dt.Rows.Add(dr);

            DataView dv = new DataView(dt);
            ViewFormPropertiesGrid.DataSource = dv;
            ViewFormPropertiesGrid.DataBind();
    }
Exemplo n.º 5
0
    private void Populate_ViewFriendsGrid(DirectoryUserData[] data)
    {
        System.Web.UI.WebControls.BoundColumn colBound;
        string sAppend = "";

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "CHECKL";
        colBound.HeaderText = "<input type=\"checkbox\" onclick=\"checkAll(this);\" name=\"FriendsMasterCB\" value=\"" + "ID" + "\" runat=\"Server\"/>";
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(1);
        colBound.Initialize();
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "SEL";
        colBound.HeaderText = this.GetMessage("lbl selected friend");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(1);
        colBound.Initialize();
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_AVATAR";
        colBound.HeaderText = this.GetMessage("lbl avatar");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_DISPLAYNAME";
        colBound.HeaderText = this.GetMessage("generic display name");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(30);
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_FIRSTNAME";
        colBound.HeaderText = this.GetMessage("generic first name");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(30);
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        colBound.ItemStyle.Wrap = false;
        FriendGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COL_LASTNAME";
        colBound.HeaderText = this.GetMessage("generic last name");
        colBound.HeaderStyle.CssClass = "friendsHeader";
        colBound.HeaderStyle.Width = Unit.Percentage(30);
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Middle;
        colBound.ItemStyle.Wrap = false;
        FriendGrid.Columns.Add(colBound);

        PageSettings();

        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("CHECKL", typeof(string)));
        dt.Columns.Add(new DataColumn("SEL", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_AVATAR", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_DISPLAYNAME", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_FIRSTNAME", typeof(string)));
        dt.Columns.Add(new DataColumn("COL_LASTNAME", typeof(string)));
        int i = 0;

        if (!(data == null))
        {
            for (i = 0; i <= data.Length - 1; i++)
            {
                dr = dt.NewRow();
                sAppend = "";
                if ((setting_data.ADAuthentication == 1) && (data[i].Domain != ""))
                {
                    sAppend = "@" + data[i].Domain;
                }
                dr["CHECKL"] = "<input type=\"checkbox\" name=\"req_deleted_users\" id=\"req_deleted_users\" value=\"" + data[i].Id + "\" >";
                if (this.IsSelectedFriend(System.Convert.ToInt32(data[i].Id)))
                {
                    dr["SEL"] = "<img src=\"" + this.m_refContentApi.AppImgPath + "check20.gif\"/>";
                }
                else
                {
                    dr["SEL"] = "&nbsp;";
                }
                dr["COL_AVATAR"] = "<img class=\"friendsAvatar\" align=\"left\" src=\"" + ((data[i].Avatar != "") ? (AppendSitePathIfNone((string)(data[i].Avatar))) : this.m_refContentApi.AppImgPath + "user.gif") + "\" width=\"32\" height=\"32\"/>";
                dr["COL_DISPLAYNAME"] = data[i].DisplayName;
                dr["COL_FIRSTNAME"] = data[i].FirstName;
                dr["COL_LASTNAME"] = data[i].LastName;
                dt.Rows.Add(dr);
            }
        }

        DataView dv = new DataView(dt);
        FriendGrid.DataSource = dv;
        FriendGrid.DataBind();
    }
Exemplo n.º 6
0
    private System.Web.UI.WebControls.BoundColumn GetColumn(string dataField, string headerText, bool wrap, string cssClass)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();

            colBound.DataField = dataField;
            colBound.HeaderText = headerText;
            colBound.Initialize();
            colBound.HeaderStyle.CssClass = cssClass;

            if (dataField.ToLower() == "comments")
            {
                colBound.ItemStyle.Width = Unit.Parse("450");
            }
            colBound.ItemStyle.Wrap = wrap;
            colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
            colBound.ItemStyle.CssClass = "history-list";
            colBound.HeaderStyle.Height = Unit.Empty;
            return colBound;
    }
Exemplo n.º 7
0
    private void Populate_EntryHistoryListGrid(long Id)
    {
        Ektron.Cms.Commerce.CatalogEntryApi m_refCatalogAPI = new Ektron.Cms.Commerce.CatalogEntryApi();
            DataTable dt = new DataTable();
            string strLink = "";
            List<Ektron.Cms.Commerce.EntryVersionData> entry_version_list = new List<Ektron.Cms.Commerce.EntryVersionData>();
            int offset = 0;
            int majorVersions = 0;

            if (Id != -1)
            {

                entry_version_list = m_refCatalogAPI.GetVersionList(Id, ContentLanguage);

            }

            if (!(entry_version_list == null))
            {

                if (_analyticsEnabled)
                {
                    offset = 1;
                    HistoryListGrid.Columns.Add(GetColumn("EkCompare", m_refMsg.GetMessage("lbl compare"), false, "title-header bottom"));
                }
                HistoryListGrid.Columns.Add(GetColumn("EkVersion", m_refMsg.GetMessage("version"), false, "title-header bottom"));
                HistoryListGrid.Columns.Add(GetColumn("PublishDate", (string) (m_refMsg.GetMessage("hist list title") + "<div class=\"caption ektronCaption\">(<span style=\"background-image: url(\'" + m_refContentApi.AppPath + "images/ui/icons/forward.png\'); display: inline-block; width: 16px; height: 16px; background-position: center center; background-repeat: no-repeat;text-indent: -10000px\">&nbsp;</span> = " + m_refMsg.GetMessage("lbl content pd label") + ")</div>"), false, "title-header bottom"));
                HistoryListGrid.Columns.Add(GetColumn("TITLE", m_refMsg.GetMessage("generic title"), false, "title-header bottom"));
                HistoryListGrid.Columns.Add(GetColumn("Editor", m_refMsg.GetMessage("content LUE label"), false, "title-header bottom"));
                HistoryListGrid.Columns.Add(GetColumn("Comments", m_refMsg.GetMessage("comment text"), false, "title-header bottom contentHistoryComment"));

                HistoryListGrid.BorderColor = System.Drawing.Color.White;

                DataRow dr;
                if (_analyticsEnabled)
                {
                    dt.Columns.Add(new DataColumn("EkCompare", typeof(string)));
                }
                dt.Columns.Add(new DataColumn("EkVersion", typeof(string)));
                dt.Columns.Add(new DataColumn("PublishDate", typeof(string)));
                dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
                dt.Columns.Add(new DataColumn("Editor", typeof(string)));
                dt.Columns.Add(new DataColumn("Comments", typeof(string)));

                int minorRev;
                int numMajors;
                int pntr;
                bool firstRadio = true;
                minorRev = 0;
                numMajors = 0;
                pntr = 0;

                int[] minorarray = new int[entry_version_list.Count + 1];
                for (int i = 0; i <= (entry_version_list.Count - 1); i++)
                {
                    if (entry_version_list[i].Status == "A")
                    {
                        minorarray[numMajors] = minorRev;
                        numMajors++;
                        minorRev = 0;
                    }
                    else
                    {
                        minorRev++;
                    }
                }
                minorarray[numMajors] = minorRev; // This is really fist 1
                minorRev = minorarray[pntr];
                for (int i = 0; i <= (entry_version_list.Count - 1); i++)
                {
                    dr = dt.NewRow();
                    //class=""history-list""
                    strLink = "<a href=\"history.aspx?LangType=" + entry_version_list[i].Entry.LanguageId + "&hist_id=" + entry_version_list[i].VersionId + "&Id=" + Id + "\" target=\"history_frame\" title=\"" + m_refMsg.GetMessage("view this version msg") + "\">";

                    dr[1 + offset] = strLink;

                    if (entry_version_list[i].Status == "A")
                    {

                        minorRev = 0;
                        dr[offset] = numMajors + ".0";
                        pntr++;
                        minorRev = minorarray[pntr];
                        numMajors--;

                        string radiochecked = "";
                        if (firstRadio)
                        {
                            firstRadio = false;
                            radiochecked = "checked ";
                        }

                        dr[1 + offset] += "<img src=\"" + m_refContentApi.AppPath + "Images/ui/icons/forward.png\" align=\"bottom\" alt=\"Published\" title=\"Published\" />";
                        dr[1 + offset] += entry_version_list[i].Date.ToShortDateString() + " " + entry_version_list[i].Date.ToShortTimeString();
                        if (_analyticsEnabled)
                        {
                            dr[0] = "<span class=\"compare_option_primary\"><input class=\"compare\" value=\"" + entry_version_list[i].VersionId + "\" id=\"oldid\" name=\"oldid\" type=\"radio\" " + radiochecked + "/></span>";
                            dr[0] += "<span class=\"compare_option_secondary\"><input class=\"compare\" value=\"" + entry_version_list[i].VersionId + "\" id=\"diff\" name=\"diff\" type=\"radio\" " + radiochecked + "/></span>";
                        }

                        majorVersions++;

                    }
                    else
                    {
                        dr[offset] = numMajors + "." + minorRev;
                        minorRev--;
                        dr[1 + offset] += "<div style=\'margin-left:15px;\'>" + entry_version_list[i].Date.ToShortDateString() + " " + entry_version_list[i].Date.ToShortTimeString() + "</div>";

                    }
                    dr[1 + offset] += "</a>";
                    dr[2 + offset] = strLink + entry_version_list[i].Entry.Title.ToString() + "</a>";
                    dr[3 + offset] = "<a href=\"#\" onclick=\"EmailUser(" + entry_version_list[i].UserId.ToString() + ", \'" + m_refMsg.GetMessage("btn email") + "\'); return false;\">";
                    dr[3 + offset] += "<img alt=\"" + m_refMsg.GetMessage("btn email") + "\" title=\"" + m_refMsg.GetMessage("btn email") + "\" src=\"" + m_refContentApi.AppPath + "Images/ui/icons/email.png\" />&#160;";
                    dr[3 + offset] += entry_version_list[i].Entry.LastEditorFirstName + " " + entry_version_list[i].Entry.LastEditorLastName + "</a>";
                    dr[4 + offset] = entry_version_list[i].Comment;

                    dt.Rows.Add(dr);
                }

                _analyticsEnabled = System.Convert.ToBoolean(majorVersions > 1);

            }
            else
            {
                System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
                colBound.DataField = "EkVersion";
                colBound.HeaderText = m_refMsg.GetMessage("lbl history status");
                colBound.HeaderStyle.CssClass = "title-header";
                colBound.Initialize();
                colBound.ItemStyle.Wrap = false;
                colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
                colBound.ItemStyle.CssClass = "history-list";
                colBound.HeaderStyle.Height = Unit.Empty;
                HistoryListGrid.Columns.Add(colBound);

                dt.Columns.Add(new DataColumn("EkVersion", typeof(string)));

                DataRow dr;
                dr = dt.NewRow();
                dr[0] = m_refMsg.GetMessage("msg current history");
                dt.Rows.Add(dr);

                _analyticsEnabled = false;

            }

            DataView dv = new DataView(dt);

            HistoryListGrid.DataSource = dv;
            HistoryListGrid.DataBind();
    }
Exemplo n.º 8
0
    private DataTable GetHistoryList(long id)
    {
        int i = 0;
            DataTable dt = new DataTable();
            string strLink = "";
            ContentHistoryData[] content_history_list = null;
            int offset = 0;
            int majorVersions = 0;

            if (id != -1)
            {
                content_history_list = m_refContentApi.GetHistoryList(id);
            }
            if (!(content_history_list == null))
            {

                if (_analyticsEnabled)
                {
                    offset = 1;
                    HistoryListGrid.Columns.Add(GetColumn("EkCompare", m_refMsg.GetMessage("lbl compare") + "<div class=\"caption ektronCaption\">(" + m_refMsg.GetMessage("lbl web traffic analytics") + ")</div>", false, "title-header bottom"));
                }
                HistoryListGrid.Columns.Add(GetColumn("EkVersion", m_refMsg.GetMessage("lbl version"), false, "title-header bottom"));
                HistoryListGrid.Columns.Add(GetColumn("PublishDate", (string) (m_refMsg.GetMessage("hist list title") + "<div class=\"caption ektronCaption\">(<span style=\"background-image: url(\'" + m_refContentApi.AppPath + "images/ui/icons/forward.png\'); display: inline-block; width: 16px; height: 16px; background-position: center center; background-repeat: no-repeat;text-indent: -10000px\">&nbsp;</span> = " + m_refMsg.GetMessage("lbl content pd label") + ")</div>"), false, "title-header bottom"));
                HistoryListGrid.Columns.Add(GetColumn("TITLE", m_refMsg.GetMessage("generic title"), false, "title-header bottom contentHistoryTitle"));
                HistoryListGrid.Columns.Add(GetColumn("Editor", m_refMsg.GetMessage("lbl content lue label"), false, "title-header bottom"));
                HistoryListGrid.Columns.Add(GetColumn("Comments", m_refMsg.GetMessage("comment text"), false, "title-header bottom contentHistoryComment"));

                //HistoryListGrid.BorderColor = Drawing.Color.White

                DataRow dr;
                if (_analyticsEnabled)
                {
                    dt.Columns.Add(new DataColumn("EkCompare", typeof(string)));
                }
                dt.Columns.Add(new DataColumn("EkVersion", typeof(string)));
                dt.Columns.Add(new DataColumn("PublishDate", typeof(string)));
                dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
                dt.Columns.Add(new DataColumn("Editor", typeof(string)));
                dt.Columns.Add(new DataColumn("Comments", typeof(string)));

                int minorRev;
                int numMajors;
                int pntr;
                bool firstRadio = true;
                bool nextRadio = true;
                minorRev = 0;
                numMajors = 0;
                pntr = 0;

                int[] minorarray = new int[content_history_list.Length + 1];
                for (i = 0; i <= content_history_list.Length - 1; i++)
                {
                    if (content_history_list[i].Status == "A")
                    {
                        minorarray[numMajors] = minorRev;
                        numMajors++;
                        minorRev = 0;
                    }
                    else
                    {
                        minorRev++;
                    }
                }
                minorarray[numMajors] = minorRev; // This is really fist 1
                minorRev = minorarray[pntr];
                for (i = 0; i <= content_history_list.Length - 1; i++)
                {
                    dr = dt.NewRow();
                    //class=""history-list""
                    strLink = "<a href=\"history.aspx?LangType=" + content_history_list[i].LanguageId + "&hist_id=" + content_history_list[i].Id + "&Id=" + id + "\" target=\"history_frame\" title=\"" + m_refMsg.GetMessage("view this version msg") + "\">";
                    dr[1 + offset] = strLink;
                    if (content_history_list[i].Status == "A")
                    {

                        minorRev = 0;
                        dr[offset] = numMajors + ".0";
                        pntr++;
                        minorRev = minorarray[pntr];
                        numMajors--;

                        string radiochecked = "";
                        string nextradiochecked = "";
                        if (firstRadio)
                        {
                            firstRadio = false;
                            radiochecked = "checked ";
                        }
                        else if (nextRadio)
                        {
                            nextRadio = false;
                            nextradiochecked = "checked ";
                        }

                        dr[1 + offset] += "<img src=\"" + m_refContentApi.AppPath + "Images/ui/icons/forward.png\" align=\"bottom\" alt=\"Published\" title=\"Published\" />";
                        dr[1 + offset] += content_history_list[i].DateInserted.ToShortDateString() + " " + content_history_list[i].DateInserted.ToShortTimeString();
                        if (_analyticsEnabled)
                        {
                            dr[0] = "<span class=\"compare_option_primary\"><input class=\"compare\" value=\"" + content_history_list[i].Id + "\" name=\"oldid\" type=\"radio\" " + radiochecked + "/></span>";
                            dr[0] += "<span class=\"compare_option_secondary\"><input class=\"compare\" value=\"" + content_history_list[i].Id + "\" name=\"diff\" type=\"radio\" " + nextradiochecked + "/></span>";
                        }

                        majorVersions++;

                    }
                    else
                    {

                        dr[offset] = numMajors + "." + minorRev;
                        minorRev--;
                        dr[1 + offset] += "<div style=\'margin-left:15px;\'>" + content_history_list[i].DateInserted.ToShortDateString() + " " + content_history_list[i].DateInserted.ToShortTimeString() + "</div>";

                    }
                    dr[1 + offset] += "</a>";
                    dr[2 + offset] = strLink + content_history_list[i].Title.ToString() + "</a>";
                    if (content_history_list[i].DisplayName != "")
                    {
                        dr[3 + offset] = content_history_list[i].DisplayName;
                    }
                    else
                    {
                        dr[3 + offset] = content_history_list[i].UserName;
                    }
                    dr[4 + offset] = content_history_list[i].Comment;

                    dt.Rows.Add(dr);
                }

                _analyticsEnabled = System.Convert.ToBoolean(majorVersions > 1);

            }
            else
            {
                System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
                colBound.DataField = "EkVersion";
                colBound.HeaderText = m_refMsg.GetMessage("lbl history status");
                colBound.HeaderStyle.CssClass = "title-header";
                colBound.Initialize();
                colBound.ItemStyle.Wrap = false;
                colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
                colBound.ItemStyle.CssClass = "history-list";
                colBound.HeaderStyle.Height = Unit.Empty;
                HistoryListGrid.Columns.Add(colBound);

                dt.Columns.Add(new DataColumn("EkVersion", typeof(string)));

                DataRow dr;
                dr = dt.NewRow();
                dr[0] = m_refMsg.GetMessage("msg current history");
                dt.Rows.Add(dr);

                _analyticsEnabled = false;

            }

            return dt;
    }
Exemplo n.º 9
0
    public void SetupStatisticsGrid()
    {
        System.Web.UI.WebControls.BoundColumn column = new System.Web.UI.WebControls.BoundColumn();
            column.DataField = "ObjectType";
            column.HeaderText = m_containerPage.RefMsg.GetMessage("lbl tagged type"); //"Type"
            column.HeaderStyle.CssClass = "ptagsHeaderType";
            column.Initialize();
            column.ItemStyle.Wrap = false;
            column.ItemStyle.VerticalAlign = VerticalAlign.Middle;
            column.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
            tagStatsGrid.Columns.Add(column);

            column = new System.Web.UI.WebControls.BoundColumn();
            column.DataField = "TaggedCount";
            column.HeaderText = m_containerPage.RefMsg.GetMessage("lbl times used"); // "Times Used"
            column.HeaderStyle.CssClass = "ptagsHeaderTagCount";
            column.Initialize();
            column.ItemStyle.Wrap = false;
            column.ItemStyle.VerticalAlign = VerticalAlign.Middle;
            column.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
            tagStatsGrid.Columns.Add(column);
    }
Exemplo n.º 10
0
    protected void LoadGrid()
    {
        if (! string.IsNullOrEmpty(Request.QueryString["orderBy"]))
            {
                m_sortOrderBy = (TagOrderBy)Convert.ToInt32(Request.QueryString["orderBy"]);
            }

            if (! string.IsNullOrEmpty(Request.QueryString["order"]))
            {
                m_sortOrder = Convert.ToString(Request.QueryString["order"]);
            }

            System.Web.UI.WebControls.BoundColumn cb = new System.Web.UI.WebControls.BoundColumn();
            cb.DataField = "fId";
            cb.HeaderText = m_containerPage.RefMsg.GetMessage("generic id"); //"ID"
            cb.Initialize();
            _dg.Columns.Add(cb);

            cb = new System.Web.UI.WebControls.BoundColumn();
            cb.DataField = "fName";
            //cb.HeaderText = m_containerPage.RefMsg.GetMessage("generic name") ' "Name"
            cb.HeaderText = "<a href=\"personaltags.aspx?orderBy=" + TagOrderBy.Text + "&order=" + (m_sortOrderBy == TagOrderBy.Text && m_sortOrder == "asc" ? "desc" : "asc") + "\">" + m_containerPage.RefMsg.GetMessage("generic name") + "</a>";
            cb.Initialize();
            _dg.Columns.Add(cb);

            cb = new System.Web.UI.WebControls.BoundColumn();
            cb.DataField = "fTotal";
            //cb.HeaderText = m_containerPage.RefMsg.GetMessage("lbl times used") ' "Times Used"
            cb.HeaderText = "<a href=\"personaltags.aspx?orderBy=" + TagOrderBy.TaggedCount + "&order=" + (m_sortOrderBy == TagOrderBy.TaggedCount && m_sortOrder == "asc" ? "desc" : "asc") + "\">" + m_containerPage.RefMsg.GetMessage("lbl times used") + "</a>";
            cb.Initialize();
            _dg.Columns.Add(cb);

            cb = new System.Web.UI.WebControls.BoundColumn();
            cb.DataField = "fLanguage";
            cb.HeaderText = m_containerPage.RefMsg.GetMessage("generic language"); // "Language"
            cb.Initialize();
            _dg.Columns.Add(cb);

            _dg.DataSource = CreateMsgData();
            _dg.DataBind();

            LoadPageSettings();
    }