mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Fix link conversion only works the first time
This commit is contained in:
parent
1c4f15078d
commit
e99ab7aff5
@ -282,19 +282,20 @@ class importexport_export_csv implements importexport_iface_export_record
|
||||
if($appname) {
|
||||
if(!self::$cf_parse_cache[$appname]) {
|
||||
$c_fields = self::convert_parse_custom_fields($appname, $selects, $links, $methods);
|
||||
|
||||
// Add in any fields that are keys to another app
|
||||
foreach((array)$fields['links'] as $link_field => $app)
|
||||
{
|
||||
if(is_numeric($link_field)) continue;
|
||||
$links[$link_field] = $app;
|
||||
// Set it as a normal link field
|
||||
$fields['links'][] = $link_field;
|
||||
unset($fields['links'][$link_field]);
|
||||
}
|
||||
self::$cf_parse_cache[$appname] = array($c_fields, $selects, $links, $methods);
|
||||
}
|
||||
list($c_fields, $c_selects, $links, $methods) = self::$cf_parse_cache[$appname];
|
||||
|
||||
// Add in any fields that are keys to another app
|
||||
foreach((array)$fields['links'] as $link_field => $app)
|
||||
{
|
||||
if(is_numeric($link_field)) continue;
|
||||
$links[$link_field] = $app;
|
||||
// Set it as a normal link field
|
||||
$fields['links'][] = $link_field;
|
||||
unset($fields['links'][$link_field]);
|
||||
}
|
||||
|
||||
// Not quite a recursive merge, since only one level
|
||||
foreach($fields as $type => &$list) {
|
||||
if($c_fields[$type]) {
|
||||
@ -304,7 +305,6 @@ class importexport_export_csv implements importexport_iface_export_record
|
||||
}
|
||||
$fields += $c_fields;
|
||||
$selects += $c_selects;
|
||||
|
||||
}
|
||||
foreach((array)$fields['select'] as $name) {
|
||||
if($record->$name != null && is_array($selects) && $selects[$name]) {
|
||||
|
@ -272,18 +272,20 @@ class importexport_import_csv implements importexport_iface_import_record { //,
|
||||
|
||||
if(!self::$cf_parse_cache[$appname]) {
|
||||
$c_fields = importexport_export_csv::convert_parse_custom_fields($appname, $selects, $links, $methods);
|
||||
// Add in any fields that are keys to another app
|
||||
foreach((array)$fields['links'] as $link_field => $app)
|
||||
{
|
||||
if(is_numeric($link_field)) continue;
|
||||
$links[$link_field] = $app;
|
||||
// Set it as a normal link field
|
||||
$fields['links'][] = $link_field;
|
||||
unset($fields['links'][$link_field]);
|
||||
}
|
||||
self::$cf_parse_cache[$appname] = array($c_fields, $selects, $links, $methods);
|
||||
}
|
||||
list($c_fields, $c_selects, $links, $methods) = self::$cf_parse_cache[$appname];
|
||||
|
||||
// Add in any fields that are keys to another app
|
||||
foreach((array)$fields['links'] as $link_field => $app)
|
||||
{
|
||||
if(is_numeric($link_field)) continue;
|
||||
$links[$link_field] = $app;
|
||||
// Set it as a normal link field
|
||||
$fields['links'][] = $link_field;
|
||||
unset($fields['links'][$link_field]);
|
||||
}
|
||||
|
||||
// Not quite a recursive merge, since only one level
|
||||
foreach($fields as $type => &$list)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user