[#4] (wip) Custom field mapping configuration

This commit is contained in:
Jens Schuppe 2019-08-06 13:58:32 +02:00
parent 73481fb7ed
commit b85291527d
5 changed files with 118 additions and 6 deletions

View file

@ -76,7 +76,8 @@ class CRM_Twingle_Profile {
public function getCustomFieldMapping() {
$custom_field_mapping = array();
if (!empty($custom_field_definition = $this->getAttribute('custom_field_mapping'))) {
foreach (preg_split('/\r\n|\r|\n/', $custom_field_definition, -1, PREG_SPLIT_NO_EMPTY) as $twingle_field_name => $custom_field_name) {
foreach (preg_split('/\r\n|\r|\n/', $custom_field_definition, -1, PREG_SPLIT_NO_EMPTY) as $custom_field_map) {
list($twingle_field_name, $custom_field_name) = explode("=", $custom_field_map);
$custom_field_mapping[$twingle_field_name] = $custom_field_name;
}
}