Puts «» around prenom.nom.
[platal.git] / templates / xnetgrp / mail.tpl
index 4b74cec..cfb56c4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -31,6 +31,14 @@ masculin ou féminin, par son prénom, ou son nom.
 
 <script type="text/javascript">//<![CDATA[
   {literal}
+  function check(form)
+  {
+    if(form.sujet.value == "" && !confirm("Le sujet de l'email est vide, veux-tu continuer ?")) {
+        form.sujet.focus();
+        return false;
+    }
+  }
+
   function updateWikiView(box) {
     if (!box.checked) {
       document.getElementById("preview_bt").style.display = "none";
@@ -42,7 +50,7 @@ masculin ou féminin, par son prénom, ou son nom.
   {/literal}
 //]]></script>
  
-<form action="{$platal->ns}mail" method="post" enctype="multipart/form-data">
+<form action="{$platal->ns}mail" method="post" enctype="multipart/form-data" onsubmit="return check(this);">
   {xsrf_token_field}
   <table class='bicol'>
     <tr>
@@ -52,7 +60,7 @@ masculin ou féminin, par son prénom, ou son nom.
       <td class="titre">Expéditeur&nbsp;:</td>
       <td>
         <input type="text" name="from" size="55" maxlength="70"
-          value="{if $smarty.request.from}{$smarty.request.from}{else}&quot;{$smarty.session.prenom} {$smarty.session.nom}&quot; <{$smarty.session.bestalias}@polytechnique.org>{/if}" />
+          value="{if $smarty.request.from}{$smarty.request.from}{else}&quot;{$user->fullName()}&quot; &lt;{$user->bestEmail()}&gt;{/if}" />
       </td>
     </tr>
     <tr>
@@ -100,7 +108,7 @@ masculin ou féminin, par son prénom, ou son nom.
       <td class="titre">
         Sujet&nbsp;:
       </td>
-      <td><input type="text" name="sujet" value="{$smarty.request.sujet|default:"remplir le sujet ..."}" size=55 maxlength=70></td>
+      <td><input type="text" name="sujet" value="{$smarty.request.sujet}" size=55 maxlength=70></td>
     </tr>
     <tr>
       <td colspan="2" class="smaller">
@@ -125,11 +133,10 @@ masculin ou féminin, par son prénom, ou son nom.
 
 Nous avons le plaisir de t'adresser la lettre mensuelle du groupe {$asso.nom}.
 
-(insérer le texte...)
+(insérer le texte&hellip;)
 
 Le bureau du groupe {$asso.nom}.
-{/if}
-         </textarea>
+{/if}</textarea>
       </td>
     </tr>
     <tr>