Skip to content

Commit

Permalink
Version 6.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bihor committed Nov 28, 2023
1 parent 1b5a21e commit bff3049
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 16 deletions.
17 changes: 15 additions & 2 deletions Classes/Controller/LogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,12 @@ public function deleteAction(Log $log = null, array $user = []): ResponseInterfa
elseif ($extAddress['gender'] == 'm') $gender = 2;
elseif ($extAddress['gender'] == 'v') $gender = 3;
$log->setGender($gender);
} elseif ($this->settings['newsletterExtension'] == 'mail' && $this->settings['table'] == 'fe_users' && $extAddress['mail_salutation']) {
$gender = 0;
if ($extAddress['mail_salutation'] == $this->settings['gender']['mrs']) $gender = 1;
elseif ($extAddress['mail_salutation'] == $this->settings['gender']['mr']) $gender = 2;
elseif ($extAddress['mail_salutation'] == $this->settings['gender']['divers']) $gender = 3;
$log->setGender($gender);
}
}
} else {
Expand Down Expand Up @@ -1188,7 +1194,8 @@ public function verifyUnsubscribeAction(): ResponseInterface
*/
protected function deleteThisUser($uid)
{
if ($this->settings['table'] == 'tt_address') {
if ($this->settings['table'] == 'tt_address' ||
($this->settings['table'] == 'fe_users' && $this->settings['newsletterExtension'] == 'mail')) {
if ($this->settings['categoryOrGroup']) {
$dmail_cats = str_replace(' ', '', $this->settings['categoryOrGroup']);
$dmCatArr = explode(',', $dmail_cats);
Expand All @@ -1198,7 +1205,13 @@ protected function deleteThisUser($uid)
} else {
$dmCatArr = [];
}
$this->logRepository->deleteExternalUser($uid, $this->settings['deleteMode'], $dmCatArr, $this->settings['table']);
$this->logRepository->deleteExternalUser(
$uid,
$this->settings['deleteMode'],
$dmCatArr,
$this->settings['table'],
$this->settings['newsletterExtension']
);
}

/**
Expand Down
31 changes: 26 additions & 5 deletions Classes/Domain/Repository/LogRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,12 @@ function updateInFeUsers($address, $tableUid, $extension)
/**
* deleteExternalUser: delete user
* @param integer $uid tt_address oder fe_users uid
* @param integer $mode Löschen-Modus: 1: update, 2: löschen
* @param integer $mode Löschen-Modus: 1: update, 2: löschen, 3: nur Kategorien/Gruppen entfernen
* @param array $dmCatArr sys_category categories
* @param string $table tt_address or fe_users
* @param string $extension luxletter or mail
*/
function deleteExternalUser($uid, $mode, $dmCatArr = [], $table = 'tt_address')
function deleteExternalUser($uid, $mode, $dmCatArr = [], $table = 'tt_address', $extension)
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
if ($mode == 2) {
Expand All @@ -425,17 +426,37 @@ function deleteExternalUser($uid, $mode, $dmCatArr = [], $table = 'tt_address')
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))
)
->executeStatement();
} else {
} elseif ($mode != 3) {
$queryBuilder
->update($table)
->where(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))
)
->set('deleted', '1')
->set('deleted', 1)
->set('tstamp', time())
->executeStatement();
} elseif ($mode == 3 && $table == 'fe_users') {
if ($extension == 'luxletter') {
$queryBuilder
->update($table)
->where(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))
)
->set('usergroup', '')
->set('tstamp', time())
->executeStatement();
} elseif ($extension == 'mail') {
$queryBuilder
->update($table)
->where(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))
)
->set('mail_active', 0)
->set('tstamp', time())
->executeStatement();
}
}
if (($table == 'tt_address') && is_array($dmCatArr) && count($dmCatArr)>0) {
if (is_array($dmCatArr) && count($dmCatArr)>0) {
$this->deleteInMm($uid, $table);
}
}
Expand Down
4 changes: 4 additions & 0 deletions Configuration/FlexForms/flexform_pi1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@
<numIndex index="0">LLL:EXT:fp_newsletter/Resources/Private/Language/locallang_be.xlf:settings.deleteMode.2</numIndex>
<numIndex index="1">2</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:fp_newsletter/Resources/Private/Language/locallang_be.xlf:settings.deleteMode.3</numIndex>
<numIndex index="1">3</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
Expand Down
7 changes: 6 additions & 1 deletion Documentation/ChangeLog/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,9 @@ Version 6.0.0:

