X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fnl.inc.php;h=728bf38a7298c65e5309ffa9f864159584a4ced7;hb=6859200d482b72f9dc6483a3c27621d6e945736d;hp=74ff54683c1cd272341e45bb9740f0278a435a58;hpb=d0327f6de73e81c4bcc656471ca4161e4f1e1e1b;p=platal.git diff --git a/include/validations/nl.inc.php b/include/validations/nl.inc.php index 74ff546..728bf38 100644 --- a/include/validations/nl.inc.php +++ b/include/validations/nl.inc.php @@ -1,6 +1,6 @@ art = new NLArticle($title, $body, $append); + parent::__construct($_user, false, 'nl'); + $this->art = new NLArticle($_title, $_body, $_append); } // }}} @@ -60,9 +60,9 @@ class NLReq extends Validate protected function handle_editor() { - $this->art->_body = Env::v('nl_body'); - $this->art->_title = Env::v('nl_title'); - $this->art->_append = Env::v('nl_append'); + $this->art->body = Env::v('nl_body'); + $this->art->title = Env::v('nl_title'); + $this->art->append = Env::v('nl_append'); return true; } @@ -79,19 +79,35 @@ class NLReq extends Validate protected function _mail_body($isok) { + $you_have = ($this->formal ? 'vous aviez' : 'tu avais'); if ($isok) { - return ' L\'article que tu avais proposé ('.$this->art->title().') vient d\'être validé.'; + return " L'article que $you_have 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 $you_have proposé a été refusé."; } } // }}} + // {{{ function _mail_ps + + protected function _mail_ps($isok) + { + if ($isok) { + return ''; + } + return "\nPS : pour rappel, en voici le contenu :" + . "\n--------------------------------------------------------------------------\n" + . $this->art->title() + . "\n--------------------------------------------------------------------------\n" + . $this->art->body() . "\n\n" . $this->art->append() . "\n"; + } + + // }}} // {{{ function commit() public function commit() { - $nl = new Newsletter(); + $nl = NewsLetter::forGroup(NewsLetter::GROUP_XORG)->getPendingIssue(true); $nl->saveArticle($this->art); return true; }