Create a new Newsletter if none is defined when validating an article
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 19 Aug 2006 09:00:20 +0000 (09:00 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 19 Aug 2006 09:00:20 +0000 (09:00 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@822 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
include/newsletter.inc.php

index ad5f8d3..e303b8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@ New:
     * Events:
         - Switch to the new URI scheme.                                 -MC/FRU
         - Rework Events administration interface.                          -FRU
+        - Create a new Newsletter if needed                                -FRU
 
     * Geoloc:
         - Switch to the new URI scheme.                                 -MC/Car
@@ -47,6 +48,7 @@ New:
 
     * Profile:
         - Switch to the new URI scheme.                                     -MC
+        - Add photo and nickname in vcard                                  -FRU
 
     * Register:
         - Switch to the new URI scheme.                                     -MC
index 712573e..79c70d7 100644 (file)
@@ -57,7 +57,11 @@ class NewsLetter
            $res = XDB::query("SELECT * FROM newsletter WHERE id={?}", $id);
        } else {
            $res = XDB::query("SELECT * FROM newsletter WHERE bits='new'");
-       }
+        if (!$res->numRows()) {
+            insert_new_nl();
+        }
+        $res = XDB::query("SELECT * FROM newsletter WHERE bits='new'");
+    }
        $nl = $res->fetchOneAssoc();
 
        $this->_id    = $nl['id'];
@@ -87,7 +91,7 @@ class NewsLetter
 
     function setSent()
     {
-       XDB::execute("UPDATE  newsletter SET bits='sent' WHERE id={?}", $this->_id);
+           XDB::execute("UPDATE  newsletter SET bits='sent' WHERE id={?}", $this->_id);
     }
 
     // }}}