mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Fix merging of custom fields with provided fields
This commit is contained in:
parent
c3bdb4c416
commit
d8f79014f8
@ -177,6 +177,7 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
public static function convert_parse_custom_fields($appname, &$selects = array(), &$links = array(), &$methods = array()) {
|
public static function convert_parse_custom_fields($appname, &$selects = array(), &$links = array(), &$methods = array()) {
|
||||||
if(!$appname) return;
|
if(!$appname) return;
|
||||||
|
|
||||||
|
$fields = array();
|
||||||
$custom = config::get_customfields($appname);
|
$custom = config::get_customfields($appname);
|
||||||
foreach($custom as $name => $c_field) {
|
foreach($custom as $name => $c_field) {
|
||||||
$name = '#' . $name;
|
$name = '#' . $name;
|
||||||
@ -234,7 +235,7 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
// Not quite a recursive merge, since only one level
|
// Not quite a recursive merge, since only one level
|
||||||
foreach($fields as $type => &$list) {
|
foreach($fields as $type => &$list) {
|
||||||
if($c_fields[$type]) {
|
if($c_fields[$type]) {
|
||||||
$list += $c_fields[$type];
|
$list = array_merge($c_fields[$type], $list);;
|
||||||
unset($c_fields[$type]);
|
unset($c_fields[$type]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,6 +270,11 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach((array)$fields['select-bool'] as $name) {
|
||||||
|
if($record->$name != null) {
|
||||||
|
$record->$name = $record->$name ? lang('Yes') : lang('No');
|
||||||
|
}
|
||||||
|
}
|
||||||
foreach((array)$fields['date-time'] as $name) {
|
foreach((array)$fields['date-time'] as $name) {
|
||||||
//if ($record->$name) $record->$name = date('Y-m-d H:i:s',$record->$name); // Standard date format
|
//if ($record->$name) $record->$name = date('Y-m-d H:i:s',$record->$name); // Standard date format
|
||||||
if ($record->$name && is_numeric($record->$name)) $record->$name = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'] . ', '.
|
if ($record->$name && is_numeric($record->$name)) $record->$name = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'] . ', '.
|
||||||
|
Loading…
Reference in New Issue
Block a user