forked from extern/egroupware
Convert recurrence type and interval to human friendly values
This commit is contained in:
parent
b95d81a521
commit
163ca54a1e
@ -31,15 +31,16 @@ class calendar_export_csv implements importexport_iface_export_plugin {
|
|||||||
'enum_recuring' => false,
|
'enum_recuring' => false,
|
||||||
'daywise' => false,
|
'daywise' => false,
|
||||||
'owner' => $options['owner'],
|
'owner' => $options['owner'],
|
||||||
'date_format' => $options['date_format'],
|
|
||||||
));
|
));
|
||||||
|
|
||||||
$export_object = new importexport_export_csv($_stream, (array)$options);
|
$export_object = new importexport_export_csv($_stream, (array)$options);
|
||||||
$export_object->set_mapping($options['mapping']);
|
$export_object->set_mapping($options['mapping']);
|
||||||
$convert_fields = importexport_export_csv::$types;
|
$convert_fields = importexport_export_csv::$types;
|
||||||
|
$convert_fields['select-account'][] = 'owner';
|
||||||
$convert_fields['date-time'][] = 'start';
|
$convert_fields['date-time'][] = 'start';
|
||||||
$convert_fields['date-time'][] = 'end';
|
$convert_fields['date-time'][] = 'end';
|
||||||
|
|
||||||
|
$recurrence = $this->bo->recur_types;
|
||||||
|
|
||||||
// $options['selection'] is array of identifiers as this plugin doesn't
|
// $options['selection'] is array of identifiers as this plugin doesn't
|
||||||
// support other selectors atm.
|
// support other selectors atm.
|
||||||
@ -51,8 +52,14 @@ class calendar_export_csv implements importexport_iface_export_plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$record->set_record($event);
|
$record->set_record($event);
|
||||||
|
if($options['mapping']['recurrence']) {
|
||||||
|
$record->recurrence = $recurrence[$record->recur_type];
|
||||||
|
if($record->recur_type != MCAL_RECUR_NONE) $record->recurrence .= ' / '. $record->recur_interval;
|
||||||
|
}
|
||||||
|
|
||||||
// Standard stuff
|
// Standard stuff
|
||||||
importexport_export_csv::convert($record, $convert_fields, 'calendar');
|
importexport_export_csv::convert($record, $convert_fields, 'calendar');
|
||||||
|
|
||||||
$export_object->export_record($record);
|
$export_object->export_record($record);
|
||||||
}
|
}
|
||||||
unset($record);
|
unset($record);
|
||||||
|
Loading…
Reference in New Issue
Block a user