diff --git a/Models/DepartmentMapper.php b/Models/DepartmentMapper.php
index c422da8..bb3ddef 100644
--- a/Models/DepartmentMapper.php
+++ b/Models/DepartmentMapper.php
@@ -38,6 +38,10 @@ class DepartmentMapper extends DataMapperAbstract
'mapper' => UnitMapper::class,
'dest' => 'organization_department_unit',
],
+ 'parent' => [
+ 'mapper' => DepartmentMapper::class,
+ 'dest' => 'organization_department_parent',
+ ],
];
/**
diff --git a/Models/NullDepartment.php b/Models/NullDepartment.php
new file mode 100644
index 0000000..f1a5008
--- /dev/null
+++ b/Models/NullDepartment.php
@@ -0,0 +1,19 @@
+department;
}
- public function setDepartment(int $department)
+ public function setDepartment($department)
{
$this->department = $department;
}
diff --git a/Models/PositionMapper.php b/Models/PositionMapper.php
index c3cf641..7ef856c 100644
--- a/Models/PositionMapper.php
+++ b/Models/PositionMapper.php
@@ -35,10 +35,14 @@ class PositionMapper extends DataMapperAbstract
];
protected static $belongsTo = [
- 'account' => [
+ 'parent' => [
'mapper' => PositionMapper::class,
'dest' => 'organization_position_parent',
],
+ 'department' => [
+ 'mapper' => DepartmentMapper::class,
+ 'dest' => 'organization_position_department',
+ ],
];
/**
diff --git a/Models/UnitMapper.php b/Models/UnitMapper.php
index 675294a..9dc7265 100644
--- a/Models/UnitMapper.php
+++ b/Models/UnitMapper.php
@@ -37,6 +37,10 @@ class UnitMapper extends DataMapperAbstract
'mapper' => UnitMapper::class,
'dest' => 'organization_uni_parent',
],
+ 'parent' => [
+ 'mapper' => UnitMapper::class,
+ 'dest' => 'organization_unit_parent',
+ ],
];
/**
diff --git a/Theme/Backend/department-list.tpl.php b/Theme/Backend/department-list.tpl.php
index d3126e6..533e572 100644
--- a/Theme/Backend/department-list.tpl.php
+++ b/Theme/Backend/department-list.tpl.php
@@ -43,8 +43,8 @@ echo $this->getData('nav')->render(); ?>
| = htmlspecialchars($value->getId(), ENT_COMPAT, 'utf-8'); ?>
| = htmlspecialchars($value->getName(), ENT_COMPAT, 'utf-8'); ?>
- | = htmlspecialchars($value->getParent(), ENT_COMPAT, 'utf-8'); ?>
- | = htmlspecialchars($value->getUnit(), ENT_COMPAT, 'utf-8'); ?>
+ | = htmlspecialchars($value->getParent()->getName(), ENT_COMPAT, 'utf-8'); ?>
+ | = htmlspecialchars($value->getUnit()->getName(), ENT_COMPAT, 'utf-8'); ?>
|
diff --git a/Theme/Backend/department-profile.tpl.php b/Theme/Backend/department-profile.tpl.php
index 7e6a416..7cebe11 100644
--- a/Theme/Backend/department-profile.tpl.php
+++ b/Theme/Backend/department-profile.tpl.php
@@ -29,7 +29,7 @@ echo $this->getData('nav')->render(); ?>
|
|
|
|
|
- |
|
+ |
|
|
|
|
|