Esempio n. 1
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        /// <param name="parentControl">The parent control.</param>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField parentControl)
        {
            // Define Control: Group Member Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = parentControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Has Group Memberships in this Data View";
            ddlDataView.Help  = "A Group Member Data View that provides the set of possible Group Members.";
            parentControl.Controls.Add(ddlDataView);

            var ddlCompare = ComparisonHelper.ComparisonControl(CountComparisonTypesSpecifier, false);

            ddlCompare.Label = "where the number of matching Group Memberships is";
            ddlCompare.ID    = parentControl.GetChildControlInstanceName(_CtlComparison);
            ddlCompare.AddCssClass("js-filter-compare");
            parentControl.Controls.Add(ddlCompare);

            var nbCount = new NumberBox();

            nbCount.Label = "&nbsp;";
            nbCount.ID    = parentControl.GetChildControlInstanceName(_CtlMemberCount);
            nbCount.AddCssClass("js-filter-control js-member-count");
            nbCount.FieldName = "Membership Count";
            parentControl.Controls.Add(nbCount);

            // Populate the Data View Picker
            ddlDataView.EntityTypeId = EntityTypeCache.Read(typeof(Rock.Model.GroupMember)).Id;

            return(new Control[] { ddlDataView, ddlCompare, nbCount });
        }
Esempio n. 2
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="parentControl"></param>
        /// <returns></returns>
        public override System.Web.UI.Control[] CreateChildControls(System.Web.UI.Control parentControl)
        {
            // Define Control: Person Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Rock.Model.Person)).Id;

            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = string.Format("{0}_ddlDataView", parentControl.ID);
            ddlDataView.Label = "Candidate Data View";
            ddlDataView.Help  = "The Data View that returns the set of people from which participation in the Group is measured.";

            parentControl.Controls.Add(ddlDataView);

            ddlDataView.EntityTypeId = entityTypeId;

            RockDropDownList ddlFormat = new RockDropDownList();

            ddlFormat.ID    = string.Format("{0}_ddlFormat", parentControl.ID);
            ddlFormat.Label = "Measure Type";
            ddlFormat.Items.Add(new ListItem("Number of Participants in Group", MeasureTypeSpecifier.NumberOfParticipants.ToString()));
            ddlFormat.Items.Add(new ListItem("Participation Rate of Group", MeasureTypeSpecifier.ParticipationRateOfGroup.ToString()));
            ddlFormat.Items.Add(new ListItem("Participation Rate of Candidates", MeasureTypeSpecifier.ParticipationRateOfCandidates.ToString()));
            parentControl.Controls.Add(ddlFormat);

            return(new System.Web.UI.Control[] { ddlDataView, ddlFormat });
        }
Esempio n. 3
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="parentControl"></param>
        /// <returns></returns>
        public override Control[] CreateChildControls(Control parentControl)
        {
            // Define Control: Output Format DropDown List
            var ddlFormat = new RockDropDownList();

            ddlFormat.ID    = parentControl.GetChildControlInstanceName(_CtlFormat);
            ddlFormat.Label = "Output Format";
            ddlFormat.Help  = "Specifies the content and format of the values in this field.";
            ddlFormat.Items.Add(new ListItem("Group List: Name And Role", ListFormatSpecifier.GroupAndRole.ToString()));
            ddlFormat.Items.Add(new ListItem("Group List: Group Name", ListFormatSpecifier.GroupOnly.ToString()));
            ddlFormat.Items.Add(new ListItem("Yes/No: Yes if any participation", ListFormatSpecifier.YesNo.ToString()));

            parentControl.Controls.Add(ddlFormat);

            // Define Control: Group Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = parentControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Participates in Groups";
            ddlDataView.Help  = "A Data View that filters the Groups included in the result. If no value is selected, any Groups that would be visible in a Group List will be included.";
            parentControl.Controls.Add(ddlDataView);

            // Define Control: Role Type DropDown List
            var ddlRoleType = new RockDropDownList();

            ddlRoleType.ID    = parentControl.GetChildControlInstanceName(_CtlRoleType);
            ddlRoleType.Label = "with Group Member Type";
            ddlRoleType.Help  = "Specifies the type of Group Role the Member must have to be included in the result. If no value is selected, Members in any Role will be included.";
            ddlRoleType.Items.Add(new ListItem(string.Empty, RoleTypeSpecifier.Any.ToString()));
            ddlRoleType.Items.Add(new ListItem("Leader", RoleTypeSpecifier.Leader.ToString()));
            ddlRoleType.Items.Add(new ListItem("Member", RoleTypeSpecifier.Member.ToString()));
            parentControl.Controls.Add(ddlRoleType);

            // Define Control: Group Member Status DropDown List
            var ddlGroupMemberStatus = new RockDropDownList();

            ddlGroupMemberStatus.CssClass = "js-group-member-status";
            ddlGroupMemberStatus.ID       = parentControl.GetChildControlInstanceName(_CtlGroupStatus);
            ddlGroupMemberStatus.Label    = "with Group Member Status";
            ddlGroupMemberStatus.Help     = "Specifies the Status the Member must have to be included in the result. If no value is selected, Members of any Group Status will be shown.";
            ddlGroupMemberStatus.BindToEnum <GroupMemberStatus>(true);
            ddlGroupMemberStatus.SetValue(GroupMemberStatus.Active.ConvertToInt());
            parentControl.Controls.Add(ddlGroupMemberStatus);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Model.Group)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView, ddlRoleType, ddlFormat, ddlGroupMemberStatus });
        }
