$uploadedFile = $filesystem->uploadFile('import_file'); $options = array("replace_existing" => $replaceUsers, "date_format" => $importForm->exportValue('date_format'), "replace_assignments" => $importForm->exportValue('replace_assignments')); $importer = EfrontImportFactory::factory("csv", $uploadedFile, $options); $importType = $importForm->exportValue('import_type'); if ($importType == "anything") { $import_types = $import_export_types; unset($import_types['anything']); if (G_VERSIONTYPE == 'enterprise') { #cpp#ifdef ENTERPRISE $import_types['employees'] = 1; } #cpp#endif $log = array("success" => array(), "failure" => array()); foreach ($import_types as $import_type => $import_name) { $templog = $importer->import($import_type); $headerType = EfrontImport::getImportTypeName($import_type); if ($headerType) { $import_header = "<u>" . _IMPORTRESULTSFOR . " " . $headerType . "</u>"; if (!empty($templog["success"])) { array_unshift($templog["success"], $import_header); } else { $templog["success"] = array($import_header); } $log["success"] = array_merge($log["success"], $templog["success"]); if (!empty($templog["failure"])) { array_unshift($templog["failure"], $import_header); } else { $templog["failure"] = array($import_header); } $log["failure"] = array_merge($log["failure"], $templog["failure"]); }