mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-29 17:28:36 +01:00
Set empty fields to '' instead of retaining their value (null or 0)
This commit is contained in:
parent
dff86e4842
commit
c200bfa403
@ -302,6 +302,10 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
$record->$name = lang($selects[$name][$record->$name]);
|
$record->$name = lang($selects[$name][$record->$name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$record->$name = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach((array)$fields['links'] as $name) {
|
foreach((array)$fields['links'] as $name) {
|
||||||
if($record->$name) {
|
if($record->$name) {
|
||||||
@ -314,6 +318,10 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
$record->$name = egw_link::title($links[$name], $record->$name);
|
$record->$name = egw_link::title($links[$name], $record->$name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$record->$name = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach((array)$fields['select-account'] as $name) {
|
foreach((array)$fields['select-account'] as $name) {
|
||||||
// Compare against null to deal with empty arrays
|
// Compare against null to deal with empty arrays
|
||||||
@ -328,6 +336,10 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
$record->$name = common::grab_owner_name($record->$name);
|
$record->$name = common::grab_owner_name($record->$name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$record->$name = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach((array)$fields['select-bool'] as $name) {
|
foreach((array)$fields['select-bool'] as $name) {
|
||||||
if($record->$name != null) {
|
if($record->$name != null) {
|
||||||
@ -339,11 +351,13 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
if ($record->$name && !is_numeric($record->$name)) $record->$name = strtotime($record->$name); // Custom fields stored as string
|
if ($record->$name && !is_numeric($record->$name)) $record->$name = strtotime($record->$name); // Custom fields stored as string
|
||||||
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'] . ' '.
|
||||||
($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '24' ? 'H:i:s' : 'h:i:s a'),$record->$name); // User date format
|
($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '24' ? 'H:i:s' : 'h:i:s a'),$record->$name); // User date format
|
||||||
|
if (!$record->$name) $record->$name = '';
|
||||||
}
|
}
|
||||||
foreach((array)$fields['date'] as $name) {
|
foreach((array)$fields['date'] as $name) {
|
||||||
//if ($record->$name) $record->$name = date('Y-m-d',$record->$name); // Standard date format
|
//if ($record->$name) $record->$name = date('Y-m-d',$record->$name); // Standard date format
|
||||||
if ($record->$name && !is_numeric($record->$name)) $record->$name = strtotime($record->$name); // Custom fields stored as string
|
if ($record->$name && !is_numeric($record->$name)) $record->$name = strtotime($record->$name); // Custom fields stored as string
|
||||||
if ($record->$name && is_numeric($record->$name)) $record->$name = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], $record->$name); // User date format
|
if ($record->$name && is_numeric($record->$name)) $record->$name = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], $record->$name); // User date format
|
||||||
|
if (!$record->$name) $record->$name = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some custom methods for conversion
|
// Some custom methods for conversion
|
||||||
@ -360,6 +374,10 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
}
|
}
|
||||||
$record->$name = implode(', ',$cats);
|
$record->$name = implode(', ',$cats);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$record->$name = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user