Participant import fix - broken uniqueName fields, mapping saving, event_id
[civicrm-core.git] / CRM / Event / Import / Form / Preview.php
index d287c1528b519c2ba71cce65be98a10ce13915ee..3912762f72b73fbe19e51a760a3c58b1d617e7d4 100644 (file)
  */
 class CRM_Event_Import_Form_Preview extends CRM_Import_Form_Preview {
 
-  /**
-   * Process the mapped fields and map it into the uploaded file
-   * preview the file and extract some summary statistics
-   *
-   * @return void
-   */
-  public function postProcess() {
-    $fileName = $this->controller->exportValue('DataSource', 'uploadFile');
-    $separator = $this->controller->exportValue('DataSource', 'fieldSeparator');
-    $invalidRowCount = $this->get('invalidRowCount');
-    $onDuplicate = $this->get('onDuplicate');
-
-    $mapper = $this->controller->exportValue('MapField', 'mapper');
-    $mapperKeys = [];
-
-    foreach ($mapper as $key => $value) {
-      $mapperKeys[$key] = $mapper[$key][0];
-    }
-
-    $parser = new CRM_Event_Import_Parser_Participant($mapperKeys);
-    $parser->setUserJobID($this->getUserJobID());
-    $mapFields = $this->get('fields');
-
-    foreach ($mapper as $key => $value) {
-      $header = [];
-      if (isset($mapFields[$mapper[$key][0]])) {
-        $header[] = $mapFields[$mapper[$key][0]];
-      }
-      $mapperFields[] = implode(' - ', $header);
-    }
-    $parser->run($fileName, $separator,
-      $mapperFields,
-      $this->getSubmittedValue('skipColumnHeader'),
-      CRM_Import_Parser::MODE_IMPORT
-    );
-
-    // add all the necessary variables to the form
-    $parser->set($this, CRM_Import_Parser::MODE_IMPORT);
-  }
-
   /**
    * @return CRM_Event_Import_Parser_Participant
    */