Пример #1
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            lp       = new LocationPicker();
            lp.ID    = filterControl.ID + "_lp";
            lp.Label = "Location";
            lp.AllowedPickerModes = LocationPickerMode.Named | LocationPickerMode.Polygon;
            lp.SetBestPickerModeForLocation(null);
            lp.CssClass = "col-lg-4";
            filterControl.Controls.Add(lp);

            Panel panel = new Panel();

            panel.CssClass = "col-lg-8";
            filterControl.Controls.Add(panel);

            ddlLocationType                = new RockDropDownList();
            ddlLocationType.ID             = filterControl.ID + "_ddlLocationType";
            ddlLocationType.Label          = "Location Type";
            ddlLocationType.DataValueField = "Id";
            ddlLocationType.DataTextField  = "Value";
            DefinedTypeCache locationDefinedType = DefinedTypeCache.Read(SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid());

            ddlLocationType.BindToDefinedType(locationDefinedType);
            ddlLocationType.Items.Insert(0, new ListItem("(All Location Types)", ""));
            panel.Controls.Add(ddlLocationType);

            return(new Control[3] {
                lp, ddlLocationType, panel
            });
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Email" /> class.
        /// </summary>
        public Sms()
        {
            ddlFrom = new RockDropDownList();
            ddlFrom.BindToDefinedType( DefinedTypeCache.Read( new Guid( Rock.SystemGuid.DefinedType.COMMUNICATION_SMS_FROM ) ) );

            tbTextMessage = new RockTextBox();
        }
Пример #3
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            var controls = new List <Control>();

            ddlStringFilterComparison    = ComparisonHelper.ComparisonControl(ComparisonHelper.StringFilterComparisonTypes);
            ddlStringFilterComparison.ID = string.Format("{0}_{1}", filterControl.ID, controls.Count());
            ddlStringFilterComparison.AddCssClass("js-filter-compare");
            filterControl.Controls.Add(ddlStringFilterComparison);
            controls.Add(ddlStringFilterComparison);

            tbPostalCode    = new RockTextBox();
            tbPostalCode.ID = filterControl.ID + "_tbPostalCode";
            tbPostalCode.AddCssClass("js-filter-control");
            filterControl.Controls.Add(tbPostalCode);
            controls.Add(tbPostalCode);

            ddlLocationType                = new RockDropDownList();
            ddlLocationType.ID             = filterControl.ID + "_ddlLocationType";
            ddlLocationType.Label          = "Location Type";
            ddlLocationType.DataValueField = "Id";
            ddlLocationType.DataTextField  = "Value";
            DefinedTypeCache locationDefinedType = DefinedTypeCache.Get(SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid());

            ddlLocationType.BindToDefinedType(locationDefinedType);
            ddlLocationType.Items.Insert(0, new ListItem("(All Location Types)", ""));
            filterControl.Controls.Add(ddlLocationType);
            controls.Add(ddlLocationType);

            return(controls.ToArray());
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Email" /> class.
        /// </summary>
        public Sms()
        {
            ddlFrom = new RockDropDownList();
            ddlFrom.BindToDefinedType(DefinedTypeCache.Read(new Guid(Rock.SystemGuid.DefinedType.COMMUNICATION_SMS_FROM)));

            tbTextMessage = new RockTextBox();
        }
Пример #5
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            ddlFrom       = new RockDropDownList();
            ddlFrom.ID    = string.Format("ddlFrom_{0}", this.ID);
            ddlFrom.Label = "From";
            ddlFrom.Help  = "The number to originate message from (configured under Admin Tools > General Settings > Defined Types > SMS From Values).";
            ddlFrom.BindToDefinedType(DefinedTypeCache.Read(new Guid(Rock.SystemGuid.DefinedType.COMMUNICATION_SMS_FROM)), false, true);
            ddlFrom.Required = true;
            Controls.Add(ddlFrom);

            rcwMessage       = new RockControlWrapper();
            rcwMessage.ID    = string.Format("rcwMessage_{0}", this.ID);
            rcwMessage.Label = "Message";
            rcwMessage.Help  = "<span class='tip tip-lava'></span>";
            Controls.Add(rcwMessage);

            mfpMessage    = new MergeFieldPicker();
            mfpMessage.ID = string.Format("mfpMergeFields_{0}", this.ID);
            mfpMessage.MergeFields.Clear();
            mfpMessage.MergeFields.Add("GlobalAttribute");
            mfpMessage.MergeFields.Add("Rock.Model.Person");
            mfpMessage.CssClass   += " pull-right margin-b-sm";
            mfpMessage.SelectItem += mfpMergeFields_SelectItem;
            rcwMessage.Controls.Add(mfpMessage);

            tbMessage          = new RockTextBox();
            tbMessage.ID       = string.Format("tbTextMessage_{0}", this.ID);
            tbMessage.TextMode = TextBoxMode.MultiLine;
            tbMessage.Rows     = 3;
            tbMessage.Required = true;
            rcwMessage.Controls.Add(tbMessage);
        }
