diff --git a/Classes/Command/AnalyzeBounceMailCommand.php b/Classes/Command/AnalyzeBounceMailCommand.php
index d88f2d27e..255b31357 100644
--- a/Classes/Command/AnalyzeBounceMailCommand.php
+++ b/Classes/Command/AnalyzeBounceMailCommand.php
@@ -22,7 +22,7 @@ class AnalyzeBounceMailCommand extends Command
/**
* Configure the command by defining the name, options and arguments
*/
- public function configure()
+ public function configure(): void
{
$this->setDescription('This command will get bounce mail from the configured mailbox')
->addOption(
diff --git a/Classes/Command/DirectmailCommand.php b/Classes/Command/DirectmailCommand.php
index 68625f1f8..45778c7f5 100644
--- a/Classes/Command/DirectmailCommand.php
+++ b/Classes/Command/DirectmailCommand.php
@@ -14,7 +14,7 @@ class DirectmailCommand extends Command
/**
* Configure the command by defining the name, options and arguments
*/
- public function configure()
+ public function configure(): void
{
$this->setDescription('This command invokes dmailer in order to process queued messages.');
//$this->setHelp('');
diff --git a/Classes/Command/InvokeMailerEngineCommand.php b/Classes/Command/InvokeMailerEngineCommand.php
index b021655bf..df4684c25 100644
--- a/Classes/Command/InvokeMailerEngineCommand.php
+++ b/Classes/Command/InvokeMailerEngineCommand.php
@@ -41,7 +41,7 @@ class InvokeMailerEngineCommand extends Command
/**
* Configure the command by defining the name, options and arguments
*/
- public function configure()
+ public function configure(): void
{
$this->setDescription('Invoke Mailer Engine of EXT:directmail');
$this->setHelp('
diff --git a/Classes/DirectMailUtility.php b/Classes/DirectMailUtility.php
index c27ce96aa..e15c90b35 100644
--- a/Classes/DirectMailUtility.php
+++ b/Classes/DirectMailUtility.php
@@ -332,7 +332,7 @@ public static function getFullUrlsForDirectMailRecord(array $row): array
$result['plainTextUrl'] = '';
} else {
$urlParts = @parse_url($result['plainTextUrl']);
- if (!$urlParts['scheme']) {
+ if (!($urlParts['scheme'] ?? null)) {
$result['plainTextUrl'] = 'http://' . $result['plainTextUrl'];
}
}
@@ -344,7 +344,7 @@ public static function getFullUrlsForDirectMailRecord(array $row): array
$result['htmlUrl'] = '';
} else {
$urlParts = @parse_url($result['htmlUrl']);
- if (!$urlParts['scheme']) {
+ if (!($urlParts['scheme'] ?? null)) {
$result['htmlUrl'] = 'http://' . $result['htmlUrl'];
}
}
diff --git a/Classes/Dmailer.php b/Classes/Dmailer.php
index 07bd932de..9c1e83be1 100644
--- a/Classes/Dmailer.php
+++ b/Classes/Dmailer.php
@@ -391,6 +391,9 @@ public function sendAdvanced(array $recipientRow, string $tableNameChar): int
$this->theParts['html']['content'] = '';
if ($this->flagHtml && (($recipientRow['module_sys_dmail_html'] ?? false) || $tableNameChar == 'P')) {
+ if(!isset($recipientRow['sys_dmail_categories_list'])){
+ $recipientRow['sys_dmail_categories_list'] = '';
+ }
$tempContentHTML = $this->getBoundaryParts($this->dmailer['boundaryParts_html'], $recipientRow['sys_dmail_categories_list']);
if ($this->mailHasContent) {
$this->theParts['html']['content'] = $this->replaceMailMarkers($tempContentHTML, $recipientRow, $additionalMarkers);
@@ -462,7 +465,7 @@ public function sendSimple(array $recipients): bool
* filters out the elements that are inteded for categories not subscribed to.
*
* @param array $cArray Array of content split by dmail boundary
- * @param string $userCategories The list of categories the user is subscribing to.
+ * @param mixed $userCategories The list of categories the user is subscribing to.
*
* @return string Content of the email, which the recipient subscribed
*/
@@ -475,7 +478,7 @@ protected function getBoundaryParts($cArray, $userCategories): string
$key = substr($cP[0], 1);
$isSubscribed = false;
$cP['mediaList'] = $cP['mediaList'] ?? '';
- if (!$key || ((int)$userCategories == -1)) {
+ if (!$key || ($userCategories === -1)) {
$returnVal .= $cP[1];
//$this->mediaList .= $cP['mediaList'];
if ($cP[1]) {
@@ -685,11 +688,12 @@ public function convertFields(array $recipRow): array
}
// Firstname must be more that 1 character
- $recipRow['firstname'] = trim(strtok(trim($recipRow['name']), ' '));
+ $name = $recipRow['name'] ?? ''; // use empty string if null
+ $recipRow['firstname'] = trim(strtok(trim($name), ' '));
if (strlen($recipRow['firstname']) < 2 || preg_match('|[^[:alnum:]]$|', $recipRow['firstname'])) {
$recipRow['firstname'] = $recipRow['name'];
}
- if (!trim($recipRow['firstname'])) {
+ if (isset($recipRow['firstname']) && !trim($recipRow['firstname'])) {
$recipRow['firstname'] = $recipRow['email'];
}
return $recipRow;
diff --git a/Classes/Hooks/TypoScriptFrontendController.php b/Classes/Hooks/TypoScriptFrontendController.php
index 54b365a43..304900956 100644
--- a/Classes/Hooks/TypoScriptFrontendController.php
+++ b/Classes/Hooks/TypoScriptFrontendController.php
@@ -31,10 +31,10 @@ class TypoScriptFrontendController
* a frontend usergroup is specified in the GET parameters, use this
* group to simulate access to an access protected page with content to be sent
*/
- public function simulateUsergroup($parameters, \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $typoScriptFrontendController)
+ public function simulateUsergroup($parameters, \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $typoScriptFrontendController): void
{
- $directMailFeGroup = (int)GeneralUtility::_GET('dmail_fe_group');
- $accessToken = (string)GeneralUtility::_GET('access_token');
+ $directMailFeGroup = (int)($GLOBALS['TYPO3_REQUEST']->getQueryParams()['dmail_fe_group'] ?? null);
+ $accessToken = (string)($GLOBALS['TYPO3_REQUEST']->getQueryParams()['access_token'] ?? null);
if ($directMailFeGroup > 0 && GeneralUtility::makeInstance(DmRegistryUtility::class)->validateAndRemoveAccessToken($accessToken)) {
/** @var UserAspect $userAspect */
$userAspect = $typoScriptFrontendController->getContext()->getAspect('frontend.user');
diff --git a/Classes/Middleware/JumpurlController.php b/Classes/Middleware/JumpurlController.php
index 088e8e4cc..d31b0f7f7 100644
--- a/Classes/Middleware/JumpurlController.php
+++ b/Classes/Middleware/JumpurlController.php
@@ -28,6 +28,7 @@
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use TYPO3\CMS\Core\Core\Environment;
+use TYPO3\CMS\Core\Crypto\HashService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
@@ -325,7 +326,7 @@ protected function performFeUserAutoLogin()
*/
protected function calculateJumpUrlHash(string $targetUrl): string
{
- return GeneralUtility::hmac($targetUrl, 'jumpurl');
+ return GeneralUtility::makeInstance(HashService::class)->hmac($targetUrl, 'jumpurl');
}
/**
diff --git a/Classes/Module/ConfigurationController.php b/Classes/Module/ConfigurationController.php
index 88a142402..abfc27623 100644
--- a/Classes/Module/ConfigurationController.php
+++ b/Classes/Module/ConfigurationController.php
@@ -8,22 +8,15 @@
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Attribute\Controller;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
-use TYPO3\CMS\Core\Messaging\FlashMessage;
-use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Imaging\IconFactory;
-use DirectMailTeam\DirectMail\Repository\PagesRepository;
-use TYPO3\CMS\Backend\Routing\UriBuilder;
-use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
final class ConfigurationController extends MainController
@@ -83,7 +76,6 @@ public function handleRequest(ServerRequestInterface $request): ResponseInterfac
public function indexAction(ModuleTemplate $view): ResponseInterface
{
// Load JavaScript via PageRenderer
- $this->pageRenderer->loadRequireJs();
$this->pageRenderer->loadJavaScriptModule('@directmailteam/diractmail/Configuration.js');
if (($this->id && $this->access) || ($this->isAdmin() && !$this->id)) {
@@ -138,20 +130,20 @@ public function indexAction(ModuleTemplate $view): ResponseInterface
}
/**
- * @return ResponseFactory
+ * @return ResponseFactoryInterface
*/
protected function getResponseFactory(): ResponseFactoryInterface
{
return GeneralUtility::makeInstance(ResponseFactoryInterface::class);
}
- public function updateConfigAction(ServerRequestInterface $request): ResponseInterface
+ public function updateConfigAction(ServerRequestInterface $request): ?ResponseInterface
{
$this->id = (int)($request->getParsedBody()['uid'] ?? 0);
$permsClause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW);
$pageAccess = BackendUtility::readPageAccess($this->id, $permsClause);
$this->pageinfo = is_array($pageAccess) ? $pageAccess : [];
- $this->access = is_array($this->pageinfo) ? true : false;
+ $this->access = is_array($this->pageinfo);
if (($this->id && $this->access) || ($this->isAdmin() && !$this->id)) {
@@ -192,6 +184,8 @@ public function updateConfigAction(ServerRequestInterface $request): ResponseInt
}
}
+
+ return null;
}
protected function setDefaultValues(): void
diff --git a/Classes/Module/DmailController.php b/Classes/Module/DmailController.php
index a634b7aa1..c5c830a12 100644
--- a/Classes/Module/DmailController.php
+++ b/Classes/Module/DmailController.php
@@ -24,14 +24,15 @@
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
+use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
+use TYPO3\CMS\Backend\Routing\PreviewUriBuilder;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Error\Http\ServiceUnavailableException;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
-use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Http\ImmediateResponseException;
use TYPO3\CMS\Core\Http\Uri;
-use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconSize;
use TYPO3\CMS\Core\Routing\InvalidRouteArgumentsException;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\ArrayUtility;
@@ -41,10 +42,7 @@
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
-use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
-use TYPO3\CMS\Backend\Attribute\Controller;
-// the module template will be initialized in handleRequest()
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Core\Page\PageRenderer;
@@ -125,7 +123,7 @@ public function handleRequest(ServerRequestInterface $request): ResponseInterfac
$permsClause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW);
$pageAccess = BackendUtility::readPageAccess($this->id, $permsClause);
$this->pageinfo = is_array($pageAccess) ? $pageAccess : [];
- $this->access = is_array($this->pageinfo) ? true : false;
+ $this->access = is_array($this->pageinfo);
// get the config from pageTS
$this->params = BackendUtility::getPagesTSconfig($this->id)['mod.']['web_modules.']['dmail.'] ?? [];
@@ -602,7 +600,7 @@ protected function getNewsletterTabIcon(bool $expand = false)
{
// opened - closes
$icon = $expand ? 'apps-pagetree-expand' : 'apps-pagetree-collapse';
- return $this->iconFactory->getIcon($icon, Icon::SIZE_SMALL);
+ return $this->iconFactory->getIcon($icon, IconSize::SMALL);
}
/**
@@ -635,11 +633,11 @@ protected function getNews(): array
$langTitle = (count($languages) > 1 ? ' - ' . $lang['title'] : '');
$plainParams = $this->implodedParams['plainParams'] ?? '' . $langParam;
$htmlParams = $this->implodedParams['HTMLParams'] ?? '' . $langParam;
- $htmlIcon = $this->iconFactory->getIcon('directmail-dmail-preview-html', Icon::SIZE_SMALL, $langIconOverlay);
- $plainIcon = $this->iconFactory->getIcon('directmail-dmail-preview-text', Icon::SIZE_SMALL, $langIconOverlay);
- $createIcon = $this->iconFactory->getIcon('directmail-dmail-new', Icon::SIZE_SMALL, $langIconOverlay);
+ $htmlIcon = $this->iconFactory->getIcon('directmail-dmail-preview-html', IconSize::SMALL, $langIconOverlay);
+ $plainIcon = $this->iconFactory->getIcon('directmail-dmail-preview-text', IconSize::SMALL, $langIconOverlay);
+ $createIcon = $this->iconFactory->getIcon('directmail-dmail-new', IconSize::SMALL, $langIconOverlay);
- $attributes = \TYPO3\CMS\Backend\Routing\PreviewUriBuilder::create($row['uid'], '')
+ $attributes = PreviewUriBuilder::create($row['uid'], '')
->withRootLine(BackendUtility::BEgetRootLine($row['uid']))
//->withSection('')
->withAdditionalQueryParameters($htmlParams)
@@ -654,7 +652,7 @@ protected function getNews(): array
$previewHTMLLink .= '' . $htmlIcon . '';
- $attributes = \TYPO3\CMS\Backend\Routing\PreviewUriBuilder::create($row['uid'], '')
+ $attributes = PreviewUriBuilder::create($row['uid'], '')
->withRootLine(BackendUtility::BEgetRootLine($row['uid']))
//->withSection('')
->withAdditionalQueryParameters($plainParams)
@@ -695,7 +693,7 @@ protected function getNews(): array
$data[] = [
'id' => $row['uid'],
- 'pageIcon' => $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL),
+ 'pageIcon' => $this->iconFactory->getIconForRecord('pages', $row, IconSize::SMALL),
'title' => htmlspecialchars($row['title']),
'createDmailLink' => $createDmailLink,
'createLink' => $createLink,
@@ -800,13 +798,13 @@ protected function getConfigFormDMail(): array
foreach ($rows as $row) {
$data[] = [
'id' => $row['uid'],
- 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL)->render(),
+ 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, IconSize::SMALL)->render(),
'link' => $this->linkDMailRecord($row['uid']),
'linkText' => htmlspecialchars($row['subject'] ?: '_'),
'tstamp' => BackendUtility::date($row['tstamp']),
'issent' => ($row['issent'] ? $this->languageService->sL($this->lllFile . ':dmail_yes') : $this->languageService->sL($this->lllFile . ':dmail_no')),
'renderedsize' => ($row['renderedsize'] ? GeneralUtility::formatSize($row['renderedsize']) : ''),
- 'attachment' => ($row['attachment'] ? $this->iconFactory->getIcon('directmail-attachment', Icon::SIZE_SMALL) : ''),
+ 'attachment' => ($row['attachment'] ? $this->iconFactory->getIcon('directmail-attachment', IconSize::SMALL) : ''),
'type' => ($row['type'] & 0x1 ? $this->languageService->sL($this->lllFile . ':nl_l_tUrl') : $this->languageService->sL($this->lllFile . ':nl_l_tPage')) . ($row['type'] & 0x2 ? ' (' . $this->languageService->sL($this->lllFile . ':nl_l_tDraft') . ')' : ''),
'deleteLink' => $this->deleteLink($row['uid']),
];
@@ -1062,7 +1060,7 @@ protected function renderRecordDetailsTable(array $row): array
];
return [
- 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL),
+ 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, IconSize::SMALL),
'title' => htmlspecialchars($row['subject'] ?? ''),
'theadTitle1' => DirectMailUtility::fName('subject'),
'theadTitle2' => GeneralUtility::fixed_lgd_cs(htmlspecialchars($row['subject'] ?? ''), 60),
@@ -1117,7 +1115,7 @@ protected function getTestMailConfig(): array
$data['test_dmail_group_table'][] = [
'moduleUrl' => $moduleUrl,
- 'iconFactory' => $this->iconFactory->getIconForRecord('sys_dmail_group', $row, Icon::SIZE_SMALL),
+ 'iconFactory' => $this->iconFactory->getIconForRecord('sys_dmail_group', $row, IconSize::SMALL),
'title' => htmlspecialchars($row['title']),
'uid' => $row['uid'],
'tds' => $this->displayMailGroupTest($result),
@@ -1173,7 +1171,7 @@ public function displayMailGroupTest(array $result): array
* @return string Messages if the mail is sent or planned to sent
* @todo remove htmlmail. sending test mail
*/
- protected function sendMail($row)
+ protected function sendMail($row): void
{
// Preparing mailer
/* @var $htmlmail Dmailer */
@@ -1384,7 +1382,7 @@ public function getRecordList(
$moduleUrl = '';
$editOnClick = '';
if ($row['uid']) {
- $tableIcon = $this->iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL);
+ $tableIcon = $this->iconFactory->getIconForRecord($table, $row, IconSize::SMALL);
if ($editLinkFlag) {
$params = [
'edit' => [
@@ -1829,7 +1827,7 @@ public function makeCategoriesForm(array $row, $indata): array
$output['rows'][] = [
'uid' => $row['uid'],
- 'icon' => $this->iconFactory->getIconForRecord('tt_content', $row, Icon::SIZE_SMALL),
+ 'icon' => $this->iconFactory->getIconForRecord('tt_content', $row, IconSize::SMALL),
'header' => $row['header'],
'CType' => $row['CType'],
'list_type' => $row['list_type'],
diff --git a/Classes/Module/ImporterController.php b/Classes/Module/ImporterController.php
index b32958c40..d4524495d 100644
--- a/Classes/Module/ImporterController.php
+++ b/Classes/Module/ImporterController.php
@@ -35,9 +35,11 @@
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
-use TYPO3\CMS\Core\Resource\DuplicationBehavior;
+use TYPO3\CMS\Core\Resource\DefaultUploadFolderResolver;
+use TYPO3\CMS\Core\Resource\Enum\DuplicationBehavior;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\ResourceFactory;
+use TYPO3\CMS\Core\SysLog\Type as SystemLogType;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\ArrayUtility;
@@ -966,7 +968,6 @@ public function writeTempFile(string $csv, string $newFile, int $newFileUid): ar
/* @var $extendedFileUtility ExtendedFileUtility */
$extendedFileUtility = GeneralUtility::makeInstance(ExtendedFileUtility::class);
$extendedFileUtility->setActionPermissions($userPermissions);
- // https://docs.typo3.org/c/typo3/cms-core/12.4/en-us/Changelog/7.4/Deprecation-63603-ExtendedFileUtilitydontCheckForUniqueIsDeprecated.html
$extendedFileUtility->setExistingFilesConflictMode(DuplicationBehavior::REPLACE);
if (empty($this->indata['newFile'])) {
@@ -975,7 +976,7 @@ public function writeTempFile(string $csv, string $newFile, int $newFileUid): ar
$httpHost = $this->getRequestHostOnly();
if ($httpHost != $refInfo['host'] && !$GLOBALS['TYPO3_CONF_VARS']['SYS']['doNotCheckReferer']) {
- $extendedFileUtility->writeLog(0, 2, 1, 'Referer host "%s" and server host "%s" did not match!', [$refInfo['host'], $httpHost]);
+ $this->beUser->writeLog(SystemLogType::FILE, 0, 2, 1, 'Referer host "%s" and server host "%s" did not match!', [$refInfo['host'], $httpHost]);
} else {
// new file
$file['newfile']['target'] = $this->userTempFolder();
@@ -1023,10 +1024,10 @@ public function checkUpload(): array
$httpHost = $this->getRequestHostOnly();
if ($httpHost != $refInfo['host'] && !$GLOBALS['TYPO3_CONF_VARS']['SYS']['doNotCheckReferer']) {
- $extendedFileUtility->writeLog(0, 2, 1, 'Referer host "%s" and server host "%s" did not match!', [$refInfo['host'], $httpHost]);
+ $this->beUser->writeLog(SystemLogType::FILE, 0, 2, 1, 'Referer host "%s" and server host "%s" did not match!', [$refInfo['host'], $httpHost]);
} else {
$extendedFileUtility->start($this->csvFile);
- $extendedFileUtility->setExistingFilesConflictMode(DuplicationBehavior::cast(DuplicationBehavior::REPLACE));
+ $extendedFileUtility->setExistingFilesConflictMode(DuplicationBehavior::REPLACE);
$tempFile = $extendedFileUtility->func_upload($this->csvFile['upload']['1']);
if (is_object($tempFile[0])) {
@@ -1075,8 +1076,9 @@ private function getFileAbsolutePath(int $fileUid): string
*/
public function userTempFolder(): string
{
+ $defaultUploadFolderResolver = GeneralUtility::makeInstance(DefaultUploadFolderResolver::class);
/** @var \TYPO3\CMS\Core\Resource\Folder $folder */
- $folder = $this->beUser->getDefaultUploadTemporaryFolder();
+ $folder = $defaultUploadFolderResolver->resolve($this->beUser);
return $folder->getPublicUrl();
}
diff --git a/Classes/Module/MailerEngineController.php b/Classes/Module/MailerEngineController.php
index 435d21227..969e8a2b2 100644
--- a/Classes/Module/MailerEngineController.php
+++ b/Classes/Module/MailerEngineController.php
@@ -7,22 +7,16 @@
use DirectMailTeam\DirectMail\Dmailer;
use DirectMailTeam\DirectMail\Repository\SysDmailMaillogRepository;
use DirectMailTeam\DirectMail\Repository\SysDmailRepository;
-use DirectMailTeam\DirectMail\Repository\PagesRepository;
use DirectMailTeam\DirectMail\Utility\SchedulerUtility;
-use DirectMailTeam\DirectMail\Utility\Typo3ConfVarsUtility;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Attribute\Controller;
-use TYPO3\CMS\Backend\Routing\UriBuilder;
+use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\Http\HtmlResponse;
-use TYPO3\CMS\Core\Http\Uri;
-use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Imaging\IconSize;
use TYPO3\CMS\Core\Localization\LanguageService;
-use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
use TYPO3\CMS\Core\Pagination\ArrayPaginator;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
@@ -95,12 +89,12 @@ public function indexAction(ModuleTemplate $view): ResponseInterface
$itemsPerPage = 100; //@TODO
$paginator = GeneralUtility::makeInstance(
- ArrayPaginator::class,
- $mailerEngine['data'],
- $this->currentPageNumber,
+ ArrayPaginator::class,
+ $mailerEngine['data'],
+ $this->currentPageNumber,
$itemsPerPage
);
-
+
$tasks = $this->getSchedulerTable();
$view->assignMultiple(
[
@@ -171,7 +165,7 @@ protected function getSchedulerTable(): array
* Shows the status of the mailer engine.
* TODO: Should really only show some entries, or provide a browsing interface.
*
- * @return string List of the mailing status
+ * @return array List of the mailing status
* @throws RouteNotFoundException If the named route doesn't exist
*/
protected function mailerengine(): array
@@ -212,7 +206,7 @@ protected function mailerengine(): array
foreach ($rows as $row) {
$data[] = [
'uid' => $row['uid'],
- 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL)->render(),
+ 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, IconSize::SMALL)->render(),
'subject' => $this->linkDMailRecord(htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['subject'], 100)), $row['uid']),
'scheduled' => BackendUtility::datetime($row['scheduled']),
'scheduled_begin' => $row['scheduled_begin'] ? BackendUtility::datetime($row['scheduled_begin']) : '',
diff --git a/Classes/Module/MainController.php b/Classes/Module/MainController.php
index 1035e55f1..4d685fe7e 100644
--- a/Classes/Module/MainController.php
+++ b/Classes/Module/MainController.php
@@ -7,7 +7,8 @@
use DirectMailTeam\DirectMail\Repository\PagesRepository;
use DirectMailTeam\DirectMail\Utility\TsUtility;
use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Attribute\Controller;
+use Psr\Http\Message\UriInterface;
+use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
@@ -21,6 +22,7 @@
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Imaging\IconSize;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Messaging\FlashMessage;
@@ -40,8 +42,6 @@ class MainController
* @var ModuleTemplate
*/
protected $moduleTemplate;
- #protected IconFactory $iconFactory;
- #protected PageRenderer $pageRenderer;
/**
* @var StandaloneView
@@ -80,13 +80,9 @@ class MainController
*/
public function __construct(
protected readonly ModuleTemplateFactory $moduleTemplateFactory,
- # $moduleTemplate = null,
protected readonly IconFactory $iconFactory,
protected readonly PageRenderer $pageRenderer
) {
- #$this->moduleTemplate = $moduleTemplate ?? GeneralUtility::makeInstance(ModuleTemplate::class);
- #$this->iconFactory = $iconFactory ?? GeneralUtility::makeInstance(IconFactory::class);
- #$this->pageRenderer = $pageRenderer ?? GeneralUtility::makeInstance(PageRenderer::class);
$this->getLanguageService()->includeLLFile('EXT:direct_mail/Resources/Private/Language/locallang_mod2-6.xlf');
$this->getLanguageService()->includeLLFile('EXT:direct_mail/Resources/Private/Language/locallang_csh_sysdmail.xlf');
}
@@ -228,7 +224,13 @@ protected function getDataHandler(): DataHandler
return GeneralUtility::makeInstance(DataHandler::class);
}
- protected function buildUriFromRoute(string $name, array $parameters = []): Uri
+ /**
+ * @param string $name
+ * @param array $parameters
+ * @return UriInterface
+ * @throws RouteNotFoundException
+ */
+ protected function buildUriFromRoute(string $name, array $parameters = []): UriInterface
{
/** @var UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
@@ -303,7 +305,7 @@ protected function getDmailerLockFilePath(): string
protected function getIconActionsOpen(): Icon
{
- return $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL);
+ return $this->iconFactory->getIcon('actions-open', IconSize::SMALL);
}
/**
@@ -314,14 +316,14 @@ protected function getIconActionsOpen(): Icon
*
* @return array list of record
*/
- protected function getRecordList(array $listArr, string $table)
+ protected function getRecordList(array $listArr, string $table): array
{
$lang = $this->getLanguageService();
$lllFile = 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_mod2-6.xlf';
$output = [
'title' => $lang->sL($lllFile . ':dmail_number_records'),
'editLinkTitle' => $lang->sL($lllFile . ':dmail_edit'),
- 'actionsOpen' => $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL),
+ 'actionsOpen' => $this->iconFactory->getIcon('actions-open', IconSize::SMALL),
'counter' => is_array($listArr) ? count($listArr) : 0,
'rows' => [],
];
@@ -374,7 +376,7 @@ protected function getRecordList(array $listArr, string $table)
* generate edit link for records
* https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Backend/EditLinks.html
*
- * @param $params
+ * @param array $params
* @return Uri
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
*/
@@ -394,14 +396,13 @@ protected function getEditOnClickLink(array $params): Uri
protected function rearrangePlainMails(array $plainMails): array
{
$out = [];
- if (is_array($plainMails)) {
- $c = 0;
- foreach ($plainMails as $v) {
- $out[$c]['email'] = trim($v);
- $out[$c]['name'] = '';
- $c++;
- }
+ $c = 0;
+ foreach ($plainMails as $v) {
+ $out[$c]['email'] = trim($v);
+ $out[$c]['name'] = '';
+ $c++;
}
+
return $out;
}
@@ -412,7 +413,7 @@ protected function rearrangePlainMails(array $plainMails): array
*
* @return array Cleaned array
*/
- protected function cleanPlainList(array $plainlist)
+ protected function cleanPlainList(array $plainlist): array
{
/**
* $plainlist is a multidimensional array.
@@ -438,7 +439,7 @@ protected function cleanPlainList(array $plainlist)
* @param string $perms_clause Select query clause
* @return array the page ID, recursively
*/
- protected function getRecursiveSelect($id, $perms_clause)
+ protected function getRecursiveSelect(int $id, string $perms_clause): array
{
$getLevels = 10000;
// Finding tree and offer setting of values recursively.
diff --git a/Classes/Module/RecipientListController.php b/Classes/Module/RecipientListController.php
index d8886db6e..1e89da86a 100644
--- a/Classes/Module/RecipientListController.php
+++ b/Classes/Module/RecipientListController.php
@@ -6,7 +6,6 @@
use DirectMailTeam\DirectMail\DmQueryGenerator;
use DirectMailTeam\DirectMail\Enum\DmailRecipientEnum;
-use DirectMailTeam\DirectMail\Importer;
use DirectMailTeam\DirectMail\Event\RecipientListCompileMailGroupEvent;
use DirectMailTeam\DirectMail\Repository\FeGroupsRepository;
use DirectMailTeam\DirectMail\Repository\FeUsersRepository;
@@ -17,17 +16,15 @@
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Attribute\Controller;
+use Psr\Http\Message\UriInterface;
+use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\Http\HtmlResponse;
-use TYPO3\CMS\Core\Http\Uri;
-use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Imaging\IconSize;
use TYPO3\CMS\Core\Localization\LanguageService;
-use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
@@ -38,6 +35,8 @@ final class RecipientListController extends MainController
{
protected FlashMessageQueue $flashMessageQueue;
+ protected array $categories = [];
+
public function __construct(
protected readonly ModuleTemplateFactory $moduleTemplateFactory,
protected readonly EventDispatcherInterface $eventDispatcher,
@@ -67,9 +66,9 @@ public function __construct(
protected string $table = '',
protected array $indata = [],
-
+
protected $requestUri = '',
-
+
protected array $allowedTables = [DmailRecipientEnum::TtAddress->value, DmailRecipientEnum::FeUsers->value],
protected bool $submit = false,
@@ -94,7 +93,7 @@ public function handleRequest(ServerRequestInterface $request): ResponseInterfac
$normalizedParams = $request->getAttribute('normalizedParams');
$this->requestUri = $normalizedParams->getRequestUri();
-
+
$this->cmd = (string)($parsedBody['cmd'] ?? $this->queryParams['cmd'] ?? '');
$this->group_uid = (int)($parsedBody['group_uid'] ?? $this->queryParams['group_uid'] ?? 0);
$this->lCmd = $parsedBody['lCmd'] ?? $this->queryParams['lCmd'] ?? '';
@@ -212,14 +211,14 @@ protected function showExistingRecipientLists(): array
]),
'rows' => [],
'sysDmailGroupIcon' => $this->iconFactory->getIconForRecord(
- 'sys_dmail_group',
- [],
- Icon::SIZE_SMALL
+ 'sys_dmail_group',
+ [],
+ IconSize::SMALL
)
];
$rows = GeneralUtility::makeInstance(SysDmailGroupRepository::class)->selectSysDmailGroupByPid(
- $this->id,
+ $this->id,
trim($GLOBALS['TCA']['sys_dmail_group']['ctrl']['default_sortby'])
);
@@ -227,7 +226,7 @@ protected function showExistingRecipientLists(): array
$result = $this->compileMailGroup((int)$row['uid']);
$data['rows'][] = [
'id' => $row['uid'],
- 'icon' => $this->iconFactory->getIconForRecord('sys_dmail_group', $row, Icon::SIZE_SMALL)->render(),
+ 'icon' => $this->iconFactory->getIconForRecord('sys_dmail_group', $row, IconSize::SMALL)->render(),
'editLink' => $this->editLink('sys_dmail_group', $row['uid']),
'reciplink' => $this->linkRecipRecord($row['uid']),
'reciplinkText' => htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], 30)),
@@ -347,14 +346,14 @@ protected function compileMailGroup(int $groupUid): array
if ($table) {
$queryGenerator = GeneralUtility::makeInstance(
- DmQueryGenerator::class,
- $this->iconFactory,
- GeneralUtility::makeInstance(UriBuilder::class),
+ DmQueryGenerator::class,
+ $this->iconFactory,
+ GeneralUtility::makeInstance(UriBuilder::class),
$this->moduleTemplateFactory
);
$idLists[$table] = GeneralUtility::makeInstance(TempRepository::class)->getSpecialQueryIdList(
- $queryGenerator,
- $table,
+ $queryGenerator,
+ $table,
$mailGroup
);
}
@@ -431,10 +430,10 @@ protected function editLink(string $table, int $uid): array
*
* @param int $uid Uid of the recipient link
*
- * @return Uri The link
+ * @return UriInterface The link
* @throws RouteNotFoundException If the named route doesn't exist
*/
- protected function linkRecipRecord(int $uid): Uri
+ protected function linkRecipRecord(int $uid): UriInterface
{
return $this->buildUriFromRoute(
$this->moduleName,
@@ -462,7 +461,7 @@ protected function displayMailGroup(array $result): array
$data = [
'queryLimitDisabled' => $group['queryLimitDisabled'] ?? true,
'group_id' => $this->group_uid,
- 'group_icon' => $this->iconFactory->getIconForRecord('sys_dmail_group', $group, Icon::SIZE_SMALL),
+ 'group_icon' => $this->iconFactory->getIconForRecord('sys_dmail_group', $group, IconSize::SMALL),
'group_title' => htmlspecialchars($group['title'] ?? ''),
'group_totalRecipients' => $this->countRecipients($idLists),
'group_link_listall' => ($this->lCmd == '') ? (string)$this->buildUriFromRoute(
@@ -497,7 +496,7 @@ protected function displayMailGroup(array $result): array
$message = $this->createFlashMessage(
'',
$this->languageService->sl($this->lllFile . ':mailgroup_table_disallowed_csv'),
- 2,
+ ContextualFeedbackSeverity::ERROR,
false
);
$this->messageQueue->addMessage($message);
@@ -522,7 +521,7 @@ protected function displayMailGroup(array $result): array
}
if (is_array($idLists[DmailRecipientEnum::FeUsers->value] ?? false)) {
$rows = GeneralUtility::makeInstance(TempRepository::class)->fetchRecordsListValues(
- $idLists[DmailRecipientEnum::FeUsers->value],
+ $idLists[DmailRecipientEnum::FeUsers->value],
DmailRecipientEnum::FeUsers->value
);
$data['tables'][] = [
@@ -540,7 +539,7 @@ protected function displayMailGroup(array $result): array
}
if (!in_array($this->userTable, [DmailRecipientEnum::TtAddress->value, DmailRecipientEnum::FeUsers->value, DmailRecipientEnum::Plainlist->value]) && is_array($idLists[$this->userTable] ?? false)) {
$rows = GeneralUtility::makeInstance(TempRepository::class)->fetchRecordsListValues(
- $idLists[$this->userTable],
+ $idLists[$this->userTable],
$this->userTable
);
$data['tables'][] = [
@@ -605,8 +604,8 @@ protected function displayMailGroup(array $result): array
];
}
- if (!in_array($this->userTable, [DmailRecipientEnum::TtAddress->value, DmailRecipientEnum::FeUsers->value, DmailRecipientEnum::Plainlist->value])
- && is_array($idLists[$this->userTable] ?? false)
+ if (!in_array($this->userTable, [DmailRecipientEnum::TtAddress->value, DmailRecipientEnum::FeUsers->value, DmailRecipientEnum::Plainlist->value])
+ && is_array($idLists[$this->userTable] ?? false)
&& count($idLists[$this->userTable])) {
$data['tables'][] = [
'title_table' => 'mailgroup_table_custom',
@@ -706,9 +705,9 @@ protected function updateSpecialQuery(array $mailGroup): array
protected function specialQuery(): array
{
$queryGenerator = GeneralUtility::makeInstance(
- DmQueryGenerator::class,
- $this->iconFactory,
- GeneralUtility::makeInstance(UriBuilder::class),
+ DmQueryGenerator::class,
+ $this->iconFactory,
+ GeneralUtility::makeInstance(UriBuilder::class),
$this->moduleTemplateFactory
);
//$queryGenerator->setFormName('dmailform');
@@ -817,7 +816,7 @@ protected function displayUserInfo(): array
'table' => $this->table,
'thisID' => $this->uid,
'cmd' => $this->cmd,
- 'html' => $row['module_sys_dmail_html'] ? true : false,
+ 'html' => (bool)$row['module_sys_dmail_html'],
];
$this->categories = GeneralUtility::makeInstance(TempRepository::class)->makeCategories($this->table, $row, $this->sys_language_uid);
diff --git a/Classes/Module/StatisticsController.php b/Classes/Module/StatisticsController.php
index f1f6da2f7..75c23fc6a 100644
--- a/Classes/Module/StatisticsController.php
+++ b/Classes/Module/StatisticsController.php
@@ -16,17 +16,15 @@
use DirectMailTeam\DirectMail\Utility\Typo3ConfVarsUtility;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Attribute\Controller;
+use Psr\Http\Message\UriInterface;
+use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
-use TYPO3\CMS\Core\Http\HtmlResponse;
-use TYPO3\CMS\Core\Http\Uri;
-use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Imaging\IconSize;
use TYPO3\CMS\Core\Localization\LanguageService;
-use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
use TYPO3\CMS\Core\Pagination\ArrayPaginator;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
@@ -38,6 +36,8 @@ final class StatisticsController extends MainController
{
protected FlashMessageQueue $flashMessageQueue;
+ protected array $categories = [];
+
public function __construct(
protected readonly ModuleTemplateFactory $moduleTemplateFactory,
protected readonly IconFactory $iconFactory,
@@ -171,9 +171,9 @@ public function indexAction(ModuleTemplate $view): ResponseInterface
$itemsPerPage = 100; //@TODO
$paginator = GeneralUtility::makeInstance(
- ArrayPaginator::class,
- $data['dataPageInfo'] ?? [],
- $this->currentPageNumber,
+ ArrayPaginator::class,
+ $data['dataPageInfo'] ?? [],
+ $this->currentPageNumber,
$itemsPerPage
);
@@ -275,7 +275,7 @@ protected function displayPageInfo(): array
foreach ($rows as $row) {
$data[] = [
'id' => $row['uid'],
- 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL)->render(),
+ 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, IconSize::SMALL)->render(),
'url' => $this->linkDMailRecord($row['uid']),
'subject' => htmlspecialchars($row['subject']),
'subjectShort' => htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['subject'], 50)),
@@ -682,7 +682,7 @@ protected function stats(array $row): array
}
}
- $iconAppsToolbarMenuSearch = $this->iconFactory->getIcon('apps-toolbar-menu-search', Icon::SIZE_SMALL)->render();
+ $iconAppsToolbarMenuSearch = $this->iconFactory->getIcon('apps-toolbar-menu-search', IconSize::SMALL)->render();
$tblLines = [];
foreach ($urlCounter['total'] as $id => $_) {
@@ -789,9 +789,9 @@ protected function stats(array $row): array
);
// The icons:
- $listIcons = $this->iconFactory->getIcon('actions-system-list-open', Icon::SIZE_SMALL);
- $csvIcons = $this->iconFactory->getIcon('actions-document-export-csv', Icon::SIZE_SMALL);
- $hideIcons = $this->iconFactory->getIcon('actions-lock', Icon::SIZE_SMALL);
+ $listIcons = $this->iconFactory->getIcon('actions-system-list-open', IconSize::SMALL);
+ $csvIcons = $this->iconFactory->getIcon('actions-document-export-csv', IconSize::SMALL);
+ $hideIcons = $this->iconFactory->getIcon('actions-lock', IconSize::SMALL);
// Table with Icon
$responseResult = $sysDmailMaillogRepository->countReturnCode($row['uid']);
@@ -1308,10 +1308,10 @@ private function getIdLists($rrows): array
*
* @param int $uid Record uid to be link
*
- * @return Uri
+ * @return UriInterface
* @throws RouteNotFoundException If the named route doesn't exist
*/
- protected function linkDMailRecord(int $uid): Uri
+ protected function linkDMailRecord(int $uid): UriInterface
{
return $this->buildUriFromRoute(
$this->moduleName,
@@ -1387,8 +1387,8 @@ protected function directMailCompactView(array $row): array
$res = GeneralUtility::makeInstance(SysDmailMaillogRepository::class)->selectSysDmailMaillogsCompactView($row['uid']);
$data = [
- 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL)->render(),
- 'iconInfo' => $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render(),
+ 'icon' => $this->iconFactory->getIconForRecord('sys_dmail', $row, IconSize::SMALL)->render(),
+ 'iconInfo' => $this->iconFactory->getIcon('actions-document-info', IconSize::SMALL)->render(),
'subject' => htmlspecialchars($row['subject']),
'from_name' => htmlspecialchars($row['from_name']),
'from_email' => htmlspecialchars($row['from_email']),
diff --git a/Classes/Plugin/DirectMail.php b/Classes/Plugin/DirectMail.php
index 8a2595903..bc81a9bb1 100644
--- a/Classes/Plugin/DirectMail.php
+++ b/Classes/Plugin/DirectMail.php
@@ -29,6 +29,7 @@
*/
use DirectMailTeam\DirectMail\DirectMailUtility;
+use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Utility\MailUtility;
use TYPO3\CMS\Frontend\DataProcessing\FilesProcessor;
@@ -105,6 +106,7 @@ class DirectMail
public $conf = [];
public $pi_tmpPageId = 0;
protected $frontendController;
+ protected $request;
protected $templateService;
@@ -113,15 +115,17 @@ class DirectMail
public $siteUrl;
public $labelsList = 'header_date_prefix,header_link_prefix,uploads_header,media_header,images_header,image_link_prefix,caption_header,unrendered_content,link_prefix';
- public function __construct($_ = null, TypoScriptFrontendController $frontendController = null)
+ public function __construct($_ = null, TypoScriptFrontendController $frontendController = null, ServerRequestInterface $request = null)
{
+ $this->request = $request ?: $GLOBALS['TYPO3_REQUEST'];
$this->frontendController = $frontendController ?: $GLOBALS['TSFE'];
$this->templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
// Setting piVars:
if ($this->prefixId) {
$this->piVars = self::getRequestPostOverGetParameterWithPrefix($this->prefixId);
}
- $this->LLkey = $this->frontendController->getLanguage()->getTypo3Language();
+ $language = $this->request->getAttribute('language') ?? $this->request->getAttribute('site')->getDefaultLanguage();
+ $this->LLkey = $language->getTypo3Language();
$locales = GeneralUtility::makeInstance(Locales::class);
if ($locales->isValidLanguageKey($this->LLkey)) {
@@ -254,7 +258,7 @@ public function main(string $content, array $conf): string
return $content;
}
- public function pi_loadLL(string $languageFilePath = '')
+ public function pi_loadLL(string $languageFilePath = ''): void
{
if ($this->LOCAL_LANG_loaded) {
return;
@@ -306,8 +310,8 @@ public function pi_loadLL(string $languageFilePath = '')
public function getMenuContent(string $cType): string
{
$str = $this->cObj->cObjGetSingle(
- $GLOBALS['TSFE']->tmpl->setup['tt_content.'][$cType],
- $GLOBALS['TSFE']->tmpl->setup['tt_content.'][$cType . '.']
+ $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript')->getSetupArray()['tt_content.'][$cType],
+ $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript')->getSetupArray()['tt_content.'][$cType . '.']
);
return $str;
@@ -928,7 +932,7 @@ public function addLabelsMarkers(array $markerArray): array
{
$labels = GeneralUtility::trimExplode(',', $this->labelsList);
foreach ($labels as $labelName) {
- $markerArray['###' . strtoupper($labelName) . '###'] = (string)LocalizationUtility::translate($labelName, 'direct_mail');
+ $markerArray['###' . strtoupper($labelName) . '###'] = (string)LocalizationUtility::translate($labelName, 'DirectMail');
}
return $markerArray;
}
diff --git a/Classes/Repository/SysDmailMaillogRepository.php b/Classes/Repository/SysDmailMaillogRepository.php
index a630f988b..22b67f235 100644
--- a/Classes/Repository/SysDmailMaillogRepository.php
+++ b/Classes/Repository/SysDmailMaillogRepository.php
@@ -709,7 +709,7 @@ public function dmailerAddToMailLog(int $mid, string $rid, int $size, int $parse
])
->executeStatement();
- return (int)$queryBuilder->getConnection()->lastInsertId($this->table);
+ return (int)$queryBuilder->getConnection()->lastInsertId();
}
public function analyzeBounceMailAddToMailLog(
@@ -733,7 +733,7 @@ public function analyzeBounceMailAddToMailLog(
])
->executeStatement();
- return (int)$queryBuilder->getConnection()->lastInsertId($this->table);
+ return (int)$queryBuilder->getConnection()->lastInsertId();
}
/**
diff --git a/Classes/Repository/SysDmailRepository.php b/Classes/Repository/SysDmailRepository.php
index af2b8c3e3..58ef2a37e 100644
--- a/Classes/Repository/SysDmailRepository.php
+++ b/Classes/Repository/SysDmailRepository.php
@@ -391,7 +391,7 @@ public function insertDMailRecord(array $dmRecord): int
{
$connection = $this->getConnection($this->table);
$connection->insert($this->table, $dmRecord);
- return (int)$connection->lastInsertId($this->table);
+ return (int)$connection->lastInsertId();
}
public function updateDMailRecord(int $dmailUid, array $dmRecord): int
diff --git a/Classes/Scheduler/AnalyzeBounceMail.php b/Classes/Scheduler/AnalyzeBounceMail.php
index 70b9a338c..a488c7ba3 100644
--- a/Classes/Scheduler/AnalyzeBounceMail.php
+++ b/Classes/Scheduler/AnalyzeBounceMail.php
@@ -19,6 +19,7 @@
use DirectMailTeam\DirectMail\Utility\ReadmailUtility;
use Fetch\Message;
use Fetch\Server;
+use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -78,7 +79,7 @@ public function getPort()
/**
* @param int $port
*/
- public function setPort($port)
+ public function setPort($port): void
{
$this->port = $port;
}
@@ -94,7 +95,7 @@ public function getUser()
/**
* @param string $user
*/
- public function setUser($user)
+ public function setUser($user): void
{
$this->user = $user;
}
@@ -110,7 +111,7 @@ public function getPassword()
/**
* @param string $password
*/
- public function setPassword($password)
+ public function setPassword($password): void
{
$this->password = $password;
}
@@ -126,7 +127,7 @@ public function getService()
/**
* @param string $service
*/
- public function setService($service)
+ public function setService($service): void
{
$this->service = $service;
}
@@ -142,7 +143,7 @@ public function getServer()
/**
* @param mixed $server
*/
- public function setServer($server)
+ public function setServer($server): void
{
$this->server = $server;
}
@@ -158,7 +159,7 @@ public function getMaxProcessed()
/**
* @param mixed $maxProcessed
*/
- public function setMaxProcessed($maxProcessed)
+ public function setMaxProcessed($maxProcessed): void
{
$this->maxProcessed = (int)$maxProcessed;
}
@@ -255,7 +256,7 @@ private function processBounceMail($message)
'return_code' => (int)$cp['reason'],
];
$connection->insert('sys_dmail_maillog', $insertFields);
- $sql_insert_id = $connection->lastInsertId('sys_dmail_maillog');
+ $sql_insert_id = $connection->lastInsertId();
return (bool)$sql_insert_id;
} catch (\Doctrine\DBAL\DBALException $e) {
// Log $e->getMessage();
@@ -300,6 +301,6 @@ private function connectMailServer()
*/
private function getEXEC_TIME()
{
- return $GLOBALS['EXEC_TIME'];
+ return GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp');
}
}
diff --git a/Classes/Scheduler/AnalyzeBounceMailAdditionalFields.php b/Classes/Scheduler/AnalyzeBounceMailAdditionalFields.php
index bfe8e458a..de27b4f36 100644
--- a/Classes/Scheduler/AnalyzeBounceMailAdditionalFields.php
+++ b/Classes/Scheduler/AnalyzeBounceMailAdditionalFields.php
@@ -18,6 +18,7 @@
use Fetch\Server;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider;
use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController;
@@ -84,7 +85,7 @@ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleCont
* @param array $submittedData An array containing the data submitted by the add/edit task form
* @param AnalyzeBounceMail $task Reference to the scheduler backend module
*/
- public function saveAdditionalFields(array $submittedData, AbstractTask $task)
+ public function saveAdditionalFields(array $submittedData, AbstractTask $task): void
{
$task->setServer($submittedData['bounceServer']);
$task->setPort((int)$submittedData['bouncePort']);
@@ -123,14 +124,14 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC
$this->addMessage(
$this->getLanguangeService()->sL('LLL:EXT:direct_mail/Resources/Private/Language/locallang_mod2-6.xlf:scheduler.bounceMail.dataVerification') .
$e->getMessage(),
- FlashMessage::ERROR
+ ContextualFeedbackSeverity::ERROR
);
$return = false;
}
} else {
$this->addMessage(
$this->getLanguangeService()->sL('LLL:EXT:direct_mail/Resources/Private/Language/locallang_mod2-6.xlf:scheduler.bounceMail.phpImapError'),
- FlashMessage::ERROR
+ ContextualFeedbackSeverity::ERROR
);
$return = false;
}
diff --git a/Classes/Scheduler/MailFromDraft.php b/Classes/Scheduler/MailFromDraft.php
index 03692f7da..4166f248b 100644
--- a/Classes/Scheduler/MailFromDraft.php
+++ b/Classes/Scheduler/MailFromDraft.php
@@ -86,7 +86,7 @@ public function execute(): bool
&& (int)$draftRecord['type'] !== 1
&& !$this->checkUrlBase((int)$draftRecord['page'])
) {
- throw new \Exception('No site found in root line of page ' . $draftRecord['page'] . '!');
+ throw new \Exception('No site found in root line of page ' . $draftRecord['page'] . '!', 6078321898);
}
$this->dmailUid = GeneralUtility::makeInstance(SysDmailRepository::class)->insertDMailRecord($draftRecord);
@@ -105,7 +105,7 @@ public function execute(): bool
$result = DirectMailUtility::fetchUrlContentsForDirectMailRecord($mailRecord, $defaultParams, true);
if ($result['errors'] !== []) {
- throw new \Exception('Failed to fetch contents: ' . implode(', ', $result['errors']));
+ throw new \Exception('Failed to fetch contents: ' . implode(', ', $result['errors']), 4132384402);
}
$mailRecord = BackendUtility::getRecord('sys_dmail', $this->dmailUid);
@@ -160,7 +160,7 @@ protected function checkUrlBase(int $pageId): bool
* @param string $hookMethod The hook method name
* @param array $hookParams The hook params
*/
- public function callHooks(string $hookMethod, array $hookParams)
+ public function callHooks(string $hookMethod, array $hookParams): void
{
foreach ($this->hookObjects as $hookObjectInstance) {
$hookObjectInstance->$hookMethod($hookParams, $this);
@@ -172,7 +172,7 @@ public function callHooks(string $hookMethod, array $hookParams)
*
* @throws \Exception
*/
- public function initializeHookObjects()
+ public function initializeHookObjects(): void
{
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['direct_mail']['mailFromDraft'] ?? false)) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['direct_mail']['mailFromDraft'] as $hookObj) {
diff --git a/Classes/Scheduler/MailFromDraftAdditionalFields.php b/Classes/Scheduler/MailFromDraftAdditionalFields.php
index 1a1f85cf8..8fc486125 100644
--- a/Classes/Scheduler/MailFromDraftAdditionalFields.php
+++ b/Classes/Scheduler/MailFromDraftAdditionalFields.php
@@ -18,9 +18,11 @@
use DirectMailTeam\DirectMail\Repository\SysDmailRepository;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider;
use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController;
+use TYPO3\CMS\Scheduler\SchedulerManagementAction;
use TYPO3\CMS\Scheduler\Task\AbstractTask;
/**
@@ -52,7 +54,7 @@ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleCont
if (empty($taskInfo['selecteddraft'])) {
// In case of edit, and editing a test task, set to internal value if not data was submitted already
// Otherwise set an empty value, as it will not be used anyway
- $taskInfo['selecteddraft'] = ($schedulerModuleController->getCurrentAction() === 'edit') ? $task->draftUid : '';
+ $taskInfo['selecteddraft'] = ($schedulerModuleController->getCurrentAction() === SchedulerManagementAction::EDIT) ? $task->draftUid : '';
}
// fetch all available drafts
@@ -78,7 +80,7 @@ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleCont
} else {
foreach ($drafts as $draft) {
// see #44577
- $selected = (((string)$schedulerModuleController->getCurrentAction() === 'edit' && $task->draftUid === $draft['uid']) ? ' selected="selected"' : '');
+ $selected = (($schedulerModuleController->getCurrentAction() === SchedulerManagementAction::EDIT && $task->draftUid === $draft['uid']) ? ' selected="selected"' : '');
$fieldHtml .= '';
}
}
@@ -118,12 +120,12 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC
$result = true;
} else {
// TODO: localization
- $this->addMessage('No draft record selected', FlashMessage::ERROR);
+ $this->addMessage('No draft record selected', ContextualFeedbackSeverity::ERROR);
$result = false;
}
} else {
// TODO: localization
- $this->addMessage('No drafts found. Please add one first through the direct mail process', FlashMessage::ERROR);
+ $this->addMessage('No drafts found. Please add one first through the direct mail process', ContextualFeedbackSeverity::ERROR);
$result = false;
}
@@ -137,7 +139,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC
* @param array $submittedData Array containing the data submitted by the user
* @param AbstractTask $task Reference to the current task object
*/
- public function saveAdditionalFields(array $submittedData, AbstractTask $task)
+ public function saveAdditionalFields(array $submittedData, AbstractTask $task): void
{
$task->setDraft($submittedData['selecteddraft']);
}
diff --git a/Classes/Utility/AuthCodeUtility.php b/Classes/Utility/AuthCodeUtility.php
index ab445acaf..4eb4f2bcd 100644
--- a/Classes/Utility/AuthCodeUtility.php
+++ b/Classes/Utility/AuthCodeUtility.php
@@ -4,6 +4,7 @@
namespace DirectMailTeam\DirectMail\Utility;
+use TYPO3\CMS\Core\Crypto\HashService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class AuthCodeUtility
@@ -17,8 +18,8 @@ class AuthCodeUtility
* @return bool
*/
public static function validateAuthCode(
- string $submittedAuthCode,
- array $recipientRecord,
+ string $submittedAuthCode,
+ array $recipientRecord,
string $authcodeFieldList = 'uid'): bool
{
if (!empty($submittedAuthCode)) {
@@ -43,6 +44,6 @@ public static function getHmac(array $recipientRecord, string $authcodeFieldList
}
$preKey = implode('|', $recCopy_temp);
- return GeneralUtility::hmac($preKey);
+ return GeneralUtility::makeInstance(HashService::class)->hmac($preKey, 'changeMe');
}
}
diff --git a/Classes/Utility/DmCsvUtility.php b/Classes/Utility/DmCsvUtility.php
index f305305db..93e4a9d5a 100644
--- a/Classes/Utility/DmCsvUtility.php
+++ b/Classes/Utility/DmCsvUtility.php
@@ -62,7 +62,9 @@ public function rearrangeCsvValues(array $lines, array $fieldListArr): array
$fieldOrder = [];
foreach ($first as $v) {
- list($fName, $fConf) = preg_split('|[\[\]]|', $v);
+ $parts = preg_split('|[\[\]]|', $v);
+ $fName = $parts[0] ?? '';
+ $fConf = $parts[1] ?? '';
$fName = trim($fName);
$fConf = trim($fConf);
$fieldOrder[] = [$fName, $fConf];
@@ -92,8 +94,8 @@ public function rearrangeCsvValues(array $lines, array $fieldListArr): array
if (count($data) > 1 || $data[0]) {
// Traverse fieldOrder and map values over
foreach ($fieldOrder as $kk => $fN) {
- if ($fN[0]) {
- if ($fN[1]) {
+ if (isset($fN[0])) {
+ if (isset($fN[1])) {
// If is true
if (trim($data[$kk])) {
if (substr($fN[1], 0, 1) == '=') {
@@ -119,7 +121,7 @@ public function rearrangeCsvValues(array $lines, array $fieldListArr): array
*
* @param array $idArr Values to be put into csv
*/
- public function downloadCSV(array $idArr)
+ public function downloadCSV(array $idArr): void
{
// https://api.typo3.org/master/class_t_y_p_o3_1_1_c_m_s_1_1_core_1_1_utility_1_1_csv_utility.html
$lines = [];
diff --git a/Classes/Widgets/DmWidget.php b/Classes/Widgets/DmWidget.php
index efc194e5a..9f82f1692 100644
--- a/Classes/Widgets/DmWidget.php
+++ b/Classes/Widgets/DmWidget.php
@@ -6,55 +6,41 @@
use DirectMailTeam\DirectMail\Widgets\Provider\DmProvider;
+use Psr\Http\Message\ServerRequestInterface;
+use TYPO3\CMS\Backend\View\BackendViewFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Dashboard\Widgets\RequestAwareWidgetInterface;
use TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface;
use TYPO3\CMS\Dashboard\Widgets\WidgetInterface;
use TYPO3\CMS\Fluid\View\StandaloneView;
-class DmWidget implements WidgetInterface
+class DmWidget implements WidgetInterface, RequestAwareWidgetInterface
{
- /**
- * @var WidgetConfigurationInterface
- */
- private $configuration;
-
- /**
- * @var StandaloneView
- */
- private $view;
-
- /**
- * @var DmProvider
- */
- private $dataProvider;
-
- /**
- * @var array
- */
- private $options;
+ private ServerRequestInterface $request;
public function __construct(
- WidgetConfigurationInterface $configuration,
- DmProvider $dataProvider,
- StandaloneView $view,
- array $options = []
+ private WidgetConfigurationInterface $configuration,
+ private DmProvider $dataProvider,
+ private readonly BackendViewFactory $backendViewFactory,
+ private array $options = []
) {
- $this->configuration = $configuration;
- $this->dataProvider = $dataProvider;
- $this->view = $view;
- $this->options = $options;
+ }
+
+ public function setRequest(ServerRequestInterface $request): void
+ {
+ $this->request = $request;
}
public function renderWidgetContent(): string
{
- $this->view->setTemplate('DmWidget');
- $this->view->assignMultiple([
+ $view = $this->backendViewFactory->create($this->request);
+ $view->assignMultiple([
'items' => $this->dataProvider->getDmPages(),
'options' => $this->options,
'configuration' => $this->configuration,
]);
- return $this->view->render();
+ return $view->render('Dashboard/Widgets/DmWidget');
}
public function getOptions(): array
diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml
index 186d1184e..049bd49d4 100644
--- a/Configuration/Services.yaml
+++ b/Configuration/Services.yaml
@@ -42,7 +42,6 @@ services:
dashboard.widget.dm:
class: 'DirectMailTeam\DirectMail\Widgets\DmWidget'
arguments:
- $view: '@dashboard.views.widget'
$dataProvider: '@dashboard.provider.dm'
tags:
- name: dashboard.widget
@@ -59,7 +58,6 @@ services:
dashboard.widget.dmMailEngineStatus:
class: 'TYPO3\CMS\Dashboard\Widgets\DoughnutChartWidget'
arguments:
- $view: '@dashboard.views.widget'
$dataProvider: '@dashboard.provider.dmMailEngineStatus'
$options:
refreshAvailable: true
@@ -78,7 +76,6 @@ services:
dashboard.widget.dmStatistics:
class: 'TYPO3\CMS\Dashboard\Widgets\BarChartWidget'
arguments:
- $view: '@dashboard.views.widget'
$dataProvider: '@dashboard.provider.dmStatistics'
$options:
refreshAvailable: true
diff --git a/Configuration/TSconfig/page.tsconfig b/Configuration/TSconfig/page.tsconfig
index d6ab5b822..db676871d 100644
--- a/Configuration/TSconfig/page.tsconfig
+++ b/Configuration/TSconfig/page.tsconfig
@@ -1,7 +1 @@
-module.tx_dashboard {
- view {
- templateRootPaths {
- 110 = EXT:direct_mail/Resources/Private/Templates/Dashboard/Widgets/
- }
- }
-}
+templates.typo3/cms-dashboard.110 = directmailteam/direct-mail:Resources/Private/
diff --git a/Configuration/page.tsconfig b/Configuration/page.tsconfig
new file mode 100644
index 000000000..f9467bb9b
--- /dev/null
+++ b/Configuration/page.tsconfig
@@ -0,0 +1 @@
+@import "EXT:direct_mail/Configuration/TSconfig/page.tsconfig"
diff --git a/Configuration/user.tsconfig b/Configuration/user.tsconfig
new file mode 100644
index 000000000..711d0e351
--- /dev/null
+++ b/Configuration/user.tsconfig
@@ -0,0 +1,3 @@
+
+ @import "EXT:direct_mail/Configuration/TSconfig/options.tsconfig"
+
diff --git a/Resources/Public/JavaScript/Configuration.js b/Resources/Public/JavaScript/Configuration.js
index 282862f20..1bffea49f 100644
--- a/Resources/Public/JavaScript/Configuration.js
+++ b/Resources/Public/JavaScript/Configuration.js
@@ -1,8 +1,9 @@
-require(['TYPO3/CMS/Core/Ajax/AjaxRequest'], function (AjaxRequest) {
- "use strict";
+import AjaxRequest from "@typo3/core/ajax/ajax-request.js";
+import DocumentService from '@typo3/core/document-service.js';
+DocumentService.ready().then(() => {
var uid = document.getElementById('dm-page-uid');
- if(uid === null) {
+ if (uid === null) {
return;
}
@@ -12,7 +13,7 @@ require(['TYPO3/CMS/Core/Ajax/AjaxRequest'], function (AjaxRequest) {
};
var config = {
- 'uid' : parseInt(uid.getAttribute('value'))
+ 'uid': parseInt(uid.getAttribute('value'))
};
var value = null;
@@ -22,22 +23,20 @@ require(['TYPO3/CMS/Core/Ajax/AjaxRequest'], function (AjaxRequest) {
config[el.getAttribute('name')] = null;
el.addEventListener('change', (event) => {
- if(el.tagName == 'SELECT') {
+ if (el.tagName == 'SELECT') {
value = el.options[el.selectedIndex].value;
}
config[el.getAttribute('name')] = value;
});
el.addEventListener('input', (event) => {
- if(el.tagName == 'INPUT') {
- if(el.getAttribute('type') == 'text') {
+ if (el.tagName == 'INPUT') {
+ if (el.getAttribute('type') == 'text') {
value = event.target.value.trim();
- }
- else if(el.getAttribute('type') == 'number') {
+ } else if (el.getAttribute('type') == 'number') {
value = parseInt(event.target.value.trim());
- }
- else if(el.getAttribute('type') == 'checkbox') {
- if(event.target.checked) {
+ } else if (el.getAttribute('type') == 'checkbox') {
+ if (event.target.checked) {
value = parseInt(event.target.value.trim());
}
}
@@ -46,12 +45,12 @@ require(['TYPO3/CMS/Core/Ajax/AjaxRequest'], function (AjaxRequest) {
});
});
- saveConfigurationButton.addEventListener('click', function() {
- const randomNumber = Math.ceil(Math.random() * 32);
- new AjaxRequest(TYPO3.settings.ajaxUrls.directmail_configuration_update)
- .withQueryArguments({input: randomNumber})
- .get()
- .then(async function (response) {
+ saveConfigurationButton.addEventListener('click', function () {
+ const randomNumber = Math.ceil(Math.random() * 32);
+ new AjaxRequest(TYPO3.settings.ajaxUrls.directmail_configuration_update)
+ .withQueryArguments({input: randomNumber})
+ .get()
+ .then(async function (response) {
const resolved = await response.resolve();
console.log(resolved.result);
});
diff --git a/Tests/Unit/Dmailer/DirectMailEngineTest.php b/Tests/Unit/Dmailer/DirectMailEngineTest.php
index a896d096e..3103207d1 100644
--- a/Tests/Unit/Dmailer/DirectMailEngineTest.php
+++ b/Tests/Unit/Dmailer/DirectMailEngineTest.php
@@ -26,7 +26,7 @@ class DirectMailEngineTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
* @test
* @dataProvider extractHyperLinksDataProvider
*/
- public function test_extractHyperLinks($content, $path, $expected)
+ public function test_extractHyperLinks($content, $path, $expected): void
{
// This test also tests "tag_regex", "get_tag_attributes" and "absRef"
// TODO: Write units tests also for those methods and provide mocked methods here.
diff --git a/composer.json b/composer.json
index 4197e92b8..29c1757cf 100644
--- a/composer.json
+++ b/composer.json
@@ -22,10 +22,10 @@
"issues": "https://github.com/kartolo/direct_mail/issues"
},
"require": {
- "typo3/cms-core": "^12.4",
- "typo3/cms-dashboard": "^12.4",
- "php": "^8.1 || ^8.2 || ^8.3",
- "friendsoftypo3/tt-address": "^8.1"
+ "typo3/cms-core": "^13.4",
+ "typo3/cms-dashboard": "^13.4",
+ "php": "^8.2 || ^8.3 || ^8.4",
+ "friendsoftypo3/tt-address": "^9.0"
},
"require-dev": {
"roave/security-advisories": "dev-master"
diff --git a/ext_emconf.php b/ext_emconf.php
index d0fc1364a..549780f68 100644
--- a/ext_emconf.php
+++ b/ext_emconf.php
@@ -11,18 +11,16 @@
'version' => '10.0.0',
'constraints' => [
'depends' => [
- 'typo3' => '12.4.0-12.99.99',
- 'lowlevel' => '12.4.0-12.99.99',
- 'tt_address' => '8.1.0-8.1.99',
- 'php' => '8.1.0-8.3.99',
+ 'typo3' => '13.4.0-13.4.99',
+ 'lowlevel' => '13.4.0-13.99.99',
+ 'tt_address' => '9.0.0-9.0.99',
+ 'php' => '8.2.0-8.4.99',
],
'conflicts' => [
],
'suggests' => [
],
],
- 'suggests' => [
- ],
'autoload' => [
'psr-4' => [
'DirectMailTeam\\DirectMail\\' => 'Classes/',
diff --git a/ext_localconf.php b/ext_localconf.php
index 82177c2e0..c11bd4996 100644
--- a/ext_localconf.php
+++ b/ext_localconf.php
@@ -54,9 +54,9 @@
*/
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail']['UseImplicitPortToFetch'] = $extConf['UseImplicitPortToFetch'];
- $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail']['SSLVerify'] = $extConf['SSLVerify'];
- $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail']['SSLVerifyPeer'] = $extConf['SSLVerifyPeer'];
- $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail']['SSLVerifyPeerName'] = $extConf['SSLVerifyPeerName'];
+ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail']['SSLVerify'] = $extConf['SSLVerify'] ?? 0;
+ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail']['SSLVerifyPeer'] = $extConf['SSLVerifyPeer'] ?? 1;
+ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail']['SSLVerifyPeerName'] = $extConf['SSLVerifyPeerName'] ?? 1;
/**
* Registering class to scheduler
@@ -82,15 +82,6 @@
'additionalFields' => 'DirectMailTeam\\DirectMail\\Scheduler\\AnalyzeBounceMailAdditionalFields',
];
- \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
- @import "EXT:direct_mail/Configuration/TSconfig/options.tsconfig"
- ');
-
- //https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/UsingSetting/PageTSconfig.html#global-page-tsconfig-compatible-with-typo3-11-and-12
- \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
- @import "EXT:direct_mail/Configuration/TSconfig/page.tsconfig"
- ');
-
// https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.3/Feature-100232-LoadAdditionalStylesheetsInTYPO3Backend.html
$GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets']['direct_mail'] = 'EXT:direct_mail/Resources/Public/StyleSheets/';
})();