From 47eadb9c338dae779fe86f4e1d400dd012c305ec Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 3 Apr 2007 13:28:34 +0000 Subject: [PATCH] Fix: gestion de la liste des pays --- htdocs/contact.class.php | 3 ++- htdocs/html.form.class.php | 10 +++++++++- htdocs/langs/en_US/companies.lang | 3 ++- htdocs/langs/fr_FR/companies.lang | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index 946d4605acc..5b2f1805388 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -375,6 +375,7 @@ class Contact function fetch($id, $user=0) { global $langs; + $langs->load("companies"); $sql = "SELECT c.idp, c.fk_soc, c.civilite as civilite_id, c.name, c.firstname,"; $sql.= " c.address, c.cp, c.ville,"; $sql.= " c.fk_pays, p.libelle as pays, p.code as pays_code,"; @@ -407,7 +408,7 @@ class Contact $this->ville = $obj->ville; $this->fk_pays = $obj->fk_pays; $this->pays_code = $obj->fk_pays?$obj->pays_code:''; - $this->pays = $langs->trans("Country".$obj->pays_code)?$langs->trans("Country".$obj->pays_code):''; + $this->pays = ($obj->fk_pays > 0)?$langs->trans("Country".$obj->pays_code):$langs->trans("SelectCountry"); $this->societeid = $obj->fk_soc; $this->socid = $obj->fk_soc; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index d9e297e579d..c989a29381c 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -323,6 +323,7 @@ class Form { if ($conf->use_ajax && $conf->global->CODE_DE_TEST == 1) { + $langs->load("companies"); $obj = $this->db->fetch_object($resql); $pays_id = $obj->rowid?$obj->rowid:''; @@ -344,7 +345,14 @@ class Form } print '
'; - print ''; + if ($obj->rowid == 0) + { + print ''; + } + else + { + print ''; + } print ''; print ''; print '
'; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 80687235e4f..6e34610b9a2 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -207,4 +207,5 @@ NoOtherDeliveryAddress=No alternative delivery address defined JuridicalStatus200=Independant DeleteFile=Delete file ConfirmDeleteFile=Are you sure you want to delete this file? -AllocateCommercial=Allocate a commercial \ No newline at end of file +AllocateCommercial=Allocate a commercial +SelectCountry=Select a country \ No newline at end of file diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index d604a4a4ce8..28f6baaa68b 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -208,4 +208,5 @@ NoOtherDeliveryAddress=Pas d'adresses alternatives d SupplierCategory=Catégorie du fournisseur DeleteFile=Suppression d'un fichier ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier ? -AllocateCommercial=Affecter un commercial \ No newline at end of file +AllocateCommercial=Affecter un commercial +SelectCountry=Sélectionner un pays \ No newline at end of file