From c6c1e1f993e44038021401b59b30af072ef35654 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jul 2009 22:53:55 +0000 Subject: [PATCH] Fxi: Translate country in region list. --- htdocs/html.formcompany.class.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/html.formcompany.class.php b/htdocs/html.formcompany.class.php index 6a5035b126a..bd5c52bac4c 100644 --- a/htdocs/html.formcompany.class.php +++ b/htdocs/html.formcompany.class.php @@ -188,9 +188,9 @@ class FormCompany function select_departement($selected='',$pays_code=0) { global $conf,$langs,$user; - + dol_syslog("Form::select_departement selected=$selected, pays_code=$pays_code",LOG_DEBUG); - + $langs->load("dict"); $htmlname='departement_id'; @@ -270,29 +270,32 @@ class FormCompany global $conf,$langs; $langs->load("dict"); - $sql = "SELECT r.rowid, r.code_region as code, r.nom as libelle, r.active, p.libelle as libelle_pays FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p"; - $sql .= " WHERE r.fk_pays=p.rowid AND r.active = 1 and p.active = 1 ORDER BY libelle_pays, libelle ASC"; + $sql = "SELECT r.rowid, r.code_region as code, r.nom as libelle, r.active, p.code as pays_code, p.libelle as libelle_pays FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p"; + $sql .= " WHERE r.fk_pays=p.rowid AND r.active = 1 and p.active = 1 ORDER BY pays_code, libelle ASC"; dol_syslog("Form::select_region sql=".$sql); - if ($this->db->query($sql)) + $resql=$this->db->query($sql); + if ($resql) { print '