mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
Enforce at least the right number of columns in import file vs definition, even if we can't tell what the columns are
This commit is contained in:
parent
a85fdb63a0
commit
29e52fc727
@ -230,7 +230,15 @@ class importexport_import_csv implements importexport_iface_import_record { //,
|
||||
protected function do_fieldmapping( ) {
|
||||
$record = $this->record;
|
||||
$this->record = array();
|
||||
foreach ($this->mapping as $cvs_idx => $new_idx) {
|
||||
if(count($this->mapping) !== count($record))
|
||||
{
|
||||
throw new egw_exception_wrong_userinput(lang("Column mismatch. Expected %1 columns, your file has %2.",
|
||||
count($this->mapping),
|
||||
count($record)
|
||||
));
|
||||
}
|
||||
foreach ($this->mapping as $cvs_idx => $new_idx)
|
||||
{
|
||||
if( $new_idx == '' ) continue;
|
||||
$this->record[$new_idx] = $record[$cvs_idx];
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ choose a plugin importexport en Choose a plugin
|
||||
choose an application importexport en Choose an application
|
||||
choose fields to export importexport en Choose fields to export
|
||||
choose seperator and charset importexport en Choose separator and charset
|
||||
column mismatch. expected %1 columns, your file has %2. importexport en Column mismatch. Expected %1 columns, your file has %2.
|
||||
condition importexport en Condition
|
||||
copied importexport en Copied.
|
||||
csv field importexport en CSV field
|
||||
|
Loading…
Reference in New Issue
Block a user