More fixes for import check (language & charset differ from definition)

This commit is contained in:
Nathan Gray 2013-05-15 15:29:21 +00:00
parent aed379e6da
commit a763710de7
2 changed files with 9 additions and 2 deletions

View File

@ -171,7 +171,10 @@ class importexport_export_csv implements importexport_iface_export_record
$fields = $wizard->get_export_fields();
foreach($this->mapping as $field => &$label)
{
if($fields[$field]) $label = $fields[$field];
if($fields[$field])
{
$label = $label != $fields[$field] ? $fields[$field] : lang($label);
}
// Make sure no *
if(substr($label,-1) == '*') $label = substr($label,0,-1);
}

View File

@ -326,9 +326,12 @@
// Only CSV files
if(!$options['csv_fields']) return true;
$preference = $GLOBALS['egw_info']['user']['preferences']['common']['csv_charset'];
$charset = $options['charset'] == 'user' || !$options['charset'] ? $preference : $options['charset'];
$data = fgetcsv($file, 8000, $options['fieldsep']);
rewind($file);
$data = translation::convert($data,$options['charset']);
$data = translation::convert($data,$charset);
$ok = true;
if(count($data) != count($options['csv_fields']) && max(array_keys($data)) != max(array_keys($options['csv_fields'])))
@ -378,6 +381,7 @@
{
continue;
}
//error_log("Raw[Defn: {$options['csv_fields'][$index]} File: $header] Lang[Defn: $lang_defn File: $lang_file] MSG_ID[Defn: $defn_message_id File: $file_message_id]");
// Problem
$message[] = lang("Column mismatch: %1 should be %2, not %3",