Code comment

This commit is contained in:
Laurent Destailleur 2017-11-06 11:32:02 +01:00
parent fe103f0492
commit 8429de031f
2 changed files with 72 additions and 69 deletions

View File

@ -269,7 +269,7 @@ class ImportCsv extends ModeleImports
* @param Object $objimport Object import (contains objimport->array_import_tables, objimport->array_import_fields, objimport->array_import_convertvalue, ...) * @param Object $objimport Object import (contains objimport->array_import_tables, objimport->array_import_fields, objimport->array_import_convertvalue, ...)
* @param int $maxfields Max number of fields to use * @param int $maxfields Max number of fields to use
* @param string $importid Import key * @param string $importid Import key
* @param array $updatekeys Array of keys to use to try to do update * @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor.
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys) function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys)
@ -588,6 +588,7 @@ class ImportCsv extends ModeleImports
{ {
$updatedone = false; $updatedone = false;
$insertdone = false; $insertdone = false;
if (!empty($updatekeys)) { if (!empty($updatekeys)) {
// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
if (empty($lastinsertid)) { if (empty($lastinsertid)) {

View File

@ -147,6 +147,7 @@ class ImportXlsx extends ModeleImports
//$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($col + 1))->setAutoSize(true); //$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($col + 1))->setAutoSize(true);
$col++; $col++;
} }
return ''; // final output will be generated in footer return ''; // final output will be generated in footer
} }
@ -165,6 +166,7 @@ class ImportXlsx extends ModeleImports
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($col, $row, $cell); $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($col, $row, $cell);
$col++; $col++;
} }
return ''; // final output will be generated in footer return ''; // final output will be generated in footer
} }
@ -292,7 +294,7 @@ class ImportXlsx extends ModeleImports
* @param Object $objimport Object import (contains objimport->array_import_tables, objimport->array_import_fields, objimport->array_import_convertvalue, ...) * @param Object $objimport Object import (contains objimport->array_import_tables, objimport->array_import_fields, objimport->array_import_convertvalue, ...)
* @param int $maxfields Max number of fields to use * @param int $maxfields Max number of fields to use
* @param string $importid Import key * @param string $importid Import key
* @param array $updatekeys Array of keys to use to try to do update * @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor.
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// What is this doing here ? it is common to all imports, is should be in the parent class // What is this doing here ? it is common to all imports, is should be in the parent class