$mapper = [];
$mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
$mapperKeysMain = [];
- $mapperLocType = [];
- $mapperPhoneType = [];
for ($i = 0; $i < $this->_columnCount; $i++) {
$mapper[$i] = $this->_mapperFields[$mapperKeys[$i][0]];
$mapperKeysMain[$i] = $mapperKeys[$i][0];
-
- if ((CRM_Utils_Array::value(1, $mapperKeys[$i])) && (is_numeric($mapperKeys[$i][1]))) {
- $mapperLocType[$i] = $mapperKeys[$i][1];
- }
- else {
- $mapperLocType[$i] = NULL;
- }
-
- if ((CRM_Utils_Array::value(2, $mapperKeys[$i])) && (!is_numeric($mapperKeys[$i][2]))) {
- $mapperPhoneType[$i] = $mapperKeys[$i][2];
- }
- else {
- $mapperPhoneType[$i] = NULL;
- }
}
$this->set('mapper', $mapper);
$this->set('savedMapping', $saveMappingFields->mapping_id);
}
- $parser = new CRM_Activity_Import_Parser_Activity($mapperKeysMain, $mapperLocType, $mapperPhoneType);
+ $parser = new CRM_Activity_Import_Parser_Activity($mapperKeysMain);
$parser->run($fileName, $separator, $mapper, $skipColumnHeader,
CRM_Import_Parser::MODE_PREVIEW
);
$mapper = $this->controller->exportValue('MapField', 'mapper');
$mapperKeys = [];
- $mapperLocType = [];
- $mapperPhoneType = [];
foreach ($mapper as $key => $value) {
$mapperKeys[$key] = $mapper[$key][0];
-
- if (!empty($mapper[$key][1]) && is_numeric($mapper[$key][1])) {
- $mapperLocType[$key] = $mapper[$key][1];
- }
- else {
- $mapperLocType[$key] = NULL;
- }
-
- if (!empty($mapper[$key][2]) && (!is_numeric($mapper[$key][2]))) {
- $mapperPhoneType[$key] = $mapper[$key][2];
- }
- else {
- $mapperPhoneType[$key] = NULL;
- }
}
- $parser = new CRM_Activity_Import_Parser_Activity($mapperKeys, $mapperLocType, $mapperPhoneType);
+ $parser = new CRM_Activity_Import_Parser_Activity($mapperKeys);
$mapFields = $this->get('fields');
*
* @param array $mapperKeys
*/
- public function __construct(&$mapperKeys) {
+ public function __construct($mapperKeys) {
parent::__construct();
- $this->_mapperKeys = &$mapperKeys;
+ $this->_mapperKeys = $mapperKeys;
}
/**