changement ville -> city, cp ->postcode et pays -> country
authorPascal Corpet <pascal.corpet@m4x.org>
Sat, 11 Jun 2005 00:30:00 +0000 (00:30 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:29:12 +0000 (23:29 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-695

25 files changed:
htdocs/advanced_search.php
htdocs/carnet/mescontacts.php
htdocs/fiche.php
htdocs/fiche_referent.php
htdocs/vcard.php
include/contacts.pdf.inc.php
include/money/paypal.inc.php
include/profil/assign_emploi.inc.php
include/profil/get_adresses.inc.php
include/profil/get_emploi.inc.php
include/profil/update_adresses.inc.php
include/profil/update_emploi.inc.php
include/profil/verif_adresses.inc.php
include/profil/verif_emploi.inc.php
include/search/classes.inc.php
include/synchro_ax.inc.php
include/user.func.inc.php
include/webservices/manageurs.client.inc.php
include/webservices/manageurs.server.inc.php
templates/admin/synchro_ax.tpl
templates/geoloc/address.tpl
templates/include/minifiche.tpl
templates/profil/adresses.tpl
templates/profil/emploi.tpl
templates/search.adv.form.tpl

index 9f3e91e..9832e54 100644 (file)
@@ -82,8 +82,8 @@ if (!Env::has('rechercher')) {
         $subscriberField = new RefSField('subscriber',array('!(u.perms IN (\'admin\',\'user\'))+1'),'','','');
         $aliveField      = new RefSField('alive',array('(u.deces!=0)+1'),'','','');
        
-        $townField       = new RefSField('ville',array('av.ville'),'adresses','av','u.user_id=av.uid',false);
-        $countryField    = new RefSField('pays',array('ap.pays'),'adresses','ap','u.user_id=ap.uid');
+        $townField       = new RefSField('city',array('av.city'),'adresses','av','u.user_id=av.uid',false);
+        $countryField    = new RefSField('country',array('ap.country'),'adresses','ap','u.user_id=ap.uid');
         $regionField     = new RefSField('region',array('ar.region'),'adresses','ar','u.user_id=ar.uid');
        
         $entrepriseField = new RefSField('entreprise',array('ee.entreprise'),'entreprises','ee','u.user_id=ee.uid',false);
index 2ad376e..ccea643 100644 (file)
@@ -126,7 +126,7 @@ if(Get::get('trombi')) {
                    IF(n.nat='',n.pays,n.nat) AS nat, n.a2 AS iso3166,
                    ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type,
                    ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type,
-                   adr.ville, gp.a2, gp.pays, gr.name AS region,
+                   adr.city, gp.a2, gp.pays, gr.name AS region,
                    IF(a.nom_usage<>'',a.nom_usage,a.nom) AS sortkey
              FROM  contacts       AS c
         INNER JOIN  auth_user_md5  AS a   ON (a.user_id = c.contact)
@@ -140,8 +140,8 @@ if(Get::get('trombi')) {
          LEFT JOIN  applis_ins     AS ai1 ON (a.user_id = ai1.uid AND ai1.ordre = 1)
          LEFT JOIN  applis_def     AS ad1 ON (ad1.id = ai1.aid)
          LEFT JOIN  adresses       AS adr ON (a.user_id = adr.uid AND FIND_IN_SET('active', adr.statut))
-         LEFT JOIN  geoloc_pays    AS gp  ON (adr.pays = gp.a2)
-         LEFT JOIN  geoloc_region  AS gr  ON (adr.pays = gr.a2 AND adr.region = gr.region)
+         LEFT JOIN  geoloc_pays    AS gp  ON (adr.country = gp.a2)
+         LEFT JOIN  geoloc_region  AS gr  ON (adr.country = gr.a2 AND adr.region = gr.region)
              WHERE  c.uid = $uid
           ORDER BY  ".$order;
     
index 1842dc1..6e685e9 100644 (file)
@@ -89,10 +89,10 @@ if (!logged()) {
             $user['adr'][$i]['adr1'] = '';
             $user['adr'][$i]['adr2'] = '';
             $user['adr'][$i]['adr3'] = '';
-            $user['adr'][$i]['ville'] = '';
-            $user['adr'][$i]['cp'] = '';
+            $user['adr'][$i]['city'] = '';
+            $user['adr'][$i]['postcode'] = '';
             $user['adr'][$i]['region'] = '';
-            $user['adr'][$i]['pays'] = '';
+            $user['adr'][$i]['country'] = '';
         }
         elseif ($adr['tel_pub'] != 'public') {
             $user['adr'][$i]['tel'] = '';
@@ -107,10 +107,10 @@ if (!logged()) {
                 $user['adr_pro'][$i]['adr1'] = '';
                 $user['adr_pro'][$i]['adr2'] = '';
                 $user['adr_pro'][$i]['adr3'] = '';
-                $user['adr_pro'][$i]['ville'] = '';
-                $user['adr_pro'][$i]['cp'] = '';
+                $user['adr_pro'][$i]['city'] = '';
+                $user['adr_pro'][$i]['postcode'] = '';
                 $user['adr_pro'][$i]['region'] = '';
-                $user['adr_pro'][$i]['pays'] = '';
+                $user['adr_pro'][$i]['country'] = '';
             }
             if ($adr['pub'] != 'public') {
                 $user['adr_pro'][$i]['entreprise'] = '';
@@ -139,7 +139,7 @@ foreach($user['adr_pro'] as $i=>$pro) {
     if ($pro['entreprise'] == '' && $pro['fonction'] == ''
         && $pro['secteur'] == '' && $pro['poste'] == ''
         && $pro['adr1'] == '' && $pro['adr2'] == '' && $pro['adr3'] == ''
-        && $pro['cp'] == '' && $pro['ville'] == '' && $pro['pays'] == ''
+        && $pro['postcode'] == '' && $pro['city'] == '' && $pro['country'] == ''
         && $pro['tel'] == '' && $pro['fax'] == '' && $pro['mobile'] == ''
         && $pro['email'] == '')
         unset($user['adr_pro'][$i]);
index b7107a6..2eec23d 100644 (file)
@@ -49,14 +49,14 @@ $page->assign('bestalias', $bestalias);
 //recuperation des infos professionnelles
 $res = $globals->xdb->query(
         "SELECT  e.entreprise, s.label as secteur , ss.label as ss_secteur , f.fonction_fr as fonction,
-                 e.poste, e.adr1, e.adr2, e.adr3, e.cp, e.ville,
+                 e.poste, e.adr1, e.adr2, e.adr3, e.postcode, e.city,
                  gp.pays, gr.name, e.tel, e.fax, e.mobile
            FROM  entreprises AS e
       LEFT JOIN  emploi_secteur AS s ON(e.secteur = s.id)
       LEFT JOIN  emploi_ss_secteur AS ss ON(e.ss_secteur = ss.id AND e.secteur = ss.secteur)
       LEFT JOIN  fonctions_def AS f ON(e.fonction = f.id)
-      LEFT JOIN  geoloc_pays AS gp ON (gp.a2 = e.pays)
-      LEFT JOIN  geoloc_region AS gr ON (gr.a2 = e.pays and gr.region = e.region)
+      LEFT JOIN  geoloc_pays AS gp ON (gp.a2 = e.country)
+      LEFT JOIN  geoloc_region AS gr ON (gr.a2 = e.country and gr.region = e.region)
           WHERE  e.uid = {?}
        ORDER BY  e.entrid", $user_id);
 $page->assign('adr_pro', $res->fetchAllAssoc());
index 79a115e..43e8583 100644 (file)
@@ -26,12 +26,12 @@ require_once("user.func.inc.php");
 
 function format_adr($params, &$smarty)
 {
-    // $adr1, $adr2, $adr3, $cp, $ville, $region, $pays
+    // $adr1, $adr2, $adr3, $postcode, $city, $region, $country
     extract($params['adr']);
     $adr = $adr1;
     $adr = trim("$adr\n$adr2");
     $adr = trim("$adr\n$adr3");
-    return quoted_printable_encode(";;$adr;$ville;$region;$cp;$pays");
+    return quoted_printable_encode(";;$adr;$city;$region;$postcode;$country");
 }
 
 $page->register_modifier('qp_enc', 'quoted_printable_encode');
index e1b67c2..e47628e 100644 (file)
@@ -175,7 +175,7 @@ class ContactsPDF extends FPDF
         $r = trim("$r\n".$a['adr1']);
         $r = trim("$r\n".$a['adr2']);
         $r = trim("$r\n".$a['adr3']);
-        $r = trim("$r\n".trim($a['cp'].' '.$a['ville']));
+        $r = trim("$r\n".trim($a['postcode'].' '.$a['city']));
 
         $this->TableRow($l, $r);
 
@@ -193,12 +193,12 @@ class ContactsPDF extends FPDF
             $this->TableRow('Entreprise', $a['entreprise']);
         }
         
-        if ($a['adr1'] || $a['adr2'] || $a['adr3'] || $a['cp'] || $a['ville']) {
+        if ($a['adr1'] || $a['adr2'] || $a['adr3'] || $a['postcode'] || $a['city']) {
             $r = '';
             $r = trim("$r\n".$a['adr1']);
             $r = trim("$r\n".$a['adr2']);
             $r = trim("$r\n".$a['adr3']);
-            $r = trim("$r\n".trim($a['cp'].' '.$a['ville']));
+            $r = trim("$r\n".trim($a['postcode'].' '.$a['city']));
             $this->TableRow('adresse pro', $r);
         }
 
@@ -310,7 +310,7 @@ class ContactsPDF extends FPDF
         
         foreach ($x['adr_pro'] as $a) {
             if ( ! ($a['entreprise'] || $a['tel'] || $a['fax']
-                    || $a['adr1'] || $a['adr2'] || $a['adr3'] || $a['cp'] || $a['ville']) )
+                    || $a['adr1'] || $a['adr2'] || $a['adr3'] || $a['postcode'] || $a['city']) )
             {
                 continue;
             }
index 4290051..63634c5 100644 (file)
@@ -74,7 +74,7 @@ class PayPal
                
        $res = $globals->xdb->query(
                "SELECT a.adr1 AS address1, a.adr2 AS address2,
-                       a.ville AS city, a.cp AS zip, a.pays AS country,
+                       a.city, a.postcode AS zip, a.country,
                        IF(a.tel, a.tel, q.profile_mobile) AS night_phone_b
                   FROM auth_user_quick AS q
              LEFT JOIN adresses        AS a ON (q.user_id = a.uid)
index ac18632..bfb867e 100644 (file)
@@ -28,9 +28,9 @@ $page->assign('fonction',$fonction);
 $page->assign('adrpro1',$adrpro1);
 $page->assign('adrpro2',$adrpro2);
 $page->assign('adrpro3',$adrpro3);
-$page->assign('cppro',$cppro);
-$page->assign('villepro',$villepro);
-$page->assign('payspro',$payspro);
+$page->assign('postcodepro',$postcodepro);
+$page->assign('citypro',$citypro);
+$page->assign('countrypro',$countrypro);
 $page->assign('regionpro',$regionpro);
 $page->assign('telpro',$telpro);
 $page->assign('faxpro',$faxpro);
index e5bb326..0e903e1 100644 (file)
@@ -30,7 +30,7 @@ function is_adr_empty($adrid){
   $adr = &$GLOBALS['adresses'][$adrid];
   return ( 
     ($adr['adr1'] == '') && ($adr['adr2'] == '') && ($adr['adr3'] == '') &&
-    ($adr['cp'] == '') && ($adr['ville'] == '') && ($adr['pays'] == '00') &&
+    ($adr['postcode'] == '') && ($adr['city'] == '') && ($adr['country'] == '00') &&
     ($adr['tel'] == '') && ($adr['fax'] == '')
     );
 }
@@ -66,8 +66,8 @@ $res = $globals->xdb->iterRow(
        "SELECT
        FIND_IN_SET('res-secondaire', statut), FIND_IN_SET('courrier', statut),
        FIND_IN_SET('active', statut), FIND_IN_SET('temporaire', statut),
-       adr1, adr2, adr3, cp, ville,
-        pays, region, tel, fax, pub, tel_pub
+       adr1, adr2, adr3, postcode, city,
+        country, region, tel, fax, pub, tel_pub
        FROM adresses
        WHERE uid = {?} AND NOT FIND_IN_SET('pro',statut) ".$sql_order
 , Session::getInt('uid', -1)
@@ -81,8 +81,8 @@ for ($i = 0; $i < $nb_adr; $i++) {
   list(
        $adresses[$adrid]['secondaire'], $adresses[$adrid]['courrier'],
        $adresses[$adrid]['active'], $adresses[$adrid]['temporaire'],
-       $adresses[$adrid]['adr1'], $adresses[$adrid]['adr2'], $adresses[$adrid]['adr3'], $adresses[$adrid]['cp'], $adresses[$adrid]['ville'],
-       $adresses[$adrid]['pays'], $adresses[$adrid]['region'], $adresses[$adrid]['tel'], $adresses[$adrid]['fax'],
+       $adresses[$adrid]['adr1'], $adresses[$adrid]['adr2'], $adresses[$adrid]['adr3'], $adresses[$adrid]['postcode'], $adresses[$adrid]['city'],
+       $adresses[$adrid]['country'], $adresses[$adrid]['region'], $adresses[$adrid]['tel'], $adresses[$adrid]['fax'],
        $adresses[$adrid]['pub'],
        $adresses[$adrid]['tel_pub'],) = $res->next();
   $adresses[$adrid]['nouvelle'] = 'modif';
index 4b8af53..46d32fd 100644 (file)
@@ -24,7 +24,7 @@ require_once('secteur.emploi.inc.php');
 require_once('fonction.emploi.inc.php');
 
 $res = $globals->xdb->iterRow("SELECT entrid, entreprise, secteur, ss_secteur, poste, fonction,
-       adr1, adr2, adr3, cp, ville, pays, region, tel, fax, mobile,
+       adr1, adr2, adr3, postcode, city, country, region, tel, fax, mobile,
        pub, adr_pub, tel_pub, email, email_pub, web
         FROM entreprises
         WHERE uid = {?} ORDER BY entrid",Session::getInt('uid', -1));
@@ -32,7 +32,7 @@ $res = $globals->xdb->iterRow("SELECT entrid, entreprise, secteur, ss_secteur, p
 $nb_res = $res->total();
 for($i = 0; $i < $nb_res ; $i++){
        list($endrid[$i], $entreprise[$i], $secteur[$i], $ss_secteur[$i], $poste[$i], $fonction[$i],
-                    $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $cppro[$i], $villepro[$i], $payspro[$i], $regionpro[$i],
+                    $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $postcodeppro[$i], $citypro[$i], $countrypro[$i], $regionpro[$i],
              $telpro[$i], $faxpro[$i], $mobilepro[$i], $pubpro[$i], $adr_pubpro[$i],
             $tel_pubpro[$i], $emailpro[$i], $email_pubpro[$i], $webpro[$i]) = $res->next();
 }
@@ -47,9 +47,9 @@ for($i = $nb_res; $i < 2 ; $i++){
         $adrpro1[$i] = '';
        $adrpro2[$i] = '';
        $adrpro3[$i] = '';
-       $cppro[$i] = '';
-       $villepro[$i] = '';
-       $payspro[$i] = '00';
+       $postcodepro[$i] = '';
+       $citypro[$i] = '';
+       $countrypro[$i] = '00';
        $regionpro[$i] = '';
         $telpro[$i] = '';
        $faxpro[$i] = '';
index 45b9b41..9ca73b5 100644 (file)
@@ -41,9 +41,9 @@ foreach($adresses as $adrid => $adr){
                         adr1 = {?},
                         adr2 = {?},
                         adr3 = {?},
-                        cp = {?},
-                        ville = {?},
-                        pays = {?},
+                        postcode = {?},
+                        city = {?},
+                        country = {?},
                         region = {?},
                         tel = {?},
                         fax = {?},
@@ -55,9 +55,9 @@ foreach($adresses as $adrid => $adr){
                         $adr['adr1'],
                         $adr['adr2'],
                         $adr['adr3'],
-                        $adr['cp'],
-                        $adr['ville'],
-                        $adr['pays'],
+                        $adr['postcode'],
+                        $adr['city'],
+                        $adr['country'],
                         $adr['region'],
                         $adr['tel'],
                         $adr['fax'],
@@ -74,9 +74,9 @@ foreach($adresses as $adrid => $adr){
                                 adr1 = {?},
                                 adr2 = {?},
                                 adr3 = {?},
-                                cp = {?},
-                                ville = {?},
-                                pays = {?},
+                                postcode = {?},
+                                city = {?},
+                                country = {?},
                                 region = {?},
                                 tel = {?},
                                 fax = {?},
@@ -88,9 +88,9 @@ foreach($adresses as $adrid => $adr){
                                 $adr['adr1'],
                                 $adr['adr2'],
                                 $adr['adr3'],
-                                $adr['cp'],
-                                $adr['ville'],
-                                $adr['pays'],
+                                $adr['postcode'],
+                                $adr['city'],
+                                $adr['country'],
                                 $adr['region'],
                                 $adr['tel'],
                                 $adr['fax'],
index 405f89c..d5827b9 100644 (file)
@@ -21,7 +21,7 @@
 
 for($i = 0; $i < 2; $i++){
 
-    $globals->xdb->execute("REPLACE INTO entreprises(uid,entrid,entreprise,secteur,ss_secteur,poste,fonction,adr1,adr2,adr3,cp,ville,pays,region,tel,fax,mobile,pub, adr_pub, tel_pub, email, email_pub, web) ".
+    $globals->xdb->execute("REPLACE INTO entreprises(uid,entrid,entreprise,secteur,ss_secteur,poste,fonction,adr1,adr2,adr3,postcode,city,country,region,tel,fax,mobile,pub, adr_pub, tel_pub, email, email_pub, web) ".
               "VALUES ({?}, {?}, {?}, ".
              "{?},".
              "{?}".
@@ -35,8 +35,8 @@ for($i = 0; $i < 2; $i++){
              ( ($secteur[$i] == "") ? null : $secteur[$i]), //sinon un faux 0 est rentre dans la base
              ( ($ss_secteur[$i] == "") ? null : $ss_secteur[$i]),
              $poste[$i], $fonction[$i],
-              $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $cppro[$i],
-              $villepro[$i], $payspro[$i],
+              $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $postcodepro[$i],
+              $citypro[$i], $countrypro[$i],
              $regionpro[$i], $telpro[$i], $faxpro[$i], $mobilepro[$i],
              $pubpro[$i], $adr_pubpro[$i], $tel_pubpro[$i],
              $emailpro[$i], $email_pubpro[$i], $webpro[$i]);
index 0801a7a..17b2f7a 100644 (file)
@@ -75,9 +75,9 @@ function replace_address($i){
   replace_ifset_adr('adr1', $i);
   replace_ifset_adr('adr2', $i);
   replace_ifset_adr('adr3', $i);
-  replace_ifset_adr('cp', $i);
-  replace_ifset_adr('ville', $i);
-  replace_ifset_adr('pays', $i);
+  replace_ifset_adr('postcode', $i);
+  replace_ifset_adr('city', $i);
+  replace_ifset_adr('country', $i);
   replace_ifset_adr('region', $i);
   replace_ifset_adr('tel', $i);
   replace_ifset_adr('fax', $i);
@@ -117,11 +117,11 @@ foreach($adresses as $adrid => $adr) {
     {
       $str_error = $str_error."Le champ '$description - Ligne 3' contient un caractère interdit.<BR />";
     }
-  if (strlen(strtok($adr['cp'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['cp']))
+  if (strlen(strtok($adr['postcode'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['postcode']))
     {
       $str_error = $str_error."Le champ '$description - Code Postal' contient un caractère interdit.<BR />";
     }
-  if (strlen(strtok($adr['ville'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['ville']))
+  if (strlen(strtok($adr['city'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['postcode']))
     {
       $str_error = $str_error."Le champ '$description - Ville' contient un caractère interdit.<BR />";
     }
@@ -161,9 +161,9 @@ if (!isset($adresses) || (count($adresses) < $nb_adr_max)){
   $adr['adr1'] = '';
   $adr['adr2'] = '';
   $adr['adr3'] = '';
-  $adr['cp'] = '';
-  $adr['ville'] = '';
-  $adr['pays'] = '00';
+  $adr['postcode'] = '';
+  $adr['city'] = '';
+  $adr['country'] = '00';
   $adr['region'] = '';
   $adr['tel'] = '';
   $adr['fax'] = '';
index 9312fdf..02f7d77 100644 (file)
@@ -40,9 +40,9 @@ replace_ifset_i($fonction,"fonction",$i);
 replace_ifset_i($adrpro1,"adrpro1",$i);
 replace_ifset_i($adrpro2,"adrpro2",$i);
 replace_ifset_i($adrpro3,"adrpro3",$i);
-replace_ifset_i($cppro,"cppro",$i);
-replace_ifset_i($villepro,"villepro",$i);
-replace_ifset_i($payspro,"payspro",$i);
+replace_ifset_i($postcodepro,"postcodepro",$i);
+replace_ifset_i($citypro,"citypro",$i);
+replace_ifset_i($countrypro,"countrypro",$i);
 replace_ifset_i($regionpro,"regionpro",$i);
 replace_ifset_i($telpro,"telpro",$i);
 replace_ifset_i($faxpro,"faxpro",$i);
@@ -105,11 +105,11 @@ if (strlen(strtok($adrpro1[$i],"<>{}@~?!
     {
       $str_error = $str_error."Le champ 'Adresse professionnelle $j - Ligne 3' contient un caractère interdit.<BR />";
     }
-  if (strlen(strtok($cppro[$i],"<>{}@~?!§*`|%$^=+")) < strlen($cppro[$i]))
+  if (strlen(strtok($postcodepro[$i],"<>{}@~?!§*`|%$^=+")) < strlen($postcodepro[$i]))
     {
       $str_error = $str_error."Le champ 'Code Postal professionnel $j' contient un caractère interdit.<BR />";
     }
-  if (strlen(strtok($villepro[$i],"<>{}@~?!§*`|%$^=+")) < strlen($villepro[$i]))
+  if (strlen(strtok($citypro[$i],"<>{}@~?!§*`|%$^=+")) < strlen($citypro[$i]))
     {
       $str_error = $str_error."Le champ 'Ville professionnelle $j' contient un caractère interdit.<BR />";
     }
index 80325fd..94ef6d7 100644 (file)
@@ -42,14 +42,14 @@ if (logged())
                q.profile_web AS web,
                q.profile_mobile AS mobile,
                q.profile_freetext AS freetext,
-                adr.ville, gp.pays, gr.name AS region,
+                adr.city, gp.pays, gr.name AS region,
                e.entreprise,';
 else
        $globals->search->result_fields .="
                IF(q.profile_web_pub='public', q.profile_web, '') AS web,
                IF(q.profile_mobile_pub='public', q.profile_mobile, '') AS mobile,
                IF(q.profile_freetext_pub='public', q.profile_freetext, '') AS freetext,
-               IF(adr.pub='public', adr.ville, '') AS ville,
+               IF(adr.pub='public', adr.city, '') AS city,
                IF(adr.pub='public', gp.pays, '') AS pays,
                IF(adr.pub='public', gr.name, '') AS region,
                IF(e.pub='public', e.entreprise, '') AS entreprise,";
@@ -63,8 +63,8 @@ $globals->search->result_where_statement = '
                 LEFT JOIN  fonctions_def  AS ef  ON (e.fonction = ef.id)
                 LEFT JOIN  geoloc_pays    AS n   ON (u.nationalite = n.a2)
                 LEFT JOIN  adresses       AS adr ON (u.user_id = adr.uid AND FIND_IN_SET(\'active\',adr.statut))
-                LEFT JOIN  geoloc_pays    AS gp  ON (adr.pays = gp.a2)
-                LEFT JOIN  geoloc_region  AS gr  ON (adr.pays = gr.a2 AND adr.region = gr.region)';
+                LEFT JOIN  geoloc_pays    AS gp  ON (adr.country = gp.a2)
+                LEFT JOIN  geoloc_region  AS gr  ON (adr.country = gr.a2 AND adr.region = gr.region)';
 
 // }}}
 // {{{ function display_lines()
index 4317f1f..8345172 100644 (file)
@@ -66,10 +66,10 @@ function get_user_ax($uid, $raw=false)
         $jobax['adr1'] = $ancien->Adresse_act_adresse1($i);
         $jobax['adr2'] = $ancien->Adresse_act_adresse2($i);
         $jobax['adr3'] = $ancien->Adresse_act_adresse3($i);
-        $jobax['cp']   = $ancien->Adresse_act_code_pst($i);
-        $jobax['ville'] = $ancien->Adresse_act_ville($i);
+        $jobax['postcode']   = $ancien->Adresse_act_code_pst($i);
+        $jobax['city'] = $ancien->Adresse_act_ville($i);
         $jobax['region'] = $ancien->Adresse_act_etat_region($i);
-        $jobax['pays'] = $ancien->Adresse_act_pays($i);
+        $jobax['country'] = $ancien->Adresse_act_pays($i);
         $jobax['tel']  = $ancien->Adresse_act_tel($i);
         $jobax['fax']  = $ancien->Adresse_act_fax($i);
         $jobax['mobile'] = $ancien->Adresse_act_mobile($i);
@@ -82,10 +82,10 @@ function get_user_ax($uid, $raw=false)
         $adrax['adr1'] = $ancien->Adresse1($i);
         $adrax['adr2'] = $ancien->Adresse2($i);
         $adrax['adr3'] = $ancien->Adresse3($i);
-        $adrax['cp'] = $ancien->Code_pst($i);
-        $adrax['ville'] = $ancien->Ville($i);
+        $adrax['postcode'] = $ancien->Code_pst($i);
+        $adrax['city'] = $ancien->Ville($i);
         $adrax['region'] = $ancien->Etat_region($i);
-        $adrax['pays'] = $ancien->Pays($i);
+        $adrax['country'] = $ancien->Pays($i);
         $adrax['tel'] = $ancien->Tel($i);
         $adrax['fax'] = $ancien->Fax($i);
         $userax['adr'][] = $adrax;
@@ -145,12 +145,12 @@ function import_from_ax($userax, $nom_usage=false, $mobile=false, $del_address=n
                 $new_adrid++;
             }
             
-            if ($adr['pays']) {
+            if ($adr['city']) {
             
                 $res = $globals->xdb->query(
                 "SELECT a2 FROM geoloc_pays
                  WHERE pays LIKE {?} OR country LIKE {?}",
-                 $adr['pays'], $adr['pays']);
+                 $adr['country'], $adr['country']);
                  
                 $a2 = $res->fetchOneCell();
             }
@@ -160,15 +160,15 @@ function import_from_ax($userax, $nom_usage=false, $mobile=false, $del_address=n
                 "INSERT INTO adresses
                          SET uid = {?}, adrid = {?},
                              adr1 = {?}, adr2 = {?}, adr3 = {?},
-                             cp = {?}, ville = {?},
-                         pays = {?},
+                             postcode = {?}, city = {?},
+                         country = {?},
                          tel = {?}, fax = {?},
                          datemaj = NOW(),
                          pub = 'ax',
                          tel_pub = 'ax'",
                 $userax['uid'], $new_adrid,
                 $adr['adr1'], $adr['adr2'], $adr['adr3'],
-                $adr['cp'], $adr['ville'],
+                $adr['postcode'], $adr['city'],
                 $a2,
                 $adr['tel'], $adr['fax']);
         }
@@ -198,11 +198,11 @@ function import_from_ax($userax, $nom_usage=false, $mobile=false, $del_address=n
                 $new_entrid++;
             }
             
-            if ($pro['pays']) {
+            if ($pro['country']) {
                 $res = $globals->xdb->query(
                     "SELECT a2 FROM geoloc_pays
                       WHERE pays LIKE {?} OR country LIKE {?}",
-                    $pro['pays'], $pro['pays']);
+                    $pro['country'], $pro['country']);
                 $a2 = $res->fetchOneCell();
             }
             if (!$a2) { $a2 = '00'; }
@@ -212,14 +212,14 @@ function import_from_ax($userax, $nom_usage=false, $mobile=false, $del_address=n
                          SET uid = {?}, entrid = {?},
                          entreprise = {?}, poste = {?},
                          adr1 = {?}, adr2 = {?}, adr3 = {?},
-                         cp = {?}, ville = {?},
-                         pays = {?},
+                         postcode = {?}, city = {?},
+                         country = {?},
                          tel = {?}, fax = {?},
                          pub = 'ax', adr_pub = 'ax', tel_pub = 'ax'",
                 $userax['uid'], $new_entrid,
                 $pro['entreprise'], $pro['fonction'],
                 $pro['adr1'], $pro['adr2'], $pro['adr3'],
-                $pro['cp'], $pro['ville'],
+                $pro['postcode'], $pro['city'],
                 $a2,
                 $pro['tel'], $pro['fax']);
         }
index a23ba67..60f2fb6 100644 (file)
@@ -181,28 +181,28 @@ function &get_user_details($login, $from_uid = '')
     $uid  = $user['user_id'];
 
     $sql  = "SELECT  e.entreprise, s.label as secteur , ss.label as sous_secteur , f.fonction_fr as fonction,
-                     e.poste, e.adr1, e.adr2, e.adr3, e.cp, e.ville,
+                     e.poste, e.adr1, e.adr2, e.adr3, e.postcode, e.city,
                      gp.pays, gr.name AS region, e.tel, e.fax, e.mobile, e.entrid,
                      e.pub, e.tel_pub, e.email, e.email_pub, e.web
                FROM  entreprises AS e
           LEFT JOIN  emploi_secteur AS s ON(e.secteur = s.id)
           LEFT JOIN  emploi_ss_secteur AS ss ON(e.ss_secteur = ss.id AND e.secteur = ss.secteur)
           LEFT JOIN  fonctions_def AS f ON(e.fonction = f.id)
-          LEFT JOIN  geoloc_pays AS gp ON (gp.a2 = e.pays)
-          LEFT JOIN  geoloc_region AS gr ON (gr.a2 = e.pays and gr.region = e.region)
+          LEFT JOIN  geoloc_pays AS gp ON (gp.a2 = e.country)
+          LEFT JOIN  geoloc_region AS gr ON (gr.a2 = e.country and gr.region = e.region)
               WHERE  e.uid = {?}
            ORDER BY  e.entrid";
     $res  = $globals->xdb->query($sql, $uid);
     $user['adr_pro'] = $res->fetchAllAssoc();
 
-    $sql  = "SELECT  a.adr1,a.adr2,a.adr3,a.cp,a.ville,
+    $sql  = "SELECT  a.adr1,a.adr2,a.adr3,a.postcode,a.city,
                      gp.pays,gr.name AS region,a.tel,a.fax,
                      FIND_IN_SET('active', a.statut) AS active, a.adrid,
                      FIND_IN_SET('res-secondaire', a.statut) AS secondaire,
                      a.pub, a.tel_pub
                FROM  adresses AS a
-          LEFT JOIN  geoloc_pays AS gp ON (gp.a2=a.pays)
-          LEFT JOIN  geoloc_region AS gr ON (gr.a2=a.pays and gr.region=a.region)
+          LEFT JOIN  geoloc_pays AS gp ON (gp.a2=a.country)
+          LEFT JOIN  geoloc_region AS gr ON (gr.a2=a.country and gr.region=a.region)
               WHERE  uid= {?} AND NOT FIND_IN_SET('pro',a.statut)
            ORDER BY  NOT FIND_IN_SET('active',a.statut), FIND_IN_SET('temporaire',a.statut), FIND_IN_SET('res-secondaire',a.statut)";
     $res  = $globals->xdb->query($sql, $uid);
index 3cbd977..559699a 100644 (file)
@@ -10,7 +10,7 @@ function get_annuaire_infos($amicale, $id_assoce, $adresse){
 
   $url = 'http://www.polytechniciens.org:80/manageurs.php';
     //decommenter pour ajouter un webservice chez l'AX :
-   // return array('adresse' => array(0 => array('adr1' => 'test AX', 'ville' => 'Trou perdu')));
+   // return array('adresse' => array(0 => array('adr1' => 'test AX', 'city' => 'Trou perdu')));
 
   $client = new xmlrpc_client($url);
  
index b8ae841..cd91bed 100644 (file)
@@ -36,7 +36,7 @@ function get_annuaire_infos($method, $params) {
             $res = $globals->xdb->iterRow(
                  "SELECT     q.profile_mobile AS cell, a.naissance AS age,
                              adr.adr1, adr.adr2, adr.adr3,
-                             adr.cp, adr.ville, adr.pays,
+                             adr.postcode, adr.city, adr.country,
                              adr.tel, adr.fax
                        FROM  auth_user_md5 AS a
                  INNER JOIN  auth_user_quick AS q USING (user_id)
@@ -51,8 +51,8 @@ function get_annuaire_infos($method, $params) {
 
         //traitement des adresss si necessaire
         if (isset($params[2])) {
-            if(list($cell, $age, $adr['adr1'], $adr['adr2'], $adr['adr3'], $adr['cp'], $adr['ville'],
-                        $adr['pays'], $adr['tel'], $adr['fax']) = $res->next())
+            if(list($cell, $age, $adr['adr1'], $adr['adr2'], $adr['adr3'], $adr['postcode'], $adr['city'],
+                        $adr['country'], $adr['tel'], $adr['fax']) = $res->next())
             {
                 $array['cell']      = $cell;
                 $array['age']       = $age;
@@ -63,8 +63,8 @@ function get_annuaire_infos($method, $params) {
 
                 if ($adresse != 1) { //on ne veut pas la premiere adresse
                     $i = 2;
-                    while(list($cell, $age, $adr['adr1'], $adr['adr2'], $adr['adr3'], $adr['cp'], $adr['ville'],
-                                $adr['pays'], $adr['tel'], $adr['fax']) = $res->next())
+                    while(list($cell, $age, $adr['adr1'], $adr['adr2'], $adr['adr3'], $adr['postcode'], $adr['city'],
+                                $adr['country'], $adr['tel'], $adr['fax']) = $res->next())
                     {
                         if($adresse == $i){//si on veut cette adresse en particulier
                             $array['adresse'][0] = $adr;
index b9175b2..f3bf34d 100644 (file)
@@ -42,7 +42,7 @@
 <form action='{$smarty.request.PHP_SELF}' method='post'>
 {if $x.profile_from_ax}
 <div style="text-align:center;margin:5px;background:green">
-<strong>Cet utilisateur a accpeté la synchronisation</strong>
+<strong>Cet utilisateur a accepeté la synchronisation</strong>
 </div>
 {else}
 <div style="text-align:center;margin:5px;background:red">
index 8a66a12..3a1108f 100644 (file)
 {**************************************************************************}
 
 
-      {if $address.adr1 || $address.pays || $geoloc_address.ville || $address.tel || $address.fax || $address.mobile}
+      {if $address.adr1 || $address.pays || $geoloc_address.city || $address.tel || $address.fax || $address.mobile}
       {if $no_div neq 1}
       <div class="adresse">
       {/if}
-        {if $titre && ($address.adr1 || $address.ville || $address.pays)}
+        {if $titre && ($address.adr1 || $address.city || $address.pays)}
           {if $titre_div}
             <div class="titre">
               {$titre}
@@ -37,7 +37,7 @@
         {if $address.adr1}<strong>{$address.adr1}</strong><br />{/if}
         {if $address.adr2}<strong>{$address.adr2}</strong><br />{/if}
         {if $address.adr3}<strong>{$address.adr3}</strong><br />{/if}
-        {if $address.ville}<strong>{$address.cp} {$address.ville}</strong><br />{/if}
+        {if $address.city}<strong>{$address.postcode} {$address.city}</strong><br />{/if}
         {if $address.pays}
         <strong>{$address.pays}{if $address.region && $address.pays != 'France'} ({$address.region}){/if}</strong>
         {/if}
index 6c225ee..7aea0b4 100644 (file)
@@ -86,7 +86,7 @@
 
   <div class="long">
   {if $c.wasinscrit}
-    {if $c.web || $c.mobile || $c.pays || $c.ville || $c.region || $c.entreprise || $c.freetext}
+    {if $c.web || $c.mobile || $c.pays || $c.city || $c.region || $c.entreprise || $c.freetext}
     <table cellspacing="0" cellpadding="0">
       {if $c.web}
       <tr>
         <td class="rt"><a href="{$c.web}">{$c.web}</a></td>
       </tr>
       {/if}
-      {if $c.pays || $c.ville}
+      {if $c.pays || $c.city}
       <tr>
         <td class="lt">Géographie:</td>
-        <td class="rt">{$c.ville}{if $c.ville && $c.pays}, {/if}{$c.pays}</td>
+        <td class="rt">{$c.city}{if $c.city && $c.pays}, {/if}{$c.pays}</td>
       </tr>
       {/if}
       {if $c.mobile}
index c7312a7..abe777b 100644 (file)
         <span class="titre">Code postal / Ville</span><br />
       </td>
       <td class="cold">
-        <input type="text" name="cp[{$adrid}]" value="{$adr.cp}" size="7" maxlength="18" />
+        <input type="text" name="postcode[{$adrid}]" value="{$adr.postcode}" size="7" maxlength="18" />
         &nbsp;
-        <input type="text" name="ville[{$adrid}]" value="{$adr.ville}" size="32" maxlength="78" />
+        <input type="text" name="city[{$adrid}]" value="{$adr.city}" size="32" maxlength="78" />
       </td>
     </tr>
     <tr>
         <span class="titre">Pays</span>
       </td>
       <td class="cold">
-        <select name="pays[{$adrid}]" onchange="this.form.submit();">
-          {geoloc_pays pays=$adr.pays}
+        <select name="country[{$adrid}]" onchange="this.form.submit();">
+          {geoloc_pays pays=$adr.country}
         </select>
       </td>
     </tr>
       </td>
       <td class="cold">
         <select name="region[{$adrid}]">
-          {geoloc_region pays=$adr.pays region=$adr.region}
+          {geoloc_region pays=$adr.country region=$adr.region}
         </select>
       </td>
     </tr>
index 3cbba31..f86f55f 100644 (file)
         <span class="titre">Code postal</span><br />
       </td>
       <td class="cold">
-        <input type="text" name="cppro[{$i}]" value="{$cppro.$i}" size="8" maxlength="8" />
+        <input type="text" name="postcodepro[{$i}]" value="{$postcodepro.$i}" size="8" maxlength="8" />
       </td>
     </tr>
     <tr>
         <span class="titre">Ville</span><br />
       </td>
       <td class="cold">
-        <input type="text" name="villepro[{$i}]" value="{$villepro.$i}" size="40" maxlength="50" />
+        <input type="text" name="citypro[{$i}]" value="{$citypro.$i}" size="40" maxlength="50" />
       </td>
     </tr>
     <tr>
         <span class="titre">Pays</span>
       </td>
       <td class="cold">
-        <select name="payspro[{$i}]" onchange="this.form.submit();">
-          {geoloc_pays pays=$payspro.$i}
+        <select name="countrypro[{$i}]" onchange="this.form.submit();">
+          {geoloc_pays pays=$countrypro.$i}
         </select>
       </td>
     </tr>
       </td>
       <td class="cold">
         <select name="regionpro[{$i}]">
-          {geoloc_region pays=$payspro.$i region=$regionpro.$i}
+          {geoloc_region pays=$countrypro.$i region=$regionpro.$i}
         </select>
       </td>
     </tr>
index 5ac1dc2..440032a 100644 (file)
     </tr>
     <tr>
       <td>Ville</td>
-      <td><input type="text" name="ville" size="32" value="{$smarty.request.ville}" /></td>
+      <td><input type="text" name="city" size="32" value="{$smarty.request.city}" /></td>
     </tr>
     <tr>
       <td>Pays</td>
       <td>
-        <select name="pays" onchange="javascript:document.forms.recherche.submit();">
-        {if $smarty.request.pays}
-          {assign var="pays" value=$smarty.request.pays}
+        <select name="coutry" onchange="javascript:document.forms.recherche.submit();">
+        {if $smarty.request.country}
+          {assign var="country" value=$smarty.request.country}
         {else}
-          {assign var="pays" value=""}
+          {assign var="country" value=""}
         {/if}
-        {geoloc_pays pays=$pays}
+        {geoloc_pays pays=$country}
         </select>
       </td>
     </tr>
         {else}
           {assign var="region" value=""}
         {/if}
-        {if $smarty.request.pays neq ""}
-        {geoloc_region pays=$smarty.request.pays region=$region}
+        {if $smarty.request.country neq ""}
+        {geoloc_region pays=$smarty.request.country region=$region}
         {else}
         <option value=""></option>
         {/if}