Adds a pop-up when the subject is not filled on the group email interface and sets...
authorStéphane Jacob <jacou@melix.net>
Thu, 27 Nov 2008 12:33:34 +0000 (13:33 +0100)
committerStéphane Jacob <jacou@melix.net>
Thu, 27 Nov 2008 12:33:34 +0000 (13:33 +0100)
templates/xnetgrp/mail.tpl

index 2f39797..c108df4 100644 (file)
@@ -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>
@@ -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">