Skip to content
Snippets Groups Projects
Commit 4875d5b9 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Work on import module

parent beb80b41
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ require_once(DOL_DOCUMENT_ROOT.'/includes/modules/import/modules_import.php'); ...@@ -32,6 +32,7 @@ require_once(DOL_DOCUMENT_ROOT.'/includes/modules/import/modules_import.php');
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
$langs->load("exports"); $langs->load("exports");
$langs->load("errors");
if (! $user->societe_id == 0) if (! $user->societe_id == 0)
...@@ -566,7 +567,7 @@ if ($step == 3 && $datatoimport) ...@@ -566,7 +567,7 @@ if ($step == 3 && $datatoimport)
$param='format='.$format.'&datatoimport='.$datatoimport; $param='format='.$format.'&datatoimport='.$datatoimport;
$modulepart='import'; $modulepart='import';
//$relativepath=$filetoimport; //$relativepath=$filetoimport;
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'&amp;step=3&amp;format='.$format.'&amp;datatoimport='.$datatoimport.'" target="_blank">'; print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=3&format='.$format.'&datatoimport='.$datatoimport.'" target="_blank">';
print $file; print $file;
print '</a>'; print '</a>';
print '</td>'; print '</td>';
...@@ -731,7 +732,7 @@ if ($step == 4 && $datatoimport) ...@@ -731,7 +732,7 @@ if ($step == 4 && $datatoimport)
$param='format='.$format.'&datatoimport='.$datatoimport; $param='format='.$format.'&datatoimport='.$datatoimport;
$modulepart='import'; $modulepart='import';
//$relativepath=$filetoimport; //$relativepath=$filetoimport;
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'&amp;step=4&amp;format='.$format.'&amp;datatoimport='.$datatoimport.'" target="_blank">'; print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4&format='.$format.'&datatoimport='.$datatoimport.'" target="_blank">';
print $filetoimport; print $filetoimport;
print '</a>'; print '</a>';
print '</td></tr>'; print '</td></tr>';
...@@ -847,8 +848,8 @@ if ($step == 4 && $datatoimport) ...@@ -847,8 +848,8 @@ if ($step == 4 && $datatoimport)
$htmltext =$langs->trans("Table").": <b>".$tablename."</b><br>"; $htmltext =$langs->trans("Table").": <b>".$tablename."</b><br>";
$htmltext.=$langs->trans("Field").': <b>'.$code."</b><br>"; $htmltext.=$langs->trans("Field").': <b>'.$code."</b><br>";
$htmltext.=$langs->trans("Required").': <b>'.yn(eregi('\*$',$label)).'</b>'; $htmltext.=$langs->trans("Required").': <b>'.yn(eregi('\*$',$label)).'</b>';
$note=''; $note=$objimport->array_import_examplevalues[0][$code];
if ($note) $htmltext.=$langs->trans("Note").': '.$note; if ($note) $htmltext.='<br>'.$langs->trans("Note").'/'.$langs->trans("Example").': '.$note;
$text.=$more; $text.=$more;
print $html->textwithpicto($text,$htmltext); print $html->textwithpicto($text,$htmltext);
print '</td>'; print '</td>';
...@@ -1072,7 +1073,7 @@ if ($step == 5 && $datatoimport) ...@@ -1072,7 +1073,7 @@ if ($step == 5 && $datatoimport)
$param='&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines; $param='&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines;
if ($excludefirstline) $param.='&excludefirstline=1'; if ($excludefirstline) $param.='&excludefirstline=1';
llxHeader('',$langs->trans("NewImport"),'EN:Module_Imports_En|FR:Module_Imports|ES:M&oacute;dulo_Importaciones'); llxHeader('',$langs->trans("NewImport"),'EN:Module_Imports_En|FR:Module_Imports|ES:M&oacute;dulo_Importaciones');
$h = 0; $h = 0;
...@@ -1133,7 +1134,7 @@ if ($step == 5 && $datatoimport) ...@@ -1133,7 +1134,7 @@ if ($step == 5 && $datatoimport)
print '<td>'; print '<td>';
$modulepart='import'; $modulepart='import';
//$relativepath=$filetoimport; //$relativepath=$filetoimport;
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&step=4'.$param.'" target="_blank">'; print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($filtetoimport).'&step=4'.$param.'" target="_blank">';
print $filetoimport; print $filetoimport;
print '</a>'; print '</a>';
print '</td></tr>'; print '</td></tr>';
...@@ -1147,14 +1148,18 @@ if ($step == 5 && $datatoimport) ...@@ -1147,14 +1148,18 @@ if ($step == 5 && $datatoimport)
// Checkbox do not import first line // Checkbox do not import first line
print '<tr><td>'; print '<tr><td>';
print $langs->trans("DoNotImportFirstLine"); print $langs->trans("Option");
print '</td><td>'; print '</td><td>';
print '<input type="checkbox" name="excludefirstline" value="1"'; print '<input type="checkbox" name="excludefirstline" value="1"';
print ($excludefirstline?' checked="true"':''); print ($excludefirstline?' checked="true"':'');
print '>'; print '>';
print ' '.$langs->trans("DoNotImportFirstLine");
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '<br>';
print '<b>'.$langs->trans("InformationOnTargetTables").'</b>'; print '<b>'.$langs->trans("InformationOnTargetTables").'</b>';
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';
//print '<tr><td colspan="2"><b>'.$langs->trans("InformationOnTargetTables").'</b></td></tr>'; //print '<tr><td colspan="2"><b>'.$langs->trans("InformationOnTargetTables").'</b></td></tr>';
...@@ -1280,7 +1285,7 @@ if ($step == 6 && $datatoimport) ...@@ -1280,7 +1285,7 @@ if ($step == 6 && $datatoimport)
$param='&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines; $param='&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines;
if ($excludefirstline) $param.='&excludefirstline=1'; if ($excludefirstline) $param.='&excludefirstline=1';
llxHeader('',$langs->trans("NewImport"),'EN:Module_Imports_En|FR:Module_Imports|ES:M&oacute;dulo_Importaciones'); llxHeader('',$langs->trans("NewImport"),'EN:Module_Imports_En|FR:Module_Imports|ES:M&oacute;dulo_Importaciones');
$h = 0; $h = 0;
...@@ -1345,7 +1350,7 @@ if ($step == 6 && $datatoimport) ...@@ -1345,7 +1350,7 @@ if ($step == 6 && $datatoimport)
print '<td>'; print '<td>';
$modulepart='import'; $modulepart='import';
//$relativepath=$filetoimport; //$relativepath=$filetoimport;
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&step=4'.$param.'" target="_blank">'; print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($filetoimport).'&step=4'.$param.'" target="_blank">';
print $filetoimport; print $filetoimport;
print '</a>'; print '</a>';
print '</td></tr>'; print '</td></tr>';
...@@ -1359,14 +1364,19 @@ if ($step == 6 && $datatoimport) ...@@ -1359,14 +1364,19 @@ if ($step == 6 && $datatoimport)
// Checkbox do not import first line // Checkbox do not import first line
print '<tr><td>'; print '<tr><td>';
print $langs->trans("DoNotImportFirstLine"); print $langs->trans("Option");
print '</td><td>'; print '</td><td>';
print '<input type="checkbox" name="excludefirstline" value="1"'; print '<input type="hidden" name="excludefirstline" value="'.$excludefirstline.'">';
print '<input type="checkbox" name="excludefirstlinebis" value="1" disabled="true"';
print ($excludefirstline?' checked="true"':''); print ($excludefirstline?' checked="true"':'');
print '>'; print '>';
print ' '.$langs->trans("DoNotImportFirstLine");
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '<br>';
print '<b>'.$langs->trans("InformationOnTargetTables").'</b>'; print '<b>'.$langs->trans("InformationOnTargetTables").'</b>';
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';
//print '<tr><td colspan="2"><b>'.$langs->trans("InformationOnTargetTables").'</b></td></tr>'; //print '<tr><td colspan="2"><b>'.$langs->trans("InformationOnTargetTables").'</b></td></tr>';
...@@ -1457,7 +1467,7 @@ if ($step == 6 && $datatoimport) ...@@ -1457,7 +1467,7 @@ if ($step == 6 && $datatoimport)
{ {
$sourcelinenb++; $sourcelinenb++;
if ($excludefirstline && $sourcelinenb == 1) continue; if ($excludefirstline && $sourcelinenb == 1) continue;
$result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,sizeof($fieldssource),$importid); $result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,sizeof($fieldssource),$importid);
if (sizeof($obj->errors)) if (sizeof($obj->errors))
{ {
...@@ -1478,12 +1488,15 @@ if ($step == 6 && $datatoimport) ...@@ -1478,12 +1488,15 @@ if ($step == 6 && $datatoimport)
$db->rollback(); // We force rollback because this was just a simulation. $db->rollback(); // We force rollback because this was just a simulation.
// If nothing
if (! sizeof($arrayoferrors) && ! sizeof($arrayofwarnings)) print img_tick().' <b>'.$langs->trans("NoErrors").'</b><br>';
// Errors // Errors
//var_dump($arrayoferrors); //var_dump($arrayoferrors);
print '<b>'.$langs->trans("Errors").'</b>';
print '<hr>';
if (sizeof($arrayoferrors)) if (sizeof($arrayoferrors))
{ {
print img_error().' <b>'.$langs->trans("ErrorsOnXLines",sizeof($arrayoferrors)).'</b><br>';
//print '<table width="100%" class="border"><tr><td>';
foreach ($arrayoferrors as $key => $val) foreach ($arrayoferrors as $key => $val)
{ {
$nboferrors++; $nboferrors++;
...@@ -1495,20 +1508,20 @@ if ($step == 6 && $datatoimport) ...@@ -1495,20 +1508,20 @@ if ($step == 6 && $datatoimport)
print '* '.$langs->trans("Line").' '.$key.'<br>'; print '* '.$langs->trans("Line").' '.$key.'<br>';
foreach($val as $i => $err) foreach($val as $i => $err)
{ {
print ' &nbsp; - '.$err['lib'].'<br>'; print ' &nbsp; &nbsp; > '.$err['lib'].'<br>';
} }
} }
//print '</td></tr></table>';
print '<br>';
} }
else print $langs->trans("None");
print '<br>';
// Warnings // Warnings
//var_dump($arrayoferrors); //var_dump($arrayoferrors);
print '<b>'.$langs->trans("Warnings").'</b>';
print '<hr>';
if (sizeof($arrayofwarnings)) if (sizeof($arrayofwarnings))
{ {
print img_warning().' <b>'.$langs->trans("WarningsOnXLines",sizeof($arrayofwarnings)).'</b><br>';
//print '<table width="100%" class="border"><tr><td>';
foreach ($arrayofwarnings as $key => $val) foreach ($arrayofwarnings as $key => $val)
{ {
$nbofwarnings++; $nbofwarnings++;
...@@ -1520,17 +1533,20 @@ if ($step == 6 && $datatoimport) ...@@ -1520,17 +1533,20 @@ if ($step == 6 && $datatoimport)
print ' * '.$langs->trans("Line").' '.$key.'<br>'; print ' * '.$langs->trans("Line").' '.$key.'<br>';
foreach($val as $i => $err) foreach($val as $i => $err)
{ {
print ' &nbsp; - '.$err['lib'].'<br>'; print ' &nbsp; &nbsp; > '.$err['lib'].'<br>';
} }
} }
//print '</td></tr></table>';
print '<br>';
} }
else print $langs->trans("None");
$importid=dol_print_date(dol_now('tzserver'),'%Y%m%d%H%M%S'); $importid=dol_print_date(dol_now('tzserver'),'%Y%m%d%H%M%S');
print '<br>'; print '<br>';
print '<center>';
print $langs->trans("NowClickToRunTheImport",$langs->transnoentitiesnoconv("RunImportFile")).'<br>'; print $langs->trans("NowClickToRunTheImport",$langs->transnoentitiesnoconv("RunImportFile")).'<br>';
print $langs->trans("DataLoadedWithId",$importid).'<br>'; print $langs->trans("DataLoadedWithId",$importid).'<br>';
print '</center>';
print '</div>'; print '</div>';
...@@ -1540,7 +1556,7 @@ if ($step == 6 && $datatoimport) ...@@ -1540,7 +1556,7 @@ if ($step == 6 && $datatoimport)
{ {
if (empty($nboferrors)) if (empty($nboferrors))
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/imports/import.php?leftmenu=import&step=7&'.$param.'">'.$langs->trans("RunImportFile").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/imports/import.php?leftmenu=import&step=7&importid='.$importid.$param.'">'.$langs->trans("RunImportFile").'</a>';
} }
else else
{ {
...@@ -1559,6 +1575,266 @@ if ($step == 6 && $datatoimport) ...@@ -1559,6 +1575,266 @@ if ($step == 6 && $datatoimport)
if ($mesg) print $mesg; if ($mesg) print $mesg;
} }
// STEP 6: Result of simulation
if ($step == 7 && $datatoimport)
{
$model=$format;
$liste=$objmodelimport->liste_modeles($db);
$importid=$_REQUEST["importid"];
// Create classe to use for import
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/import/";
$file = "import_".$model.".modules.php";
$classname = "Import".ucfirst($model);
require_once($dir.$file);
$obj = new $classname($db);
// Load source fields in input file
$fieldssource=array();
$result=$obj->import_open_file($conf->import->dir_temp.'/'.$filetoimport,$langs);
if ($result >= 0)
{
// Read first line
$arrayrecord=$obj->import_read_record();
// Put into array fieldssource starting with 1.
$i=1;
foreach($arrayrecord as $key => $val)
{
$fieldssource[$i]['example1']=dol_trunc($val['val'],24);
$i++;
}
$obj->import_close_file();
}
$nboflines=(! empty($_GET["nboflines"])?$_GET["nboflines"]:dol_count_nb_of_line($conf->import->dir_temp.'/'.$filetoimport));
$param='&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines;
if ($excludefirstline) $param.='&excludefirstline=1';
llxHeader('',$langs->trans("NewImport"),'EN:Module_Imports_En|FR:Module_Imports|ES:M&oacute;dulo_Importaciones');
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=1';
$head[$h][1] = $langs->trans("Step")." 1";
$h++;
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=2&datatoimport='.$datatoimport;
$head[$h][1] = $langs->trans("Step")." 2";
$h++;
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=3&'.$param;
$head[$h][1] = $langs->trans("Step")." 3";
$h++;
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=4&'.$param;
$head[$h][1] = $langs->trans("Step")." 4";
$h++;
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=5&'.$param;
$head[$h][1] = $langs->trans("Step")." 5";
$h++;
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=6&'.$param;
$head[$h][1] = $langs->trans("Step")." 6";
$h++;
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=7&'.$param;
$head[$h][1] = $langs->trans("Step")." 7";
$hselected=$h;
$h++;
dol_fiche_head($head, $hselected, $langs->trans("NewImport"));
print '<table width="100%" class="border">';
// Module
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
print '<td>';
//print img_object($objimport->array_import_module[0]->getName(),$objimport->array_import_module[0]->picto).' ';
print $objimport->array_import_module[0]->getName();
print '</td></tr>';
// Lot de donnees a importer
print '<tr><td>'.$langs->trans("DatasetToImport").'</td>';
print '<td>';
print img_object($objimport->array_import_module[0]->getName(),$objimport->array_import_icon[0]).' ';
print $objimport->array_import_label[0];
print '</td></tr>';
print '</table><br>';
print '<b>'.$langs->trans("InformationOnSourceFile").'</b>';
print '<table width="100%" class="border">';
//print '<tr><td colspan="2"><b>'.$langs->trans("InformationOnSourceFile").'</b></td></tr>';
// Source file format
print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>';
print '<td>';
$text=$objmodelimport->getDriverDesc($format);
print $html->textwithpicto($objmodelimport->getDriverLabel($format),$text);
print '</td></tr>';
// File to import
print '<tr><td>'.$langs->trans("FileToImport").'</td>';
print '<td>';
$modulepart='import';
//$relativepath=$filetoimport;
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($filetoimport).'&step=4'.$param.'" target="_blank">';
print $filetoimport;
print '</a>';
print '</td></tr>';
// Nb of fields
print '<tr><td>';
print $langs->trans("NbOfSourceLines");
print '</td><td>';
print $nboflines;
print '</td></tr>';
// Checkbox do not import first line
print '<tr><td>';
print $langs->trans("Option");
print '</td><td>';
print '<input type="checkbox" name="excludefirstline" value="1" disabled="true"';
print ($excludefirstline?' checked="true"':'');
print '>';
print ' '.$langs->trans("DoNotImportFirstLine");
print '</td></tr>';
print '</table>';
print '<br>';
print '<b>'.$langs->trans("InformationOnTargetTables").'</b>';
print '<table width="100%" class="border">';
//print '<tr><td colspan="2"><b>'.$langs->trans("InformationOnTargetTables").'</b></td></tr>';
// Tables imported
print '<tr><td width="25%">';
print $langs->trans("TablesTarget");
print '</td><td>';
$listtables=array();
foreach($array_match_file_to_database as $code=>$label)
{
//var_dump($fieldssource);
if ($code > sizeof($fieldssource)) continue;
//print $code.'-'.$label;
$alias=eregi_replace('\..*$','',$label);
$listtables[$alias]=$objimport->array_import_tables[0][$alias];
}
if (sizeof($listtables))
{
$newval='';
foreach ($listtables as $val)
{
if ($newval) print ', ';
$newval=$val;
// Link to Dolibarr wiki pages
/*$helppagename='EN:Table_'.$newval;
if ($helppagename && empty($conf->global->MAIN_HELP_DISABLELINK))
{
// Get helpbaseurl, helppage and mode from helppagename and langs
$arrayres=getHelpParamFor($helppagename,$langs);
$helpbaseurl=$arrayres['helpbaseurl'];
$helppage=$arrayres['helppage'];
$mode=$arrayres['mode'];
$newval.=' <a href="'.sprintf($helpbaseurl,$helppage).'">'.img_picto($langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage': 'GoToHelpPage'),DOL_URL_ROOT.'/theme/common/helpdoc.png','',1).'</a>';
}*/
print $newval;
}
}
else print $langs->trans("Error");
print '</td></tr>';
// Fields imported
print '<tr><td>';
print $langs->trans("FieldsTarget").'</td><td>';
$listfields=array();
$i=0;
$sort_array_match_file_to_database=$array_match_file_to_database;
ksort($sort_array_match_file_to_database);
//var_dump($sort_array_match_file_to_database);
foreach($sort_array_match_file_to_database as $code=>$label)
{
$i++;
//var_dump($fieldssource);
if ($code > sizeof($fieldssource)) continue;
//print $code.'-'.$label;
$alias=eregi_replace('\..*$','',$label);
$listfields[$i]=$label;
}
print sizeof($listfields)?(join(', ',$listfields)):$langs->trans("Error");
print '</td></tr>';
print '</table>';
print '<br>';
// Launch import
$arrayoferrors=array();
$arrayofwarnings=array();
$maxnboferrors=empty($conf->global->IMPORT_MAX_NB_OF_ERRORS)?50:$conf->global->IMPORT_MAX_NB_OF_ERRORS;
$maxnbofwarnings=empty($conf->global->IMPORT_MAX_NB_OF_WARNINGS)?50:$conf->global->IMPORT_MAX_NB_OF_WARNINGS;
$nboferrors=0;
$nbofwarnings=0;
$importid=dol_print_date(dol_now('tzserver'),'%Y%m%d%H%M%S');
$db->begin();
//var_dump($array_match_file_to_database);
// Open input file
$pathfile=$conf->import->dir_temp.'/'.$filetoimport;
$result=$obj->import_open_file($pathfile,$langs);
if ($result > 0)
{
$sourcelinenb=0;
// Loop on each input file record
while ($arrayrecord=$obj->import_read_record())
{
$sourcelinenb++;
if ($excludefirstline && $sourcelinenb == 1) continue;
$result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,sizeof($fieldssource),$importid);
if (sizeof($obj->errors))
{
$arrayoferrors[$sourcelinenb]=$obj->errors;
}
if (sizeof($obj->warnings))
{
$arrayofwarnings[$sourcelinenb]=$obj->warnings;
}
}
// Close file
$obj->import_close_file();
}
else
{
print $langs->trans("ErrorFailedToOpenFile",$pathfile);
}
$db->rollback(); // We force rollback because this was just a simulation.
// TODO Show result
print '<br>';
print '<center>';
print $langs->trans("xxxx",$importid).'<br>';
print '</center>';
print '</div>';
if ($mesg) print $mesg;
}
print '<br>'; print '<br>';
......
...@@ -273,7 +273,7 @@ class ImportCsv extends ModeleImports ...@@ -273,7 +273,7 @@ class ImportCsv extends ModeleImports
function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid) function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid)
{ {
global $langs,$conf; global $langs,$conf;
$error=0; $error=0;
$warning=0; $warning=0;
$this->errors=array(); $this->errors=array();
...@@ -331,7 +331,7 @@ class ImportCsv extends ModeleImports ...@@ -331,7 +331,7 @@ class ImportCsv extends ModeleImports
// Make some tests // Make some tests
// Required field is ok // Required field is ok
if (eregi('\*',$objimport->array_import_fields[0][$val]) && empty($newval)) if (eregi('\*',$objimport->array_import_fields[0][$val]) && ($newval==''))
{ {
$this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key); $this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key);
$this->errors[$error]['type']='NOTNULL'; $this->errors[$error]['type']='NOTNULL';
...@@ -351,7 +351,7 @@ class ImportCsv extends ModeleImports ...@@ -351,7 +351,7 @@ class ImportCsv extends ModeleImports
{ {
if ($listfields) if ($listfields)
{ {
$sql='INSERT INTO '.$tablename.'('.$listfields.',import_key) VALUES('.$listvalues.",'".$importid."')"; $sql='INSERT INTO '.$tablename.'('.$listfields.', import_key) VALUES('.$listvalues.", '".$importid."')";
dol_syslog("import_csv.modules sql=".$sql); dol_syslog("import_csv.modules sql=".$sql);
//print '> '.join(',',$arrayrecord); //print '> '.join(',',$arrayrecord);
...@@ -369,7 +369,6 @@ class ImportCsv extends ModeleImports ...@@ -369,7 +369,6 @@ class ImportCsv extends ModeleImports
else else
{ {
//print 'E'; //print 'E';
print $sql;
$this->errors[$error]['lib']=$this->db->lasterror(); $this->errors[$error]['lib']=$this->db->lasterror();
$this->errors[$error]['type']='SQL'; $this->errors[$error]['type']='SQL';
$error++; $error++;
......
# Dolibarr language file - en_US - errors # Dolibarr language file - en_US - errors
CHARSET=UTF-8 CHARSET=UTF-8
Error=Error
Errors=Errors
MenuManager=Menu manager MenuManager=Menu manager
ErrorLoginAlreadyExists=Login %s already exists. ErrorLoginAlreadyExists=Login %s already exists.
ErrorGroupAlreadyExists=Group %s already exists. ErrorGroupAlreadyExists=Group %s already exists.
...@@ -51,4 +53,6 @@ ErrorRecordHasChildren=Failed to delete records since it has some childs. ...@@ -51,4 +53,6 @@ ErrorRecordHasChildren=Failed to delete records since it has some childs.
WarningConfFileMustBeReadOnly=Warning, your config file (<b>htdocs/conf/conf.php</b>) can be overwritten by the web server. This is a serious security hole. Modify permissions on file to be in read only mode for operating system user used by Web server. If you use Windows and FAT format for your disk, you must know that this file system does not allow to add permissions on file, so can't be completely safe. WarningConfFileMustBeReadOnly=Warning, your config file (<b>htdocs/conf/conf.php</b>) can be overwritten by the web server. This is a serious security hole. Modify permissions on file to be in read only mode for operating system user used by Web server. If you use Windows and FAT format for your disk, you must know that this file system does not allow to add permissions on file, so can't be completely safe.
ErrorModuleRequireJavascript=Javascript must not be disabled to have this feature working. To enable/disable Javascript, go to menu Home->Setup->Display. ErrorModuleRequireJavascript=Javascript must not be disabled to have this feature working. To enable/disable Javascript, go to menu Home->Setup->Display.
ErrorPasswordsMustMatch=Both typed passwords must match each other ErrorPasswordsMustMatch=Both typed passwords must match each other
ErrorContactEMail=A technical error occured. Pleas, contact administrator to folowwing email <b>%</b> en provide the error code <b>%s</b> in your message, or even better by adding a screen copy of this page. ErrorContactEMail=A technical error occured. Please, contact administrator to folowwing email <b>%</b> en provide the error code <b>%s</b> in your message, or even better by adding a screen copy of this page.
\ No newline at end of file ErrorsOnXLines=Errors on <b>%s</b> source lines
WarningsOnXLines=Warnings on <b>%s</b> source lines
\ No newline at end of file
...@@ -540,6 +540,7 @@ CreditCard=Credit card ...@@ -540,6 +540,7 @@ CreditCard=Credit card
FieldsWithAreMandatory=Fields with <b>%s</b> are mandatory FieldsWithAreMandatory=Fields with <b>%s</b> are mandatory
FieldsWithIsForPublic=Fields with <b>%s</b> are shown on public list of members. If you don't want this, check the "public" box. FieldsWithIsForPublic=Fields with <b>%s</b> are shown on public list of members. If you don't want this, check the "public" box.
AccordingToGeoIPDatabase=(according to GeoIP convertion) AccordingToGeoIPDatabase=(according to GeoIP convertion)
Line=Line
# Week day # Week day
Day1=Monday Day1=Monday
......
# Dolibarr language file - fr_FR - errors # Dolibarr language file - fr_FR - errors
CHARSET=UTF-8 CHARSET=UTF-8
Error=Erreur
Errors=Erreurs
MenuManager=Gestionnaire de menu MenuManager=Gestionnaire de menu
ErrorLoginAlreadyExists=Le login %s existe déjà. ErrorLoginAlreadyExists=Le login %s existe déjà.
ErrorGroupAlreadyExists=Le groupe %s existe déjà. ErrorGroupAlreadyExists=Le groupe %s existe déjà.
...@@ -53,3 +55,5 @@ WarningConfFileMustBeReadOnly=Attention, votre fichier de configuration (<b>htdo ...@@ -53,3 +55,5 @@ WarningConfFileMustBeReadOnly=Attention, votre fichier de configuration (<b>htdo
ErrorModuleRequireJavascript=Le javascript ne doit pas etre désactivé pour que cette fonctionnalité soit utilisable. Pour activer/désactiver l'utilisation de javascript, aller dans le menu Accueil->Configuration->Affichage. ErrorModuleRequireJavascript=Le javascript ne doit pas etre désactivé pour que cette fonctionnalité soit utilisable. Pour activer/désactiver l'utilisation de javascript, aller dans le menu Accueil->Configuration->Affichage.
ErrorPasswordsMustMatch=Les 2 mots de passe saisis doivent correspondre ErrorPasswordsMustMatch=Les 2 mots de passe saisis doivent correspondre
ErrorContactEMail=Une erreur technique est apparue. Merci de contacter l'administrateur à l'email suivant <b>%s</b> en lui indiquant le code erreur <b>%s</b> dans votre message ou mieux en fournissant une copie d'écran de cette page. ErrorContactEMail=Une erreur technique est apparue. Merci de contacter l'administrateur à l'email suivant <b>%s</b> en lui indiquant le code erreur <b>%s</b> dans votre message ou mieux en fournissant une copie d'écran de cette page.
ErrorsOnXLines=Erreurs sur <b>%s</b> lines sources
WarningsOnXLines=Alertes sur <b>%s</b> lines sources
\ No newline at end of file
...@@ -539,6 +539,7 @@ CreditCard=Carte de crédit ...@@ -539,6 +539,7 @@ CreditCard=Carte de crédit
FieldsWithAreMandatory=Les champs marqués par un <b>%s</b> sont obligatoires FieldsWithAreMandatory=Les champs marqués par un <b>%s</b> sont obligatoires
FieldsWithIsForPublic=Les champs marqués par <b>%s</b> seront affiches sur la liste publique des membres. Si vous ne le souhaitez pas, décochez la case "public". FieldsWithIsForPublic=Les champs marqués par <b>%s</b> seront affiches sur la liste publique des membres. Si vous ne le souhaitez pas, décochez la case "public".
AccordingToGeoIPDatabase=(obtenu par conversion GeoIP) AccordingToGeoIPDatabase=(obtenu par conversion GeoIP)
Line=Ligne
# Week day # Week day
Day1=Lundi Day1=Lundi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment