Adds custom welcome message for group subscription (Closes #1230).
authorStéphane Jacob <sj@m4x.org>
Mon, 3 Jan 2011 20:17:04 +0000 (21:17 +0100)
committerStéphane Jacob <sj@m4x.org>
Mon, 3 Jan 2011 20:17:04 +0000 (21:17 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/xnetgrp.php
templates/xnetgrp/edit.tpl
upgrade/1.1.0/04_xnetgrp.sql

index 844df9d..1d1b4fe 100644 (file)
@@ -196,7 +196,7 @@ class XnetGrpModule extends PLModule
                              descr={?}, site={?}, mail={?}, resp={?},
                              forum={?}, mail_domain={?}, ax={?}, axDate = {?}, pub={?},
                              sub_url={?}, inscriptible={?}, unsub_url={?},
-                             flags={?}
+                             flags = {?}, welcome_msg = {?}
                       WHERE  id={?}",
                       Post::v('nom'), Post::v('diminutif'),
                       Post::v('cat'), (Post::i('dom') == 0) ? null : Post::i('dom'),
@@ -205,7 +205,8 @@ class XnetGrpModule extends PLModule
                       Post::v('forum'), Post::v('mail_domain'),
                       Post::has('ax'), $axDate, Post::v('pub'),
                       Post::v('sub_url'), Post::v('inscriptible'),
-                      Post::v('unsub_url'), $flags, $globals->asso('id'));
+                      Post::v('unsub_url'), $flags, Post::t('welcome_msg'),
+                      $globals->asso('id'));
                 if (Post::v('mail_domain')) {
                     XDB::execute('INSERT IGNORE INTO virtual_domains (domain) VALUES({?})',
                                            Post::v('mail_domain'));
@@ -215,13 +216,14 @@ class XnetGrpModule extends PLModule
                     "UPDATE  groups
                         SET  descr={?}, site={?}, mail={?}, resp={?},
                              forum={?}, pub= {?}, sub_url={?},
-                             unsub_url={?},flags={?}
+                             unsub_url = {?}, flags = {?}, welcome_msg = {?}
                       WHERE  id={?}",
                       Post::v('descr'), $site,
                       Post::v('mail'), Post::v('resp'),
                       Post::v('forum'), Post::v('pub'),
                       Post::v('sub_url'), Post::v('unsub_url'),
-                      $flags, $globals->asso('id'));
+                      $flags, Post::t('welcome_msg'),
+                      $globals->asso('id'));
             }
 
 
@@ -407,6 +409,7 @@ class XnetGrpModule extends PLModule
                      . "\n"
                      . "  Suite à ta demande d'adhésion à " . $globals->asso('nom')
                      . ", j'ai le plaisir de t'annoncer que ton inscription a été validée !\n"
+                     . (is_null($globals->asso('welcome_msg')) ? '' : "\n" . $globals->asso('welcome_msg') . "\n")
                      . "\n"
                      . "Bien cordialement,\n"
                      . "-- \n"
index f6cbaf7..9ba552f 100644 (file)
     </tr>
 
     <tr>
+      <td class="titre">
+        Message de bienvenue&nbsp;:<br />
+        <em>envoyé à l'inscription</em>
+      </td>
+      <td>
+        <textarea cols='40' rows='8' name='welcome_msg'>{$asso->welcome_msg}</textarea>
+      </td>
+    </tr>
+
+    <tr>
       <td class="titre center" colspan="2">
         Diffusion de la liste des membres&nbsp;:
         <select name="pub">
index 568cd5d..377a21c 100644 (file)
@@ -1,4 +1,5 @@
 ALTER TABLE groups ADD COLUMN axDate DATE DEFAULT NULL;
 ALTER TABLE group_members ADD COLUMN position ENUM('Président', 'Vice-président', 'Trésorier', 'Vice-trésorier', 'Secrétaire', 'Directeur', 'Délégué général', 'Secrétaire général', 'Membre du bureau') DEFAULT NULL;
+ALTER TABLE groups ADD COLUMN welcome_msg MEDIUMTEXT DEFAULT NULL;
 
 -- vim:set syntax=mysql: