From: x2003bruneau Date: Sat, 16 Dec 2006 09:51:32 +0000 (+0000) Subject: Better fix for [1276] X-Git-Tag: xorg/0.9.13~186 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f56e5e531ccb47ceca2e26ffc01d6a107fb140f6;p=platal.git Better fix for [1276] git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1280 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/xnetevents.php b/modules/xnetevents.php index 75b1bfe..bee8a2e 100644 --- a/modules/xnetevents.php +++ b/modules/xnetevents.php @@ -347,14 +347,16 @@ class XnetEventsModule extends PLModule new_groupadmin_page('xnetevents/edit.tpl'); $moments = range(1, 4); - $short_name = ''; + $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'), @@ -365,7 +367,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' => is_null($short_name) ? '' : $short_name, + 'short_name' => $short_name, ); $trivial = array('intitule', 'descriptif', 'noinvite', @@ -422,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'; @@ -440,7 +441,7 @@ class XnetEventsModule extends PLModule VALUES ({?}, {?}, '', '', 0)", $eid, 1); } - if (!is_null($short_name)) { + if (!$error) { pl_redirect('events'); } } @@ -470,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); diff --git a/modules/xnetevents/xnetevents.inc.php b/modules/xnetevents/xnetevents.inc.php index ed5794c..455641f 100644 --- a/modules/xnetevents/xnetevents.inc.php +++ b/modules/xnetevents/xnetevents.inc.php @@ -233,6 +233,9 @@ function event_change_shortname(&$page, $old, $new) { global $globals; + if (is_null($old)) { + $old = ''; + } // Quelques vérifications sur l'alias (caractères spéciaux) if ($new && !preg_match( "/^[a-zA-Z0-9\-.]{3,20}$/", $new)) { $page->trig("Le raccourci demandé n'est pas valide. diff --git a/templates/xnetevents/index.tpl b/templates/xnetevents/index.tpl index aed7bd2..ed5a33f 100644 --- a/templates/xnetevents/index.tpl +++ b/templates/xnetevents/index.tpl @@ -161,7 +161,7 @@ Tu dois encore payer {math equation="a-b" a=$e.topay b=$e.paid|replace:'.':','} € (tu as déjà payé {$e.paid|replace:'.':','} €) {else} - Tu as déjà payé {$e.paid|replace:'.':','} € pour ton inscription. + Tu as déjà payé les {$e.paid|replace:'.':','} € de ton inscription. {/if} {if $e.paiement_id && $e.paid < $e.topay} [