Esempio n. 4
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="parentControl"></param>
        /// <returns></returns>
        public override Control[] CreateChildControls(Control parentControl)
        {
            // Define Control: Output Format DropDown List
            var ddlFormat = new RockDropDownList();

            ddlFormat.ID    = parentControl.GetChildControlInstanceName(_CtlFormat);
            ddlFormat.Label = "Output Format";
            ddlFormat.Help  = "Specifies the content and format of the items in this field.";
            ddlFormat.Items.Add(new ListItem("First Name/Last Name/Role", ListFormatSpecifier.FirstNameLastNameRole.ToString()));
            ddlFormat.Items.Add(new ListItem("First Name/Last Name", ListFormatSpecifier.FirstNameLastName.ToString()));

            parentControl.Controls.Add(ddlFormat);

            // Define Control: Group Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = parentControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Exists in this Person Data View";
            ddlDataView.Help  = "A Data View that filters the people included in the result. If no value is selected, all Group Members will be included.";
            parentControl.Controls.Add(ddlDataView);

            // Define Control: Role Type DropDown List
            var ddlRoleType = new RockDropDownList();

            ddlRoleType.ID    = parentControl.GetChildControlInstanceName(_CtlRoleType);
            ddlRoleType.Label = "with Group Role Type";
            ddlRoleType.Help  = "Specifies the type of Group Role the Member must have to be included in the result. If no value is selected, Members in every Role will be shown.";
            ddlRoleType.Items.Add(new ListItem(string.Empty, RoleTypeSpecifier.Any.ToString()));
            ddlRoleType.Items.Add(new ListItem("Leader", RoleTypeSpecifier.Leader.ToString()));
            ddlRoleType.Items.Add(new ListItem("Member", RoleTypeSpecifier.Member.ToString()));
            parentControl.Controls.Add(ddlRoleType);

            // Define Control: Group Member Status DropDown List
            var ddlGroupMemberStatus = new RockDropDownList();

            ddlGroupMemberStatus.CssClass = "js-group-member-status";
            ddlGroupMemberStatus.ID       = parentControl.GetChildControlInstanceName(_CtlGroupStatus);
            ddlGroupMemberStatus.Label    = "with Group Member Status";
            ddlGroupMemberStatus.Help     = "Specifies the Status the Member must have to be included in the result. If no value is selected, Members of every Group Status will be shown.";
            ddlGroupMemberStatus.BindToEnum <GroupMemberStatus>(true);
            ddlGroupMemberStatus.SetValue(GroupMemberStatus.Active.ConvertToInt());
            parentControl.Controls.Add(ddlGroupMemberStatus);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Model.Person)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView, ddlRoleType, ddlFormat, ddlGroupMemberStatus });
        }
Esempio n. 5
0
        /// <summary>
        /// Creates the model representation of the child controls used to display and edit the filter settings.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="filterControl">The control that serves as the container for the filter controls.</param>
        /// <returns>
        /// The array of new controls created to implement the filter.
        /// </returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            // Define Control: Person Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = filterControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Represents People from this Data View";
            ddlDataView.Help  = "A Person Data View that represents the set of possible Group Members.";
            filterControl.Controls.Add(ddlDataView);

            // Populate the Data View Picker
            ddlDataView.EntityTypeId = EntityTypeCache.Read(typeof(Rock.Model.Person)).Id;

            return(new Control[] { ddlDataView });
        }
