diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 8e88243ac46..73bee41c4ce 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -173,9 +173,10 @@ class Import * @param string $model Name of import engine ('csv', ...) * @param string $headerlinefields Array of values for first line of example file * @param string $contentlinevalues Array of values for content line of example file + * @param string $datatoimport Dataset to import * @return string <0 if KO, >0 if OK */ - function build_example_file($model, $headerlinefields, $contentlinevalues) + function build_example_file($model, $headerlinefields, $contentlinevalues,$datatoimport) { global $conf,$langs; @@ -188,7 +189,7 @@ class Import $file = "import_".$model.".modules.php"; $classname = "Import".$model; require_once($dir.$file); - $objmodel = new $classname($this->db); + $objmodel = new $classname($this->db,$datatoimport); $outputlangs=$langs; // Lang for output $s=''; diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php index c65791568da..21ae9d9a80c 100644 --- a/htdocs/imports/emptyexample.php +++ b/htdocs/imports/emptyexample.php @@ -21,12 +21,6 @@ * \brief Show example of import file */ -// This is to make Dolibarr working with Plesk -set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); - -$datatoimport=isset($_GET["datatoimport"])? $_GET["datatoimport"] : (isset($_POST["datatoimport"])?$_POST["datatoimport"]:''); -$format=isset($_GET["format"])? $_GET["format"] : (isset($_POST["format"])?$_POST["format"]:''); - // This file is a wrapper, so empty header function llxHeader() { print '