Пример #1
0
        protected override void RenderToolPart(HtmlTextWriter output)
        {
            base.RenderToolPart(output);
            ToolPane tp   = this.ParentToolPane;
            Comments myWP =
                (Comments)tp.SelectedWebPart;

            output.Write("<div class=\"UserSectionTitle\">");
            output.Write("<table style=\"PADDING-LEFT: 5px\" cellPadding=\"1\">");
            output.Write("<tbody>");

            output.Write("<tr>");
            output.Write("<td>");
            output.Write("Number of threads to display: \r\n <input type=\"text\" id=\"tbMaxThreads\" name=\"tbMaxThreads\" value=\"" + myWP.NumThreads.ToString() + "\" />");
            output.Write("</td>");
            output.Write("</tr>");

            output.Write("<tr>");
            output.Write("<td>");
            output.Write("Default number of comments per thread: \r\n <input type=\"text\" id=\"tbMaxComments\" name=\"tbMaxComments\" value=\"" + myWP.MaxComments.ToString() + "\" />");
            output.Write("</td>");
            output.Write("</tr>");

            output.Write("<tr>");
            output.Write("<td>");
            output.Write("Default height(px): \r\n <input type=\"text\" id=\"tbDefaultHeight\" name=\"tbDefaultHeight\" value=\"" + ((myWP.DefaultHeight != null) ? myWP.DefaultHeight.ToString() : "600") + "\" />");
            output.Write("</td>");
            output.Write("</tr>");

            output.Write("</tbody>");
            output.Write("</table>");
            output.Write("</div>");
        }
Пример #2
0
        protected override void RenderToolPart(HtmlTextWriter output)
        {
            base.RenderToolPart(output);
            ToolPane tp = this.ParentToolPane;
            DisplayProfilePictures myWP =
                (DisplayProfilePictures)tp.SelectedWebPart;

            //output.Write("<div>");
            output.Write("<div class=\"UserSectionTitle\">");
            output.Write("<table style=\"PADDING-LEFT: 5px\" cellPadding=\"1\">");
            output.Write("<tbody>");
            output.Write("<tr>");

            output.Write("<td>");
            if (myWP.LargeImage)
            {
                output.Write("<input type=\"checkbox\" name=\"cbLargeSize\" checked=\"checked\" value=\"true\" />Large Size");
            }
            else
            {
                output.Write("<input type=\"checkbox\" name=\"cbLargeSize\" value=\"true\" />Large Size");
            }
            output.Write("</td>");
            output.Write("</tr>");
            output.Write("</tbody>");
            output.Write("</table>");
            output.Write("</div>");
        }
Пример #3
0
        internal static string ConfigurationToolPaneLink(Control webpart)
        {
            string configureLink =
                string.Format("<a href=\"javascript:{0};\">Check webpart properties in tool panel.</a>",
                              ToolPane.GetShowExtensibleToolPaneEvent(string.Format(@"'{0}'", webpart.UniqueID)));

            return(configureLink.Replace("ExtensibleView", "Edit"));
        }
        protected override void CreateChildControls()
        {
            try
            {
                base.CreateChildControls();

                Panel pnlGroup = new Panel(); // configuration section panel

                ValidationSummary             = new ValidationSummary();
                ValidationSummary.ID          = "ValidationSummary";
                ValidationSummary.DisplayMode = ValidationSummaryDisplayMode.SingleParagraph;
                ValidationSummary.ShowSummary = true;
                pnlGroup.Controls.Add(ValidationSummary);

                MessageTextBox    = new TextBox();
                MessageTextBox.ID = "MessageTextBox";

                HelloWorldWithEditorWebPart webPart
                    = this.WebPartToEdit as HelloWorldWithEditorWebPart;

                if (webPart != null)
                {
                    Label lblMessage = new Label();
                    lblMessage.Text = "Message";

                    Panel pnlMessageLabel = new Panel(); // head for configuration section
                    pnlMessageLabel.Controls.Add(lblMessage);

                    // Required field validator
                    RequiredFieldValidator messageRequiredValidator =
                        new RequiredFieldValidator();
                    messageRequiredValidator.ControlToValidate = MessageTextBox.ClientID;
                    messageRequiredValidator.ErrorMessage      = "Message cannot be blank";
                    messageRequiredValidator.Display           = ValidatorDisplay.Dynamic;
                    messageRequiredValidator.Text = "*";

                    Panel pnlMessageControls = new Panel(); // body of configuration section
                    pnlMessageControls.Controls.Add(MessageTextBox);
                    pnlMessageControls.Controls.Add(messageRequiredValidator);

                    pnlGroup.Controls.Add(pnlMessageLabel);
                    pnlGroup.Controls.Add(pnlMessageControls);
                }

                this.Controls.Add(pnlGroup);

                // stop Cancel button from calling validation code
                ToolPane pane = Zone as ToolPane;
                if (pane != null)
                {
                    pane.Cancel.CausesValidation = false;
                }
            }
            catch (Exception ex)
            {
                WebPartUtil.HandleException(this, ex);
            }
        }
