Type: New Feature
Affects Version/s: None
Fix Version/s: 1.1
We've received several requests to allow the creation of 'custom' activity types by CiviCRM Admins. These will be stored in a generic civicrm_activity table. All custom activities will have the same properties - but will be assigned an activity_type from an admin-configurable list of Custom Activity Types (similar to Location Types).
We also realized that all activities could be more useful if the 'target' object did not have to be a contact. So we need to modify the data structure for civicrm_phonecall and _meeting - changing the target_contact_id to target_entity_id. For 1.1, the UI will only support the current use case (entity_table = contact). But these mods will allow us to easily link meetings, calls, etc to a Group or a Relationship or other object types.
1. Modify schema/class properties for civicrm_phonecall and civicrm_meeting.
1.1 Replace target_contact_id with target_entity_id + target_entity_table in schema
1.2 For this version, set default target_entity_table to contact. As such, all forms/inserts/selects/etc. should 'behave' as they do now (i.e. we will only support create/view phonecalls/meetings for contacts).
2. Create new class/table for Activity Type and Admin UI for this set of values
2.1 Create schema for civicrm_activity_type (exactly the same as civicrm_location_type)
2.2 Create Admin tab with Page and Form to view/add/edit/disable Activity Types (again, clone Admin Location Type)
3. Create new class/table for generic (custom) activities: civicrm_activity
3.1 Schema - clone of civicrm_meeting except:
- replace target_contact_id w/ target_entity_table + target_entity_id
- add activity_type - int - FK to civicrm_activity_type.id
3.2 Add new link on contact/view - 'Other Activities'. Links to add form (3.3 below). This link can be placed in a <div> below the 'Send an Email; Schedule a Meeting' etc.
3.3 Create Add/Edit form for this class. Activity Type is <select> drop-down (option value = activity_type.name). Would be ideal to display the corresponding activity_type.description value as a 'frozen' field value next to the <select> control. See if we can use QF hierarchical select with the description element 'frozen' to accomplish this (else, we'll just have the activity_type.name).
3.4 When status is completed, insert activity_history record with associated activity_type value (as we do for meeting and phone call).
3.5 Scheduled (not yet completed) civicrm_activity records show up in Open Activities selector.