} // END - if
// Version of this extension
-setThisExtensionVersion('0.7.8');
+setThisExtensionVersion('0.7.9');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.2.0', '0.3.0', '0.3.1', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8'));
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.2.0', '0.3.0', '0.3.1', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
addDropTableSql('admins_mails');
addCreateTableSql('admins_mails', "
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`admin_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
`mail_template` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`),
INDEX (`admin_id`)",
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Abgekürzte Bezeichnungen können für Missverständnisse am Code sorgen. Daher wurde der Spaltenalias <strong>def_acl</strong> entfernt.");
break;
+
+ case '0.7.9': // SQL queries for v0.7.9
+ addExtensionChangeTableColumnSql('admins_mails', 'admin_id', 'admin_id', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
+ addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_admins_mails` SET `admin_id` = NULL WHERE `admin_id`=0');
+ addExtensionSql("DELETE `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template` IN ('admin-del_links', 'back-admin', 'done-admin', 'order-admin', 'register-admin')");
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Spalte <strong>admin_id</strong> ist jetzt Ausgangswert NULL, alte Mail-Templates bereinigt.");
+ break;
} // END - switch
break;
} else {
// Load all assigned mails
$result = SQL_QUERY("SELECT
- m.id, m.admin_id, a.login, m.mail_template
+ m.`id`,
+ m.`admin_id`,
+ a.`login`,
+ m.`mail_template`
FROM
- `{?_MYSQL_PREFIX?}_admins_mails` AS m
+ `{?_MYSQL_PREFIX?}_admins_mails` AS `m`
LEFT JOIN
- `{?_MYSQL_PREFIX?}_admins` AS a
+ `{?_MYSQL_PREFIX?}_admins` AS `a`
ON
- m.admin_id=a.id
+ m.`admin_id`=a.`id`
WHERE
- (m.admin_id=a.id OR m.admin_id < 1) AND m.mail_template != ''
+ (m.`admin_id`=a.`id` OR m.`admin_id` < 1) AND m.`mail_template` != ''
ORDER BY
- m.admin_id ASC,
- m.mail_template ASC", __FILE__, __LINE__);
+ m.`admin_id` ASC,
+ m.`mail_template` ASC", __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
// Shall I change entries?