Пример #5
0
        public override void ApplyChanges()
        {
            ToolPane tp         = this.ParentToolPane;
            Comments wpComments = (Comments)tp.SelectedWebPart;

            wpComments.NumThreads    = int.Parse(Page.Request["tbMaxThreads"]);
            wpComments.MaxComments   = int.Parse(Page.Request["tbMaxComments"]);
            wpComments.DefaultHeight = Page.Request["tbDefaultHeight"];
        }
        protected override void CreateChildControls()
        {
            //base.CreateChildControls();



            ToolPane    tp   = this.ParentToolPane;
            ListSummary myWP = (ListSummary)tp.SelectedWebPart;
        }
Пример #7
0
        public override void ApplyChanges()
        {
            ToolPane tp = this.ParentToolPane;
            DisplayProfilePictures myWP =
                (DisplayProfilePictures)tp.SelectedWebPart;

            bool result = false;

            bool.TryParse(Page.Request["cbLargeSize"], out result);
            myWP.LargeImage = result;
        }
Пример #8
0
        protected override void CreateChildControls()
        {
            //base.CreateChildControls();



            ToolPane     tp   = this.ParentToolPane;
            GridListView myWP = (GridListView)tp.SelectedWebPart;

            ddlList.EnableViewState = true;
        }
        public override void ApplyChanges()
        {
            //Get our web part
            ToolPane      tp   = this.ParentToolPane;
            RollupSummary myWP =
                (RollupSummary)tp.SelectedWebPart;

            //Send back our text to our web part
            myWP.MyXml         = Page.Request.Form[inputname];
            myWP.MyRollupSites = Page.Request.Form["rollupsites"];
        }
        protected override void RenderToolPart(HtmlTextWriter output)
        {
            ToolPane      tp   = this.ParentToolPane;
            RollupSummary myWP =
                (RollupSummary)tp.SelectedWebPart;

            output.Write("<br>Please enter your XML: <textarea cols=\"30\" rows=\"15\" name=\""
                         + inputname + "\">" + myWP.MyXml
                         + "</textarea><BR>");

            output.Write("<br><br>Cross Site URL(s): <textarea cols=\"30\" rows=\"15\" name=\"rollupsites\">" + myWP.MyRollupSites
                         + "</textarea><BR>");
        }
        protected override void CreateChildControls()
        {
            // Get a reference to the Edit Tool Pane.
            ToolPane pane = this.Zone as ToolPane;

            if (pane != null)
            {
                // Disable the validation on Cancel Button of ToolPane
                pane.Cancel.CausesValidation = false;
                pane.Cancel.Click           += new EventHandler(Cancel_Click);
            }

            // Load the User Control and it to the Controls Collection of the Editor Part
            this.configuratorControl =
                this.Page.LoadControl(TabConfigurationEditorPart.TabControlConfigurationPath) as TabConfigurationEditorPartUserControl;
            this.configuratorControl.ID = TabConfigurationEditorPart.UserControlID;
            this.Controls.Add(configuratorControl);
        }
        public override void ApplyChanges()
        {
            //EnsureChildControls();

            ToolPane    tp   = this.ParentToolPane;
            ListSummary myWP =
                (ListSummary)tp.SelectedWebPart;

            ////Send back our text to our web part
            myWP.PropList = Page.Request["ddlList" + this.ID];
            myWP.PropView = Page.Request["ddlView" + this.ID];

            myWP.PropRollupList  = Page.Request["rollupList"];
            myWP.PropRollupSites = Page.Request["rollupSites"];

            myWP.PropStatus = Page.Request["ddlStatus" + this.ID];

            myWP.PropUrl = Page.Request["actionurl"].ToString().Replace(SPContext.Current.Web.Url, "{SiteUrl}");
        }
        public override void ApplyChanges()
        {
            ToolPane       tp   = this.ParentToolPane;
            ListReportView myWP =
                (ListReportView)tp.SelectedWebPart;
            var gridviewwithcheckbox = (SPGridView)this.FindControl("mySPGridViewControl");

            //string newVal = Page.Request["reportViewLists"];
            //if (!string.IsNullOrEmpty(newVal.Trim()))
            //{
            //    newVal = newVal.Replace("\r\n", "|");
            //}
            //myWP.ViewLists = newVal;

            bool result = false;

            bool.TryParse(Page.Request["cbExpandView"], out result);
            myWP.ExpandView = result;

            StoreSortListByDisplayName(myWP, gridviewwithcheckbox);
            _selectedHashNames = myWP.GetListNamesInHashtable(myWP.SelectedListNames);
            SortListByDisplayName(_selectedHashNames, myWP);
        }
        protected override void RenderToolPart(HtmlTextWriter output)
        {
            base.RenderToolPart(output);
            ToolPane       tp   = this.ParentToolPane;
            ListReportView myWP =
                (ListReportView)tp.SelectedWebPart;

            //output.Write("<div>");
            output.Write("<div class=\"UserSectionTitle\">");
            output.Write("<table style=\"PADDING-LEFT: 5px\" cellPadding=\"1\">");
            output.Write("<tbody>");
            output.Write("<tr>");

            //output.Write("<td>List(s)<br/>");
            //output.Write("<textarea class=\"ms-input\" rows=\"5\" cols=\"25\" name=\"reportViewLists\">" +
            //    ((!string.IsNullOrEmpty(myWP.ViewLists)) ? myWP.ViewLists.Replace("|", "\r\n") : string.Empty) +
            //    "</textarea>");
            //output.Write("</td>");
            //output.Write("</tr>");
            //output.Write("<tr>");

            output.Write("<td>");
            if (myWP.ExpandView)
            {
                output.Write("<input type=\"checkbox\" name=\"cbExpandView\" checked=\"checked\" value=\"true\" />Expand View");
            }
            else
            {
                output.Write("<input type=\"checkbox\" name=\"cbExpandView\" value=\"true\" />Expand View");
            }
            output.Write("</td>");
            output.Write("</tr>");
            output.Write("</tbody>");
            output.Write("</table>");
            output.Write("</div>");
        }
