From c1b80cf9a7e1abb5aad78f52767c4e9bf2641df3 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 25 Jun 2024 08:31:40 +0200 Subject: [PATCH] work on placement --- .../controllers/jobs/OrganigrammTest.php | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/application/controllers/jobs/OrganigrammTest.php b/application/controllers/jobs/OrganigrammTest.php index 9b21441e1..0ea15ef4e 100644 --- a/application/controllers/jobs/OrganigrammTest.php +++ b/application/controllers/jobs/OrganigrammTest.php @@ -109,7 +109,7 @@ HEADER; STARTDIAGRAMM; - renderOE($root, 0, 0); + renderOE($root, 0, 0, 100); echo << @@ -141,27 +141,29 @@ FOOTER; } } -function renderOE($oe, $level, $parentchildcount) +function renderOE($oe, $level, $parentchildcount, $minxoffset) { $nextlevel = $level + 1; $ownchildcount = 0; + $childsmaxxoffset = $minxoffset; foreach($oe->childs AS $child) { - renderOE($child, $nextlevel, $ownchildcount); + $childsmaxxoffset = renderOE($child, $nextlevel, $ownchildcount, $childsmaxxoffset); $ownchildcount++; } - $width = 200; - $height = 100; - $x = 100 + ($parentchildcount * 280); - $y = 180 + ($level * 180); + $width = 200; + $height = 100; + $spacing = 80; + $x = $minxoffset; + $y = 180 + ($level * ($height + $spacing)); $bezeichnung = htmlspecialchars($oe->bezeichnung); $leitung = ($oe->leitung_uid !== null) ? htmlspecialchars($oe->leitung_uid) : 'N.N.'; $fillcolors = array( - 'Team' => '#ffe6cc', - 'Abteilung' => '#e6ffcc', - 'Studiengang'=> '#cce6ff', - 'Lehrgang'=> '#e6ccff' + 'Team' => '#ffe6cc', + 'Abteilung' => '#e6ffcc', + 'Studiengang' => '#cce6ff', + 'Lehrgang' => '#e6ccff' ); $fillcolor = (isset($fillcolors[$oe->organisationseinheittyp_kurzbz])) ? $fillcolors[$oe->organisationseinheittyp_kurzbz] : '#ffffff'; echo <<