From 0ec87105826e0353ca559596d0b6414341ae1853 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Mon, 26 Oct 2009 07:13:24 +0000
Subject: [PATCH] Fix: field lost after selected country

---
 htdocs/admin/company.php                              | 8 ++++----
 htdocs/imports/import.php                             | 2 +-
 htdocs/includes/modules/import/import_csv.modules.php | 3 ++-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 97d46a191f1..1932c3114d3 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -221,19 +221,19 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
 
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyName").'</td><td>';
-	print '<input name="nom" size="30" value="'. $conf->global->MAIN_INFO_SOCIETE_NOM . '"></td></tr>'."\n";
+	print '<input name="nom" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM:$_POST["nom"]) . '"></td></tr>'."\n";
 
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyAddress").'</td><td>';
-	print '<textarea name="address" cols="80" rows="'.ROWS_3.'">'. $conf->global->MAIN_INFO_SOCIETE_ADRESSE . '</textarea></td></tr>'."\n";
+	print '<textarea name="address" cols="80" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADRESSE?$conf->global->MAIN_INFO_SOCIETE_ADRESSE:$_POST["address"]) . '</textarea></td></tr>'."\n";
 
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyZip").'</td><td>';
-	print '<input name="cp" value="'. $conf->global->MAIN_INFO_SOCIETE_CP . '" size="10"></td></tr>'."\n";
+	print '<input name="cp" value="'. ($conf->global->MAIN_INFO_SOCIETE_CP?$conf->global->MAIN_INFO_SOCIETE_CP:$_POST["cp"]) . '" size="10"></td></tr>'."\n";
 
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyTown").'</td><td>';
-	print '<input name="ville" size="30" value="'. $conf->global->MAIN_INFO_SOCIETE_VILLE . '"></td></tr>'."\n";
+	print '<input name="ville" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_VILLE?$conf->global->MAIN_INFO_SOCIETE_VILLE:$_POST["ville"]) . '"></td></tr>'."\n";
 
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td>'.$langs->trans("Country").'</td><td>';
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 0497875631d..2e768f60526 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2005-2009 Laurent Destailleur  <eldy@users.sourceforge.net>
- * Copyright (C) 2005-2007 Regis Houssin        <regis@dolibarr.fr>
+ * Copyright (C) 2005-2009 Regis Houssin        <regis@dolibarr.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/htdocs/includes/modules/import/import_csv.modules.php b/htdocs/includes/modules/import/import_csv.modules.php
index 5e1a894b899..6b52d62522f 100644
--- a/htdocs/includes/modules/import/import_csv.modules.php
+++ b/htdocs/includes/modules/import/import_csv.modules.php
@@ -1,5 +1,6 @@
 <?php
 /* Copyright (C) 2006-2009 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2009      Regis Houssin        <regis@dolibarr.fr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -60,7 +61,7 @@ class ImportCsv extends ModeleImports
         $this->db = $db;
 
         $this->separator=',';
-        if (! empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->EXPORT_CSV_SEPARATOR_TO_USE;
+        if (! empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->IMPORT_CSV_SEPARATOR_TO_USE;
         $this->enclosure='"';
         $this->escape='"';
 
-- 
GitLab