From 9be4a981587806840e509ca9ebc7c642b8652837 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 31 Oct 2009 11:53:35 +0100 Subject: [PATCH] Adds the text of the article in the mail when refused (Closes #991). --- ChangeLog | 1 + include/validations.inc.php | 15 +++++++++++++-- include/validations/nl.inc.php | 20 ++++++++++++++++++-- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 790f045..57e13d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ Bug/Wish: * Newsletter: - #986: Improves the nl edition page -JAC + - #991: Adds the text of the article in the mail when refused -JAC * Profile: - #983: Fixes issue with the professional email publicity -JAC diff --git a/include/validations.inc.php b/include/validations.inc.php index 4ae9086..aaa6bf5 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -236,8 +236,11 @@ abstract class Validate $body = ($this->user->isFemale() ? "Chère camarade,\n\n" : "Cher camarade,\n\n") . $this->_mail_body($isok) - . (Env::has('comm') ? "\n\n".Env::v('comm') : '') - . "\n\nCordialement,\n\n-- \nL'équipe de Polytechnique.org\n"; + . (Env::has('comm') ? "\n\n" . Env::v('comm') : '') + . "\n\nCordialement,\n-- \nL'équipe de Polytechnique.org\n"; + if (!is_null($this->_mail_ps($isok))) { + $body .= $this->_mail_ps($isok); + } $mailer->setTxtBody(wordwrap($body)); $mailer->send(); @@ -333,6 +336,14 @@ abstract class Validate abstract protected function _mail_subj(); // }}} + // {{{ function _mail_ps + + protected function _mail_ps($isok) + { + return null; + } + + // }}} // {{{ function commit() /** fonction à utiliser pour insérer les données dans x4dat diff --git a/include/validations/nl.inc.php b/include/validations/nl.inc.php index c0eecdd..1098673 100644 --- a/include/validations/nl.inc.php +++ b/include/validations/nl.inc.php @@ -80,9 +80,25 @@ class NLReq extends Validate protected function _mail_body($isok) { if ($isok) { - return ' L\'article que tu avais proposé ('.$this->art->title().') vient d\'être validé.'; + return " L'article que tu avais proposé (" . $this->art->title() . ") vient d'être validé."; } else { - return ' L\'article que tu avais proposé ('.$this->art->title().') a été refusé.'; + return " L'article que tu avais proposé a été refusé."; + } + } + + // }}} + // {{{ function _mail_ps + + protected function _mail_ps($isok) + { + if ($isok) { + return null; + } else { + return "\nPS : pour rappel, en voici le contenu :\n" + . "--------------------------------------------------------------------------------\n*" + . $this->art->title() + . "\n--------------------------------------------------------------------------------\n" + . $this->art->body() . "\n\n" . $this->art->append() . "\n"; } } -- 2.1.4