Calendar CSV import

- Handle end date before start date
This commit is contained in:
Nathan Gray 2015-09-22 17:42:18 +00:00
parent d693871b0c
commit b7da91b7dc

View File

@ -98,6 +98,14 @@ class calendar_import_csv extends importexport_basic_import_csv {
$record->owner = $options['owner'];
}
// Handle errors in length or start/end date
if($record->start > $record->end)
{
$record->end = $record->start + $GLOBALS['egw_info']['user']['preferences']['calendar']['defaultlength'] * 60;
$this->warnings[$import_csv->get_current_position()] = lang('error: starttime has to be before the endtime !!!');
}
// Parse particpants
if ($record->participants && !is_array($record->participants)) {
// Importing participants in human friendly format:
// Name (quantity)? (status) Role[, Name (quantity)? (status) Role]+