Add a warning when birthday is do not match with promotion
[platal.git] / include / profil / assign_adresses.inc.php
index 9cab098..c811deb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  Copyright (C) 2003-2006 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -18,6 +18,9 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
+
+global $adresses;
+
 //on génère une éventuelle nouvelle adresse
 if (!isset($adresses) || (count($adresses) < $nb_adr_max)){
   $adrid = generate_new_adrid();
@@ -44,7 +47,7 @@ unset($adrid);
 reset($adresses);
 //on génère un éventuel nouveau tel pour chaque adresse
 foreach($adresses as $adrid => $adr){
-  if (!isset($adr['tels'])) {
+  if (!isset($adr['tels'])  || count($adr['tels']) == 0) {
     $adresses[$adrid]['tels'] = array(
       array('tel' => '', 'tel_pub' => 'private', 'tel_type' => 'Tél.', 'telid' => 0, 'new_tel' => true),
       array('tel' => '', 'tel_pub' => 'private', 'tel_type' => 'Fax', 'telid' => 1, 'new_tel' => true));