From e9700d3e5963eadb7af15b9c2ebee95f40af33c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Tue, 22 Feb 2011 22:33:04 +0100 Subject: [PATCH] Improve template for group NLs notification (Closes #1400) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- include/newsletter.inc.php | 9 +++------ templates/newsletter/notify_scheduled.mail.tpl | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index 26f648f..6a1060e 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -453,7 +453,7 @@ class NewsLetter /** Get the prefix to use for all 'admin' pages of this NL. */ - public function adminPrefix() + public function adminPrefix($enforce_xnet=true) { if (!empty($GLOBALS['IS_XNET_SITE'])) { return $this->group . '/admin/nl'; @@ -467,7 +467,7 @@ class NewsLetter return 'epletter/admin'; default: // Don't display groups NLs on X.org - assert(false); + assert(!$enforce_xnet); } } @@ -668,11 +668,8 @@ class NLIssue if ($success) { global $globals; $mailer = new PlMailer('newsletter/notify_scheduled.mail.tpl'); - $mailer->assign('group', $this->nl->group); - $mailer->assign('nl_title', $this->title_mail); - $mailer->assign('nl_id', $this->id()); + $mailer->assign('issue', $this); $mailer->assign('base', $globals->baseurl); - $mailer->assign('send_before', $this->send_before); $mailer->send(); $this->refresh(); } diff --git a/templates/newsletter/notify_scheduled.mail.tpl b/templates/newsletter/notify_scheduled.mail.tpl index 67f65c8..90423d9 100644 --- a/templates/newsletter/notify_scheduled.mail.tpl +++ b/templates/newsletter/notify_scheduled.mail.tpl @@ -24,13 +24,13 @@ {if $mail_part eq 'head'} {from full=#from#} {to addr=#to#} -{subject text="Validation de l'envoi d'une NL du groupe $group"} +{subject text="Validation de l'envoi d'une NL du groupe `$issue->nl->group`"} {elseif $mail_part eq 'text'} -L'envoi d'une NL pour le groupe {$group}, "{$nl_title}", a été planifié pour le {$send_before}. +L'envoi d'une NL pour le groupe {$issue->nl->group}, "{$issue->title_mail}", a été planifié pour le {$issue->send_before}. Aperçu / édition : -{$base}/newsletter/admin/edit/{$nl_id} +{$base}/{$issue->nl->adminPrefix(false)}/edit/{$issue->id()} {/if} -- 2.1.4