$this->assign('highlightedFields', $highlightedFields);
}
+ /**
+ * Should contact fields be filtered which determining fields to show.
+ *
+ * This applies to Contribution import as we put all contact fields in the metadata
+ * but only present those used for a match - but will permit create via LeXIM.
+ *
+ * @return bool
+ */
+ protected function isFilterContactFields() : bool {
+ return TRUE;
+ }
+
/**
* Build the form object.
*
// Duplicates are being skipped so id matching is not available.
continue;
}
+ if (($field['entity'] ?? '') === 'Contact' && $this->isFilterContactFields() && empty($field['match_rule'])) {
+ // Filter out metadata that is intended for create & update - this is not available in the quick-form
+ // but is now loaded in the Parser for the LexIM variant.
+ continue;
+ }
$return[$name] = $field['html']['label'] ?? $field['title'];
}
return $return;
}
+ /**
+ * Should contact fields be filtered which determining fields to show.
+ *
+ * This applies to Contribution import as we put all contact fields in the metadata
+ * but only present those used for a match - but will permit create via LeXIM.
+ *
+ * @return bool
+ */
+ protected function isFilterContactFields() : bool {
+ return FALSE;
+ }
+
/**
* Get the fields available for import selection.
*
$contactFields = $this->getAllContactFields('');
$dedupeFields = $this->getDedupeFields($contactType);
- $contactFieldsForContactLookup = [];
foreach ($dedupeFields as $fieldName => $dedupeField) {
if (!isset($contactFields[$fieldName])) {
continue;
}
- $contactFieldsForContactLookup[$fieldName] = $contactFields[$fieldName];
- $contactFieldsForContactLookup[$fieldName]['title'] . ' ' . ts('(match to contact)');
- $contactFieldsForContactLookup[$fieldName]['entity'] = 'Contact';
+ $contactFields[$fieldName]['title'] . ' ' . ts('(match to contact)');
+ $contactFields[$fieldName]['match_rule'] = $this->getDefaultRuleForContactType($contactType);
}
- $contactFieldsForContactLookup['external_identifier'] = $contactFields['external_identifier'];
- $contactFieldsForContactLookup['external_identifier']['title'] = $contactFields['external_identifier']['title'] . ' ' . ts('(match to contact)');
- return $contactFieldsForContactLookup;
+ $contactFields['external_identifier']['title'] .= ts('(match to contact)');
+ $contactFields['external_identifier']['match_rule'] = '*';
+ return $contactFields;
}
/**