Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 1.9
-
Component/s: CiviMail, Core CiviCRM
-
Labels:None
Description
Rationale
=======
Groups can be used for Mailing Lists, Access Control, and other general segmentation purposes. Currently, all groups are shown in all views and workflows. We need to allow users to assign type(s) to groups - and then filter group listings based on task.
Implementation
============
1. Schema
We'll store "group type" options in civicrm_option_value and then store a delimited list of the assigned group type ID's in a new varchar field in civicrm_group. (Check the implementation of civicrm_preferences.address_options for an existing model of this approach.)
1.1 Add group_type_options varchar(128) to civicrm_group (can be NULL)
1.2 Create this column in 1.8 -> 1.9 upgrade script
1.3 Inserts for civicrm_data.mysql, civicrm_generated.mysql and upgrade script:
- insert into civicrm_option_group - name = 'group_type'
- insert into civicrm_option_value: group_type, label = "Mailing List", value = 1, is_reserved = 1
- insert into civicrm_option_value: group_type, label = "Access Control", value = 2, is_reserved = 1
2. Add Group / Edit Group Settings
Add checkbox field to this form for "Type" (linked to option_values where option_group.name = 'group_type')
3. Manage Groups
Add sortable "Type" column to selector.
NOTE: Refer to CRM-2264 for additional changes to Manage Groups screen.
— removed this feature for now - no use case for other Group Types at this time --------------
4. Admin / Option Lists
Add menu item and implement option value listing/editing for "Group Types"
-------------------------------------------------------------------------------------------------------------------------
5. Access Control -> Assign Users to Roles (ACL/Form/EntityRole)
Filter entity_id (Assigned To) select options to only show groups where group_type_options contains 2 (i.e. where group types include "Access Control")
6. Send Mailing -> Select Recipients (wizard step 2)
Filter __includeGroups[] select options to only show groups where group_type_options contains 1 (i.e. "Mailing Lists").
NOTE: For now, let's NOT filter the Exclude Groups select - as these are NOT necessarily mailing lists.