<?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 *
* 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();
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));