Fisheye: Tag 15608 refers to a dead (removed) revision in file `branches/5.2.x/core/admin_templates/regional/email_messages_edit.tpl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: branches/5.2.x/core/units/users/users_event_handler.php
===================================================================
diff -u -r15590 -r15608
--- branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 15590)
+++ branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 15608)
@@ -1,6 +1,6 @@
status == kEvent::erSUCCESS) && $event->redirect ) {
$this->assignToPrimaryGroup($event);
- $object->SendEmailEvents();
+ $object->sendEmails();
$this->autoLoginUser($event);
}
}
@@ -657,8 +657,8 @@
);
$user_id = $this->Application->RecallVar('user_id');
- $email_sent = $this->Application->EmailEventUser('USER.SUGGEST', $user_id, $send_params);
- $this->Application->EmailEventAdmin('USER.SUGGEST');
+ $email_sent = $this->Application->emailUser('USER.SUGGEST', $user_id, $send_params);
+ $this->Application->emailAdmin('USER.SUGGEST');
if ( $email_sent ) {
$event->SetRedirectParam('pass', 'all');
@@ -815,8 +815,8 @@
$this->Conn->doInsert($fields_hash, TABLE_PREFIX . 'UserGroupRelations');
}
- $this->Application->EmailEventAdmin('USER.SUBSCRIBE');
- $this->Application->EmailEventUser('USER.SUBSCRIBE', $object->GetID());
+ $this->Application->emailAdmin('USER.SUBSCRIBE');
+ $this->Application->emailUser('USER.SUBSCRIBE', $object->GetID());
}
/**
@@ -832,8 +832,8 @@
WHERE PortalUserId = ' . $user_id . ' AND GroupId = ' . $group_id;
$this->Conn->Query($sql);
- $this->Application->EmailEventAdmin('USER.UNSUBSCRIBE');
- $this->Application->EmailEventUser('USER.UNSUBSCRIBE', $user_id);
+ $this->Application->emailAdmin('USER.UNSUBSCRIBE');
+ $this->Application->emailUser('USER.UNSUBSCRIBE', $user_id);
}
/**
@@ -876,7 +876,7 @@
}
if ( $found && $allow_reset ) {
- $this->Application->EmailEventUser('USER.PSWDC', $user->GetID());
+ $this->Application->emailUser('USER.PSWDC', $user->GetID());
$event->redirect = $this->Application->GetVar('template_success');
return;
@@ -1038,8 +1038,8 @@
if ($records) {
$conditions = Array();
foreach ($records as $record) {
- $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
- $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
+ $this->Application->emailUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
+ $this->Application->emailAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
$conditions[] = '(PortalUserId = '.$record['PortalUserId'].' AND GroupId = '.$record['GroupId'].')';
}
$sql = 'UPDATE '.TABLE_PREFIX.'UserGroupRelations
@@ -1056,8 +1056,8 @@
$user_ids = $this->Conn->GetCol($sql);
if ($user_ids) {
foreach ($user_ids as $id) {
- $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
- $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
+ $this->Application->emailUser('USER.MEMBERSHIP.EXPIRED', $id);
+ $this->Application->emailAdmin('USER.MEMBERSHIP.EXPIRED');
}
}
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroupRelations
@@ -1381,7 +1381,7 @@
$object->SetField('Password', $email_passwords[$temp_id]);
$object->SetField('VerifyPassword', $email_passwords[$temp_id]);
- $this->Application->EmailEventUser($temp_id > 0 ? 'USER.NEW.PASSWORD': 'USER.ADD.BYADMIN', $object->GetID());
+ $this->Application->emailUser($temp_id > 0 ? 'USER.NEW.PASSWORD': 'USER.ADD.BYADMIN', $object->GetID());
unset($email_passwords[$temp_id]);
$this->Application->StoreVar('email_passwords', serialize($email_passwords));
@@ -1430,8 +1430,8 @@
$email_event = isset($status_events[$new_status]) ? $status_events[$new_status] : false;
if (($prev_status != $new_status) && $email_event) {
- $this->Application->EmailEventUser($email_event, $user_id);
- $this->Application->EmailEventAdmin($email_event);
+ $this->Application->emailUser($email_event, $user_id);
+ $this->Application->emailAdmin($email_event);
}
// deletes sessions from users, that are no longer active
@@ -1485,11 +1485,11 @@
'to_name' => trim($object->GetDBField('FirstName') . ' ' . $object->GetDBField('LastName')),
);
- $this->Application->EmailEventUser('USER.EMAIL.CHANGE.UNDO', null, $send_params);
+ $this->Application->emailUser('USER.EMAIL.CHANGE.UNDO', null, $send_params);
}
if ( $new_email ) {
- $this->Application->EmailEventUser('USER.EMAIL.CHANGE.VERIFY', $user_id);
+ $this->Application->emailUser('USER.EMAIL.CHANGE.VERIFY', $user_id);
}
// direct DB update, since USER.EMAIL.CHANGE.VERIFY puts verification code in user record, that we don't want to loose
@@ -1903,7 +1903,7 @@
$new_root_password = kUtil::generatePassword();
$this->Application->SetConfigValue('RootPass', $password_formatter->hashPassword($new_root_password));
- $this->Application->EmailEventAdmin('ROOT.RESET.PASSWORD', null, Array ('password' => $new_root_password));
+ $this->Application->emailAdmin('ROOT.RESET.PASSWORD', null, Array ('password' => $new_root_password));
$event->SetRedirectParam('reset', 1);
$event->SetRedirectParam('pass', 'm');
Index: branches/5.2.x/core/admin_templates/config/custom_variables.tpl
===================================================================
diff -u -r15437 -r15608
--- branches/5.2.x/core/admin_templates/config/custom_variables.tpl (.../custom_variables.tpl) (revision 15437)
+++ branches/5.2.x/core/admin_templates/config/custom_variables.tpl (.../custom_variables.tpl) (revision 15608)
@@ -114,7 +114,7 @@
-
+
-
+
Index: branches/5.2.x/core/install/upgrades.php
===================================================================
diff -u -r15590 -r15608
--- branches/5.2.x/core/install/upgrades.php (.../upgrades.php) (revision 15590)
+++ branches/5.2.x/core/install/upgrades.php (.../upgrades.php) (revision 15608)
@@ -1,6 +1,6 @@
Array ('from' => 'Category', 'to' => 'Categories'),
'cf' => Array ('from' => 'CustomField', 'to' => 'CustomFields'),
'draft' => Array ('from' => 'Drafts', 'to' => 'FormSubmissionReplyDrafts'),
- 'emailevents' => Array ('from' => 'Events', 'to' => 'EmailEvents'),
+ 'email-template' => Array ('from' => 'Events', 'to' => 'EmailEvents'),
'fav' => Array ('from' => 'Favorites', 'to' => 'UserFavorites'),
'img' => Array ('from' => 'Images', 'to' => 'CatalogImages'),
'#file' => Array ('from' => 'ItemFiles', 'to' => 'CatalogFiles'),
@@ -164,9 +164,9 @@
if ($mode == 'after') {
// 1. get event ids based on their name and type combination
$event_names = Array (
- 'USER.PSWD_' . EmailEvent::EVENT_TYPE_ADMIN,
- 'USER.PSWD_' . EmailEvent::EVENT_TYPE_FRONTEND,
- 'USER.PSWDC_' . EmailEvent::EVENT_TYPE_FRONTEND,
+ 'USER.PSWD_' . EmailTemplate::TEMPLATE_TYPE_ADMIN,
+ 'USER.PSWD_' . EmailTemplate::TEMPLATE_TYPE_FRONTEND,
+ 'USER.PSWDC_' . EmailTemplate::TEMPLATE_TYPE_FRONTEND,
);
$event_sql = Array ();
@@ -1212,7 +1212,7 @@
// partially delete events
$sql = 'SELECT EventId
FROM ' . TABLE_PREFIX . 'Events
- WHERE (Event IN ("CATEGORY.APPROVE", "CATEGORY.DENY")) AND (Type = ' . EmailEvent::EVENT_TYPE_ADMIN . ')';
+ WHERE (Event IN ("CATEGORY.APPROVE", "CATEGORY.DENY")) AND (Type = ' . EmailTemplate::TEMPLATE_TYPE_ADMIN . ')';
$event_ids = $this->Conn->GetCol($sql);
if ($event_ids) {
@@ -1485,12 +1485,12 @@
/* @var $ml_helper kMultiLanguageHelper */
$ml_helper->createFields('phrases');
- $ml_helper->createFields('emailevents');
+ $ml_helper->createFields('email-template');
$languages = $ml_helper->getLanguages();
if ($this->Conn->TableFound(TABLE_PREFIX . 'EmailMessage', true)) {
- $email_message_helper = $this->Application->recallObject('kEmailMessageHelper');
- /* @var $email_message_helper kEmailMessageHelper */
+ $email_template_helper = $this->Application->recallObject('kEmailTemplateHelper');
+ /* @var $email_template_helper kEmailTemplateHelper */
foreach ($languages as $language_id) {
$sql = 'SELECT EmailMessageId, Template, EventId
@@ -1499,7 +1499,7 @@
$translations = $this->Conn->Query($sql, 'EventId');
foreach ($translations as $event_id => $translation_data) {
- $parsed = $email_message_helper->parseTemplate($translation_data['Template'], 'html');
+ $parsed = $email_template_helper->parseTemplate($translation_data['Template'], 'html');
$fields_hash = Array (
'l' . $language_id . '_Subject' => $parsed['Subject'],
@@ -1702,22 +1702,22 @@
continue;
}
- if ($event_data['Type'] == EmailEvent::EVENT_TYPE_FRONTEND) {
+ if ($event_data['Type'] == EmailTemplate::TEMPLATE_TYPE_FRONTEND) {
// from user
$fields_hash = Array (
'CustomSender' => 1,
- 'SenderAddressType' => EmailEvent::ADDRESS_TYPE_USER,
+ 'SenderAddressType' => EmailTemplate::ADDRESS_TYPE_USER,
'SenderAddress' => $username
);
}
- if ($event_data['Type'] == EmailEvent::EVENT_TYPE_ADMIN) {
+ if ($event_data['Type'] == EmailTemplate::TEMPLATE_TYPE_ADMIN) {
// to user
$records = Array (
Array (
- 'RecipientType' => EmailEvent::RECIPIENT_TYPE_TO,
+ 'RecipientType' => EmailTemplate::RECIPIENT_TYPE_TO,
'RecipientName' => '',
- 'RecipientAddressType' => EmailEvent::ADDRESS_TYPE_USER,
+ 'RecipientAddressType' => EmailTemplate::ADDRESS_TYPE_USER,
'RecipientAddress' => $username
)
);
@@ -2054,8 +2054,8 @@
*/
private function _splitEmailBody()
{
- $id_field = $this->Application->getUnitOption('emailevents', 'IDField');
- $table_name = $this->Application->getUnitOption('emailevents', 'TableName');
+ $id_field = $this->Application->getUnitOption('email-template', 'IDField');
+ $table_name = $this->Application->getUnitOption('email-template', 'TableName');
$fields = $this->Conn->Query('DESCRIBE ' . $table_name, 'Field');
if ( !isset($fields['l1_Body']) ) {
@@ -2067,7 +2067,7 @@
/* @var $ml_helper kMultiLanguageHelper */
$languages = $ml_helper->getLanguages();
- $ml_helper->createFields('emailevents');
+ $ml_helper->createFields('email-template');
$sql = 'SELECT *
FROM ' . $table_name;
@@ -2111,7 +2111,7 @@
$languages = $ml_helper->getLanguages();
- $event_table = $this->Application->getUnitOption('emailevents', 'TableName');
+ $event_table = $this->Application->getUnitOption('email-template', 'TableName');
$sql = 'SELECT *
FROM ' . $event_table . '
@@ -2189,7 +2189,7 @@
// fix e-mail event translations
$languages = $ml_helper->getLanguages();
- $table_name = $this->Application->getUnitOption('emailevents', 'TableName');
+ $table_name = $this->Application->getUnitOption('email-template', 'TableName');
$change_fields = Array ('Subject', 'HtmlBody', 'PlainTextBody');
@@ -2206,7 +2206,7 @@
// add new ml columns to phrases/e-mail events
$ml_helper->createFields('phrases');
- $ml_helper->createFields('emailevents');
+ $ml_helper->createFields('email-template');
}
/**
Index: branches/5.2.x/core/units/helpers/language_import_helper.php
===================================================================
diff -u -r15601 -r15608
--- branches/5.2.x/core/units/helpers/language_import_helper.php (.../language_import_helper.php) (revision 15601)
+++ branches/5.2.x/core/units/helpers/language_import_helper.php (.../language_import_helper.php) (revision 15608)
@@ -1,6 +1,6 @@
false,
- 'emailevents' => false,
+ 'email-template' => false,
'country-state' => false,
);
@@ -190,7 +190,7 @@
// copy data from temp tables to live
foreach ($this->_languages as $language_id) {
$this->_performUpgrade($language_id, 'phrases', 'PhraseKey', Array ('l%s_Translation', 'l%s_HintTranslation', 'l%s_ColumnTranslation', 'PhraseType'));
- $this->_performUpgrade($language_id, 'emailevents', 'EventId', Array ('l%s_Subject', 'Headers', 'l%s_HtmlBody', 'l%s_PlainTextBody'));
+ $this->_performUpgrade($language_id, 'email-template', 'TemplateId', Array ('l%s_Subject', 'Headers', 'l%s_HtmlBody', 'l%s_PlainTextBody'));
$this->_performUpgrade($language_id, 'country-state', 'CountryStateId', Array ('l%s_Name'));
}
@@ -262,19 +262,19 @@
$module_sql = preg_replace('/(.*),/U', 'INSTR(Module,\'\\1\') OR ', implode(',', $module_ids) . ',');
// apply event selection limit
- if ($this->_exportLimits['emailevents']) {
- $escaped_email_events = $this->Conn->qstrArray($this->_exportLimits['emailevents']);
- $limit_where = '`Event` IN (' . implode(',', $escaped_email_events) . ')';
+ if ($this->_exportLimits['email-template']) {
+ $escaped_email_templates = $this->Conn->qstrArray($this->_exportLimits['email-template']);
+ $limit_where = 'TemplateName IN (' . implode(',', $escaped_email_templates) . ')';
}
else {
$limit_where = 'TRUE';
}
$sql = 'SELECT *
- FROM ' . $this->Application->getUnitOption('emailevents', 'TableName') . '
+ FROM ' . $this->Application->getUnitOption('email-template', 'TableName') . '
WHERE `Type` IN (' . implode(',', $phrase_types) . ') AND (' . substr($module_sql, 0, -4) . ') AND ' . $limit_where . '
- ORDER BY `Event`, `Type`';
- $events = $this->Conn->Query($sql, 'EventId');
+ ORDER BY TemplateName, `Type`';
+ $email_templates = $this->Conn->Query($sql, 'TemplateId');
if ( in_array('Core', $module_ids) ) {
if ($this->_exportLimits['country-state']) {
@@ -388,15 +388,15 @@
}
// email events
- if ($events) {
+ if ($email_templates) {
$ret .= "\t\t" . '' . "\n";
- foreach ($events as $event_data) {
+ foreach ($email_templates as $template_data) {
$fields_hash = Array (
- 'HEADERS' => $event_data['Headers'],
- 'SUBJECT' => $event_data['l' . $language_id . '_Subject'],
- 'HTMLBODY' => $event_data['l' . $language_id . '_HtmlBody'],
- 'PLAINTEXTBODY' => $event_data['l' . $language_id . '_PlainTextBody'],
+ 'HEADERS' => $template_data['Headers'],
+ 'SUBJECT' => $template_data['l' . $language_id . '_Subject'],
+ 'HTMLBODY' => $template_data['l' . $language_id . '_HtmlBody'],
+ 'PLAINTEXTBODY' => $template_data['l' . $language_id . '_PlainTextBody'],
);
$data = '';
@@ -408,7 +408,7 @@
}
if ( $data ) {
- $ret .= "\t\t\t" . '' . "\n" . $data . "\t\t\t" . '' . "\n";
+ $ret .= "\t\t\t" . '' . "\n" . $data . "\t\t\t" . '' . "\n";
}
}
@@ -493,7 +493,7 @@
function setExportLimit($prefix, $data = null)
{
if ( !isset($data) ) {
- $key_field = $prefix == 'phrases' ? 'Phrase' : 'Event';
+ $key_field = $prefix == 'phrases' ? 'Phrase' : 'TemplateName';
$ids = $this->getExportIDs($prefix);
$sql = 'SELECT ' . $key_field . '
@@ -665,7 +665,7 @@
function _initImportTables($drop_only = false)
{
$this->_tables['phrases'] = $this->_prepareTempTable('phrases', $drop_only);
- $this->_tables['emailevents'] = $this->_prepareTempTable('emailevents', $drop_only);
+ $this->_tables['email-template'] = $this->_prepareTempTable('email-template', $drop_only);
$this->_tables['country-state'] = $this->_prepareTempTable('country-state', $drop_only);
}
@@ -698,8 +698,8 @@
$unique_field = 'PhraseKey';
break;
- case 'emailevents':
- $unique_field = 'EventId';
+ case 'email-template':
+ $unique_field = 'TemplateId';
break;
case 'country-state':
@@ -724,8 +724,8 @@
*/
function _updateEventsCache()
{
- $sql = 'SELECT EventId, CONCAT(Event,"_",Type) AS EventMix
- FROM ' . TABLE_PREFIX . 'EmailEvents';
+ $sql = 'SELECT TemplateId, CONCAT(TemplateName,"_",Type) AS EventMix
+ FROM ' . $this->Application->getUnitOption('email-template', 'TableName');
$this->events_hash = $this->Conn->GetCol($sql, 'EventMix');
}
@@ -984,59 +984,59 @@
$this->Application->Debugger->profileStart('L[' . $language_id . ']E', 'Language: ' . $language_id . '; Events Import');
}
- $email_message_helper = $this->Application->recallObject('kEmailMessageHelper');
- /* @var $email_message_helper kEmailMessageHelper */
+ $email_template_helper = $this->Application->recallObject('kEmailTemplateHelper');
+ /* @var $email_template_helper kEmailTemplateHelper */
foreach ($events as $event_node) {
/* @var $event_node SimpleXMLElement */
$message_type = (string)$event_node['MessageType'];
- $event_id = $this->_getEventId((string)$event_node['Event'], (int)$event_node['Type']);
+ $email_template_id = $this->_getEmailTemplateId((string)$event_node['Event'], (int)$event_node['Type']);
- if ( !$event_id ) {
+ if ( !$email_template_id ) {
continue;
}
$fields_hash = Array (
- 'EventId' => $event_id,
- 'Event' => (string)$event_node['Event'],
+ 'TemplateId' => $email_template_id,
+ 'TemplateName' => (string)$event_node['Event'],
'Type' => (int)$event_node['Type'],
);
if ( $message_type == '' ) {
- $parsed = $email_message_helper->parseTemplate($event_node, '');
+ $parsed = $email_template_helper->parseTemplate($event_node, '');
$parsed = array_map($language_encoding == 'plain' ? 'rtrim' : 'base64_decode', $parsed);
}
else {
$template = $language_encoding == 'plain' ? rtrim($event_node) : base64_decode($event_node);
- $parsed = $email_message_helper->parseTemplate($template, $message_type);
+ $parsed = $email_template_helper->parseTemplate($template, $message_type);
}
- if ( !array_key_exists($event_id, $other_translations) ) {
+ if ( !array_key_exists($email_template_id, $other_translations) ) {
// ensure translation in every language to make same column count in every insert
- $other_translations[$event_id] = Array ();
+ $other_translations[$email_template_id] = Array ();
foreach ($this->_languages as $other_language_id) {
- $other_translations[$event_id]['l' . $other_language_id . '_Subject'] = '';
- $other_translations[$event_id]['l' . $other_language_id . '_HtmlBody'] = '';
- $other_translations[$event_id]['l' . $other_language_id . '_PlainTextBody'] = '';
+ $other_translations[$email_template_id]['l' . $other_language_id . '_Subject'] = '';
+ $other_translations[$email_template_id]['l' . $other_language_id . '_HtmlBody'] = '';
+ $other_translations[$email_template_id]['l' . $other_language_id . '_PlainTextBody'] = '';
}
}
- $other_translations[$event_id]['l' . $language_id . '_Subject'] = $parsed['Subject'];
- $other_translations[$event_id]['l' . $language_id . '_HtmlBody'] = $parsed['HtmlBody'];
- $other_translations[$event_id]['l' . $language_id . '_PlainTextBody'] = $parsed['PlainTextBody'];
+ $other_translations[$email_template_id]['l' . $language_id . '_Subject'] = $parsed['Subject'];
+ $other_translations[$email_template_id]['l' . $language_id . '_HtmlBody'] = $parsed['HtmlBody'];
+ $other_translations[$email_template_id]['l' . $language_id . '_PlainTextBody'] = $parsed['PlainTextBody'];
if ( $parsed['Headers'] ) {
- $other_translations[$event_id]['Headers'] = $parsed['Headers'];
+ $other_translations[$email_template_id]['Headers'] = $parsed['Headers'];
}
- elseif ( !$parsed['Headers'] && !array_key_exists('Headers', $other_translations[$event_id]) ) {
- $other_translations[$event_id]['Headers'] = $parsed['Headers'];
+ elseif ( !$parsed['Headers'] && !array_key_exists('Headers', $other_translations[$email_template_id]) ) {
+ $other_translations[$email_template_id]['Headers'] = $parsed['Headers'];
}
- $fields_hash = array_merge($fields_hash, $other_translations[$event_id]);
- $this->Conn->doInsert($fields_hash, $this->_tables['emailevents'], 'REPLACE', false);
+ $fields_hash = array_merge($fields_hash, $other_translations[$email_template_id]);
+ $this->Conn->doInsert($fields_hash, $this->_tables['email-template'], 'REPLACE', false);
}
if ( $this->Application->isDebugMode() ) {
@@ -1045,7 +1045,7 @@
if ( isset($fields_hash) ) {
// at least one email event in language pack was found in database
- $this->Conn->doInsert($fields_hash, $this->_tables['emailevents'], 'REPLACE');
+ $this->Conn->doInsert($fields_hash, $this->_tables['email-template'], 'REPLACE');
}
}
@@ -1157,15 +1157,15 @@
}
/**
- * Returns event id based on it's name and type
+ * Returns e-mail template id based on it's name and type
*
- * @param string $event_name
- * @param string $event_type
+ * @param string $template_name
+ * @param string $template_type
* @return int
*/
- function _getEventId($event_name, $event_type)
+ function _getEmailTemplateId($template_name, $template_type)
{
- $cache_key = $event_name . '_' . $event_type;
+ $cache_key = $template_name . '_' . $template_type;
return array_key_exists($cache_key, $this->events_hash) ? $this->events_hash[$cache_key] : 0;
}
Index: branches/5.2.x/core/install/install_schema.sql
===================================================================
diff -u -r15602 -r15608
--- branches/5.2.x/core/install/install_schema.sql (.../install_schema.sql) (revision 15602)
+++ branches/5.2.x/core/install/install_schema.sql (.../install_schema.sql) (revision 15608)
@@ -83,9 +83,9 @@
KEY MailingId (MailingId)
);
-CREATE TABLE EmailEvents (
- EventId int(11) NOT NULL AUTO_INCREMENT,
- `Event` varchar(40) NOT NULL DEFAULT '',
+CREATE TABLE EmailTemplates (
+ TemplateId int(11) NOT NULL AUTO_INCREMENT,
+ TemplateName varchar(40) NOT NULL DEFAULT '',
ReplacementTags text,
AllowChangingSender tinyint(4) NOT NULL DEFAULT '0',
CustomSender tinyint(4) NOT NULL DEFAULT '0',
@@ -118,10 +118,10 @@
`Type` int(11) NOT NULL DEFAULT '0',
LastChanged int(10) unsigned DEFAULT NULL,
BindToSystemEvent varchar(255) NOT NULL DEFAULT '',
- PRIMARY KEY (EventId),
+ PRIMARY KEY (TemplateId),
KEY `Type` (`Type`),
KEY Enabled (Enabled),
- KEY `Event` (`Event`),
+ KEY `Event` (TemplateName),
KEY FrontEndOnly (FrontEndOnly),
KEY AllowChangingSender (AllowChangingSender),
KEY CustomSender (CustomSender),
@@ -142,7 +142,7 @@
CREATE TABLE SystemEventSubscriptions (
SubscriptionId int(11) NOT NULL AUTO_INCREMENT,
- EmailEventId int(11) DEFAULT NULL,
+ EmailTemplateId int(11) DEFAULT NULL,
SubscriberEmail varchar(255) NOT NULL DEFAULT '',
UserId int(11) DEFAULT NULL,
CategoryId int(11) DEFAULT NULL,
@@ -151,7 +151,7 @@
ParentItemId int(11) DEFAULT NULL,
SubscribedOn int(11) DEFAULT NULL,
PRIMARY KEY (SubscriptionId),
- KEY EmailEventId (EmailEventId)
+ KEY EmailEventId (EmailTemplateId)
);
CREATE TABLE IdGenerator (
@@ -414,7 +414,7 @@
HtmlBody longtext,
TextBody longtext,
SentOn int(11) DEFAULT NULL,
- EventName varchar(255) NOT NULL DEFAULT '',
+ TemplateName varchar(255) NOT NULL DEFAULT '',
EventType tinyint(4) DEFAULT NULL,
EventParams text,
AccessKey varchar(32) NOT NULL DEFAULT '',
Index: branches/5.2.x/core/units/forms/forms/forms_eh.php
===================================================================
diff -u -r15145 -r15608
--- branches/5.2.x/core/units/forms/forms/forms_eh.php (.../forms_eh.php) (revision 15145)
+++ branches/5.2.x/core/units/forms/forms/forms_eh.php (.../forms_eh.php) (revision 15608)
@@ -1,6 +1,6 @@
Validate() ) {
$event->redirect = $this->Application->GetVar('success_template');
- $this->Application->EmailEventAdmin($this->Application->GetVar('email_event'));
+ $this->Application->emailAdmin($this->Application->GetVar('email_event'));
$send_params = Array (
'to_email' => $field_values[$this->Application->GetVar('email_field')],
'to_name' => $field_values[$this->Application->GetVar('name_field')]
);
- $this->Application->EmailEventUser($this->Application->GetVar('email_event'), null, $send_params);
+ $this->Application->emailUser($this->Application->GetVar('email_event'), null, $send_params);
if ( $field_values['MailingList'] ) {
$this->Application->StoreVar('SubscriberEmail', $field_values['Email']);
Index: branches/5.2.x/core/units/logs/email_logs/email_logs_config.php
===================================================================
diff -u -r15433 -r15608
--- branches/5.2.x/core/units/logs/email_logs/email_logs_config.php (.../email_logs_config.php) (revision 15433)
+++ branches/5.2.x/core/units/logs/email_logs/email_logs_config.php (.../email_logs_config.php) (revision 15608)
@@ -1,6 +1,6 @@
Array ('type' => 'string', 'default' => NULL),
'TextBody' => Array ('type' => 'string', 'default' => NULL),
'SentOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'EventName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'TemplateName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'EventType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1,
@@ -99,7 +99,7 @@
'From' => Array ('title' => 'column:la_fld_Sender', 'filter_block' => 'grid_like_filter', 'width' => 200),
'To' => Array ('title' => 'column:la_fld_Recipient', 'filter_block' => 'grid_like_filter', 'width' => 200),
'Subject' => Array ('filter_block' => 'grid_like_filter', 'width' => 200),
- 'EventName' => Array ('title' => 'column:la_fld_Event', 'filter_block' => 'grid_like_filter', 'width' => 170),
+ 'TemplateName' => Array ('filter_block' => 'grid_like_filter', 'width' => 170),
'EventType' => Array ('title' => 'column:la_fld_Type', 'filter_block' => 'grid_options_filter', 'width' => 60),
'SentOn' => Array ('title' => 'la_prompt_SentOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145),
// 'EventParams' => Array ('title' => 'la_col_EventParams', 'filter_block' => 'grid_like_filter'),
Index: branches/5.2.x/admin/system_presets/simple/languages_lang.php
===================================================================
diff -u -r14572 -r15608
--- branches/5.2.x/admin/system_presets/simple/languages_lang.php (.../languages_lang.php) (revision 14572)
+++ branches/5.2.x/admin/system_presets/simple/languages_lang.php (.../languages_lang.php) (revision 15608)
@@ -15,7 +15,7 @@
// toolbar buttons
$remove_buttons = Array (
// 'languages_list' => Array ('new_item', 'edit', 'delete', 'export', 'import', 'setprimary', 'refresh', 'view', 'dbl-click'),
-// 'email_messages_edit' => Array ('select', 'cancel', 'prev', 'next'),
+// 'email_template_edit' => Array ('select', 'cancel', 'prev', 'next'),
);
Index: branches/5.2.x/core/units/logs/email_logs/email_log_tp.php
===================================================================
diff -u -r15230 -r15608
--- branches/5.2.x/core/units/logs/email_logs/email_log_tp.php (.../email_log_tp.php) (revision 15230)
+++ branches/5.2.x/core/units/logs/email_logs/email_log_tp.php (.../email_log_tp.php) (revision 15608)
@@ -1,6 +1,6 @@
$recipients) {
- if ( $recipient_type == EmailEvent::RECIPIENT_TYPE_TO ) {
+ if ( $recipient_type == EmailTemplate::RECIPIENT_TYPE_TO ) {
array_shift($recipients);
}
@@ -61,9 +61,9 @@
protected function RecipientType($params)
{
$heading_mapping = Array (
- EmailEvent::RECIPIENT_TYPE_TO => 'To',
- EmailEvent::RECIPIENT_TYPE_CC => 'Cc',
- EmailEvent::RECIPIENT_TYPE_BCC => 'Bcc',
+ EmailTemplate::RECIPIENT_TYPE_TO => 'To',
+ EmailTemplate::RECIPIENT_TYPE_CC => 'Cc',
+ EmailTemplate::RECIPIENT_TYPE_BCC => 'Bcc',
);
$recipient_type = $this->Application->Parser->GetParam('recipient_type');
Index: branches/5.2.x/admin/system_presets/simple/email_events_emailevents.php
===================================================================
diff -u -r15252 -r15608
--- branches/5.2.x/admin/system_presets/simple/email_events_emailevents.php (.../email_events_emailevents.php) (revision 15252)
+++ branches/5.2.x/admin/system_presets/simple/email_events_emailevents.php (.../email_templates_email-template.php) (revision 15608)
@@ -15,18 +15,18 @@
// toolbar buttons
$remove_buttons = Array (
// list of all email templates
- 'email_message_list' => Array (/*'new_item', 'edit', 'delete', 'approve', 'decline', 'frontend_mail', 'view',*/ 'export', /*'dbl-click'*/),
+ 'email_template_list' => Array (/*'new_item', 'edit', 'delete', 'approve', 'decline', 'frontend_mail', 'view',*/ 'export', /*'dbl-click'*/),
-// edit email edit - general tab
-// 'email_message_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+// edit email template - general tab
+// 'email_template_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
-// edit email edit - settings tab
-// 'email_message_edit_settings' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+// edit email template - settings tab
+// 'email_template_edit_settings' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
);
// fields to hide
$hidden_fields = Array (
- /*'EventId', 'Event', 'ReplacementTags', 'AllowChangingSender', 'CustomSender',
+ /*'TemplateId', 'TemplateName', 'ReplacementTags', 'AllowChangingSender', 'CustomSender',
'SenderName', 'SenderAddressType', 'SenderAddress', 'AllowChangingRecipient',
'CustomRecipient', 'Recipients', 'Subject', 'HtmlBody', 'PlainTextBody', 'Headers',
'Enabled', 'FrontEndOnly', 'Module', 'BindToSystemEvent', 'Description', 'Type'*/
@@ -40,7 +40,7 @@
// fields to make required
$required_fields = Array (
- /*'EventId',*/ 'Event', /*'ReplacementTags', 'AllowChangingSender', 'CustomSender',
+ /*'TemplateId',*/ 'TemplateName', /*'ReplacementTags', 'AllowChangingSender', 'CustomSender',
'SenderName', 'SenderAddressType', 'SenderAddress', 'AllowChangingRecipient',
'CustomRecipient', 'Recipients',*/ 'Subject', /*'HtmlBody', 'PlainTextBody', 'Headers',*/
/*'Enabled', 'FrontEndOnly',*/ 'Module', /*'BindToSystemEvent', 'Description',*/ 'Type'
@@ -59,6 +59,6 @@
// hide columns in grids
$hide_columns = Array (
-// 'Default' => Array ('EventId', 'Description', 'Event', 'Module', 'Type', 'Enabled', 'LastChanged'),
-// 'Emails' => Array ('EventId', 'Event', 'Subject', 'Description', 'Type', 'Enabled', 'Module', 'FrontEndOnly', 'LastChanged'),
+// 'Default' => Array ('TemplateId', 'Description', 'TemplateName', 'Module', 'Type', 'Enabled', 'LastChanged'),
+// 'Emails' => Array ('TemplateId', 'TemplateName', 'Subject', 'Description', 'Type', 'Enabled', 'Module', 'FrontEndOnly', 'LastChanged'),
);
\ No newline at end of file
Index: branches/5.2.x/core/units/system_event_subscriptions/system_event_subscription_tp.php
===================================================================
diff -u -r15290 -r15608
--- branches/5.2.x/core/units/system_event_subscriptions/system_event_subscription_tp.php (.../system_event_subscription_tp.php) (revision 15290)
+++ branches/5.2.x/core/units/system_event_subscriptions/system_event_subscription_tp.php (.../system_event_subscription_tp.php) (revision 15608)
@@ -1,6 +1,6 @@
_subscriptions->GetDBField('BindToSystemEvent'));
if ( !$event->Prefix ) {
- throw new Exception('Subscription "#' . $this->_subscriptions->GetID() . '" is connected to invalid or missing e-mail event "#' . $this->_subscriptions->GetDBField('EmailEventId') . '"');
+ throw new Exception('Subscription "#' . $this->_subscriptions->GetID() . '" is connected to invalid or missing e-mail template "#' . $this->_subscriptions->GetDBField('EmailTemplateId') . '"');
}
return $event->Prefix;
Index: branches/5.2.x/core/admin_templates/regional/email_messages_edit.tpl
===================================================================
diff -u -r15222 -r15608
--- branches/5.2.x/core/admin_templates/regional/email_messages_edit.tpl (.../email_messages_edit.tpl) (revision 15222)
+++ branches/5.2.x/core/admin_templates/regional/email_messages_edit.tpl (.../email_template_edit.tpl) (revision 15608)
@@ -1,7 +1,7 @@
-
+
-
-
+
+
Index: branches/5.2.x/core/units/email_templates/email_events_event_handler.php
===================================================================
diff -u -r15268 -r15608
--- branches/5.2.x/core/units/email_templates/email_events_event_handler.php (.../email_events/email_events_event_handler.php) (revision 15268)
+++ branches/5.2.x/core/units/email_templates/email_events_event_handler.php (.../email_templates/email_template_eh.php) (revision 15608)
@@ -1,6 +1,6 @@
Array ('self' => 'edit'),
'OnSaveSelected' => Array ('self' => 'view'),
'OnProcessEmailQueue' => Array ('self' => 'add|edit'),
- 'OnExportEmailEvents' => Array ('self' => 'view'),
+ 'OnExportEmailTemplates' => Array ('self' => 'view'),
'OnSuggestAddress' => Array ('self' => 'add|edit'),
@@ -42,6 +42,7 @@
'OnMassDelete' => Array ('self' => 'debug'),
'OnMassApprove' => Array ('self' => 'debug'),
'OnMassDecline' => Array ('self' => 'debug'),
+ 'OnSend' => Array ('self' => 'debug'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
@@ -97,6 +98,9 @@
$module = $this->Application->GetVar('module');
$object->addFilter('module_filter', '%1$s.Module = ' . $this->Conn->qstr($module));
}
+ else {
+ $object->addFilter('module_filter', '%1$s.Module IN (SELECT Name FROM ' . TABLE_PREFIX . 'Modules WHERE Loaded = 1)');
+ }
if ( !$event->Special && !$this->Application->isDebugMode() ) {
// no special
@@ -158,12 +162,12 @@
return;
}
- $ids = implode(',', $this->StoreSelectedIDs($event));
-
+ $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
+
$sql = 'UPDATE ' . $table_name . '
SET FrontEndOnly = 1
- WHERE EventId IN (' . $ids . ')';
+ WHERE ' . $id_field . ' IN (' . implode(',', $this->StoreSelectedIDs($event)) . ')';
$this->Conn->Query($sql);
$this->clearSelectedIDs($event);
@@ -190,10 +194,8 @@
$items_info = $this->Application->GetVar('u');
if ( $items_info ) {
- $user_id = array_shift(array_keys($items_info));
+ list ($user_id, ) = each($items_info);
- $selected_ids = $this->getSelectedIDs($event, true);
-
$ids = $this->Application->RecallVar($event->getPrefixSpecial() . '_selected_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
@@ -345,10 +347,10 @@
if ( !$this->Application->isDebugMode(false) ) {
if ( $object->GetDBField('AllowChangingRecipient') ) {
- $object->SetDBField('RecipientType', EmailEvent::RECIPIENT_TYPE_TO);
+ $object->SetDBField('RecipientType', EmailTemplate::RECIPIENT_TYPE_TO);
}
else {
- $object->SetDBField('RecipientType', EmailEvent::RECIPIENT_TYPE_CC);
+ $object->SetDBField('RecipientType', EmailTemplate::RECIPIENT_TYPE_CC);
}
}
@@ -511,17 +513,17 @@
}
switch ($address_type) {
- case EmailEvent::ADDRESS_TYPE_EMAIL:
+ case EmailTemplate::ADDRESS_TYPE_EMAIL:
$field = 'Email';
$table_name = TABLE_PREFIX . 'Users';
break;
- case EmailEvent::ADDRESS_TYPE_USER:
+ case EmailTemplate::ADDRESS_TYPE_USER:
$field = 'Username';
$table_name = TABLE_PREFIX . 'Users';
break;
- case EmailEvent::ADDRESS_TYPE_GROUP:
+ case EmailTemplate::ADDRESS_TYPE_GROUP:
$field = 'Name';
$table_name = TABLE_PREFIX . 'UserGroups';
break;
@@ -548,7 +550,7 @@
echo '';
foreach ($data as $item) {
- echo '- ' . htmlspecialchars($item) . '
';
+ echo '- ' . htmlspecialchars($item, null, CHARSET) . '
';
}
echo '';
@@ -589,12 +591,12 @@
*/
protected function _validateEmailTemplate($object)
{
- $email_message_helper = $this->Application->recallObject('kEmailMessageHelper');
- /* @var $email_message_helper kEmailMessageHelper */
+ $email_template_helper = $this->Application->recallObject('kEmailTemplateHelper');
+ /* @var $email_template_helper kEmailTemplateHelper */
- $email_message_helper->parseField($object, 'Subject');
- $email_message_helper->parseField($object, 'HtmlBody');
- $email_message_helper->parseField($object, 'PlainTextBody');
+ $email_template_helper->parseField($object, 'Subject');
+ $email_template_helper->parseField($object, 'HtmlBody');
+ $email_template_helper->parseField($object, 'PlainTextBody');
}
/**
@@ -620,13 +622,13 @@
}
switch ($address_type) {
- case EmailEvent::ADDRESS_TYPE_EMAIL:
+ case EmailTemplate::ADDRESS_TYPE_EMAIL:
if ( !preg_match('/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', $address) ) {
$object->SetError($field_prefix . 'Address', 'invalid_email');
}
break;
- case EmailEvent::ADDRESS_TYPE_USER:
+ case EmailTemplate::ADDRESS_TYPE_USER:
$sql = 'SELECT PortalUserId
FROM ' . TABLE_PREFIX . 'Users
WHERE Username = ' . $this->Conn->qstr($address);
@@ -635,7 +637,7 @@
}
break;
- case EmailEvent::ADDRESS_TYPE_GROUP:
+ case EmailTemplate::ADDRESS_TYPE_GROUP:
$sql = 'SELECT GroupId
FROM ' . TABLE_PREFIX . 'UserGroups
WHERE Name = ' . $this->Conn->qstr($address);
@@ -674,7 +676,7 @@
* @return void
* @access protected
*/
- protected function OnExportEmailEvents(kEvent $event)
+ protected function OnExportEmailTemplates(kEvent $event)
{
if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) {
$event->status = kEvent::erFAIL;
@@ -711,7 +713,7 @@
$sql = 'SELECT SubscriptionId
FROM ' . TABLE_PREFIX . 'SystemEventSubscriptions
- WHERE EmailEventId = ' . $object->GetID();
+ WHERE EmailTemplateId = ' . $object->GetID();
$ids = $this->Conn->GetCol($sql);
if ( !$ids ) {
@@ -723,4 +725,32 @@
$temp_handler->DeleteItems('system-event-subscription', '', $ids);
}
+
+ /**
+ * Sends selected e-mail event
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnSend(kEvent $event)
+ {
+ $object = $event->getObject(Array ('skip_autoload' => true));
+ /* @var $object kDBItem */
+
+ $ids = $this->StoreSelectedIDs($event);
+
+ foreach ($ids as $id) {
+ $object->Load($id);
+
+ if ( $object->GetDBField('Type') == EmailTemplate::TEMPLATE_TYPE_ADMIN ) {
+ $this->Application->emailAdmin($object->GetDBField('TemplateName'));
+ }
+ else {
+ $this->Application->emailUser($object->GetDBField('TemplateName'));
+ }
+ }
+
+ $this->clearSelectedIDs($event);
+ }
}
\ No newline at end of file
Fisheye: Tag 15608 refers to a dead (removed) revision in file `branches/5.2.x/core/admin_templates/languages/email_message_settings.tpl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: branches/5.2.x/core/units/system_event_subscriptions/system_event_subscriptions_config.php
===================================================================
diff -u -r15563 -r15608
--- branches/5.2.x/core/units/system_event_subscriptions/system_event_subscriptions_config.php (.../system_event_subscriptions_config.php) (revision 15563)
+++ branches/5.2.x/core/units/system_event_subscriptions/system_event_subscriptions_config.php (.../system_event_subscriptions_config.php) (revision 15608)
@@ -1,6 +1,6 @@
Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
- LEFT JOIN ' . TABLE_PREFIX . 'EmailEvents ee ON %1$s.EmailEventId = ee.EventId
+ LEFT JOIN ' . TABLE_PREFIX . 'EmailTemplates et ON %1$s.EmailTemplateId = et.TemplateId
LEFT JOIN ' . TABLE_PREFIX . 'Users u ON %1$s.UserId = u.PortalUserId
LEFT JOIN ' . TABLE_PREFIX . 'Categories c ON %1$s.CategoryId = c.CategoryId',
),
'CalculatedFields' => Array (
'' => Array (
- 'BindToSystemEvent' => 'ee.BindToSystemEvent',
- 'EmailEventName' => 'ee.Event',
+ 'BindToSystemEvent' => 'et.BindToSystemEvent',
+ 'EmailTemplateName' => 'et.TemplateName',
'Username' => 'CASE %1$s.UserId WHEN ' . USER_ROOT . ' THEN "root" WHEN ' . USER_GUEST . ' THEN "Guest" ELSE IF(CONCAT(u.FirstName, u.LastName) <> "", CONCAT(u.FirstName, " ", u.LastName), IF(%1$s.UserId IS NULL, "Guest", IF(u.Username = "", u.Email, u.Username))) END',
'CategoryName' => 'c.l%2$s_Name',
'ItemName' => '%1$s.ItemId',
@@ -95,9 +95,9 @@
'Fields' => Array (
'SubscriptionId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'EmailEventId' => Array (
+ 'EmailTemplateId' => Array (
'type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'EmailEvents WHERE BindToSystemEvent <> "" ORDER BY Event ASC', 'option_key_field' => 'EventId', 'option_title_field' => 'BindToSystemEvent',
+ 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'EmailTemplates WHERE BindToSystemEvent <> "" ORDER BY TemplateName ASC', 'option_key_field' => 'TemplateId', 'option_title_field' => 'BindToSystemEvent',
'required' => 1, 'default' => NULL
),
'SubscriberEmail' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
@@ -115,16 +115,16 @@
'VirtualFields' => Array (
'Username' => Array ('type' => 'string', 'default' => ''),
- 'EmailEventName' => Array ('type' => 'string', 'default' => ''),
+ 'EmailTemplateName' => Array ('type' => 'string', 'default' => ''),
'CategoryName' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => ''),
),
'Grids' => Array (
'Default' => Array (
'Fields' => Array (
'SubscriptionId' => Array ('title' => 'column:la_fld_Id', 'filter_block' => 'grid_range_filter', 'width' => 80),
- 'EmailEventId' => Array ('title' => 'column:la_fld_SystemEvent', 'filter_block' => 'grid_options_filter', 'width' => 170),
- 'EmailEventName' => Array ('title' => 'column:la_fld_EmailEvent', 'filter_block' => 'grid_like_filter', 'width' => 170),
+ 'EmailTemplateId' => Array ('title' => 'column:la_fld_SystemEvent', 'filter_block' => 'grid_options_filter', 'width' => 170),
+ 'EmailTemplateName' => Array ('filter_block' => 'grid_like_filter', 'width' => 170),
'SubscriberEmail' => Array ('title' => 'column:la_fld_Email', 'filter_block' => 'grid_like_filter'),
'UserId' => Array ('title' => 'la_col_PortalUserId', 'filter_block' => 'grid_range_filter', 'width' => 80),
'Username' => Array ('filter_block' => 'grid_like_filter'),
Fisheye: Tag 15608 refers to a dead (removed) revision in file `branches/5.2.x/core/units/helpers/email_message_helper.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: branches/5.2.x/core/units/forms/submission_log/submission_log_eh.php
===================================================================
diff -u -r15145 -r15608
--- branches/5.2.x/core/units/forms/submission_log/submission_log_eh.php (.../submission_log_eh.php) (revision 15145)
+++ branches/5.2.x/core/units/forms/submission_log/submission_log_eh.php (.../submission_log_eh.php) (revision 15608)
@@ -1,6 +1,6 @@
Application->EmailEventAdmin('FORM.SUBMISSION.REPLY.TO.USER', null, $send_params);
+ $this->Application->emailAdmin('FORM.SUBMISSION.REPLY.TO.USER', null, $send_params);
// mark as sent after sending is finished
$object->SetDBField('SentStatus', SUBMISSION_LOG_SENT);
@@ -438,7 +438,7 @@
if ( $this->Application->GetVar('client_mode') ) {
// new reply from client received -> send notification about it
- $this->Application->EmailEventAdmin('FORM.SUBMISSION.REPLY.FROM.USER');
+ $this->Application->emailAdmin('FORM.SUBMISSION.REPLY.FROM.USER');
}
}
@@ -488,7 +488,7 @@
$sent_status = $object->GetDBField('SentStatus');
if ( $object->GetOriginalField('SentStatus') != $sent_status && $sent_status == SUBMISSION_LOG_BOUNCE ) {
- $this->Application->EmailEventAdmin('FORM.SUBMISSION.REPLY.FROM.USER.BOUNCED');
+ $this->Application->emailAdmin('FORM.SUBMISSION.REPLY.FROM.USER.BOUNCED');
}
}
Index: branches/5.2.x/admin/system_presets/simple/system_event_subscriptions_system-event-subscription.php
===================================================================
diff -u -r15268 -r15608
--- branches/5.2.x/admin/system_presets/simple/system_event_subscriptions_system-event-subscription.php (.../system_event_subscriptions_system-event-subscription.php) (revision 15268)
+++ branches/5.2.x/admin/system_presets/simple/system_event_subscriptions_system-event-subscription.php (.../system_event_subscriptions_system-event-subscription.php) (revision 15608)
@@ -23,30 +23,30 @@
// fields to hide
$hidden_fields = Array (
- /*'SubscriptionId', 'EmailEventId', 'SubscriberEmail', 'UserId', 'CategoryId',
+ /*'SubscriptionId', 'EmailTemplateId', 'SubscriberEmail', 'UserId', 'CategoryId',
'ItemId', 'ParentItemId', 'SubscribedOn',*/
);
// virtual fields to hide
$virtual_hidden_fields = Array (
- /*'Username', 'EmailEventName', 'CategoryName',*/
+ /*'Username', 'EmailTemplateName', 'CategoryName',*/
);
// fields to make required
$required_fields = Array (
- /*'SubscriptionId',*/ 'EmailEventId', /*'SubscriberEmail', 'UserId', 'CategoryId',
+ /*'SubscriptionId',*/ 'EmailTemplateId', /*'SubscriberEmail', 'UserId', 'CategoryId',
'ItemId', 'ParentItemId',*/ 'SubscribedOn',
);
// virtual fields to make required
$virtual_required_fields = Array (
- /*'Username', 'EmailEventName', 'CategoryName',*/
+ /*'Username', 'EmailTemplateName', 'CategoryName',*/
);
// hide columns in grids
$hide_columns = Array (
/*'Default' => Array (
- 'SubscriptionId', 'EmailEventId', 'EmailEventName', 'SubscriberEmail', 'UserId', 'Username', 'CategoryId',
+ 'SubscriptionId', 'EmailTemplateId', 'EmailTemplateName', 'SubscriberEmail', 'UserId', 'Username', 'CategoryId',
'CategoryName', 'ItemId', 'ItemName', 'ParentItemId', 'ParentItemName', 'SubscribedOn',
),*/
);
\ No newline at end of file
Index: branches/5.2.x/core/install/english.lang
===================================================================
diff -u -r15593 -r15608
--- branches/5.2.x/core/install/english.lang (.../english.lang) (revision 15593)
+++ branches/5.2.x/core/install/english.lang (.../english.lang) (revision 15608)
@@ -82,7 +82,7 @@
U2VjdGlvbiBOYW1l
Q29sdW1uIFBocmFzZQ==
RWZmZWN0aXZl
- RW1haWwgRXZlbnRz
+ RS1tYWlsIFRlbXBsYXRlcw==
RW5hYmxlIEUtbWFpbCBDb21tdW5pY2F0aW9u
Jm5ic3A7
RXZlbnQgRGVzY3JpcHRpb24=
@@ -402,24 +402,23 @@
RWxhcHNlZCBUaW1l
RS1tYWls
RS1tYWlsIENvbW11bmljYXRpb24gUm9sZQ==
- RS1tYWlsIEV2ZW50
RS1tYWlsIG9yIFVzZXJuYW1l
RS1tYWlsICI8c3Ryb25nPntwYXNzd29yZH08L3N0cm9uZz4iIHBhc3N3b3JkIHRvIHVzZXI=
RW1haWxzIGluIFF1ZXVl
RW1haWxzIFNlbnQ=
RW1haWxzIFRvdGFs
+ RS1tYWlsIFRlbXBsYXRlIE5hbWU=
RW1haWwgVmVyaWZpZWQ=
RW5hYmxl
RW5hYmxlZA==
RW5hYmxlIENhY2hpbmcgZm9yIHRoaXMgU2VjdGlvbg==
RXJyb3IgVGFn
RXN0aW1hdGVkIFRpbWU=
- RXZlbnQ=
RXhwaXJl
RXhwb3J0IGNvbHVtbnM=
RXhwb3J0IFNwZWNpZmllZCBDb3VudHJpZXM=
RGF0YSBUeXBlcyB0byBFeHBvcnQ=
- RXhwb3J0IFNwZWNpZmllZCBFbWFpbCBFdmVudHM=
+ RXhwb3J0IFNwZWNpZmllZCBFLW1haWwgVGVtcGxhdGVz
RXhwb3J0IEZpbGVuYW1l
RXhwb3J0IGZvcm1hdA==
RXhwb3J0IE1vZHVsZXM=
@@ -683,6 +682,7 @@
VGFn
SXRlbQ==
VGVtcGxhdGUgRmlsZQ==
+ VGVtcGxhdGUgTmFtZQ==
VGVtcGxhdGU=
VGV4dA==
VGV4dCBBbGlnbg==
@@ -882,9 +882,9 @@
RWRpdG9yJ3MgUGljaw==
RS1tYWls
RS1tYWlsIEJvZHk=
- RS1tYWlsIEV2ZW50cw==
Rm9yZXZlciAobmV2ZXIgZGVsZXRlZCBhdXRvbWF0aWNhbGx5KQ==
RS1tYWlsIFN1YmplY3Q=
+ RS1tYWlsIFRlbXBsYXRlcw==
RXZlcnlvbmU=
RXhhY3Q=
RXhwaXJlZA==
@@ -1252,11 +1252,10 @@
U2VhcmNo
R2VuZXJhbA==
Q3VzdG9t
- RS1tYWlsIFRlbXBsYXRlcw==
RS1tYWlsIENvbW11bmljYXRpb24=
- RW1haWwgRXZlbnRz
RS1tYWlsIExvZw==
RW1haWwgUXVldWU=
+ RS1tYWlsIFRlbXBsYXRlcw==
RmllbGRz
RmlsZXM=
Rm9ybXMgQ29uZmlndXJhdGlvbg==
@@ -1369,6 +1368,7 @@
QWRkaW5nIEJhbiBSdWxl
QWRkaW5nIENvdW50cnkvU3RhdGU=
QWRkaW5nIEN1c3RvbSBGaWVsZA==
+ QWRkaW5nIEUtbWFpbCBUZW1wbGF0ZQ==
QWRkaW5nIEZpbGU=
QWRkaW5nIEl0ZW0gRmlsdGVy
QWRkaW5nIE1haWxpbmcgTGlzdA==
@@ -1389,7 +1389,6 @@
QWRkaW5nIFNlY3Rpb24=
QWRkaW5nIFNlYXJjaCBGaWVsZA==
QWRkaW5nIENNUyBCbG9jaw==
- QWRkaW5nIEVtYWlsIEV2ZW50
QWRkaW5nIEZvcm0=
QWRkaW5nIEZvcm0gRmllbGQ=
QWRkaW5nIEdyb3Vw
@@ -1423,7 +1422,7 @@
Q29udGVudCBFZGl0b3IgLSBBdXRvLXNhdmVkIGF0ICVz
RWRpdGluZyBDb3VudHJ5L1N0YXRl
RWRpdGluZyBEcmFmdCAoJTIkcyk=
- RWRpdGluZyBFbWFpbCBFdmVudA==
+ RWRpdGluZyBFLW1haWwgVGVtcGxhdGU=
RWRpdGluZyBGaWxl
RWRpdGluZyBJdGVtIEZpbHRlcg==
RWRpdGluZyBNZW1iZXJzaGlw
@@ -1447,7 +1446,6 @@
RWRpdGluZyBTZWN0aW9u
RWRpdGluZyBDTVMgQmxvY2s=
RWRpdGluZyBDdXN0b20gRmllbGQ=
- RWRpdGluZyBFLW1haWw=
RWRpdGluZyBGb3Jt
RWRpdGluZyBGb3JtIEZpZWxk
RWRpdGluZyBHcm91cA==
@@ -1460,9 +1458,8 @@
RWRpdGluZyBUaGVtZQ==
RWRpdGluZyBVc2Vy
RS1tYWlsIENvbW11bmljYXRpb24=
- RS1tYWlsIEV2ZW50cw==
- RS1tYWlscw==
RS1tYWlsIFNldHRpbmdz
+ RS1tYWlsIFRlbXBsYXRlcw==
RXhwb3J0IExhbmd1YWdlIFBhY2sgLSBSZXN1bHRz
RXhwb3J0IExhbmd1YWdlIFBhY2sgLSBTdGVwMQ==
RmllbGRz
@@ -1488,7 +1485,7 @@
TWFpbGluZ3M=
TWVzc2FnZXM=
TW9kdWxlcw==
- TmV3IEVtYWlsIEV2ZW50
+ TmV3IEUtbWFpbCBUZW1wbGF0ZQ==
TmV3IEZpbGU=
TmV3IFJlcGx5
TmV3IFNjaGVkdWxlZCBUYXNr
Index: branches/5.2.x/core/admin_templates/mailing_lists/send_complete.tpl
===================================================================
diff -u -r14244 -r15608
--- branches/5.2.x/core/admin_templates/mailing_lists/send_complete.tpl (.../send_complete.tpl) (revision 14244)
+++ branches/5.2.x/core/admin_templates/mailing_lists/send_complete.tpl (.../send_complete.tpl) (revision 15608)
@@ -1,7 +1,7 @@
-
+
-
+
-
+
\ No newline at end of file
Index: branches/5.2.x/core/admin_templates/languages/email_message_list.tpl
===================================================================
diff -u -r15542 -r15608
--- branches/5.2.x/core/admin_templates/languages/email_message_list.tpl (.../email_message_list.tpl) (revision 15542)
+++ branches/5.2.x/core/admin_templates/languages/email_message_list.tpl (.../email_template_list.tpl) (revision 15608)
@@ -1,6 +1,6 @@
-
+
@@ -86,8 +86,8 @@
-
+
\ No newline at end of file
Index: branches/5.2.x/core/install/remove_schema.sql
===================================================================
diff -u -r15552 -r15608
--- branches/5.2.x/core/install/remove_schema.sql (.../remove_schema.sql) (revision 15552)
+++ branches/5.2.x/core/install/remove_schema.sql (.../remove_schema.sql) (revision 15608)
@@ -3,7 +3,7 @@
DROP TABLE CustomFields;
DROP TABLE SystemSettings;
DROP TABLE EmailQueue;
-DROP TABLE EmailEvents;
+DROP TABLE EmailTemplates;
DROP TABLE SystemEventSubscriptions;
DROP TABLE IdGenerator;
DROP TABLE Languages;
Index: branches/5.2.x/core/install/upgrades.sql
===================================================================
diff -u -r15602 -r15608
--- branches/5.2.x/core/install/upgrades.sql (.../upgrades.sql) (revision 15602)
+++ branches/5.2.x/core/install/upgrades.sql (.../upgrades.sql) (revision 15608)
@@ -2863,3 +2863,16 @@
INSERT INTO SystemSettings VALUES(DEFAULT, 'TypeKitId', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_TypeKitId', 'text', NULL, NULL, 80.05, 0, 1, NULL);
ALTER TABLE MailingLists CHANGE EmailsQueued EmailsQueuedTotal INT(10) UNSIGNED NOT NULL DEFAULT '0';
+
+RENAME TABLE <%TABLE_PREFIX%>EmailEvents TO <%TABLE_PREFIX%>EmailTemplates;
+ALTER TABLE EmailTemplates CHANGE `Event` TemplateName VARCHAR(40) NOT NULL DEFAULT '';
+ALTER TABLE EmailTemplates CHANGE EventId TemplateId INT(11) NOT NULL AUTO_INCREMENT;
+ALTER TABLE SystemEventSubscriptions CHANGE EmailEventId EmailTemplateId INT(11) NULL DEFAULT NULL;
+
+DELETE FROM LanguageLabels WHERE PhraseKey IN (
+ 'LA_FLD_EXPORTEMAILEVENTS', 'LA_FLD_EVENT', 'LA_TITLE_EMAILMESSAGES', 'LA_TAB_E-MAILS', 'LA_COL_EMAILEVENTS',
+ 'LA_OPT_EMAILEVENTS', 'LA_FLD_EMAILEVENT', 'LA_TITLE_EMAILEVENTS', 'LA_TITLE_ADDING_E-MAIL', 'LA_TITLE_EDITING_E-MAIL',
+ 'LA_TITLE_EDITINGEMAILEVENT', 'LA_TITLE_NEWEMAILEVENT', 'LA_TAB_EMAILEVENTS'
+);
+DELETE FROM UserPersistentSessionData WHERE VariableName IN ('system-event-subscription[Default]columns_.', 'email-log[Default]columns_.');
+ALTER TABLE EmailLog CHANGE EventName TemplateName VARCHAR(255) NOT NULL DEFAULT '';
Index: branches/5.2.x/core/admin_templates/incs/form_blocks.tpl
===================================================================
diff -u -r15541 -r15608
--- branches/5.2.x/core/admin_templates/incs/form_blocks.tpl (.../form_blocks.tpl) (revision 15541)
+++ branches/5.2.x/core/admin_templates/incs/form_blocks.tpl (.../form_blocks.tpl) (revision 15608)
@@ -731,7 +731,7 @@
-
+
-
+
-
-
+
+
-
+
\ No newline at end of file