deux titres pour la nl : un pour le mail, un pour le vrai titre
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 17 Nov 2006 23:05:15 +0000 (23:05 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 17 Nov 2006 23:05:15 +0000 (23:05 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1098 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
include/newsletter.inc.php
modules/events.php
templates/newsletter/edit.tpl
upgrade/0.9.12/02_newsletter.sql

index 0cccce6..9472cdd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,27 +5,27 @@ New:
 
     * Admin:
         - Can add sorting key in Table Editor.                             -FRU
-        - Can manage not registered users                                  -FRU
+        - Can manage not registered users.                                 -FRU
 
     * Carnet:
-        - Add a vcard of all the contacts                                  -FRU
-        - Fix timestamp in RSS feed                                        -FRU
+        - Add a vcard of all the contacts.                                 -FRU
+        - Fix timestamp in RSS feed.                                       -FRU
 
     * Lists:
-        - Add the fourth antispam level (moderate and drop)                -FRU
+        - Add the fourth antispam level (moderate and drop).               -FRU
 
     * Events:
-        - Add author and event id in RSS feed                              -FRU
+        - Add author and event id in RSS feed.                             -FRU
 
     * Xnet:
-        - Add a vcard of all the members of a group                        -FRU
-        - Add a full announce system                                       -FRU
-        - Add a list of the administrators of the group                    -FRU
+        - Add a vcard of all the members of a group.                       -FRU
+        - Add a full announce system.                                      -FRU
+        - Add a list of the administrators of the group.                   -FRU
 
     * Xnet/Events:
-        - Events can be archived                                           -FRU
-        - Can get iCal version of the events                               -FRU
-        - Can use short name as an event identifier in the URL             -FRU
+        - Events can be archived.                                          -FRU
+        - Can get iCal version of the events.                              -FRU
+        - Can use short name as an event identifier in the URL.            -FRU
 
 Bug/Wish:
 
@@ -37,33 +37,33 @@ Bug/Wish:
     * Core:
         - #473: Use 'événement' instead of 'évènement'.                    -FRU
         - #475: More understandable bug report form.                       -FRU
-        - #548: More informations for recovery for homonyms                -FRU
+        - #548: More informations for recovery for homonyms.               -FRU
 
     * Events:
         - #517: URL catcher update (www).                                  -Car
-        - #525: Add a user-friendly id for newsletters                     -FRU
-        - #530: Members can be identified as a unregistered user           -FRU
+        - #525: Add a user-friendly id for newsletters.                    -FRU
+        - #530: Members can be identified as a unregistered user.          -FRU
 
     * Lists:
-        - #485: Can moderate pure-HTML mails                               -FRU
-        - #532: Fix case sensitivity issues in emails processing           -FRU
+        - #485: Can moderate pure-HTML mails.                              -FRU
+        - #532: Fix case sensitivity issues in emails processing.          -FRU
 
     * Profile:
-        - #385: Add section, binets and groupes-X in vCard                 -FRU
-        - #451: vCard are RFC compliant                                    -FRU
-        - #502: Use 'alias' instead of 'aka' to specify the nickname       -FRU
-        - #536: Can use login.promo as a valid user identifier             -FRU
-        - #539: Medals and deco need validation from admin                 -Car
-        - #540: Profile of unregistered user redirects to marketing        -FRU
+        - #385: Add section, binets and groupes-X in vCard.                -FRU
+        - #451: vCard are RFC compliant.                                   -FRU
+        - #502: Use 'alias' instead of 'aka' to specify the nickname.      -FRU
+        - #536: Can use login.promo as a valid user identifier.            -FRU
+        - #539: Medals and deco need validation from admin.                -Car
+        - #540: Profile of unregistered user redirects to marketing.       -FRU
 
     * Xnet:
-        - #511: Migrate ML subscription when changing email of a non-X     -FRU
+        - #511: Migrate ML subscription when changing email of a non-X.    -FRU
 
     * Xnet/Events:
-        - #490: Events can be opened to non-members                        -FRU
-        - #514: Improve visibility of open events                          -FRU
-        - #523: Organizer does not change when editing an event            -FRU
-        - #546: More understandable new payment form                       -FRU
+        - #490: Events can be opened to non-members.                       -FRU
+        - #514: Improve visibility of open events.                         -FRU
+        - #523: Organizer does not change when editing an event.           -FRU
+        - #546: More understandable new payment form.                      -FRU
 
 From 0.9.11 branch:
 
@@ -71,18 +71,21 @@ From 0.9.11 branch:
         - #472: Fix problem with auth when using the cookie.                -MC
 
     * Emails:
-        - #496: Fix link to warn user who has a broken email               -FRU
+        - #496: Fix link to warn user who has a broken email.              -FRU
 
     * Geoloc:
         - #469: Google Maps link works for the USA.                        -FRU
 
+    * Newsletter:
+        - Mail can have different title not to repeat the month or sender. -Car
+
     * Payment:
-        - #482: fix action in the form.                                     -MC
+        - #482: Fix action in the form.                                     -MC
 
     * Profile:
-        - #486: fix force login to see private fiche.                      -Car
-        - #509: can access trombi of the current year promotion            -FRU
-        - #529: Disabled state is private                                  -FRU
+        - #486: Fix force login to see private fiche.                      -Car
+        - #509: Can access trombi of the current year promotion.           -FRU
+        - #529: Disabled state is private.                                 -FRU
 
 ================================================================================
 VERSION 0.9.11                                                 18 Septembre 2006
index 236026c..482a61d 100644 (file)
@@ -41,6 +41,7 @@ class NewsLetter
     var $_shortname;
     var $_date;
     var $_title;
+    var $_title_mail;
     var $_head;
     var $_cats = Array();
     var $_arts = Array();
@@ -69,6 +70,7 @@ class NewsLetter
         $this->_shortname = $nl['short_name'];
         $this->_date      = $nl['date'];
         $this->_title     = $nl['titre'];
+        $this->_title_mail = $nl['titre_mail'];
         $this->_head      = $nl['head'];
 
         $res = XDB::iterRow("SELECT cid,titre FROM newsletter_cat ORDER BY pos");
@@ -101,8 +103,8 @@ class NewsLetter
 
     function save()
     {
-        XDB::execute('UPDATE newsletter SET date={?},titre={?},head={?},short_name={?} WHERE id={?}',
-                     $this->_date, $this->_title, $this->_head, $this->_shortname,$this->_id);
+        XDB::execute('UPDATE newsletter SET date={?},titre={?},titre_mail={?},head={?},short_name={?} WHERE id={?}',
+                     $this->_date, $this->_title, $this->_title_mail, $this->_head, $this->_shortname,$this->_id);
     }
 
     // }}}
@@ -116,8 +118,12 @@ class NewsLetter
     // }}}
     // {{{ function title()
 
-    function title()
-    { return $this->_title; }
+    function title($mail = false) {
+       if ($mail) {
+               return $this->_title_mail;
+       }
+               return $this->_title;
+       }
 
     // }}}
     // {{{ function head()
@@ -331,7 +337,7 @@ EOF;
 
     $mailer = new HermesMailer();
     $mailer->setFrom($globals->newsletter->from);
-    $mailer->setSubject($this->title());
+    $mailer->setSubject($this->title(true));
     $mailer->addTo("\"$prenom $nom\" <$login@{$globals->mail->domain}>");
         if (!empty($globals->newsletter->replyto)) {
             $mailer->addHeader('Reply-To',$globals->newsletter->replyto);
@@ -448,18 +454,18 @@ class NLArticle
 
 function insert_new_nl()
 {
-    XDB::execute("INSERT INTO newsletter SET bits='new',date=NOW(),titre='to be continued'");
+    XDB::execute("INSERT INTO newsletter SET bits='new',date=NOW(),titre='to be continued',titre_mail='to be continued'");
 }
 
 function get_nl_slist()
 {
-    $res = XDB::query("SELECT IF(short_name IS NULL, id,short_name) as id,date,titre FROM newsletter ORDER BY date DESC");
+    $res = XDB::query("SELECT IF(short_name IS NULL, id,short_name) as id,date,titre_mail AS titre FROM newsletter ORDER BY date DESC");
     return $res->fetchAllAssoc();
 }
 
 function get_nl_list()
 {
-    $res = XDB::query("SELECT IF(short_name IS NULL, id,short_name) as id,date,titre FROM newsletter WHERE bits!='new' ORDER BY date DESC");
+    $res = XDB::query("SELECT IF(short_name IS NULL, id,short_name) as id,date,titre_mail AS titre FROM newsletter WHERE bits!='new' ORDER BY date DESC");
     return $res->fetchAllAssoc();
 }
 
index 0adde06..f828d15 100644 (file)
@@ -392,6 +392,7 @@ class EventsModule extends PLModule
         
         if($aid == 'update') {
             $nl->_title     = Post::v('title');
+            $nl->_title_mail= Post::v('title_mail');
             $nl->_date      = Post::v('date');
             $nl->_head      = Post::v('head');
             $nl->_shortname = strlen(Post::v('shortname')) ? Post::v('shortname') : null;
index 2d6ca24..dbe7e38 100644 (file)
     </tr>
     <tr>
       <td class='titre'>
+        Titre du mail
+      </td>
+      <td>
+        <input type='text' size='60' name='title_mail' value="{$nl->title(true)}" />
+      </td>
+    </tr>
+    <tr>
+      <td class='titre'>
         Titre
       </td>
       <td>
index 40b3777..384858c 100644 (file)
@@ -1 +1,4 @@
 ALTER TABLE newsletter ADD COLUMN short_name varchar(16) DEFAULT NULL;
+ALTER TABLE newsletter ADD COLUMN titre_mail varchar(255) NOT NULL DEFAULT '';
+UPDATE newsletter SET titre_mail = IF(locate('§|§',titre), LEFT(titre, LOCATE('§|§', titre) -1),titre);
+UPDATE newsletter SET titre = IF(locate('§|§',titre), SUBSTRING(titre, LOCATE('§|§', titre) +3),titre);