diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 5726981586a..d79e65f766f 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -977,7 +977,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql { //var_dump($objMod->dictionaries['tabname']); $nbtabname=$nbtablib=$nbtabsql=$nbtabsqlsort=$nbtabfield=$nbtabfieldvalue=$nbtabfieldinsert=$nbtabrowid=$nbtabcond=$nbtabfieldcheck=$nbtabhelp=0; - foreach($objMod->dictionaries['tabname'] as $val) { $nbtabname++; $taborder[] = count($tabname)+1; $tabname[] = $val; } + foreach($objMod->dictionaries['tabname'] as $val) { $nbtabname++; $taborder[] = max($taborder)+1; $tabname[] = $val; } foreach($objMod->dictionaries['tablib'] as $val) { $nbtablib++; $tablib[] = $val; } foreach($objMod->dictionaries['tabsql'] as $val) { $nbtabsql++; $tabsql[] = $val; } foreach($objMod->dictionaries['tabsqlsort'] as $val) { $nbtabsqlsort++; $tabsqlsort[] = $val; } diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 0c01ef07d89..8d35ff63225 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -177,7 +177,6 @@ class ExportCsv extends ModeleExports */ function write_header($outputlangs) { - return 0; } @@ -190,23 +189,18 @@ class ExportCsv extends ModeleExports * @param Translate $outputlangs Object lang to translate values * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK - * - * //TODO transnoentities send back UTF-8 so using an ISO charset at this point create an issue - * (get a blank screen and an empty file) - * my feeling is that we should not force charset till we are not writing the final result. */ function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs,$array_types) { - global $conf; - + if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) { $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; } else { - $outputlangs->charset_output = $conf->file->character_set_client; + $outputlangs->charset_output = 'ISO-8859-1'; } foreach($array_selected_sorted as $code => $value) @@ -217,7 +211,6 @@ class ExportCsv extends ModeleExports fwrite($this->handle,$newvalue.$this->separator); } fwrite($this->handle,"\n"); - return 0; } @@ -230,10 +223,6 @@ class ExportCsv extends ModeleExports * @param Translate $outputlangs Object lang to translate values * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK - * - * //TODO transnoentities send back UTF-8 so using an ISO charset at this point create an issue - * (get a blank screen and an empty file) - * my feeling is that we should not force charset till we are not writing the final result. */ function write_record($array_selected_sorted,$objp,$outputlangs,$array_types) { @@ -245,7 +234,7 @@ class ExportCsv extends ModeleExports } else { - $outputlangs->charset_output = $conf->file->character_set_client; + $outputlangs->charset_output = 'ISO-8859-1'; } $this->col=0; @@ -314,7 +303,7 @@ class ExportCsv extends ModeleExports { global $conf; $addquote=0; - dol_syslog("ExportCsv::csvClean ".$newvalue); + // Rule Dolibarr: No HTML //print $charset.' '.$newvalue."\n"; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index c4c14ff8d5f..3b93c40e5ef 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -868,13 +868,13 @@ if ($step == 4 && $datatoimport) $i++; - $entity=(! empty($objimport->array_import_entities[0][$code])?$objimport->array_import_entities[0][$code]:$objimport->array_import_icon[0]); + $entity=(! empty($objimport->array_import_entities[0][$code])?$objimport->array_import_entities[0][$code]:$objimport->array_import_label[0]); $tablealias=preg_replace('/(\..*)$/i','',$code); $tablename=$objimport->array_import_tables[0][$tablealias]; $entityicon=$entitytoicon[$entity]?$entitytoicon[$entity]:$entity; $entitylang=$entitytolang[$entity]?$entitytolang[$entity]:$entity; - print '