X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FImport%2FForm%2FPreview.php;h=ddd8c2554d94d3e39e0c775d0e6334569e69ea56;hb=1861d923dd4e29ac945caa98e1efbeda0bb71483;hp=b8a43dde2cb51f90b3b393e0914d43ad68fecf02;hpb=13c1cf91881e22bbcc38024c645736a3fc6fad4a;p=civicrm-core.git diff --git a/CRM/Contribute/Import/Form/Preview.php b/CRM/Contribute/Import/Form/Preview.php index b8a43dde2c..ddd8c2554d 100644 --- a/CRM/Contribute/Import/Form/Preview.php +++ b/CRM/Contribute/Import/Form/Preview.php @@ -1,9 +1,9 @@ controller->exportValue('DataSource', 'skipColumnHeader'); //get the data from the session - $dataValues = $this->get('dataValues'); - $mapper = $this->get('mapper'); - $softCreditFields = $this->get('softCreditFields'); - $invalidRowCount = $this->get('invalidRowCount'); - $conflictRowCount = $this->get('conflictRowCount'); - $mismatchCount = $this->get('unMatchCount'); + $dataValues = $this->get('dataValues'); + $mapper = $this->get('mapper'); + $softCreditFields = $this->get('softCreditFields'); + $mapperSoftCreditType = $this->get('mapperSoftCreditType'); + $invalidRowCount = $this->get('invalidRowCount'); + $conflictRowCount = $this->get('conflictRowCount'); + $mismatchCount = $this->get('unMatchCount'); //get the mapping name displayed if the mappingId is set $mappingId = $this->get('loadMappingId'); @@ -91,6 +92,7 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview { $properties = array( 'mapper', 'softCreditFields', + 'mapperSoftCreditType', 'dataValues', 'columnCount', 'totalRowCount', 'validRowCount', 'invalidRowCount', 'conflictRowCount', @@ -117,6 +119,7 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview { $invalidRowCount = $this->get('invalidRowCount'); $conflictRowCount = $this->get('conflictRowCount'); $onDuplicate = $this->get('onDuplicate'); + $mapperSoftCreditType = $this->get('mapperSoftCreditType'); $config = CRM_Core_Config::singleton(); $seperator = $config->fieldSeparator; @@ -128,15 +131,16 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview { foreach ($mapper as $key => $value) { $mapperKeys[$key] = $mapper[$key][0]; - if (isset($mapper[$key][0]) && $mapper[$key][0] == 'soft_credit') { - $mapperSoftCredit[$key] = $mapper[$key][1]; + if (isset($mapper[$key][0]) && $mapper[$key][0] == 'soft_credit' && isset($mapper[$key])) { + $mapperSoftCredit[$key] = isset($mapper[$key][1]) ? $mapper[$key][1] : ''; + $mapperSoftCreditType[$key] = $mapperSoftCreditType[$key]['value']; } else { - $mapperSoftCredit[$key] = NULL; + $mapperSoftCredit[$key] = $mapperSoftCreditType[$key] = NULL; } } - $parser = new CRM_Contribute_Import_Parser_Contribution($mapperKeys, $mapperSoftCredit, $mapperPhoneType); + $parser = new CRM_Contribute_Import_Parser_Contribution($mapperKeys, $mapperSoftCredit, $mapperPhoneType, $mapperSoftCreditType); $mapFields = $this->get('fields');