Version 6.1.0:
- Compatibility to TYPO3 11.5 added again.
- Bugfix: language added to the links in the email.
- Bugfix: language added to the links in the email.

Version 6.2.0:
- fe_users can now be used with the extension luxletter or mail.
- deleteMode 3 added: delete only categories (Mail) or user-group (Luxletter).
- new setting: newsletterExtension (mail or luxletter).
7 changes: 6 additions & 1 deletion Documentation/Configuration/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ editUid integer Page, where a user can edit his su
gdprUid integer Page with the GDPR text 1
daysExpire integer The link expires after X days 2
searchPidMode integer Search in tt_address: 0: only in the 1. folder; 1: in all folders° 0
deleteMode integer 1: set deletion flag; 2: delete entry 1
deleteMode integer 1: set deletion flag; 2: delete entry; 3: remove only the cat./group 1
languageMode integer 0: uses -1 if L>0; 1: uses the sys_language_uid from pages 0
categoryMode integer 0: allow only categories/groups specified in categoryOrGroup; 1: all 1
categoryOrderBy string category order by: title, sorting or uid title
Expand Down Expand Up @@ -198,6 +198,11 @@ The categories are as hidden-field in the template. You could add checkboxes and
the hidden-field if you need a more flexible solution.

Note: this setting is used for groups of fe_users too! If you use fe_users, here you can set the fe_groups.
That works only with the extension Luxletter. If newsletterExtension=mail is set, user groups are ignored.
Therefore only categories are used.

Note: if deleteMode=3 is set, only categories set in categoryOrGroup will be removed. And the flag mail_active will be
set to 0, if newsletterExtension=mail is set.

Changing the labels
^^^^^^^^^^^^^^^^^^^
Expand Down
7 changes: 6 additions & 1 deletion Documentation/Localization.de_DE/ChangeLog/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,9 @@ Version 6.0.0:

Version 6.1.0:
- Kompatibilität zu TYPO3 11.5 erneut hinzugefügt.
- Bugfix: Sprache zu den Links in den E-Mails hinzugefügt.
- Bugfix: Sprache zu den Links in den E-Mails hinzugefügt.

Version 6.2.0:
- fe_users kann nun mit der Extension Luxletter oder Mail benutzt werden.
- deleteMode 3 hinzugefügt: lösche nur Kategorien (Mail) oder Benutzergruppe (Luxletter).
- Neue Einstellungsmöglichkeit: newsletterExtension (mail oder luxletter).
8 changes: 6 additions & 2 deletions Documentation/Localization.de_DE/Configuration/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ editUid integer Seite, auf der man seit Abonnement
gdprUid integer Seite mit den DSGVO-Texten 1
daysExpire integer Der Verifikations-Link wird ungültig nach X Tagen 2
searchPidMode integer Suche in tt_address: 0: nur im 1. Ordner; 1: in allen Ordners° 0
deleteMode integer 1: setze delete-Flag; 2: lösche endgültig 1
deleteMode integer 1: setze delete-Flag; 2: lösche endgültig; 3: lösche nur Kat./Gruppe 1
languageMode integer 0: setzt -1 wenn L>0; 1: benutzte die sys_language_uid von pages 0
categoryMode integer 0: nur angegebene Kategorien bei Edit erlauben; 1: alle 1
unsubscribeMode integer 0: Sofort-Abmeldung durch Link aus Luxletter; 1: zeige Abmeldeform 0
Expand Down Expand Up @@ -192,7 +192,11 @@ Es werden dann 2 Einträge in sys_category_record_mm gemacht und in tt_address w
Die Kategorien werden als hidden-Feld ins Template eingefügt. Wenn man eine flexiblere Lösung will, könnte man z.B. Checkboxes per jQuery auswerten und
die angeklickten Kategorien ins hidden-Feld kopieren.

Genau so kann man auch Gruppen für fe_users angeben.
Genau so kann man auch Gruppen für fe_users angeben. Das gilt nur für die Extension Luxletter.
Wenn newsletterExtension=mail gesetzt ist, werden keine Benutzer-Gruppen beachtet. Dann werden nur Kategorien benutzt.

Beachte: wenn deleteMode=3 gesetzt ist, werden nur die Kategorien entfernt, die unter categoryOrGroup angegeben sind.
Und das Feld mail_active wird auf 0 gesetzt, wenn newsletterExtension=mail gesetzt ist.

Ändern der Labels
^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# fp_newsletter

version 6.1.1
version 6.2.0

The TYPO3 extension fp_newsletter is designed to provide a newsletter subscription and unsubscription service for the
table tt_address which can be used by the extension mail OR for the table fe_users which can be used by luxletter.
table tt_address which can be used by the extension mail OR for the table fe_users which can be used by luxletter or mail.
Furthermore, it is designed to be compatible with the GDPR. A log is written about every action in a separate table.
Old log entries can be deleted by a scheduler task.
Supports Google reCaptcha v3 or a mathematical captcha.
Expand Down Expand Up @@ -41,4 +41,6 @@ Version 6.1.0:
- Bugfix: language added to the links in the email.

Version 6.2.0:
- fe_users can now be used with the extension luxletter or mail.
- fe_users can now be used with the extension luxletter or mail.
- deleteMode 3 added: delete only categories (Mail) or user-group (Luxletter).
- new setting: newsletterExtension (mail or luxletter).
4 changes: 4 additions & 0 deletions Resources/Private/Language/de.locallang_be.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
<source>delete entry</source>
<target>lösche den Eintrag endgültig</target>
</trans-unit>
<trans-unit id="settings.deleteMode.3" resname="settings.deleteMode.3">
<source>delete only cat./group</source>
<target>lösche nur die Kategorien (Mail) oder die Benutzergruppe (Luxletter)</target>
</trans-unit>
<trans-unit id="settings.languageMode" resname="settings.languageMode">
<source>Language mode</source>
<target>Sprachmodus</target>
Expand Down
4 changes: 4 additions & 0 deletions Resources/Private/Language/fr.locallang_be.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
<source>delete entry</source>
<target>Suppression physique</target>
</trans-unit>
<trans-unit id="settings.deleteMode.3" resname="settings.deleteMode.3">
<source>delete only cat/group</source>
<target>Supprimer uniquement les catégories (Mail) ou le groupe d'utilisateurs (Luxletter)</target>
</trans-unit>
<trans-unit id="settings.languageMode" resname="settings.languageMode">
<source>Language mode</source>
<target>Mode de localisation</target>
Expand Down
4 changes: 4 additions & 0 deletions Resources/Private/Language/it.locallang_be.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
<source>delete entry</source>
<target>eliminare la voce</target>
</trans-unit>
<trans-unit id="settings.deleteMode.3" resname="settings.deleteMode.3">
<source>delete only cat./group</source>
<target>eliminare solo le categorie (Mail) o il gruppo utenti (Luxletter)</target>
</trans-unit>
<trans-unit id="settings.languageMode" resname="settings.languageMode">
<source>Language mode</source>
<target>Modalità lingua</target>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang_be.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<trans-unit id="settings.deleteMode.2" resname="settings.deleteMode.2">
<source>delete entry</source>
</trans-unit>
<trans-unit id="settings.deleteMode.3" resname="settings.deleteMode.3">
<source>delete only categories (mail) or user-group (luxletter)</source>
</trans-unit>
<trans-unit id="settings.languageMode" resname="settings.languageMode">
<source>Language mode</source>
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'author_company' => 'fixpunkt für digitales GmbH',
'state' => 'stable',
'clearCacheOnLoad' => 0,
'version' => '6.1.1',
'version' => '6.2.0',
'constraints' => [
'depends' => [
'typo3' => '11.5.0-12.4.99'
Expand Down

0 comments on commit bff3049

Please sign in to comment.