Some fixes on event form
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 22 Apr 2007 22:11:19 +0000 (22:11 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 22 Apr 2007 22:11:19 +0000 (22:11 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1727 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/events.php
templates/events/form.tpl

index c332760..2ccd14a 100644 (file)
@@ -389,9 +389,8 @@ class EventsModule extends PLModule
         } elseif (Post::v('action') == "Proposer" && $eid) {
             $promo_min = Post::i('promo_min');
             $promo_max = Post::i('promo_max');
-            if ($promo_min > $promo_max ||
-                ($promo_min != 0 && ($promo_min <= 1900 || $promo_min >= 2020)) ||
-                ($promo_max != 0 && ($promo_max <= 1900 || $promo_max >= 2020)))
+            if (($promo_min != 0 && ($promo_min <= 1900 || $promo_min >= 2020)) ||
+                ($promo_max != 0 && ($promo_max <= 1900 || $promo_max >= 2020 || $promo_max < $promo_min)))
             {
                 $page->trig("L'intervalle de promotions $promo_min -> $promo_max n'est pas valide");
                 $action = 'edit';
index 8411cfc..543b296 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
+{assign var=texte value=$smarty.request.texte|default:$texte} 
+{assign var=titre value=$smarty.request.titre|default:$titre} 
+{assign var=promo_min value=$smarty.request.promo_min|default:$promo_min} 
+{assign var=promo_max value=$smarty.request.promo_max|default:$promo_max} 
+{assign var=peremption value=$smarty.request.peremption|default:$peremption}
+{assign var=important value=$smarty.request.important|default:$important}
+
 <script type="text/javascript">//<![CDATA[
   {literal}
   function updatePreview()
@@ -92,6 +99,7 @@
           {/literal}
         //]]></script>
         Essaie de faire un <strong>texte court</strong>, une annonce ne doit pas excéder 800 caractères soit une douzaine de ligne. Tu en es déjà à <input type='text' name='texte_count' size="4" /> caractères.
+        <script type="text/javascript">update_texte_count(document.getElementById('texte').form);</script>
       </td>
     </tr>
     <tr class="pair">