From: Pascal Corpet Date: Sat, 11 Jun 2005 14:48:42 +0000 (+0000) Subject: pays -> countrytxt X-Git-Tag: xorg/old~64 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6ffb2a9bc7fe682f61ab516aab62298a06b8d32c;p=platal.git pays -> countrytxt git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-700 --- diff --git a/bin/cron/checkdb.php b/bin/cron/checkdb.php index d14af8a..4141713 100755 --- a/bin/cron/checkdb.php +++ b/bin/cron/checkdb.php @@ -115,8 +115,8 @@ check("select g.* from groupesx_ins as g left join groupesx_def as gd on g.gid=g check("select p.* from photo as p left join auth_user_md5 as u on u.user_id=p.uid where u.prenom is null"); /* validite des champ pays et region */ -check("SELECT a.uid, a.pays FROM adresses AS a LEFT JOIN geoloc_pays AS gp ON a.pays = gp.a2 WHERE gp.pays IS NULL","donne la liste des pays dans les profils qui n'ont pas d'entree correspondante dans geoloc_pays"); -check("SELECT a.uid, a.pays, a.region FROM adresses AS a LEFT JOIN geoloc_region AS gr ON (a.pays = gr.a2 AND a.region = gr.region) WHERE a.region != '' AND gr.name IS NULL","donne la liste des regions dans les profils qui n'ont pas d'entree correspondante dans geoloc_region"); +check("SELECT a.uid, a.country FROM adresses AS a LEFT JOIN geoloc_pays AS gp ON a.country = gp.a2 WHERE gp.pays IS NULL","donne la liste des pays dans les profils qui n'ont pas d'entree correspondante dans geoloc_pays"); +check("SELECT a.uid, a.country, a.region FROM adresses AS a LEFT JOIN geoloc_region AS gr ON (a.country = gr.a2 AND a.region = gr.region) WHERE a.region != '' AND gr.name IS NULL","donne la liste des regions dans les profils qui n'ont pas d'entree correspondante dans geoloc_region"); /* donne la liste des gens pour qui on a fait du marketing mais qui se sont inscrits depuis (nettoyage de envoidirect) */ info("select e.matricule,e.nom,e.prenom,e.promo from envoidirect as e inner join auth_user_md5 as a on (e.matricule = a.matricule and a.perms = 'user') order by promo,nom;"); diff --git a/htdocs/carnet/mescontacts.php b/htdocs/carnet/mescontacts.php index ccea643..a98dfce 100644 --- a/htdocs/carnet/mescontacts.php +++ b/htdocs/carnet/mescontacts.php @@ -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.city, gp.a2, gp.pays, gr.name AS region, + adr.city, gp.a2, gp.pays AS countrytxt, 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) diff --git a/include/geoloc.inc.php b/include/geoloc.inc.php index 69b5dbe..4cf977a 100644 --- a/include/geoloc.inc.php +++ b/include/geoloc.inc.php @@ -24,7 +24,7 @@ /** donne la liste déroulante des pays * @param $current pays actuellement selectionné */ -function geoloc_pays($current) { +function geoloc_country($current) { global $globals; $res = $globals->xdb->iterRow('SELECT a2,pays FROM geoloc_pays ORDER BY pays'); $html = ""; @@ -35,20 +35,20 @@ function geoloc_pays($current) { return $html; } -function _geoloc_pays_smarty($params){ - if(!isset($params['pays'])) +function _geoloc_country_smarty($params){ + if(!isset($params['country'])) return; - return geoloc_pays($params['pays']); + return geoloc_country($params['country']); } -$page->register_function('geoloc_pays', '_geoloc_pays_smarty'); +$page->register_function('geoloc_country', '_geoloc_country_smarty'); /** donne la liste deroulante des regions pour un pays * @param $pays le pays dont on veut afficher les regions * @param $current la region actuellement selectionnee */ -function geoloc_region($pays,$current) { +function geoloc_region($country,$current) { global $globals; - $res = $globals->xdb->iterRow('SELECT region,name FROM geoloc_region where a2={?} ORDER BY name', $pays); + $res = $globals->xdb->iterRow('SELECT region,name FROM geoloc_region where a2={?} ORDER BY name', $country); $html = ""; while (list($regid, $regname) = $res->next()) { $html .= sprintf("\n", @@ -58,11 +58,11 @@ function geoloc_region($pays,$current) { } function _geoloc_region_smarty($params){ - if(!isset($params['pays'])) + if(!isset($params['country'])) return; if(!isset($params['region'])) return; - return geoloc_region($params['pays'], $params['region']); + return geoloc_region($params['country'], $params['region']); } $page->register_function('geoloc_region', '_geoloc_region_smarty'); // }}} @@ -99,7 +99,7 @@ function get_address_text($adr) { if ($adr['city']) $l .= $adr['city']; } if ($l) $t .= "\n".trim($l); - if ($adr['pays']) $t .= "\n".$adr['pays']; + if ($adr['countrytxt']) $t .= "\n".$adr['countrytxt']; return trim($t); } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: diff --git a/include/profil/get_adresses.inc.php b/include/profil/get_adresses.inc.php index bef7e07..c2201a2 100644 --- a/include/profil/get_adresses.inc.php +++ b/include/profil/get_adresses.inc.php @@ -68,7 +68,7 @@ $res = $globals->xdb->iterRow( FIND_IN_SET('active', statut), FIND_IN_SET('temporaire', statut), adr1, adr2, adr3, postcode, city, cityid, a.country, region, tel, fax, pub, tel_pub, - gp.pays + gp.pays AS countrytxt FROM adresses AS a INNER JOIN geoloc_pays AS gp ON(gp.a2 = a.country) WHERE uid = {?} AND NOT FIND_IN_SET('pro',statut) ".$sql_order , Session::getInt('uid', -1) @@ -85,7 +85,7 @@ for ($i = 0; $i < $nb_adr; $i++) { $adresses[$adrid]['adr1'], $adresses[$adrid]['adr2'], $adresses[$adrid]['adr3'], $adresses[$adrid]['postcode'], $adresses[$adrid]['city'], $adresses[$adrid]['cityid'], $adresses[$adrid]['country'], $adresses[$adrid]['region'], $adresses[$adrid]['tel'], $adresses[$adrid]['fax'], $adresses[$adrid]['pub'], - $adresses[$adrid]['tel_pub'],$adresses[$adrid]['pays']) = $res->next(); + $adresses[$adrid]['tel_pub'],$adresses[$adrid]['countrytxt']) = $res->next(); $adresses[$adrid]['nouvelle'] = 'modif'; $adresses[$adrid]['numero_formulaire'] = -1; require_once('geoloc.inc.php'); diff --git a/include/search/classes.inc.php b/include/search/classes.inc.php index 94ef6d7..4b5718a 100644 --- a/include/search/classes.inc.php +++ b/include/search/classes.inc.php @@ -42,7 +42,7 @@ if (logged()) q.profile_web AS web, q.profile_mobile AS mobile, q.profile_freetext AS freetext, - adr.city, gp.pays, gr.name AS region, + adr.city, gp.pays AS countrytxt, gr.name AS region, e.entreprise,'; else $globals->search->result_fields .=" @@ -50,7 +50,7 @@ else 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.city, '') AS city, - IF(adr.pub='public', gp.pays, '') AS pays, + IF(adr.pub='public', gp.pays, '') AS countrytxt, IF(adr.pub='public', gr.name, '') AS region, IF(e.pub='public', e.entreprise, '') AS entreprise,"; $globals->search->result_where_statement = ' diff --git a/include/user.func.inc.php b/include/user.func.inc.php index 60f2fb6..a90fcd3 100644 --- a/include/user.func.inc.php +++ b/include/user.func.inc.php @@ -182,7 +182,7 @@ function &get_user_details($login, $from_uid = '') $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.postcode, e.city, - gp.pays, gr.name AS region, e.tel, e.fax, e.mobile, e.entrid, + gp.pays AS countrytxt, 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) @@ -196,7 +196,7 @@ function &get_user_details($login, $from_uid = '') $user['adr_pro'] = $res->fetchAllAssoc(); $sql = "SELECT a.adr1,a.adr2,a.adr3,a.postcode,a.city, - gp.pays,gr.name AS region,a.tel,a.fax, + gp.pays AS countrytxt,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 diff --git a/templates/geoloc/address.tpl b/templates/geoloc/address.tpl index 3a1108f..05145a5 100644 --- a/templates/geoloc/address.tpl +++ b/templates/geoloc/address.tpl @@ -21,11 +21,11 @@ {**************************************************************************} - {if $address.adr1 || $address.pays || $geoloc_address.city || $address.tel || $address.fax || $address.mobile} + {if $address.adr1 || $address.countrytxt || $geoloc_address.city || $address.tel || $address.fax || $address.mobile} {if $no_div neq 1}
{/if} - {if $titre && ($address.adr1 || $address.city || $address.pays)} + {if $titre && ($address.adr1 || $address.city || $address.countrytxt)} {if $titre_div}
{$titre} @@ -38,8 +38,8 @@ {if $address.adr2}{$address.adr2}
{/if} {if $address.adr3}{$address.adr3}
{/if} {if $address.city}{$address.postcode} {$address.city}
{/if} - {if $address.pays} - {$address.pays}{if $address.region && $address.pays != 'France'} ({$address.region}){/if} + {if $address.countrytxt} + {$address.countrytxt}{if $address.region && $address.countrytxt != 'France'} ({$address.region}){/if} {/if} {if $address.tel} diff --git a/templates/geoloc/form.address.tpl b/templates/geoloc/form.address.tpl index 30aa57f..dd8d632 100644 --- a/templates/geoloc/form.address.tpl +++ b/templates/geoloc/form.address.tpl @@ -1,10 +1,9 @@ - {$titre} {if $adr.nouvelle != 'new' && !$smarty.request.detail[$adrid]}
- [corriger] + [corriger] {/if} {if $adr.nouvelle != 'new' && !$adr.cityid}
@@ -60,7 +59,7 @@ @@ -71,7 +70,7 @@ {/if} diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index 7aea0b4..a670f59 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -86,7 +86,7 @@
{if $c.wasinscrit} - {if $c.web || $c.mobile || $c.pays || $c.city || $c.region || $c.entreprise || $c.freetext} + {if $c.web || $c.mobile || $c.countrytxt || $c.city || $c.region || $c.entreprise || $c.freetext} {if $c.web} @@ -94,10 +94,10 @@ {/if} - {if $c.pays || $c.city} + {if $c.countrytxt || $c.city} - + {/if} {if $c.mobile} diff --git a/templates/profil/emploi.tpl b/templates/profil/emploi.tpl index f86f55f..0b40d88 100644 --- a/templates/profil/emploi.tpl +++ b/templates/profil/emploi.tpl @@ -128,7 +128,7 @@ @@ -139,7 +139,7 @@ diff --git a/templates/profil/mentor.tpl b/templates/profil/mentor.tpl index 0100451..00ec29b 100644 --- a/templates/profil/mentor.tpl +++ b/templates/profil/mentor.tpl @@ -130,7 +130,7 @@ notamment internationales sur la base desquels tu seras identifiable depuis @@ -156,7 +156,7 @@ {assign var="region" value=""} {/if} {if $smarty.request.country neq ""} - {geoloc_region pays=$smarty.request.country region=$region} + {geoloc_region country=$smarty.request.country region=$region} {else} {/if}
{$c.web}
Géographie:{$c.city}{if $c.city && $c.pays}, {/if}{$c.pays}{$c.city}{if $c.city && $c.countrytxt}, {/if}{$c.countrytxt}
diff --git a/templates/search.adv.form.tpl b/templates/search.adv.form.tpl index 440032a..52f6a35 100644 --- a/templates/search.adv.form.tpl +++ b/templates/search.adv.form.tpl @@ -142,7 +142,7 @@ {else} {assign var="country" value=""} {/if} - {geoloc_pays pays=$country} + {geoloc_country country=$country}