Esempio n. 6
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            int entityTypeId = EntityTypeCache.Read(entityType).Id;

            var ddlDataViews = new DataViewPicker();

            ddlDataViews.ID = filterControl.ID + "_0";
            filterControl.Controls.Add(ddlDataViews);

            ddlDataViews.EntityTypeId = entityTypeId;


            return(new Control[1] {
                ddlDataViews
            });
        }
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        /// <param name="filterControl">The control that serves as the container for the filter controls.</param>
        /// <returns>
        /// The array of new controls created to implement the filter.
        /// </returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = filterControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Has a Person in this Data View";
            ddlDataView.Help  = "A Data View that provides the set of Person to match.";

            filterControl.Controls.Add(ddlDataView);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Model.FinancialTransaction)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView });
        }
Esempio n. 8
0
        /// <summary>
        /// Creates the model representation of the child controls used to display and edit the filter settings.
        /// Implement this version of CreateChildControls if your DataFilterComponent works the same in all filter modes
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="filterControl">The control that serves as the container for the filter controls.</param>
        /// <returns>
        /// The array of new controls created to implement the filter.
        /// </returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            // Define Control: Group Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = filterControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Is Member of Group from Data View";
            ddlDataView.Help  = "A Data View that filters the Groups included in the result. If no value is selected, any Groups that would be visible in a Group List will be included.";
            filterControl.Controls.Add(ddlDataView);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Model.Group)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView });
        }
        /// <summary>
        /// Creates the model representation of the child controls used to display and edit the filter settings.
        /// Implement this version of CreateChildControls if your DataFilterComponent works the same in all filter modes
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="filterControl">The control that serves as the container for the filter controls.</param>
        /// <returns>
        /// The array of new controls created to implement the filter.
        /// </returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            // Define Control: History Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = filterControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Connected to History Records";
            ddlDataView.Help  = "A Data View that provides the set of History items to which the Person may be connected, either because the history is attached to their record or it affected them in some way.";

            filterControl.Controls.Add(ddlDataView);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(History)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView });
        }
Esempio n. 10
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            // Define Control: Person Device Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = filterControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "In Personal Device DataView";
            ddlDataView.Help  = "A Personal Device Data View that provides the set of possible people with personal devices.";

            filterControl.Controls.Add(ddlDataView);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Model.PersonalDevice)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView });
        }
Esempio n. 11
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        /// <param name="filterControl">The control that serves as the container for the filter controls.</param>
        /// <returns>
        /// The array of new controls created to implement the filter.
        /// </returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            // Define Control: History Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = filterControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Has a Group Type in this Data View";
            ddlDataView.Help  = "A Data View that provides the set of Group Types to match.";

            filterControl.Controls.Add(ddlDataView);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(GroupType)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView });
        }
Esempio n. 12
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            // Define Control: History Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = filterControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "In User Login DataView";
            ddlDataView.Help  = "A User Login Data View that provides the set of possible users.";

            filterControl.Controls.Add(ddlDataView);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Model.UserLogin)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView });
        }
Esempio n. 13
0
        //private const string _CtlGroupStatus = "ddlGroupStatus";

        public override Control[] CreateChildControls(Control parentControl)
        {
            // Define Control: Output Format DropDown List
            //var ddlFormat = new RockDropDownList();
            //ddlFormat.ID = GetControlInstanceName(parentControl, _CtlFormat);
            //ddlFormat.Label = "Output Format";
            //ddlFormat.Help = "Specifies the content and format of the items in this field.";
            //ddlFormat.Items.Add( new ListItem( "Group Name And Role", ListFormatSpecifier.GroupAndRole.ToString() ) );
            //ddlFormat.Items.Add( new ListItem( "Group Name", ListFormatSpecifier.GroupOnly.ToString() ) );
            //parentControl.Controls.Add( ddlFormat );

            // Define Control: Location Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = parentControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Found in Locations";
            ddlDataView.Help  = "A Data View that filters the Locations included in the result. If no value is selected, all Named Locations will be included.";

            parentControl.Controls.Add(ddlDataView);

            // Define Control: Location Type DropDown List
            var ddlLocationType = new RockDropDownList();

            ddlLocationType.ID    = parentControl.GetChildControlInstanceName(_CtlLocationType);
            ddlLocationType.Label = "Address Type";
            ddlLocationType.Help  = "Specifies the type of Address to use as the Person's Location. If no value is selected, all of a Person's Addresses will be considered.";

            foreach (var value in DefinedTypeCache.Read(DefinedType.GROUP_LOCATION_TYPE.AsGuid()).DefinedValues.OrderBy(a => a.Order).ThenBy(a => a.Value))
            {
                ddlLocationType.Items.Add(new ListItem(value.Value, value.Guid.ToString()));
            }

            ddlLocationType.Items.Insert(0, None.ListItem);

            parentControl.Controls.Add(ddlLocationType);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Location)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView, ddlLocationType });
        }
