';
$filetoimport='';
- $fullpathfiletoimport='';
$var=true;
// Add format informations and link to download example
@@ -359,7 +379,8 @@ if ($step == 2 && $datatoimport)
$var=!$var;
print '
';
diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang
index 0f4ce8b8ddc..5ccf7f948ff 100644
--- a/htdocs/langs/en_US/exports.lang
+++ b/htdocs/langs/en_US/exports.lang
@@ -69,3 +69,10 @@ MoveField=Move field column number %s
ExampleOfImportFile=Example_of_import_file
SaveImportProfile=Save this import profile
ErrorImportDuplicateProfil=Failed to save this import profile with this name. An existing profile already exists with this name.
+ImportSummary=Import setup summary
+TablesTarget=Targeted tables
+FieldsTarget=Targeted fields
+DoNotImportFirstLine=Do not import first line of source file
+NbOfSourceLines=Number of lines in source file
+NowClickToTestTheImport=Check import parameters you have defined. If they are correct, click on button "%s" to launch a simulation of import process (no data will be changed in your database, it's only a simulation for the moment)...
+RunSimulateImportFile=Launch the import simulation
diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang
index aff1a8892f4..9d3b440267c 100644
--- a/htdocs/langs/fr_FR/exports.lang
+++ b/htdocs/langs/fr_FR/exports.lang
@@ -68,4 +68,11 @@ NoFields=Aucun champ
MoveField=Déplacer champ colonne numéro %s
ExampleOfImportFile=Exemple_de_fichier_import
SaveImportProfile=Sauvegarder ce profil d'import
-ErrorImportDuplicateProfil=Impossible de sauvegarder le profil d'import sous ce nom. Un profil existant existe déjà pour ce nom.
\ No newline at end of file
+ErrorImportDuplicateProfil=Impossible de sauvegarder le profil d'import sous ce nom. Un profil existant existe déjà pour ce nom.
+ImportSummary=Résumé de la configuration d'import
+TablesTarget=Tables cibles
+FieldsTarget=Champs cibles
+DoNotImportFirstLine=Ne pas importer la première ligne du fichier source
+NbOfSourceLines=Nombre de lignes du fichier source
+NowClickToTestTheImport=Vérifiez les paramètres d'import que vous avez défini. S'ils vous conviennent, cliquez sur le bouton "%s" pour lancer une simulation d'import (aucune donnée ne sera modifié, il s'agit dans un premier temps d'une simple simulation)...
+RunSimulateImportFile=Lancer la simulation d'import
\ No newline at end of file
diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php
index 6ea2d4c2055..9329b17e311 100644
--- a/htdocs/lib/files.lib.php
+++ b/htdocs/lib/files.lib.php
@@ -187,8 +187,9 @@ function dol_mimetype($file)
/**
- * \brief Test if a folder is empty
- * \return true is empty or non-existing, false if it contains files
+ * \brief Test if a folder is empty
+ * \param folder Name of folder
+ * \return boolean True if dir is empty or non-existing, false if it contains files
*/
function dol_dir_is_emtpy($folder)
{
@@ -212,4 +213,31 @@ function dol_dir_is_emtpy($folder)
return true; // Le repertoire n'existe pas
}
+/**
+ * \brief Count number of lines in a file
+ * \param file Filename
+ * \return int <0 if KO, Number of lines in files if OK
+ */
+function dol_count_nb_of_line($file)
+{
+ $nb=0;
+ //print 'x'.$file;
+ $fp=fopen($file,'r');
+ if ($fp)
+ {
+ while (!feof($fp))
+ {
+ $line=fgets($fp);
+ $nb++;
+ }
+ fclose($fp);
+ }
+ else
+ {
+ $nb=-1;
+ }
+
+ return $nb;
+}
+
?>