Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-978

Preferred Communication Method : Change from DB ENUM to configurable option values

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: None
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None

      Description

      Currently, civicrm_contact.preferred_communication_method is a DB enum with a fixed set of values. Users have requested the ability to extend this set of values AND would like to store multiple preferrence values for some contacts.

      1. Modify the Contact schema:

      • preferred_communication_method is varchar(255) - so we can store a delimited list of value keys

      2. Add a default set of records which define the options for this field using our new option value data-store:

      • insert into civicrm_option_group (name, description, is_reserved, is_active) values ('preferred_communication_method','Options for contact preferred communications method property.',1,1);
      • insert civicrm_option_value records for each existing ENUM (e.g. 'Phone', 'Email', 'Post', 'SMS', 'Fax')
      • add these inserts to civicrm_data.mysql and civicrm_generated.mysql

      3. Modify Contact Edit form to render the active civicrm_option_value(s) as a checkboxes (replaces the existing select field) - and to save/getdefaults for the new form field/db structure.

      4. Modify contact view to display any checked values for this field.

      5. Make sure field is still importable, exportable.

        Attachments

          Activity

            People

            • Assignee:
              anil Anil Kokitkar
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: