Commit 3e1c20b4 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing some issues with the blacklisted field

parent e9be4554
......@@ -112,7 +112,7 @@ class Mail extends AbstractEntity {
/**
* @var boolean
*/
protected $isBlacklisted = FALSE;
protected $blacklisted = FALSE;
/**
* @return string
......@@ -318,14 +318,14 @@ class Mail extends AbstractEntity {
/**
* @return bool
*/
public function isBlacklisted() {
return $this->isBlacklisted;
public function getBlacklisted() {
return $this->blacklisted;
}
/**
* @param bool $isBlacklisted
* @param bool $blacklisted
*/
public function setIsBlacklisted(bool $isBlacklisted) {
$this->isBlacklisted = $isBlacklisted;
public function setBlacklisted($blacklisted) {
$this->blacklisted = (bool) $blacklisted;
}
}
......@@ -52,7 +52,7 @@ class MailRepository extends AbstractRepository {
$query->setOrderings(['priority' => Query::ORDER_DESCENDING]);
// ignore blacklisted templates
$constraintsAnd[] = $query->equals('is_blacklisted', FALSE);
$constraintsAnd[] = $query->equals('blacklisted', FALSE);
$constraintsAnd[] = $query->equals('sending_time', 0);
return $query->matching($query->logicalAnd($constraintsAnd))->execute();
}
......
......@@ -395,7 +395,7 @@ class MailTemplateService {
$mail->setExtensionKey($extensionKey);
$mail->setTemplateName($templateName);
$mail->setLanguage($language);
$mail->setIsBlacklisted(self::isTemplateBlacklisted($extensionKey, $templateName, $pid));
$mail->setBlacklisted(self::isTemplateBlacklisted($extensionKey, $templateName, $pid));
$mail->setFromAddress($this->fromAddress);
$mail->setFromName($this->fromName);
......
......@@ -32,7 +32,7 @@ return [
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'searchFields' => 'is_blacklisted, mail_subject, mail_body, to_address, from_address, from_name, bcc_addresses, cc_addresses, extension_key, template_name, sending_time, last_sending_time, language',
'searchFields' => 'blacklisted, mail_subject, mail_body, to_address, from_address, from_name, bcc_addresses, cc_addresses, extension_key, template_name, sending_time, last_sending_time, language',
'dividers2tabs' => TRUE,
'delete' => 'deleted',
'enablecolumns' => [
......@@ -42,11 +42,11 @@ return [
'iconfile' => 'EXT:sg_mail/Resources/Public/Icons/ModuleIconTCA.svg'
],
'interface' => [
'showRecordFieldList' => 'hidden, is_blacklisted, mail_subject, mail_body, to_address, from_address, priority, from_name, bcc_addresses, cc_addresses, extension_key, template_name, sending_time, last_sending_time, language',
'showRecordFieldList' => 'hidden, blacklisted, mail_subject, mail_body, to_address, from_address, priority, from_name, bcc_addresses, cc_addresses, extension_key, template_name, sending_time, last_sending_time, language',
],
'types' => [
'1' => [
'showitem' => 'hidden;;1, is_blacklisted, priority, to_address, from_address, mail_subject, mail_body, from_name, bcc_addresses, cc_addresses, extension_key, template_name, sending_time, last_sending_time, language'
'showitem' => 'hidden;;1, blacklisted, priority, to_address, from_address, mail_subject, mail_body, from_name, bcc_addresses, cc_addresses, extension_key, template_name, sending_time, last_sending_time, language'
],
],
'columns' => [
......@@ -57,9 +57,9 @@ return [
'type' => 'check',
],
],
'is_blacklisted' => [
'blacklisted' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_mail/Resources/Private/Language/locallang_db.xlf:tx_sgmail_domain_model_mail.is_blacklisted',
'label' => 'LLL:EXT:sg_mail/Resources/Private/Language/locallang_db.xlf:tx_sgmail_domain_model_mail.blacklisted',
'config' => [
'type' => 'check',
],
......
......@@ -16,7 +16,7 @@ CREATE TABLE tx_sgmail_domain_model_mail (
sending_time int(11) unsigned DEFAULT '0' NOT NULL,
last_sending_time int(11) unsigned DEFAULT '0' NOT NULL,
language varchar(255) DEFAULT '' NOT NULL,
is_blacklisted tinyint(4) unsigned DEFAULT '0' NOT NULL,
blacklisted tinyint(4) unsigned DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment