fixed usermanagement and added city, company and building to topology
This commit is contained in:
1 parent
2a685896bd
commit
6cc2413daa
7 files changed
+1281
-1166
No files matched your search
@@ -35,8 +35,18 @@ trait NextFloorPermissions
|
||||
private function accessCatalog(): array
|
||||
{
|
||||
$rooms = []; $devices = [];
|
||||
foreach ($this->building()['floors'] ?? [] as $floor) {
|
||||
$prefix = (string) ($floor['name'] ?? 'Etage') . ' / ';
|
||||
$building = $this->building();
|
||||
$topology = $building['topology'] ?? [];
|
||||
$find = static function (string $group, ?string $id) use ($topology): array {
|
||||
foreach ($topology[$group] ?? [] as $row) if ($row['id'] === $id) return $row;
|
||||
return [];
|
||||
};
|
||||
foreach ($building['floors'] ?? [] as $floor) {
|
||||
$group = $find('buildings', $floor['building_id'] ?? null);
|
||||
$branch = $find('branches', $group['branch_id'] ?? null);
|
||||
$location = $find('locations', $floor['outdoor_location_id'] ?? $branch['location_id'] ?? null);
|
||||
$parts = [$location['name'] ?? '', $branch['name'] ?? '', $group['name'] ?? '', $floor['name'] ?? 'Etage'];
|
||||
$prefix = implode(' / ', array_filter($parts, static fn(string $v): bool => $v !== '')) . ' / ';
|
||||
foreach ($floor['rooms'] ?? [] as $room) $rooms[] = ['caption' => $prefix . ($room['name'] ?? $room['id']), 'value' => $this->planKey('room', $floor, (string) $room['id'])];
|
||||
foreach (['furniture', 'openings', 'placements'] as $group) foreach ($floor[$group] ?? [] as $item) {
|
||||
$id = (string) ($item['id'] ?? $item['entity_id'] ?? '');
|
||||
|
||||
Reference in new issue
Block a user