Fix : import module sim message + warnings

This commit is contained in:
lmarcouiller 2022-09-28 12:27:20 +02:00
parent 00adad02ff
commit b753968c18
3 changed files with 6 additions and 4 deletions

View File

@ -726,7 +726,7 @@ class ImportCsv extends ModeleImports
}
// Define $listfields and $listvalues to build SQL request
if ($conf->socialnetworks->enabled && strpos($fieldname, "socialnetworks") !== false) {
if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) {
if (!in_array("socialnetworks", $listfields)) {
$listfields[] = "socialnetworks";
}
@ -840,7 +840,7 @@ class ImportCsv extends ModeleImports
foreach ($updatekeys as $key) {
$col = $objimport->array_import_updatekeys[0][$key];
$key = preg_replace('/^.*\./i', '', $key);
if ($conf->socialnetworks->enabled && strpos($key, "socialnetworks") !== false) {
if (isModEnabled("socialnetworks") && strpos($key, "socialnetworks") !== false) {
$tmp = explode("_", $key);
$key = $tmp[0];
$socialnetwork = $tmp[1];

View File

@ -1910,8 +1910,8 @@ if ($step == 5 && $datatoimport) {
print '<br>';
print '<div class="info">';
print '<div class=""><b>'.$langs->trans("ResultOfSimulationNoError").'</b></div>';
print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'<br>';
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br>';
print $langs->trans("NbInsertSim", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'<br>';
print $langs->trans("NbUpdateSim", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br>';
print '</div>';
print '<br>';
} else {

View File

@ -134,7 +134,9 @@ FormatControlRule=Format control rule
## imports updates
KeysToUseForUpdates=Key (column) to use for <b>updating</b> existing data
NbInsert=Number of inserted lines: %s
NbInsertSim=Number of lines that will be inserted: %s
NbUpdate=Number of updated lines: %s
NbUpdateSim=Number of lines that will be updated : %s
MultipleRecordFoundWithTheseFilters=Multiple records have been found with these filters: %s
StocksWithBatch=Stocks and location (warehouse) of products with batch/serial number
WarningFirstImportedLine=The first line(s) will not be imported with the current selection