Fix a bug in event short name edition
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 15 Dec 2006 16:14:29 +0000 (16:14 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 15 Dec 2006 16:14:29 +0000 (16:14 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1276 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/xnetevents.php
templates/xnetevents/edit.tpl

index 0a20b21..75b1bfe 100644 (file)
@@ -346,7 +346,8 @@ class XnetEventsModule extends PLModule
 
         new_groupadmin_page('xnetevents/edit.tpl');
 
-        $moments = range(1, 4);
+        $moments    = range(1, 4);
+        $short_name = '';
         $page->assign('moments', $moments);
 
         if (Post::v('intitule')) {
@@ -364,7 +365,7 @@ class XnetEventsModule extends PLModule
                 'fin'              => Post::v('fin_Year').'-'.Post::v('fin_Month')
                                       .'-'.Post::v('fin_Day').' '.Post::v('fin_Hour')
                                       .':'.Post::v('fin_Minute').':00',
-                'short_name'       => $short_name,
+                'short_name'       => is_null($short_name) ? '' : $short_name,
             );
 
             $trivial = array('intitule', 'descriptif', 'noinvite',
@@ -439,7 +440,9 @@ class XnetEventsModule extends PLModule
                                         VALUES ({?}, {?}, '', '', 0)", $eid, 1);
             }
 
-            pl_redirect('events');
+            if (!is_null($short_name)) {
+                pl_redirect('events');
+            }
         }
 
         // get a list of all the payment for this asso
index c8b08ab..c4a0c44 100644 (file)
@@ -80,7 +80,7 @@ function deadlineChange(box)
       </td>
       <td>
         <input type="text" name="short_name" size="20" maxlength="20"
-          value="{$evt.short_name|default:$smarty.request.short_name}" />
+          value="{$evt.short_name}" />
         <small>(n'utiliser que chiffres, lettres, tiret et point. garder court)</small>
       </td>
     </tr>