Display priority of tips.
[platal.git] / modules / xnetevents.php
index 0a20b21..10672f7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -346,14 +346,17 @@ class XnetEventsModule extends PLModule
 
         new_groupadmin_page('xnetevents/edit.tpl');
 
-        $moments = range(1, 4);
+        $moments    = range(1, 4);
+        $error      = false;
         $page->assign('moments', $moments);
 
         if (Post::v('intitule')) {
             require_once dirname(__FILE__).'/xnetevents/xnetevents.inc.php';
             $short_name = event_change_shortname($page, $infos['short_name'],
                                                  Env::v('short_name', ''));
-
+            if ($short_name != Env::v('short_name')) {
+                $error = true;
+            }
             $evt = array(
                 'eid'              => $eid,
                 'asso_id'          => $globals->asso('id'),
@@ -421,7 +424,6 @@ class XnetEventsModule extends PLModule
                                             WHERE eid = {?} AND item_id = {?}", $eid, $i);
                 }
             }
-
             // request for a new payment
             if (Post::v('paiement_id') == -1 && $money_defaut >= 0) {
                 require_once 'validations.inc.php';
@@ -439,7 +441,9 @@ class XnetEventsModule extends PLModule
                                         VALUES ({?}, {?}, '', '', 0)", $eid, 1);
             }
 
-            pl_redirect('events');
+            if (!$error) {
+                pl_redirect('events');
+            }
         }
 
         // get a list of all the payment for this asso
@@ -467,7 +471,7 @@ class XnetEventsModule extends PLModule
                                PayReq::same_event($eid, $globals->asso('id')));
             $stamp = $res->fetchOneCell();
             if ($stamp) {
-                $evt['paiement_id'] = -2;
+                $evt['paiement_id']  = -2;
                 $evt['paiement_req'] = $stamp;
             }
             $page->assign('evt', $evt);