| 1 |
<?php |
| 2 |
|
| 3 |
namespace AcyMailing\Helpers\Update; |
| 4 |
|
| 5 |
use AcyMailing\Classes\ConfigurationClass; |
| 6 |
|
| 7 |
trait Patchv11 |
| 8 |
{ |
| 9 |
private function updateFor1102(): void |
| 10 |
{ |
| 11 |
if ($this->isPreviousVersionAtLeast('11.0.2')) { |
| 12 |
return; |
| 13 |
} |
| 14 |
|
| 15 |
$this->updateQuery('UPDATE #__acym_user_has_list SET `status` = 0 WHERE `status` = -1'); |
| 16 |
} |
| 17 |
|
| 18 |
private function updateFor1105(): void |
| 19 |
{ |
| 20 |
if ($this->isPreviousVersionAtLeast('11.0.5')) { |
| 21 |
return; |
| 22 |
} |
| 23 |
|
| 24 |
$this->updateQuery( |
| 25 |
'CREATE TABLE IF NOT EXISTS `#__acym_mail_stat_detail` ( |
| 26 |
`mail_id` INT NOT NULL, |
| 27 |
`detail_type` VARCHAR(20) NOT NULL, |
| 28 |
`detail_key` VARCHAR(100) NOT NULL, |
| 29 |
`number` INT NOT NULL DEFAULT 0, |
| 30 |
PRIMARY KEY (`mail_id`, `detail_type`, `detail_key`) |
| 31 |
)' |
| 32 |
); |
| 33 |
} |
| 34 |
|
| 35 |
private function updateFor1110(): void |
| 36 |
{ |
| 37 |
if ($this->isPreviousVersionAtLeast('11.1.0')) { |
| 38 |
return; |
| 39 |
} |
| 40 |
|
| 41 |
$this->updateQuery( |
| 42 |
'UPDATE #__acym_configuration |
| 43 |
SET `value` = 0 |
| 44 |
WHERE `name` = "favorite_template" |
| 45 |
AND `value` != 0 |
| 46 |
AND `value` NOT IN (SELECT `id` FROM #__acym_mail)' |
| 47 |
); |
| 48 |
} |
| 49 |
|
| 50 |
private function updateFor1111(ConfigurationClass $config): void |
| 51 |
{ |
| 52 |
if ($this->isPreviousVersionAtLeast('11.1.1')) { |
| 53 |
return; |
| 54 |
} |
| 55 |
|
| 56 |
$sendMethod = $config->get('mailer_method'); |
| 57 |
if ($sendMethod === 'acymailer') { |
| 58 |
$config->saveConfig( |
| 59 |
[ |
| 60 |
'embed_images' => 0, |
| 61 |
'embed_files' => 0, |
| 62 |
] |
| 63 |
); |
| 64 |
} |
| 65 |
} |
| 66 |
} |
| 67 |
|