-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from pluswerk/typo3-12
- Loading branch information
Showing
54 changed files
with
693 additions
and
1,084 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,26 +9,16 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ] | ||
typo3: [ '10', '11' ] | ||
exclude: | ||
- php: '7.2' | ||
typo3: '11' | ||
- php: '7.3' | ||
typo3: '11' | ||
|
||
- php: '8.0' | ||
typo3: '10' | ||
- php: '8.1' | ||
typo3: '10' | ||
php: [ '8.1', '8.2' ] | ||
typo3: [ '11', '12' ] | ||
steps: | ||
- name: Setup PHP with PECL extension | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
- uses: mirromutth/[email protected] | ||
with: | ||
mysql version: '5.7' | ||
mysql version: '8.0' | ||
mysql database: 'typo3_test' | ||
mysql root password: 'root' | ||
- uses: actions/checkout@v2 | ||
|
@@ -64,7 +54,7 @@ jobs: | |
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
php-version: '8.2' | ||
extensions: intl, mbstring, xml, soap, zip, curl | ||
|
||
- name: Install typo3/tailor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
/.Build/ | ||
/composer.lock | ||
/vendor/ | ||
var/ | ||
public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,5 @@ | ||
<?php | ||
|
||
/*** | ||
* | ||
* This file is part of an "+Pluswerk AG" Extension for TYPO3 CMS. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* (c) 2019 Felix König <[email protected]>, +Pluswerk AG | ||
* | ||
***/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pluswerk\MailLogger\Command; | ||
|
@@ -20,13 +9,13 @@ | |
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use TYPO3\CMS\Core\Mail\MailerInterface; | ||
use TYPO3\CMS\Core\Mail\MailMessage; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Extbase\Object\ObjectManager; | ||
|
||
class TestMailCommand extends Command | ||
{ | ||
protected function configure() | ||
protected function configure(): void | ||
{ | ||
$this | ||
->setDescription('Sends a test mail.') | ||
|
@@ -44,12 +33,20 @@ protected function execute(InputInterface $input, OutputInterface $output): int | |
if ($args['templatekey'] !== '') { | ||
$mail = MailUtility::getMailByKey($args['templatekey'], null); | ||
} else { | ||
$mail = GeneralUtility::makeInstance(ObjectManager::class)->get(MailMessage::class); | ||
$mail = GeneralUtility::makeInstance(MailMessage::class); | ||
->setSubject('Testmail') | ||
->html(str_pad('This is a testmail (html).', (int)$input->getOption('textLength'), '_ ')); | ||
} | ||
|
||
$mail->addTo($args['addressto']); | ||
return $mail->send() ? 0 : 1; | ||
|
||
if ($mail->send()) { | ||
$output->writeln('Successfully send mail'); | ||
return 0; | ||
} | ||
|
||
$output->writeln('<error>Error on send</error>'); | ||
return 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,53 @@ | ||
<?php | ||
|
||
/*** | ||
* | ||
* This file is part of an "+Pluswerk AG" Extension for TYPO3 CMS. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* (c) 2018 Markus Hölzle <[email protected]>, +Pluswerk AG | ||
* | ||
***/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pluswerk\MailLogger\Controller; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; | ||
use TYPO3\CMS\Core\Http\HtmlResponse; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Core\Page\PageRenderer; | ||
use Pluswerk\MailLogger\Domain\Model\MailLog; | ||
use Pluswerk\MailLogger\Domain\Repository\MailLogRepository; | ||
use TYPO3\CMS\Core\Pagination\SimplePagination; | ||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; | ||
use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator; | ||
|
||
/** | ||
*/ | ||
class MailLogController extends ActionController | ||
{ | ||
/** | ||
* @var \Pluswerk\MailLogger\Domain\Repository\MailLogRepository | ||
*/ | ||
protected $mailLogRepository; | ||
|
||
public function injectMailLogRepository(MailLogRepository $mailLogRepository): void | ||
{ | ||
$this->mailLogRepository = $mailLogRepository; | ||
public function __construct( | ||
private readonly MailLogRepository $mailLogRepository, | ||
private readonly ModuleTemplateFactory $moduleTemplateFactory, | ||
) { | ||
} | ||
|
||
/** | ||
* action dashboard | ||
* | ||
* @return void | ||
*/ | ||
public function dashboardAction(): void | ||
public function dashboardAction(): ResponseInterface | ||
{ | ||
$moduleTemplate = $this->moduleTemplateFactory->create($this->request); | ||
// Add required js files. | ||
$pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); | ||
$pageRenderer->loadRequireJsModule('TYPO3/CMS/MailLogger/MailLogController'); | ||
$pageRenderer->loadRequireJsModule('TYPO3/CMS/MailLogger/DashboardController'); | ||
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); | ||
assert($pageRenderer instanceof PageRenderer); | ||
$pageRenderer->loadRequireJsModule('TYPO3/CMS/MailLogger/Main'); | ||
|
||
// Assign all logged mails to template. | ||
$this->view->assign('mailLogs', $this->mailLogRepository->findAll()); | ||
|
||
$moduleTemplate->setContent($this->view->render()); | ||
return $this->htmlResponse($moduleTemplate->renderContent()); | ||
} | ||
|
||
/** | ||
* action show | ||
* | ||
* @param \Pluswerk\MailLogger\Domain\Model\MailLog $mailLog | ||
* @return void | ||
*/ | ||
public function showAction(MailLog $mailLog): void | ||
public function showAction(MailLog $mailLog): ResponseInterface | ||
{ | ||
$this->view->assign('mailLog', $mailLog); | ||
|
||
return $this->htmlResponse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,16 @@ | ||
<?php | ||
|
||
/*** | ||
* | ||
* This file is part of an "+Pluswerk AG" Extension for TYPO3 CMS. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* (c) 2018 Markus Hölzle <[email protected]>, +Pluswerk AG | ||
* | ||
***/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pluswerk\MailLogger\Domain\Model; | ||
|
||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; | ||
|
||
/** | ||
* Class AbstractModel | ||
*/ | ||
abstract class AbstractModel extends AbstractEntity | ||
{ | ||
/** | ||
* @var int|null | ||
*/ | ||
protected $tstamp = 0; | ||
|
||
/** | ||
* @var int|null | ||
*/ | ||
protected $crdate = 0; | ||
protected int|null $tstamp = 0; | ||
|
||
protected int|null $crdate = 0; | ||
|
||
public function getTstamp(): ?int | ||
{ | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,47 @@ | ||
<?php | ||
|
||
/*** | ||
* | ||
* This file is part of an "+Pluswerk AG" Extension for TYPO3 CMS. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* (c) 2018 Markus Hölzle <[email protected]>, +Pluswerk AG | ||
* | ||
***/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pluswerk\MailLogger\Domain\Model; | ||
|
||
/** | ||
* Class MailLog | ||
*/ | ||
class MailLog extends AbstractModel | ||
{ | ||
const MEBI_BYTE = 1048576; | ||
/** | ||
* @var string | ||
* @var int | ||
*/ | ||
protected $typoScriptKey = ''; | ||
final public const MEBI_BYTE = 1048576; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $subject = ''; | ||
protected string $typoScriptKey = ''; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $message = ''; | ||
protected string $subject = ''; | ||
|
||
protected string $message = ''; | ||
|
||
/** | ||
* json encoded | ||
* | ||
* @var string | ||
*/ | ||
protected $mailFrom = ''; | ||
protected string $mailFrom = ''; | ||
|
||
/** | ||
* json encoded | ||
* | ||
* @var string | ||
*/ | ||
protected $mailTo = ''; | ||
protected string $mailTo = ''; | ||
|
||
/** | ||
* json encoded | ||
* | ||
* @var string | ||
*/ | ||
protected $mailCopy = ''; | ||
protected string $mailCopy = ''; | ||
|
||
/** | ||
* json encoded | ||
* | ||
* @var string | ||
*/ | ||
protected $mailBlindCopy = ''; | ||
protected string $mailBlindCopy = ''; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $headers = ''; | ||
protected string $headers = ''; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $result = 'Not send until now'; | ||
protected string $result = 'Not send until now'; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
protected $sysLanguageUid = 0; | ||
protected int $sysLanguageUid = 0; | ||
|
||
public function getTypoScriptKey(): string | ||
{ | ||
|
@@ -113,6 +77,7 @@ public function setMessage(string $message): self | |
$this->message = substr($this->message, 0, self::MEBI_BYTE); | ||
$this->message .= ' (... message trimmed ...)'; | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
|
Oops, something went wrong.