Send email form.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 29 Dec 2008 21:12:45 +0000 (22:12 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 29 Dec 2008 21:12:45 +0000 (22:12 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/email.php
templates/emails/send.tpl

index 3a0721e..796d40b 100644 (file)
@@ -478,12 +478,12 @@ class EmailModule extends PLModule
         }
 
         $res = XDB::query(
-                "SELECT  u.prenom, u.nom, u.promo, a.alias as forlife
-                   FROM  auth_user_md5 AS u
-             INNER JOIN  contacts      AS c ON (u.user_id = c.contact)
-             INNER JOIN  aliases       AS a ON (u.user_id=a.id AND FIND_IN_SET('bestalias',a.flags))
+                "SELECT  ac.full_name, a.alias as forlife
+                   FROM  accounts      AS ac
+             INNER JOIN  contacts      AS c ON (ac.uid = c.contact)
+             INNER JOIN  aliases       AS a ON (ac.uid = a.id AND FIND_IN_SET('bestalias', a.flags))
                   WHERE  c.uid = {?}
-                 ORDER BY u.nom, u.prenom", S::v('uid'));
+                 ORDER BY ac.full_name", S::i('uid'));
         $page->assign('contacts', $res->fetchAllAssoc());
         $page->assign('maxsize', ini_get('upload_max_filesize') . 'o');
         $page->assign('user', S::user());
index bfd0f4b..9768f31 100644 (file)
 
 <p>
   <small>{icon name=information title="Envoi d'email"} Pour envoyer un email, tu peux soit le faire depuis l'interface
-  ci-dessous, soit utiliser <a href="Xorg/SMTPSecurise">notre serveur d'envoi SMTP<a>.</small>
+  ci-dessous, soit utiliser <a href="Xorg/SMTPSecurise">notre serveur d'envoi SMTP</a>.</small>
 </p>
 
 <form action="emails/send" method="post" enctype="multipart/form-data" id="form_mail" onsubmit="return check(this);">
           {foreach key=key item=contact from=$contacts}
           {if in_array($contact.forlife, $smarty.request.to_contacts)}
           <option value="{$contact.forlife}">
-            {$contact.prenom} {$contact.nom} (X{$contact.promo})
+            {$contact.full_name}
           </option>
           {/if}
           {/foreach}
           {foreach key=key item=contact from=$contacts}
           {if in_array($contact.forlife, $smarty.request.cc_contacts)}
           <option value="{$contact.forlife}">
-            {$contact.prenom} {$contact.nom} (X{$contact.promo})
+            {$contact.full_name}
           </option>
           {/if}
           {/foreach}
             {foreach item=contact from=$contacts}
             {if !in_array($contact.forlife, $smarty.request.to_contacts) && !in_array($contact.forlife, $smarty.request.cc_contacts)}
             <option value="{$contact.forlife}">
-              {$contact.prenom} {$contact.nom} (X{$contact.promo})
+              {$contact.full_name}
             </option>
             {/if}
             {/foreach}