/** * Process the uploaded file * * @return void * @access public */ public function postProcess() { $this->controller->resetPage('MapField'); $fileName = $this->controller->exportValue($this->_name, 'uploadFile'); $skipColumnHeader = $this->controller->exportValue($this->_name, 'skipColumnHeader'); $onDuplicate = $this->controller->exportValue($this->_name, 'onDuplicate'); $contactType = $this->controller->exportValue($this->_name, 'contactType'); $dateFormats = $this->controller->exportValue($this->_name, 'dateFormats'); $savedMapping = $this->controller->exportValue($this->_name, 'savedMapping'); $this->set('onDuplicate', $onDuplicate); $this->set('contactType', $contactType); $this->set('dateFormats', $dateFormats); $this->set('savedMapping', $savedMapping); $session = CRM_Core_Session::singleton(); $session->set("dateTypes", $dateFormats); $config = CRM_Core_Config::singleton(); $seperator = $config->fieldSeparator; $mapper = array(); $parser = new CRM_Contribute_Import_Parser_Contribution($mapper); $parser->setMaxLinesToProcess(100); $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, CRM_Contribute_Import_Parser::MODE_MAPFIELD, $contactType); // add all the necessary variables to the form $parser->set($this); }