Пример #15
0
        ///<summary>
        /// Create controls for tool part
        ///</summary>
        protected override void CreateChildControls()
        {
            try
            {
                base.CreateChildControls();
                ToolPane pane = this.Zone as ToolPane;
                if (pane != null)
                {
                    pane.Cancel.CausesValidation = false;
                    pane.Cancel.Click           += new EventHandler(Cancel_Click);
                }



                //        const string caminhoControle = @"~/_CONTROLTEMPLATES/com.sandigital.sharepoint.webparts/VisualizadorDeListaAgrupadaEditor.ascx";

                this.configuradorUserControl    = this.Page.LoadControl("~/_CONTROLTEMPLATES/com.sandigital.sharepoint.webparts/VisualizadorDeListaAgrupadaEditor.ascx") as VisualizadorDeListaAgrupadaEditor;
                this.configuradorUserControl.ID = WebPartToEdit.ID + "ctl_Editor";
                this.Controls.Add(configuradorUserControl);
            }
            catch
            {
            }
        }
Пример #16
0
        protected override void RenderToolPart(HtmlTextWriter output)
        {
            SPWeb web = SPContext.Current.Web;

            ToolPane     tp   = this.ParentToolPane;
            GridListView myWP =
                (GridListView)tp.SelectedWebPart;



            ddlList.Items.Add(new ListItem("< Select List >", ""));
            foreach (SPList list in web.Lists)
            {
                if (!list.Hidden)
                {
                    try
                    {
                        ddlList.Items.Add(new ListItem(list.Title, list.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url));
                    }
                    catch { }
                }
            }
            ddlList.ID            = "ddlList" + this.ID;
            ddlList.SelectedValue = myWP.PropList;
            output.Write("<script src=\"/_layouts/epmlive/DHTML/xgrid/dhtmlxcommon.js\"></script>");
            output.Write("<div id=\"divTpLoading\" style=\"width:100%;height:400;background:#FFFFFF;display:none\" align=\"center\">");
            output.Write("<br><br><br><br><br><br><br><img src=\"_layouts/images/gears_anv4.gif\">");
            output.Write("</div>");
            output.Write("<div id=\"divEverything\">");

            output.Write("<div class=\"UserSectionHead\">");
            output.Write("List Information");
            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkLock" + this.ID + "\" id=\"chkLock" + this.ID + "\"");
            if (myWP.PropLockViewContext.Value)
            {
                output.Write(" checked");
            }
            output.Write(" onclick=\"lockContext();\">Lock View Context");
            output.Write("</td></tr><tr><td>");

            output.Write("List:<br>");
            if (myWP.PropLockViewContext.Value)
            {
                ddlList.Enabled = false;
            }

            ddlList.Attributes.Add("onchange", "changeList();");
            ddlList.RenderControl(output);

            output.Write("</td></tr><tr><td>");

            output.Write("View:<br>");
            output.Write("<select id=\"ddlView" + this.ID + "\" name=\"ddlView" + this.ID + "\"");
            if (myWP.PropLockViewContext.Value)
            {
                output.Write(" disabled");
            }
            output.Write(" >");
            output.Write("<option value=\"\">&lt; Select View &gt;</option>");
            if (myWP.PropList != null && myWP.PropList != "")
            {
                foreach (SPView view in web.GetListFromUrl(myWP.PropList).Views)
                {
                    if (!view.Hidden && !view.PersonalView)
                    {
                        output.Write("<option value=\"" + view.Title + "\"");
                        if (view.Title == myWP.PropView)
                        {
                            output.Write(" selected");
                        }
                        output.Write(">" + view.Title + "</option>");
                    }
                }
            }
            output.Write("</select>");
            output.Write("</td></tr><tr><td>");

            output.Write("Default Control:<br>");
            if (myWP.PropDefaultControl.ToLower() == "gantt")
            {
                output.Write("<select id=\"ddlDefaultControl" + this.ID + "\" name=\"ddlDefaultControl" + this.ID + "\"><option value=\"Grid\">Grid</option><option value=\"Gantt\" selected=\"selected\">Gantt</option></select>");
            }
            else
            {
                output.Write("<select id=\"ddlDefaultControl" + this.ID + "\" name=\"ddlDefaultControl" + this.ID + "\"><option value=\"Grid\" selected=\"selected\">Grid</option><option value=\"Gantt\">Gantt</option></select>");
            }
            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkUseDefaults" + this.ID + "\" id=\"chkUseDefaults" + this.ID + "\"");
            if (myWP.PropUseDefaults.Value)
            {
                output.Write(" checked");
            }
            output.Write(" onclick=\"useDefaults();\">Use Settings from List");
            output.Write("</td></tr><tr><td>");
            output.Write("</td></tr></table>");

            output.Write("</div>");
            output.Write("<div style='width:100%' class='UserDottedLine'></div>");

            output.Write("<div id=\"divNonDefaults\" style=\"display:");
            if (myWP.PropUseDefaults.Value)
            {
                output.Write("none");
            }
            output.Write("\">");

            output.Write("<div class=\"UserSectionHead\" id=\"fldSection" + this.ID + "\">");
            output.Write("Field Information");
            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");

            output.Write("Start:<br>");
            output.Write("<select id=\"ddlStart" + this.ID + "\" name=\"ddlStart" + this.ID + "\" onchange=\"propStart = this.options[this.selectedIndex].value;\"></select>");
            output.Write("</td></tr><tr><td>");

            output.Write("Finish:<br>");
            output.Write("<select id=\"ddlFinish" + this.ID + "\" name=\"ddlFinish" + this.ID + "\" onchange=\"propFinish = this.options[this.selectedIndex].value;\"></select>");
            output.Write("</td></tr><tr><td>");

            output.Write("Progress Bar:<br>");
            output.Write("<select id=\"ddlProgress" + this.ID + "\" name=\"ddlProgress" + this.ID + "\" onchange=\"propProgress = this.options[this.selectedIndex].value;\"></select>");
            output.Write("</td></tr><tr><td>");

            output.Write("Milestone:<br>");
            output.Write("<select id=\"ddlMilestone" + this.ID + "\" name=\"ddlMilestone" + this.ID + "\" onchange=\"propMilestone = this.options[this.selectedIndex].value;\"></select>");
            output.Write("</td></tr><tr><td>");

            output.Write("Right Information:<br>");
            output.Write("<select id=\"ddlInfo" + this.ID + "\" name=\"ddlInfo" + this.ID + "\" onchange=\"propInfo = this.options[this.selectedIndex].value;\"></select>");
            output.Write("</td></tr><tr><td>");

            output.Write("WBS:<br>");
            output.Write("<select id=\"ddlWBS" + this.ID + "\" name=\"ddlWBS" + this.ID + "\" onchange=\"propWBS = this.options[this.selectedIndex].value;\"></select>");
            output.Write("</td></tr></table>");
            output.Write("</div>");

            output.Write("<div style='width:100%' class='UserDottedLine'></div>");

            output.Write("<div class=\"UserSectionHead\">");
            output.Write("Rollup Settings<br>");
            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");
            output.Write("Rollup List(s):<br>");
            output.Write("<textarea name=\"rollupList\" class=\"ms-input\" cols=\"25\" rows=\"5\">" + myWP.PropRollupList + "</textarea>");

            output.Write("</td></tr><tr><td>");
            output.Write("Rollup Site(s):<br>");
            output.Write("<textarea name=\"rollupSites\" class=\"ms-input\" cols=\"25\" rows=\"5\">" + myWP.PropRollupSites + "</textarea>");

            if (SPContext.Current.Web.CurrentUser.IsSiteAdmin)
            {
                output.Write("</td></tr><tr><td>");
                output.Write("<input type=\"checkbox\" name=\"chkExecutive" + this.ID + "\"");
                if (myWP.PropExecView == "on")
                {
                    output.Write(" checked");
                }
                output.Write("> Executive View");
            }

            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkPerformance" + this.ID + "\"");
            if (myWP.PropPerformance.Value)
            {
                output.Write(" checked");
            }
            output.Write("> Enhance Perfomance");

            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkContentReporting" + this.ID + "\"");
            if (myWP.PropContentReporting.Value)
            {
                output.Write(" checked");
            }
            output.Write("> Use Content DB");

            output.Write("</td></tr></table>");
            output.Write("</div>");

            output.Write("<div style='width:100%' class='UserDottedLine'></div>");

            output.Write("<div class=\"UserSectionHead\">");
            output.Write("Other Information");
            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkShowViewToolbar" + this.ID + "\"");
            if (myWP.PropShowViewToolbar.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Show View Toolbar");
            output.Write("</td></tr><tr><td>");

            output.Write("Item Link Type:<br>");
            output.Write("<select id=\"ddlLinkType" + this.ID + "\" name=\"ddlLinkType" + this.ID + "\">");
            output.Write("</select>");
            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkHideNew" + this.ID + "\"");
            if (myWP.PropHideNewButton.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Hide New Button");
            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkUsePopup" + this.ID + "\"");
            if (myWP.PropUsePopup.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Use Pop-up");
            output.Write("</td></tr></table>");
            output.Write("</div>");
            output.Write("<div style='width:100%' class='UserDottedLine'></div>");

            output.Write("<div class=\"UserSectionHead\">");
            output.Write("Edit Mode");
            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkAllowEdit" + this.ID + "\"");
            if (myWP.PropAllowEdit.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Allow Edit Toggle");
            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkEditMode" + this.ID + "\"");
            if (myWP.PropEdit.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Default To Edit Mode");
            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkShowInsertRow" + this.ID + "\"");
            if (myWP.PropShowInsertRow.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Show Insert Row");

            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkUseParent" + this.ID + "\"");
            if (myWP.PropUseParent.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Use Parent Item");

            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkShowSearch" + this.ID + "\"");
            if (myWP.PropShowSearch.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Force Search");

            output.Write("</td></tr><tr><td>");
            output.Write("<input type=\"checkbox\" name=\"chkLockSearch" + this.ID + "\"");
            if (myWP.PropLockSearch.Value)
            {
                output.Write(" checked");
            }
            output.Write(">Persist Search");

            output.Write("</td></tr></table>");
            output.Write("</div>");

            output.Write("<div style='width:100%' class='UserDottedLine'></div>");
            output.Write("</div>");



            //===================================

            output.Write("<div class=\"UserSectionHead\">");
            output.Write("Additional Groupings");
            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");

            output.Write("Select Field:<br>");
            output.Write("<select id=\"ddlGroup1" + this.ID + "\" name=\"ddlGroup1" + this.ID + "\" onchange=\"propGroup1 = this.options[this.selectedIndex].value;\"></select>");
            output.Write("</td></tr><tr><td>");

            output.Write("Select Field:<br>");
            output.Write("<select id=\"ddlGroup2" + this.ID + "\" name=\"ddlGroup2" + this.ID + "\" onchange=\"propGroup2 = this.options[this.selectedIndex].value;\"></select>");
            output.Write("</td></tr><tr><td>");

            output.Write("Expand To Level:<br>");
            output.Write("<select id=\"ddlExpand" + this.ID + "\" name=\"ddlExpand" + this.ID + "\">");
            output.Write("<option value=\"\">< Use View Settings ></option>");
            for (int i = 1; i <= 4; i++)
            {
                output.Write("<option value=\"" + i + "\"");
                if (i.ToString() == myWP.PropExpand)
                {
                    output.Write(" selected");
                }
                output.Write(">Level " + i + "</option>");
            }
            output.Write("</select>");
            output.Write("</td></tr></table>");
            output.Write("</div>");


            string cList   = "";
            string cView   = "";
            string cFields = "";

            try
            {
                cList = SPContext.Current.List.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url;
                cView = SPContext.Current.ViewContext.View.Title;
                foreach (SPField f in SPContext.Current.List.Fields)
                {
                    if (!f.Hidden && f.Type != SPFieldType.Computed)
                    {
                        f.Title  = System.Web.HttpUtility.UrlEncode(f.Title).Replace("+", "%20");
                        cFields += "," + f.Title + "|" + f.InternalName + "|" + f.Type.ToString();
                    }
                }
                if (cFields.Length > 1)
                {
                    cFields = cFields.Substring(1);
                }
            }
            catch { }

            string oFields = "";

            try
            {
                if (myWP.PropList != null && myWP.PropList != "")
                {
                    foreach (SPField f in web.GetListFromUrl(myWP.PropList).Fields)
                    {
                        if (!f.Hidden && f.Type != SPFieldType.Computed)
                        {
                            f.Title  = System.Web.HttpUtility.UrlEncode(f.Title).Replace("+", "%20");
                            oFields += "," + f.Title + "|" + f.InternalName + "|" + f.Type.ToString();
                        }
                    }
                    if (oFields.Length > 1)
                    {
                        oFields = oFields.Substring(1);
                    }
                }
            }
            catch { }


            output.Write("<script>");
            output.Write("var contextList = \"" + cList + "\";");
            output.Write("var contextView = \"" + cView + "\";");
            output.Write("var contextFields = \"" + cFields + "\";");
            output.Write("var propStart = \"" + myWP.PropStart + "\";");
            output.Write("var propFinish = \"" + myWP.PropFinish + "\";");
            output.Write("var propProgress = \"" + myWP.PropProgress + "\";");
            output.Write("var propInfo = \"" + myWP.PropInformation + "\";");
            output.Write("var propWBS = \"" + myWP.PropWBS + "\";");
            output.Write("var propMilestone = \"" + myWP.PropMilestone + "\";");
            output.Write("var propGroup1 = \"" + myWP.PropGroup1 + "\";");
            output.Write("var propGroup2 = \"" + myWP.PropGroup2 + "\";");
            output.Write("var propLinkType = \"" + myWP.PropLinkType + "\";");

            output.Write("var webUrl = \"" + web.Url + "\";");


            output.Write("var oFields = \"" + oFields + "\";");

            output.Write(Properties.Resources.txtGridToolpartJS.Replace("#tpid#", this.ID));

            output.Write("_spBodyOnLoadFunctionNames.push(\"loadFields\");");

            output.Write("</script>");
            output.Write("</div>");
        }
        protected override void RenderToolPart(HtmlTextWriter output)
        {
            SPWeb web = SPContext.Current.Web;

            ToolPane    tp   = this.ParentToolPane;
            ListSummary myWP =
                (ListSummary)tp.SelectedWebPart;



            ddlList.Items.Add(new ListItem("< Select List >", ""));
            foreach (SPList list in web.Lists)
            {
                if (!list.Hidden)
                {
                    ddlList.Items.Add(new ListItem(list.Title, list.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url));
                }
            }
            ddlList.ID            = "ddlList" + this.ID;
            ddlList.SelectedValue = myWP.PropList;


            output.Write("<script src=\"/_layouts/epmlive/DHTML/dhtmlxajax.js\"></script>");

            output.Write("<div id=\"divTpLoading\" style=\"width:100%;height:400;background:#FFFFFF;display:none\" align=\"center\">");
            output.Write("<br><br><br><br><br><br><br><img src=\"_layouts/images/GEARS_ANv4.GIF\">");
            output.Write("</div>");

            output.Write("<div id=\"divEverything\">");

            output.Write("<div class=\"UserSectionHead\">");
            output.Write("List Information");

            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");
            output.Write("List:<br>");

            ddlList.Attributes.Add("onchange", "changeList();");
            ddlList.RenderControl(output);

            output.Write("</td></tr><tr><td>");

            output.Write("View Filters:<br>");
            output.Write("<select id=\"ddlView" + this.ID + "\" name=\"ddlView" + this.ID + "\"");
            output.Write(" >");
            output.Write("<option value=\"\">&lt; Select View &gt;</option>");
            if (myWP.PropList != null && myWP.PropList != "")
            {
                foreach (SPView view in web.GetListFromUrl(myWP.PropList).Views)
                {
                    if (!view.Hidden && !view.PersonalView)
                    {
                        output.Write("<option value=\"" + view.Title + "\"");
                        if (view.Title == myWP.PropView)
                        {
                            output.Write(" selected");
                        }
                        output.Write(">" + view.Title + "</option>");
                    }
                }
            }
            output.Write("</select>");
            output.Write("</td></tr><tr><td>");

            output.Write("Count Value Field:<br>");
            output.Write("<select id=\"ddlStatus" + this.ID + "\" name=\"ddlStatus" + this.ID + "\" onchange=\"propStatus = this.options[this.selectedIndex].value;\"></select>");

            output.Write("</td></tr></table>");
            output.Write("</div>");

            //output.Write("<div class=\"UserSectionHead\" id=\"fldSection" + this.ID + "\">");
            output.Write("<div style='width:100%' class='UserDottedLine'></div>");

            output.Write("<div class=\"UserSectionHead\">");
            output.Write("Rollup Settings<br>");
            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");
            output.Write("Rollup List(s):<br>");
            output.Write("<textarea name=\"rollupList\" class=\"ms-input\" cols=\"25\" rows=\"5\">" + myWP.PropRollupList + "</textarea>");

            output.Write("</td></tr><tr><td>");
            output.Write("Rollup Site(s):<br>");
            output.Write("<textarea name=\"rollupSites\" class=\"ms-input\" cols=\"25\" rows=\"5\">" + myWP.PropRollupSites + "</textarea>");
            output.Write("</td></tr></table>");

            output.Write("</div>");

            output.Write("<div style='width:100%' class='UserDottedLine'></div>");
            output.Write("<div class=\"UserSectionHead\">");
            output.Write("Additional Settings<br>");
            output.Write("<table cellpadding=1 style=\"padding-left: 5px\"><tr><td>");
            output.Write("Action URL:<br>");
            output.Write("<input type=\"text\" name=\"actionurl\" class=\"ms-input\" value=\"" + myWP.PropUrl + "\"><br>Note: Use {SiteUrl} as a wildcard for your site url.");
            output.Write("</td></tr></table>");
            output.Write("</div>");

            //output.Write("</div>");



            string cList   = "";
            string cView   = "";
            string cFields = "";

            try
            {
                cList = SPContext.Current.List.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url;
                cView = SPContext.Current.ViewContext.View.Title;
                foreach (SPField f in SPContext.Current.List.Fields)
                {
                    if (!f.Hidden && f.Type != SPFieldType.Computed)
                    {
                        cFields += "," + f.Title + "|" + f.InternalName + "|" + f.Type.ToString();
                    }
                }
                if (cFields.Length > 1)
                {
                    cFields = cFields.Substring(1);
                }
            }
            catch { }

            string oFields = "";

            try
            {
                if (myWP.PropList != null && myWP.PropList != "")
                {
                    foreach (SPField f in web.GetListFromUrl(myWP.PropList).Fields)
                    {
                        if (!f.Hidden && f.Type != SPFieldType.Computed)
                        {
                            oFields += "," + f.Title + "|" + f.InternalName + "|" + f.Type.ToString();
                        }
                    }
                    if (oFields.Length > 1)
                    {
                        oFields = oFields.Substring(1);
                    }
                }
            }
            catch { }


            output.Write("<script>");
            output.Write("var contextList = \"" + cList + "\";");
            output.Write("var contextView = \"" + cView + "\";");
            output.Write("var contextFields = \"" + cFields + "\";");
            output.Write("var propStatus = \"" + myWP.PropStatus + "\";");

            output.Write("var webUrl = \"" + web.Url + "\";");


            output.Write("var oFields = \"" + oFields + "\";");

            output.Write(Properties.Resources.txtListSummaryJS.Replace("#tpid#", this.ID));

            output.Write("_spBodyOnLoadFunctionNames.push(\"loadFields\");");

            output.Write("</script>");
            output.Write("</div>");
        }
