bug 255 : add a new e-mail directly from private.php
authorPascal Corpet <pascal.corpet@m4x.org>
Mon, 17 Jan 2005 16:34:42 +0000 (16:34 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:47 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-375

htdocs/marketing/private.php
templates/marketing/private.tpl

index 0b3f11d..c305b02 100644 (file)
@@ -65,6 +65,14 @@ if (Env::has('relance')) {
     }
 }
 
+if (Env::get('action') == 'ajouter') {
+    $globals->xdb->execute(
+        "INSERT INTO register_marketing
+                 SET uid = {?}, sender = {?}, email = {?},
+                     date = NOW(), type = {?}",
+        $uid, Session::get('uid'), Env::get('email'), Env::get('type')); 
+}
+
 $res = $globals->xdb->iterator(
         "SELECT  r.*, a.alias
            FROM  register_marketing AS r
index b0c2778..4d7ae87 100644 (file)
@@ -50,6 +50,7 @@ sa derni
 
 <h2>Adresses connues</h2>
 
+<form action="{$smarty.request.PHP_SELF}" method="post">
 <table class="bicol" cellpadding="0" cellspacing="0">
   <tr>
     <th>Adresse</th>
@@ -76,7 +77,23 @@ sa derni
     <td></td>
     <td colspan='5' class='smaller'>(*): mail perso</td>
   </tr>
+  <tr>
+    <td>
+      <input type='text' name='email' />
+    </td>
+    <td colspan="4">
+      <select name="type">
+        <option value="staff">staff</option>
+        <option value="user">user</option>
+      </select>
+    </td>
+    <td class='action'>
+      <input type='hidden' name='uid' value='{$smarty.request.uid}' />
+      <input type='submit' name='action' value='ajouter' />
+    </td>
+  </tr>
 </table>
+</form>
 
 {if $rel_to}
 <form action="{$smarty.request.PHP_SELF}" method="post">