systopia / de.systopia.xcm

CiviCRM Extended Contact Matcher
Other
5 stars 10 forks source link

Provide option to fill multi-value field values. #18

Closed jensschuppe closed 6 years ago

jensschuppe commented 6 years ago

Add a configuration option and functionality for adding values to multi-value fields (core and custom), aka "fill", when there are values already (i.e. the field is not empty).

Values should be added, not synchronized/overwritten with the submitted set of field values.

jensschuppe commented 6 years ago

Added an explicit check for a field being assigned an option group for deciding whether it is multi-value. This makes sure, core fields with multiple values (such as preferred_communication_method) can be handled as well as custom fields.

Also made sure current and submitted field values are arrays before merging them.

@systopia This could use another review.

jensschuppe commented 6 years ago

Now using the field's HTML type for deciding whether it is multi-value (and hard-coded multi-value core fields).

Also, intersecting with the field's allowed option values for storing them in the correct order, as otherwise they might not be displayed correctly e.g. on the contact summary.