<?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 *
require_once('geoloc.inc.php');
+global $adresses, $nb_adr_max, $nb_tel_max;
+
// on limite à 6 adresses personnelles par utilisateur
$nb_adr_max = 6; // ( = max(adrid possibles)
// on limite à 4 numéros de téléphone par adresse
function is_adr_empty($adrid){
$adr = &$GLOBALS['adresses'][$adrid];
+ $emptytel = count($adr['tels']) == 0;
+ if (!$emptytel) {
+ $emptytel = true;
+ foreach ($adr['tels'] as $t) if ($t['tel']) {
+ $emptytel = false;
+ break;
+ }
+ }
return (
($adr['adr1'] == '') && ($adr['adr2'] == '') && ($adr['adr3'] == '') &&
($adr['postcode'] == '') && ($adr['city'] == '') && ($adr['country'] == '00') &&
- (count($adr['tels']) == 0)
+ ($emptytel)
);
}
delete_address($i,true);
}
}
+if (Env::i('deltel')) {
+ XDB::execute("DELETE FROM tels WHERE uid = {?} AND adrid = {?} AND telid = {?}",
+ S::v('uid', -1), Env::i('adrid'), Env::i('telid'));
+}
//$sql_order = "ORDER BY (NOT FIND_IN_SET('active', statut)), FIND_IN_SET('temporaire', statut)";
$sql_order = '';