From 55ba064db8f95f783207b383b640d3c6a8558776 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 6 Dec 2020 11:13:19 +0100 Subject: [PATCH] tpl fixes, dont use printHtml for none-string types --- Controller/BackendController.php | 3 ++- .../department-selector.tpl.php | 18 +++++++++--------- .../position-selector.tpl.php | 18 +++++++++--------- .../UnitTagSelector/unit-selector.tpl.php | 18 +++++++++--------- Theme/Backend/department-list.tpl.php | 2 +- Theme/Backend/organigram.tpl.php | 6 +++--- Theme/Backend/position-create.tpl.php | 5 +++-- Theme/Backend/position-list.tpl.php | 2 +- Theme/Backend/unit-create.tpl.php | 4 ++-- Theme/Backend/unit-list.tpl.php | 2 +- Theme/Backend/unit-profile.tpl.php | 4 ++-- 11 files changed, 42 insertions(+), 40 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 6298c70..ea64463 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -17,6 +17,7 @@ namespace Modules\Organization\Controller; use Modules\Organization\Models\Department; use Modules\Organization\Models\DepartmentMapper; use Modules\Organization\Models\Position; +use Modules\Organization\Models\NullPosition; use Modules\Organization\Models\PositionMapper; use Modules\Organization\Models\Unit; use Modules\Organization\Models\UnitMapper; @@ -168,7 +169,7 @@ final class BackendController extends Controller $parent = $component->parent->getId(); if (!($component instanceof Position) // parent could be in different department then ignore - || $component->parent->department->getId() === $component->department->getId() + || (!($component->parent instanceof NullPosition) && $component->parent->department->getId() === $component->department->getId()) ) { if (!isset($tree[$ref][$parent])) { $tree[$ref][$parent] = ['obj' => null, 'children' => [], 'index' => 0]; diff --git a/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php b/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php index 2f0e895..fc52f4a 100755 --- a/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php +++ b/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php @@ -1,10 +1,10 @@
- -
- + -