Update/merge Newsletter-related code. (Closes #1226, #858, #1047)
[platal.git] / include / validations / nl.inc.php
index 25067a4..0a385ac 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -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;
     }
 
@@ -106,7 +106,7 @@ class NLReq extends Validate
 
     public function commit()
     {
-        $nl  = new NewsLetter();
+        $nl = NewsLetter::forGroup(NewsLetter::GROUP_XORG)->getPendingIssue();
         $nl->saveArticle($this->art);
         return true;
     }