<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview {
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
*
* @return void
- * @access public
*/
public function preProcess() {
$skipColumnHeader = $this->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');
$properties = array(
'mapper', 'softCreditFields',
+ 'mapperSoftCreditType',
'dataValues', 'columnCount',
'totalRowCount', 'validRowCount',
'invalidRowCount', 'conflictRowCount',
* preview the file and extract some summary statistics
*
* @return void
- * @access public
*/
public function postProcess() {
$fileName = $this->controller->exportValue('DataSource', 'uploadFile');
$invalidRowCount = $this->get('invalidRowCount');
$conflictRowCount = $this->get('conflictRowCount');
$onDuplicate = $this->get('onDuplicate');
+ $mapperSoftCreditType = $this->get('mapperSoftCreditType');
$config = CRM_Core_Config::singleton();
$seperator = $config->fieldSeparator;
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');
}
}
}
-