Пример #18
0
        public override void ApplyChanges()
        {
            //EnsureChildControls();

            ToolPane     tp   = this.ParentToolPane;
            GridListView myWP =
                (GridListView)tp.SelectedWebPart;

            ////Send back our text to our web part
            myWP.PropList = Page.Request["ddlList" + this.ID];
            myWP.PropView = Page.Request["ddlView" + this.ID];

            myWP.PropRollupList  = Page.Request["rollupList"];
            myWP.PropRollupSites = Page.Request["rollupSites"];

            myWP.PropFinish      = Page.Request["ddlFinish" + this.ID];
            myWP.PropInformation = Page.Request["ddlInformation" + this.ID];
            myWP.PropMilestone   = Page.Request["ddlMilestone" + this.ID];
            myWP.PropProgress    = Page.Request["ddlProgress" + this.ID];
            myWP.PropStart       = Page.Request["ddlStart" + this.ID];
            myWP.PropWBS         = Page.Request["ddlWBS" + this.ID];

            string psvt = Page.Request["chkShowViewToolbar" + this.ID];

            if (psvt == "on")
            {
                myWP.PropShowViewToolbar = true;
            }
            else
            {
                myWP.PropShowViewToolbar = false;
            }

            string psup = Page.Request["chkUsePopup" + this.ID];

            if (psup == "on")
            {
                myWP.PropUsePopup = true;
            }
            else
            {
                myWP.PropUsePopup = false;
            }

            string psparent = Page.Request["chkUseParent" + this.ID];

            if (psparent == "on")
            {
                myWP.PropUseParent = true;
            }
            else
            {
                myWP.PropUseParent = false;
            }

            string search = Page.Request["chkShowSearch" + this.ID];

            if (search == "on")
            {
                myWP.PropShowSearch = true;
            }
            else
            {
                myWP.PropShowSearch = false;
            }

            string locksearch = Page.Request["chkLockSearch" + this.ID];

            if (locksearch == "on")
            {
                myWP.PropLockSearch = true;
            }
            else
            {
                myWP.PropLockSearch = false;
            }

            myWP.PropExecView = Page.Request["chkExecutive" + this.ID];
            myWP.PropLinkType = Page.Request["ddlLinkType" + this.ID];

            myWP.PropGroup1 = Page.Request["ddlGroup1" + this.ID];
            myWP.PropGroup2 = Page.Request["ddlGroup2" + this.ID];
            myWP.PropExpand = Page.Request["ddlExpand" + this.ID];

            string plvc = Page.Request["chkLock" + this.ID];

            if (plvc == "on")
            {
                myWP.PropLockViewContext = true;
            }
            else
            {
                myWP.PropLockViewContext = false;
            }

            myWP.PropDefaultControl = Page.Request["ddlDefaultControl" + this.ID];

            string ud = Page.Request["chkUseDefaults" + this.ID];

            if (ud == "on")
            {
                myWP.PropUseDefaults = true;
            }
            else
            {
                myWP.PropUseDefaults = false;
            }

            string hn = Page.Request["chkHideNew" + this.ID];

            if (hn == "on")
            {
                myWP.PropHideNewButton = true;
            }
            else
            {
                myWP.PropHideNewButton = false;
            }

            string ae = Page.Request["chkAllowEdit" + this.ID];

            if (ae == "on")
            {
                myWP.PropAllowEdit = true;
            }
            else
            {
                myWP.PropAllowEdit = false;
            }

            string em = Page.Request["chkEditMode" + this.ID];

            if (em == "on")
            {
                myWP.PropEdit = true;
            }
            else
            {
                myWP.PropEdit = false;
            }

            string ir = Page.Request["chkShowInsertRow" + this.ID];

            if (ir == "on")
            {
                myWP.PropShowInsertRow = true;
            }
            else
            {
                myWP.PropShowInsertRow = false;
            }


            string ip = Page.Request["chkPerformance" + this.ID];

            if (ip == "on")
            {
                myWP.PropPerformance = true;
            }
            else
            {
                myWP.PropPerformance = false;
            }

            string ic = Page.Request["chkContentReporting" + this.ID];

            if (ic == "on")
            {
                myWP.PropContentReporting = true;
            }
            else
            {
                myWP.PropContentReporting = false;
            }
        }