Пример #6
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            var selectedNumberGuids = SelectedNumbers; //GetAttributeValue( "FilterCategories" ).SplitDelimitedValues( true ).AsGuidList();
            var definedType         = DefinedTypeCache.Get(new Guid(Rock.SystemGuid.DefinedType.COMMUNICATION_SMS_FROM));


            ddlFrom       = new RockDropDownList();
            ddlFrom.ID    = string.Format("ddlFrom_{0}", this.ID);
            ddlFrom.Label = "From";
            ddlFrom.Help  = "The number to originate message from (configured under Admin Tools > General Settings > Defined Types > SMS From Values).";
            if (selectedNumberGuids.Any())
            {
                ddlFrom.SelectedIndex = -1;
                ddlFrom.DataSource    = definedType.DefinedValues.Where(v => selectedNumberGuids.Contains(v.Guid)).Select(v => new
                {
                    v.Description,
                    v.Id
                });
                ddlFrom.DataTextField  = "Description";
                ddlFrom.DataValueField = "Id";
                ddlFrom.DataBind();
            }
            else
            {
                ddlFrom.BindToDefinedType(definedType, false, true);
            }
            ddlFrom.Required = true;
            Controls.Add(ddlFrom);

            rcwMessage       = new RockControlWrapper();
            rcwMessage.ID    = string.Format("rcwMessage_{0}", this.ID);
            rcwMessage.Label = "Message";
            rcwMessage.Help  = "<span class='tip tip-lava'></span>";
            Controls.Add(rcwMessage);

            mfpMessage    = new MergeFieldPicker();
            mfpMessage.ID = string.Format("mfpMergeFields_{0}", this.ID);
            mfpMessage.MergeFields.Clear();
            mfpMessage.MergeFields.Add("GlobalAttribute");
            mfpMessage.MergeFields.Add("Rock.Model.Person");
            mfpMessage.CssClass   += " margin-b-sm pull-right";
            mfpMessage.SelectItem += mfpMergeFields_SelectItem;
            rcwMessage.Controls.Add(mfpMessage);

            lblCount          = new Label();
            lblCount.CssClass = "badge margin-all-sm pull-right";
            lblCount.ID       = string.Format("lblCount_{0}", this.ID);
            lblCount.Visible  = this.CharacterLimit > 0;
            rcwMessage.Controls.Add(lblCount);

            tbMessage          = new RockTextBox();
            tbMessage.ID       = string.Format("tbTextMessage_{0}", this.ID);
            tbMessage.TextMode = TextBoxMode.MultiLine;
            tbMessage.Rows     = 3;
            tbMessage.Required = true;
            rcwMessage.Controls.Add(tbMessage);
        }
Пример #7
0
        /// <summary>
        /// Creates the HTML controls required to configure this type of field
        /// </summary>
        /// <returns></returns>
        public override List <Control> ConfigurationControls()
        {
            var controls = base.ConfigurationControls();

            var ddl = new RockDropDownList();

            controls.Add(ddl);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += OnQualifierUpdated;

            var definedType = DefinedTypeCache.Read(Rock.SystemGuid.DefinedType.GROUPTYPE_PURPOSE.AsGuid());

            ddl.BindToDefinedType(definedType, true);
            ddl.Label = "Purpose";
            ddl.Help  = "An optional setting to limit the selection of group types to those that have the selected purpose.";

            return(controls);
        }
Пример #8
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            ddlFrom = new RockDropDownList();
            ddlFrom.ID = string.Format( "ddlFrom_{0}", this.ID );
            ddlFrom.Label = "From";
            ddlFrom.Help = "The number to originate message from (configured under Admin Tools > General Settings > Defined Types > SMS From Values).";
            ddlFrom.BindToDefinedType( DefinedTypeCache.Read( new Guid( Rock.SystemGuid.DefinedType.COMMUNICATION_SMS_FROM ) ), false, true );
            Controls.Add( ddlFrom );

            rcwMessage = new RockControlWrapper();
            rcwMessage.ID = string.Format( "rcwMessage_{0}", this.ID );
            rcwMessage.Label = "Message";
            Controls.Add( rcwMessage );

            mfpMessage = new MergeFieldPicker();
            mfpMessage.ID = string.Format( "mfpMergeFields_{0}", this.ID );
            mfpMessage.MergeFields.Clear();
            mfpMessage.MergeFields.Add( "GlobalAttribute" );
            mfpMessage.MergeFields.Add( "Rock.Model.Person" );
            mfpMessage.CssClass += " pull-right margin-b-sm";
            mfpMessage.SelectItem += mfpMergeFields_SelectItem;
            rcwMessage.Controls.Add( mfpMessage );

            tbMessage = new RockTextBox();
            tbMessage.ID = string.Format( "tbTextMessage_{0}", this.ID );
            tbMessage.TextMode = TextBoxMode.MultiLine;
            tbMessage.Rows = 3;
            rcwMessage.Controls.Add( tbMessage );
        }