[FEATURE] Make csv delimiter configurable 15/56415/4
authorGuido Schmechel <littlegee@web.de>
Wed, 21 Mar 2018 20:35:40 +0000 (21:35 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 29 Mar 2018 12:09:21 +0000 (14:09 +0200)
It is now possible to control the delimiter and quote character of the
recordlist csv export.

Resolves: #84517
Releases: master
Change-Id: I47d6f7bbc4dffc83032e096e2e141714edb4e714
Reviewed-on: https://review.typo3.org/56415
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Steffen Frese <steffenf14@gmail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Kevin Appelt <kevin.appelt@icloud.com>
Reviewed-by: Patricia Tiedemann <pixelaeffchen@googlemail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Documentation/Changelog/master/Feature-84517-Recordlist-MakeCsvDelimiterConfigurable.rst [new file with mode: 0644]
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-84517-Recordlist-MakeCsvDelimiterConfigurable.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-84517-Recordlist-MakeCsvDelimiterConfigurable.rst
new file mode 100644 (file)
index 0000000..19bce79
--- /dev/null
@@ -0,0 +1,23 @@
+.. include:: ../../Includes.txt
+
+==============================================================
+Feature: #84517 - Recordlist - Make csv delimiter configurable
+==============================================================
+
+See :issue:`84517`
+
+Description
+===========
+
+Two new Page TSconfig options were added for the DatabaseRecordList:
+
+- `mod.web_list.csvDelimiter = ,` - defines the delimiter between csv values
+- `mod.web_list.csvQuote = "` - defines the quote-character to wrap csv values
+
+
+Impact
+======
+
+It is now possible to control the delimiter and quote-character of the recordlist csv export.
+
+.. index:: Backend
\ No newline at end of file
index 72d5298..e78e611 100644 (file)
@@ -2737,7 +2737,10 @@ class DatabaseRecordList
      */
     public function setCsvRow($csvRow)
     {
-        $this->csvLines[] = CsvUtility::csvValues($csvRow);
+        $csvDelimiter = $this->modTSconfig['properties']['csvDelimiter'] ?? ',';
+        $csvQuote = $this->modTSconfig['properties']['csvQuote'] ?? '"';
+
+        $this->csvLines[] = CsvUtility::csvValues($csvRow, $csvDelimiter, $csvQuote);
     }
 
     /**