Fix: Removed warning
This commit is contained in:
parent
4e1418a6a6
commit
492cf03989
@ -173,9 +173,10 @@ class Import
|
|||||||
* @param string $model Name of import engine ('csv', ...)
|
* @param string $model Name of import engine ('csv', ...)
|
||||||
* @param string $headerlinefields Array of values for first line of example file
|
* @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 $contentlinevalues Array of values for content line of example file
|
||||||
|
* @param string $datatoimport Dataset to import
|
||||||
* @return string <0 if KO, >0 if OK
|
* @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;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -188,7 +189,7 @@ class Import
|
|||||||
$file = "import_".$model.".modules.php";
|
$file = "import_".$model.".modules.php";
|
||||||
$classname = "Import".$model;
|
$classname = "Import".$model;
|
||||||
require_once($dir.$file);
|
require_once($dir.$file);
|
||||||
$objmodel = new $classname($this->db);
|
$objmodel = new $classname($this->db,$datatoimport);
|
||||||
|
|
||||||
$outputlangs=$langs; // Lang for output
|
$outputlangs=$langs; // Lang for output
|
||||||
$s='';
|
$s='';
|
||||||
|
|||||||
@ -21,12 +21,6 @@
|
|||||||
* \brief Show example of import file
|
* \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
|
// This file is a wrapper, so empty header
|
||||||
function llxHeader() { print '<html><title>Build an import example file</title><body>'; }
|
function llxHeader() { print '<html><title>Build an import example file</title><body>'; }
|
||||||
// This file is a wrapper, so empty footer
|
// 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."/imports/class/import.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php');
|
||||||
|
|
||||||
|
$datatoimport=GETPOST('datatoimport');
|
||||||
|
$format=GETPOST('format');
|
||||||
|
|
||||||
$langs->load("exports");
|
$langs->load("exports");
|
||||||
|
|
||||||
// Check exportkey
|
// Check exportkey
|
||||||
@ -86,6 +83,6 @@ foreach($fieldstarget as $code=>$label)
|
|||||||
//var_dump($headerlinefields);
|
//var_dump($headerlinefields);
|
||||||
//var_dump($contentlinevalues);
|
//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