Details
-
Type: New Feature
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.1
-
Fix Version/s: 3.1.NYSS
-
Component/s: CiviCase, Core CiviCRM
-
Labels:None
Description
1. Modify schema to allow objects other than contacts to have tags assigned to them
- Replace civicrm_entity_tag.contact_id column with entity_table + entity_id columns
- implement schema change in Upgrade script (contact_id can be renamed to entity_id, and entity_table set to 'civicrm_contact' for all existing rows)
2. Modify existing tag edit, display, and search code to handle schema modification (item #1).
3. Reserved flag for tags
- Add 'Reserved' (is_reserved) boolean property for tags (civicrm_tag table). Default is FALSE.
- Add Reserved display column to administer tags table (checkbox style)
- Add Reserved? checkbox to add/edit tag form.
- Reserved tags can not be edited or deleted (remove those action links)
4. Add 'Hidden' flag for tags
NOTE: NYSS / rayogram will use Hidden tags to store the free tag hierarchies (freetag1 and freetag2 as parent hierarchies).
- Add 'Hidden' (is_hidden) boolean property for tags (civicrm_tag table). Default is FALSE.
- Add 'Hidden' display column to administer tags table (checkbox style)
- Add 'Hidden?' checkbox to add/edit tag form.
NOTE: Child tags are automatically flagged as Hidden if their parent is hidden. The checkbox is frozen for this condition.
- Introduce a permission called "access hidden tags" to allow certain users to see hidden tags when editing tags in the admin UI (Administer >> Option Lists >> Tags).
- Hidden tags are not shown in the admin UI unless the user has 'access hidden tags' permission.
- Hidden tags are never shown in built-in tag assignment (selection) lists.
5. Allow admins to associate tags with one, multiple or any object types (i.e. this tag is used for cases, activities, contacts, any supported/taggable object).
Tag-related fields should ONLY be visible in the Activity and Case 'create/edit/view/search' interfaces IF tags exist that are 'Used For' that type of object. If no tags have 'Activities' or 'Any' as 'Used For' properties - tag fields should not appear in activity forms, display pages or search interface.
- Add a 'Used for' property for tags (civicrm_tag.used_for). Default is NULL which means 'any' type of object. This column can store any subset/combination of supported values as a Ctrl+A delimited list of strings. The string values will be the table names of the used for objects (e.g. 'Ctrl+Acivicrm_activityCtrl+Acivicrm_caseCtrl+A'). They will be keys into option_value rows in a new option group (see next bullet)
- Create a new 'option_group' for 'tag_used_for' option values. Option values in this group will store the currently supported 'used for' options ... e.g.
- option_value.value = 'civicrm_contact, option_value.label = 'Contacts', option_value.name = 'Contacts'
- option_value.value = 'civicrm_activity, option_value.label = 'Activities', option_value.name = 'Activities'
- option_value.value = 'civicrm_case, option_value.label = 'Cases', option_value.name = 'Cases'
- Add 'Used For' display column to administer tags table (displaying option_value.label's)
- Add 'Used For' multiselect field to add / edit tag form
NOTE: I don't think 'Used For' should be editable for child tags (i.e. tags that have a parent). Rather they should inherit their parent's Used For value. Let me know if you can think of a use case which breaks this rule.
6. Add tag input and display support to create/edit/view Activity and Case screens
6.1 Activities
- Add / edit activity form: IF there are tags which can be 'used for' Activities, then include tag assignment field to this form below 'Priority' field.
NOTE: Rayogram may be committing an alternate tag assignment widget - use that if available. Else use the existing multi-select listing box UI (div with list of checkboxes as used in Edit Contact). - View activity page: IF tag(s) are assigned to this activity, display list of assigned tags (after Priority field).
6.2 Cases
For cases, tag assignment will be done via extended activity forms.
- IF there are tags which can be 'used for' Cases, add a tag assignment field to 'Open Case' activity form below Duration field, and add postProcess code to handle tag assignment.
- Show case tags on Manage Case screen and "Edit" link next to it. When you click Edit we should give dialog with tags. If user clicks save update tags and create new activity of type "Change Case Tags".
- View 'case activity' pop-up (dialog) should include Tags display when viewing Open Case and "Change Case Tags" activities.
7. API / AJAX interface for tags
- Extend api/v2/Tag.php and api/v2/EntityTag.php to include hidden and reserved properties.
- Add ajax callbacks that can be used by the rendered html to add/edit/delete tags and entity tags
8. Add Tags to Case and Activity (component) Search
- Case and activity searches include tags select fields in their 'component' search interfaces IF there are tags available for them.
NOTE: For activities this affects Adv Search only if we're NOT merging inCRM-5803to this release.
7. Advanced Search
- Tag select (search criteria) field is present in main search criteria block (as currently) IF there are tags available to 'Contacts'. This search criteria is used to search for tagged contacts (as currently).
- Tag select (search criteria) field is present in Activities pane IF there are tags available to 'Activities'. This search criteria is used to search for tagged Activities.
- Tag select (search criteria) field is present in Cases pane IF there are tags available to 'Cases' This search criteria is used to search for tagged Cases.
NOTE: We assume NYSS will be responsible for introducing the free tagging elements into the search and edit interfaces.