diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-07-18 09:43:18 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-07-18 09:43:18 (GMT) |
commit | 5eca39c1d5d20a428ad4c0133c3f421db3809280 (patch) | |
tree | 699ed79d1b986782a87ba2ccabb48604a8f7f799 | |
parent | ab63090e44eab1d3c4da543315087ead871c3880 (diff) |
ASLO spanish notification #1072
-rw-r--r-- | aslo/config.php | 9 | ||||
-rw-r--r-- | site/app/controllers/components/editors.php | 45 | ||||
-rw-r--r-- | site/app/views/editors/email/aslo/release_en_plain.thtml (renamed from site/app/views/editors/email/aslo/release_plain.thtml) | 1 |
3 files changed, 30 insertions, 25 deletions
diff --git a/aslo/config.php b/aslo/config.php index 6cf1346..08f6b26 100644 --- a/aslo/config.php +++ b/aslo/config.php @@ -243,7 +243,14 @@ define('SITE_FAQ', 'http://wiki.sugarlabs.org/go/Activity_Library/FAQ'); define('SITE_BLOG', 'http://planet.sugarlabs.org/'); define('SITE_IRC', '#sugar on chat.freenode.net'); -define('SITE_RELEASE_EMAIL', 'sugar-devel@lists.sugarlabs.org'); +global $SITE_RELEASE_EMAIL; +$SITE_RELEASE_EMAIL = array( + 'en_US' => array('email' => 'sugar-devel@lists.sugarlabs.org', + 'subject' => '[RELEASE] %s-%s', + 'template' => 'release_en'), + 'es_ES' => array('email' => 'olpc-sur@lists.laptop.org', + 'subject' => '[RELEASE] %s-%s', + 'template' => 'release_es')); define('ADMIN_EMAIL', 'aslo-admins@sugarlabs.org'); define('EDITOR_EMAIL', 'aslo-editors@sugarlabs.org'); diff --git a/site/app/controllers/components/editors.php b/site/app/controllers/components/editors.php index 9bc98d8..ed8d1f3 100644 --- a/site/app/controllers/components/editors.php +++ b/site/app/controllers/components/editors.php @@ -137,14 +137,8 @@ class EditorsComponent extends Object { $this->controller->set('info', $emailInfo); - if ($data['Approval']['ActionField'] == 'public') { - if (SITE_RELEASE_EMAIL) { - $this->controller->Email->template = 'email/aslo/release'; - $this->controller->Email->to = SITE_RELEASE_EMAIL; - $this->controller->Email->subject = sprintf('[RELEASE] %s-%s', $emailInfo['name'], $emailInfo['version']); - $this->controller->Email->send(false, SITE_RELEASE_EMAIL); - } - } + if ($data['Approval']['ActionField'] == 'public') + $this->_sendReleaseNotes('', $emailInfo); if ($data['Approval']['ActionField'] != 'superreview') { $this->controller->Email->template = 'email/nominated/'.$data['Approval']['ActionField']; @@ -282,14 +276,8 @@ class EditorsComponent extends Object { ); $this->controller->set('info', $emailInfo); - if ($data['Approval']['ActionField'] == 'public') { - if (SITE_RELEASE_EMAIL) { - $this->controller->Email->template = 'email/aslo/release'; - $this->controller->Email->to = SITE_RELEASE_EMAIL; - $this->controller->Email->subject = sprintf('[RELEASE] %s-%s', $emailInfo['name'], $emailInfo['version']); - $this->controller->Email->send(false, SITE_RELEASE_EMAIL); - } - } + if ($data['Approval']['ActionField'] == 'public') + $this->_sendReleaseNotes('', $emailInfo); if ($data['Approval']['ActionField'] != 'superreview') { $this->controller->Email->template = 'email/pending/'.$data['Approval']['ActionField']; @@ -562,13 +550,8 @@ class EditorsComponent extends Object { } } - if ($addon['Addon']['trusted'] == 1 && $release_notify) { - $this->controller->Email->template = '../editors/email/aslo/release'; - $this->controller->Email->to = SITE_RELEASE_EMAIL; - $this->controller->Email->subject = sprintf('[RELEASE] %s-%s', $emailInfo['name'], $emailInfo['version']); - $this->controller->Email->send(false, SITE_RELEASE_EMAIL); - } - + if ($addon['Addon']['trusted'] == 1 && $release_notify) + $this->_sendReleaseNotes('../editors/', $emailInfo); } /** @@ -924,5 +907,21 @@ class EditorsComponent extends Object { return true; } + + function _sendReleaseNotes($prefix, $emailInfo) { + global $SITE_RELEASE_EMAIL; + + if (!isset($emailInfo['releasenotes'])) { + $emailInfo['releasenotes'] = SITE_URL.'/addon/'.$emailInfo['id'].'#release-notes'; + $this->controller->set('info', $emailInfo); + } + + foreach ($SITE_RELEASE_EMAIL as $lang => $props) { + $this->controller->Email->template = $prefix.'email/aslo/'.$props['template']; + $this->controller->Email->to = $props['email']; + $this->controller->Email->subject = sprintf($props['subject'], $emailInfo['name'], $emailInfo['version']); + $this->controller->Email->send(false, $props['email']); + } + } } ?> diff --git a/site/app/views/editors/email/aslo/release_plain.thtml b/site/app/views/editors/email/aslo/release_en_plain.thtml index 8e3309c..89e7c12 100644 --- a/site/app/views/editors/email/aslo/release_plain.thtml +++ b/site/app/views/editors/email/aslo/release_en_plain.thtml @@ -10,7 +10,6 @@ Reviewer comments: <?=$info['comments']?> - <?=SITE_NAME?> <?=SITE_URL?> |