Give proper error messages for modification error as well as permissions error

This commit is contained in:
Nathan Gray 2012-03-19 18:45:14 +00:00
parent 102c0e569c
commit 5f1c65b31e

View File

@ -327,12 +327,22 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin {
break; break;
} else { } else {
$result = $this->boinfolog->write( $_data, true, 2); // 2 = dont touch modification date $result = $this->boinfolog->write( $_data, true, 2); // 2 = dont touch modification date
if(!$result) { if(!$result)
$this->errors[$record_num] = lang('Permissions error - %1 could not %2', {
$GLOBALS['egw']->accounts->id2name($_data['info_owner']), if($result === false)
lang($_action) {
); $this->errors[$record_num] = lang('Permissions error - %1 could not %2',
} else { $GLOBALS['egw']->accounts->id2name($_data['info_owner']),
lang($_action)
);
}
else
{
$this->errors[$record_num] = lang('Error: the entry has been updated since you opened it for editing!');
}
}
else
{
$this->results[$_action]++; $this->results[$_action]++;
} }
break; break;