diff --git a/tine20/HumanResources/Export/Xls.php b/tine20/HumanResources/Export/Xls.php
deleted file mode 100644
index 07626bf447d..00000000000
--- a/tine20/HumanResources/Export/Xls.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- * @copyright Copyright (c) 2013 Metaways Infosystems GmbH (http://www.metaways.de)
- *
- */
-
-/**
- * HumanResources xls generation class
- *
- * @package HumanResources
- * @subpackage Export
- */
-class HumanResources_Export_Xls extends Tinebase_Export_Spreadsheet_Xls
-{
- /**
- * @var string $_applicationName
- */
- protected $_applicationName = 'HumanResources';
-
- /**
- * default export definition name
- *
- * @var string
- */
- protected $_defaultExportname = 'hr_default_xls';
-}
diff --git a/tine20/HumanResources/Export/definitions/hr_default_newcsv.xml b/tine20/HumanResources/Export/definitions/hr_default_newcsv.xml
new file mode 100644
index 00000000000..4f19e90c542
--- /dev/null
+++ b/tine20/HumanResources/Export/definitions/hr_default_newcsv.xml
@@ -0,0 +1,163 @@
+
+
+ HumanResources_Model_Employee
+ hr_default_newcsv
+
+ export
+ Tinebase_Export_CsvNew
+ default csv employee export definition with custom fields
+ true
+ 1
+
+
+ number
+ ASC
+
+
+
+ number
+
+
+
+ account_id
+
+
+
+ description
+
+
+
+ countryname
+
+
+
+ locality
+
+
+
+ postalcode
+
+
+
+ region
+
+
+
+ street
+
+
+
+ street2
+
+
+
+ email
+
+
+
+ tel_home
+
+
+
+ tel_cell
+
+
+
+ title
+
+
+
+ salutation
+
+
+
+ n_family
+
+
+
+ n_given
+
+
+
+ n_fn
+
+
+
+ bday
+
+
+
+ bank_account_holder
+
+
+
+ bank_account_number
+
+
+
+ iban
+
+
+
+ bic
+
+
+
+ bank_name
+
+
+
+ bank_code_number
+
+
+
+ employment_begin
+
+
+
+ employment_end
+
+
+
+ supervisor_id
+
+
+
+ division_id
+
+
+
+ health_insurance
+
+
+
+ profession
+
+
+
+ position
+
+
+
+ created_by
+
+
+
+ creation_time
+
+
+
+ last_modified_by
+
+
+
+ last_modified_time
+
+
+
+ tags
+
+ tags
+
+
+
diff --git a/tine20/HumanResources/Export/definitions/hr_default_xls.xml b/tine20/HumanResources/Export/definitions/hr_default_xls.xml
deleted file mode 100644
index dc08311ef3b..00000000000
--- a/tine20/HumanResources/Export/definitions/hr_default_xls.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
- HumanResources_Model_Employee
- hr_default_xls
- export
- HumanResources_Export_Xls
- default xls employee export definition
-
-
- number
- account_id
- description
- countryname
- locality
- postalcode
- region
- street
- street2
- email
- tel_home
- tel_cell
- title
- salutation
- n_family
- n_given
- n_fn
- bday
- bank_account_holder
- bank_account_number
- bank_name
- bank_code_number
- employment_begin
- employment_end
- supervisor_id
- division_id
- health_insurance
- profession
-
- created_by
-
-
- creation_time
-
-
- last_modified_by
-
-
- last_modified_time
-
-
- tags
- tags
-
-
-
diff --git a/tine20/HumanResources/Export/definitions/hr_xls_current_columns.xml b/tine20/HumanResources/Export/definitions/hr_xls_current_columns.xml
deleted file mode 100644
index ae1dbaeeac6..00000000000
--- a/tine20/HumanResources/Export/definitions/hr_xls_current_columns.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- HumanResources_Model_Employee
- hr_xls_current_columns
-
-
- export
- HumanResources_Export_Xls
- tinebase-action-export-xls
- true
- 600
- multi
- true
-
diff --git a/tine20/HumanResources/translations/de.po b/tine20/HumanResources/translations/de.po
index e5e417ea54b..464af019810 100644
--- a/tine20/HumanResources/translations/de.po
+++ b/tine20/HumanResources/translations/de.po
@@ -260,9 +260,6 @@ msgstr "Nicht erlaubt!"
msgid "It's only allowed to book remaining vacation days from years in the past!"
msgstr "Es ist nur erlaubt, Resturlaub aus vergangenen Jahren zu buchen!"
-msgid "Excel current columns"
-msgstr "Excel angezeigte Spalten"
-
msgid "Monthly Report (Clock Times)"
msgstr "Monatsbericht (Stempelzeiten)"
@@ -1288,3 +1285,6 @@ msgstr "Sonderzahlung"
msgid "[H] Short Business trip"
msgstr "[Z] Kurze Dienstreise"
+
+#~ msgid "Excel current columns"
+#~ msgstr "Excel angezeigte Spalten"
diff --git a/tine20/HumanResources/translations/en.po b/tine20/HumanResources/translations/en.po
index b2eb02cd59b..2e874b8106f 100644
--- a/tine20/HumanResources/translations/en.po
+++ b/tine20/HumanResources/translations/en.po
@@ -245,9 +245,6 @@ msgstr "Not allowed!"
msgid "It's only allowed to book remaining vacation days from years in the past!"
msgstr "It's only allowed to book remaining vacation days from years in the past!"
-msgid "Excel current columns"
-msgstr "Excel current columns"
-
msgid "Monthly Report (Clock Times)"
msgstr "Monthly Report (Clock Times)"
diff --git a/tine20/HumanResources/translations/template.pot b/tine20/HumanResources/translations/template.pot
index b1626e59cb8..40f4d71cc05 100644
--- a/tine20/HumanResources/translations/template.pot
+++ b/tine20/HumanResources/translations/template.pot
@@ -245,9 +245,6 @@ msgstr ""
msgid "It's only allowed to book remaining vacation days from years in the past!"
msgstr ""
-msgid "Excel current columns"
-msgstr ""
-
msgid "Monthly Report (Clock Times)"
msgstr ""
diff --git a/tine20/Tinebase/Export/CsvNew.php b/tine20/Tinebase/Export/CsvNew.php
index 8847d295606..eb34329a0e1 100644
--- a/tine20/Tinebase/Export/CsvNew.php
+++ b/tine20/Tinebase/Export/CsvNew.php
@@ -152,6 +152,27 @@ protected function _startRow()
protected function _endRow()
{
+ if ($this->_config->columns && $this->_config->customFields) {
+ $record = new $this->_modelName(array(), true);
+
+ $this->_fields = $record->getFields();
+ $this->_fields = array_unique(array_merge(
+ array_diff($this->_fields, ['customfields']),
+ array_keys($this->_expandCustomFields)
+ ));
+
+ foreach ($this->_expandCustomFields as $key => $value) {
+ if ($this->_currentRowType === self::ROW_TYPE_GENERIC_HEADER) {
+ $name = $this->_translate->_($value);
+ $this->_writeValue($name);
+ }
+ if ($this->_currentRowType === self::ROW_TYPE_RECORD) {
+ $record = $this->_currentRecord;
+ $this->_writeValue($this->_convertToString($record->{$key}));
+ }
+ }
+ }
+
if (false === self::fputcsv($this->_filehandle, $this->_currentRow, $this->_delimiter, $this->_enclosure,
$this->_escape_char, $this->_charset)) {
throw new Tinebase_Exception_Backend('could not write current row to csv stream');