Fix: Removed warning
This commit is contained in:
parent
3354b35e75
commit
cfa8ca5c52
@ -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='';
|
||||
|
||||
@ -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 '<html><title>Build an import example file</title><body>'; }
|
||||
// This file is a wrapper, so empty footer
|
||||
@ -37,6 +31,9 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/imports/class/import.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php');
|
||||
|
||||
$datatoimport=GETPOST('datatoimport');
|
||||
$format=GETPOST('format');
|
||||
|
||||
$langs->load("exports");
|
||||
|
||||
// Check exportkey
|
||||
@ -86,6 +83,6 @@ foreach($fieldstarget as $code=>$label)
|
||||
//var_dump($headerlinefields);
|
||||
//var_dump($contentlinevalues);
|
||||
|
||||
print $objimport->build_example_file($format,$headerlinefields,$contentlinevalues);
|
||||
print $objimport->build_example_file($format,$headerlinefields,$contentlinevalues,$datatoimport);
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user