mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-02-04 02:28:41 +00:00
bug fixes and permission tests
This commit is contained in:
parent
90115162de
commit
9fd6d3d3a1
|
|
@ -145,8 +145,8 @@ class Department implements \JsonSerializable, ArrayableInterface
|
|||
'status' => $this->status,
|
||||
'description' => $this->description,
|
||||
'descriptionRaw' => $this->descriptionRaw,
|
||||
'unit' => $this->unit ?? new NullUnit(),
|
||||
'parent' => $this->parent ?? new NullDepartment(),
|
||||
'unit' => $this->unit,
|
||||
'parent' => $this->parent ?? null,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ class Position implements \JsonSerializable, ArrayableInterface
|
|||
'description' => $this->description,
|
||||
'descriptionRaw' => $this->descriptionRaw,
|
||||
'department' => $this->department ?? new NullDepartment(),
|
||||
'parent' => $this->parent ?? new NullPosition(),
|
||||
'parent' => $this->parent ?? null,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class Unit implements \JsonSerializable, ArrayableInterface
|
|||
'status' => $this->status,
|
||||
'description' => $this->description,
|
||||
'descriptionRaw' => $this->descriptionRaw,
|
||||
'parent' => $this->parent,
|
||||
'parent' => $this->parent ?? null,
|
||||
'image' => $this->image,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ $unitRoot = $unitTree[null][0]['children'];
|
|||
|
||||
do {
|
||||
++$toCloseDep;
|
||||
$parentDep = $parentDep->parent;
|
||||
$parentDepId = $parentDep->getId();
|
||||
$parentDep = $parentDep->parent ?? null;
|
||||
$parentDepId = $parentDep?->getId() ?? 0;
|
||||
} while ($parentDepId !== 0
|
||||
&& !isset($depTree[$unitId][$parentDepId]['children'][($depTree[$unitId][$parentDepId]['index'] ?? 0) + 1])
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user