Fix: gestion de la liste des pays

This commit is contained in:
Regis Houssin 2007-04-03 13:28:34 +00:00
parent ed40fb9330
commit 47eadb9c33
4 changed files with 15 additions and 4 deletions

View File

@ -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;

View File

@ -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 '<div>';
print '<input type="text" size="45" id="pays" name="pays" value="'.$obj->libelle.'" '.$htmloption.' />';
if ($obj->rowid == 0)
{
print '<input type="text" size="45" id="pays" name="pays" value="'.$langs->trans("SelectCountry").'" '.$htmloption.' />';
}
else
{
print '<input type="text" size="45" id="pays" name="pays" value="'.$obj->libelle.'" '.$htmloption.' />';
}
print '<span id="indicator1" style="display: none">'.img_gif('Working...','ajaxworking').'</span>';
print '<input type="hidden" name="pays_id" id="pays_id" value="'.$pays_id.'" />';
print '</div>';

View File

@ -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
AllocateCommercial=Allocate a commercial
SelectCountry=Select a country

View File

@ -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
AllocateCommercial=Affecter un commercial
SelectCountry=Sélectionner un pays