$defaults = [];
$mapperKeys = array_keys($this->_mapperFields);
- $hasHeaders = !empty($this->_columnHeaders);
+ $hasHeaders = $this->getSubmittedValue('skipColumnHeader');
$headerPatterns = $this->getHeaderPatterns();
$dataPatterns = $this->getDataPatterns();
$savedMappingID = $this->getSubmittedValue('savedMapping');
$js .= "swapOptions($formName, 'mapper[$i]', 0, 3, 'hs_mapper_" . $i . "_');\n";
if ($hasHeaders) {
- $defaults["mapper[$i]"] = array($this->defaultFromHeader($this->_columnHeaders[$i], $headerPatterns));
+ $defaults["mapper[$i]"] = array($this->defaultFromHeader($columnHeader, $headerPatterns));
}
else {
$defaults["mapper[$i]"] = array($this->defaultFromData($dataPatterns, $i));
if ($hasHeaders) {
// Infer the default from the skipped headers if we have them
$defaults["mapper[$i]"] = array(
- $this->defaultFromHeader($this->_columnHeaders[$i],
+ $this->defaultFromHeader($columnHeader,
$headerPatterns
),
// $defaultLocationType->id
* The initializer code, called before the processing.
*/
public function init() {
+ unset($this->userJob);
$this->setFieldMetadata();
foreach ($this->importableFieldsMetadata as $name => $field) {
$field['type'] = CRM_Utils_Array::value('type', $field, CRM_Utils_Type::T_INT);