if (isset($mapperKeys[$i][0]) && $mapperKeys[$i][0] == 'soft_credit') {
$mapperSoftCredit[$i] = $mapperKeys[$i][1];
if (strpos($mapperSoftCredit[$i], '_') !== FALSE) {
- list($first, $second) = explode('_', $mapperSoftCredit[$i]);
+ [$first, $second] = explode('_', $mapperSoftCredit[$i]);
$softCreditFields[$i] = ucwords($first . " " . $second);
}
else {
* @throws \API_Exception
*/
public static function convertMappingFieldLabelsToNames(): bool {
+ // Contribution fields....
$mappings = MappingField::get(FALSE)
->setSelect(['id', 'name'])
->addWhere('mapping_id.mapping_type_id:name', '=', 'Import Contribution')
$fieldMap = [];
foreach ($fields as $fieldName => $field) {
$fieldMap[$field['title']] = $fieldName;
+ if (!empty($field['html']['label'])) {
+ $fieldMap[$field['html']['label']] = $fieldName;
+ }
}
$fieldMap[ts('Soft Credit')] = 'soft_credit';
$fieldMap[ts('Pledge Payment')] = 'pledge_payment';
$fieldMap[ts(ts('Pledge ID'))] = 'pledge_id';
$fieldMap[ts(ts('Financial Type'))] = 'financial_type_id';
$fieldMap[ts(ts('Payment Method'))] = 'payment_instrument_id';
+ $fieldMap[ts('- do not import -')] = 'do_not_import';
foreach ($mappings as $mapping) {
if (!empty($fieldMap[$mapping['name']])) {