Esempio n. 14
0
        /// <summary>
        /// Creates the model representation of the child controls used to display and edit the filter settings.
        /// Implement this version of CreateChildControls if your DataFilterComponent works the same in all filter modes
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="filterControl">The control that serves as the container for the filter controls.</param>
        /// <returns>
        /// The array of new controls created to implement the filter.
        /// </returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            // Define Control: Group Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = filterControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Is Member of Group from Data View";
            ddlDataView.Help  = "A Data View that filters the Groups included in the result. If no value is selected, any Groups that would be visible in a Group List will be included.";
            filterControl.Controls.Add(ddlDataView);

            // Define Control: Group Member Status DropDown List
            var ddlGroupMemberStatus = new RockDropDownList();

            ddlGroupMemberStatus.CssClass = "js-group-member-status";
            ddlGroupMemberStatus.ID       = filterControl.GetChildControlInstanceName(_CtlGroupStatus);
            ddlGroupMemberStatus.Label    = "with Group Member Status";
            ddlGroupMemberStatus.Help     = "Specifies the Status the Member must have to be included in the result. If no value is selected, Members of every Group Status will be shown.";
            ddlGroupMemberStatus.BindToEnum <GroupMemberStatus>(true);
            ddlGroupMemberStatus.SetValue(GroupMemberStatus.Active.ConvertToInt());
            filterControl.Controls.Add(ddlGroupMemberStatus);

            // Define Control: Role Type DropDown List
            var ddlRoleType = new RockDropDownList();

            ddlRoleType.ID    = filterControl.GetChildControlInstanceName(_CtlRoleType);
            ddlRoleType.Label = "with Group Role Type";
            ddlRoleType.Help  = "Specifies the type of Group Role the Member must have to be included in the result. If no value is selected, Members in every Role will be shown.";
            ddlRoleType.Items.Add(new ListItem(string.Empty, RoleTypeSpecifier.Any.ToString()));
            ddlRoleType.Items.Add(new ListItem("Leader", RoleTypeSpecifier.Leader.ToString()));
            ddlRoleType.Items.Add(new ListItem("Member", RoleTypeSpecifier.Member.ToString()));
            filterControl.Controls.Add(ddlRoleType);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Model.Group)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView, ddlGroupMemberStatus, ddlRoleType });
        }
Esempio n. 15
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        /// <param name="parentControl">The parent control.</param>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField parentControl)
        {
            // Define Control: Location Data View Picker
            var ddlDataView = new DataViewPicker();

            ddlDataView.ID    = parentControl.GetChildControlInstanceName(_CtlDataView);
            ddlDataView.Label = "Connected to Locations";
            ddlDataView.Help  = "A Data View that provides the list of Locations to which the Person may be connected.";

            parentControl.Controls.Add(ddlDataView);

            // Define Control: Location Type DropDown List
            var ddlLocationType = new RockDropDownList();

            ddlLocationType.ID    = parentControl.GetChildControlInstanceName(_CtlLocationType);
            ddlLocationType.Label = "Address Type";
            ddlLocationType.Help  = "Specifies the type of Address the filter will be applied to. If no value is selected, all of the Person's Addresses will be considered.";

            var familyLocations = GroupTypeCache.GetFamilyGroupType().LocationTypeValues.OrderBy(a => a.Order).ThenBy(a => a.Value);

            foreach (var value in familyLocations)
            {
                ddlLocationType.Items.Add(new ListItem(value.Value, value.Guid.ToString()));
            }

            ddlLocationType.Items.Insert(0, None.ListItem);

            parentControl.Controls.Add(ddlLocationType);

            // Populate the Data View Picker
            int entityTypeId = EntityTypeCache.Read(typeof(Location)).Id;

            ddlDataView.EntityTypeId = entityTypeId;

            return(new Control[] { ddlDataView, ddlLocationType });
        }