mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Format CSV export data from internal/numeric format into something a little more friendly for normal people
This commit is contained in:
parent
70d0e8dad1
commit
9ab9397af7
@ -44,7 +44,7 @@ class calendar_egw_record implements importexport_iface_egw_record
|
||||
* @param string $_attribute_name
|
||||
*/
|
||||
public function __get($_attribute_name) {
|
||||
|
||||
return $this->record[$_attribute_name];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,7 +54,7 @@ class calendar_egw_record implements importexport_iface_egw_record
|
||||
* @param data $data
|
||||
*/
|
||||
public function __set($_attribute_name, $data) {
|
||||
|
||||
$this->record[$_attribute_name] = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -36,12 +36,23 @@ class calendar_export_csv implements importexport_iface_export_plugin {
|
||||
|
||||
$export_object = new importexport_export_csv($_stream, (array)$options);
|
||||
$export_object->set_mapping($options['mapping']);
|
||||
$convert_fields = importexport_export_csv::$types;
|
||||
$convert_fields['date-time'][] = 'start';
|
||||
$convert_fields['date-time'][] = 'end';
|
||||
|
||||
|
||||
// $options['selection'] is array of identifiers as this plugin doesn't
|
||||
// support other selectors atm.
|
||||
$record = new calendar_egw_record();
|
||||
foreach ($events as $event) {
|
||||
// Add in participants
|
||||
if($options['mapping']['participants']) {
|
||||
$event['participants'] = implode(", ",$this->bo->participants($event,true));
|
||||
}
|
||||
|
||||
$record->set_record($event);
|
||||
// Standard stuff
|
||||
importexport_export_csv::convert($record, $convert_fields, 'calendar');
|
||||
$export_object->export_record($record);
|
||||
}
|
||||
unset($record);
|
||||
|
Loading…
Reference in New Issue
Block a user