mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-27 21:32:46 +02:00
Use mapped columns instead of original file columns to verify file. Still not perfect, but maybe better?
This commit is contained in:
parent
72e6f6f8f4
commit
d7316f76ad
@ -294,11 +294,11 @@
|
|||||||
$data = translation::convert($data,$options['charset']);
|
$data = translation::convert($data,$options['charset']);
|
||||||
|
|
||||||
$ok = true;
|
$ok = true;
|
||||||
if(max(array_keys($data)) != max(array_keys($options['csv_fields'])))
|
if(count($data) != count($options['field_mapping']))
|
||||||
{
|
{
|
||||||
$message[] = lang("Column mismatch. Expected %1 columns, your file has %2.",
|
$message[] = lang("Column mismatch. Expected %1 columns, your file has %2.",
|
||||||
max(array_keys($options['csv_fields'])),
|
count($options['field_mapping']),
|
||||||
max(array_keys($data))
|
count($data)
|
||||||
);
|
);
|
||||||
$ok = false;
|
$ok = false;
|
||||||
}
|
}
|
||||||
@ -309,7 +309,7 @@
|
|||||||
// Skipped column in definition
|
// Skipped column in definition
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
elseif($index < count($options['csv_fields']) && $options['csv_fields'][$index] != $header)
|
elseif($index < count($options['csv_fields']) && strtoupper($options['csv_fields'][$index]) != strtoupper($header))
|
||||||
{
|
{
|
||||||
// Problem
|
// Problem
|
||||||
$message[] = lang("Column mismatch: %1 should be %2, not %3",
|
$message[] = lang("Column mismatch: %1 should be %2, not %3",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user