From 04828b94e9df8321feae0bfb99daa468c0d3d383 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 23 Jul 2019 13:57:20 +0200 Subject: [roomplanner] Support creating recursive/composed rooms --- modules-available/locations/inc/location.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules-available/locations') diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php index 8db0c5f3..bd4be245 100644 --- a/modules-available/locations/inc/location.inc.php +++ b/modules-available/locations/inc/location.inc.php @@ -87,11 +87,13 @@ class Location } $output = array(); foreach ($tree as $node) { + $cc = empty($node['children']) ? array() : array_map(function ($item) { return (int)$item['locationid']; }, $node['children']); $output[(int)$node['locationid']] = array( 'locationid' => (int)$node['locationid'], 'parentlocationid' => (int)$node['parentlocationid'], 'parents' => $parents, - 'children' => empty($node['children']) ? array() : array_map(function ($item) { return (int)$item['locationid']; }, $node['children']), + 'children' => $cc, + 'directchildren' => $cc, 'locationname' => $node['locationname'], 'depth' => $depth, 'isleaf' => true, -- cgit v1.2.3-55-g7522