From f040b28f58f43c2b89eb54117b4fd6b6ddc3fecb Mon Sep 17 00:00:00 2001 From: Marcus Schwemer Date: Thu, 20 Feb 2025 10:37:20 +0100 Subject: [PATCH] [TASK] Use phpspreadsheet consistently - raise version numbers - suggest the direct use of `phpoffice/phpspreadsheet` via composer - suggest `EXT:base_excel` for legacy installations - test for class existence of PhpSpreadSheet Related: in2code-de/powermail#1214 Related: in2code-de/powermail#1208 --- Classes/Controller/AbstractController.php | 3 +-- Documentation/Index.md | 10 ++++++---- composer.json | 4 ++-- ext_emconf.php | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index c49934a07..6017ee3fe 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -16,7 +16,6 @@ use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException; use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException; use TYPO3\CMS\Core\EventDispatcher\EventDispatcher; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException; @@ -110,7 +109,7 @@ public function __construct( $this->uploadService = $uploadService; $this->eventDispatcher = $eventDispatcher; - $this->isPhpSpreadsheetInstalled = ExtensionManagementUtility::isLoaded('base_excel'); + $this->isPhpSpreadsheetInstalled = class_exists(\PhpOffice\PhpSpreadsheet\IOFactory::class); } /** diff --git a/Documentation/Index.md b/Documentation/Index.md index ea9a6a703..22f954875 100644 --- a/Documentation/Index.md +++ b/Documentation/Index.md @@ -17,11 +17,13 @@ look at the final output in the frontend. Some basic points: - Main features of this mailform extension is to store the mails into - the database. Export it from the backend module (xls, csv) or list the + the database. + +- Export it from the backend module (xls, csv) or list the values in the frontend again (Pi2). XLS export in the backend is only - possible if the extension *jambagecom/base-excel* is installed. In - classic installation, a phar file for phpspreadsheet must be manually - created (See docs of EXT:base_excel). + possible for classic installation, if a phar file for phpspreadsheet is manually + created (See docs of EXT:base_excel). In composer-based installation the neccessary + package is installed automatically. - Powermail send one or more mails to a static receiver or to dynamic receivers or to a whole Frontend-User Group. diff --git a/composer.json b/composer.json index 793748241..2322eb218 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,8 @@ "ext-curl": "*" }, "suggest": { - "sjbr/static-info-tables": "*", - "jambagecom/base-excel": "^v1.29.0" + "sjbr/static-info-tables": "Provides country information for the country field", + "phpoffice/phpspreadsheet": "Enables xlsx export via the powermail module" }, "replace": { "typo3-ter/powermail": "self.version" diff --git a/ext_emconf.php b/ext_emconf.php index c1168d971..c3eb9f224 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -19,6 +19,7 @@ 'conflicts' => [ ], 'suggests' => [ + 'base_excel' => '', 'static_info_tables' => '' ], ],