mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-02-16 00:08: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,
|
'status' => $this->status,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'descriptionRaw' => $this->descriptionRaw,
|
'descriptionRaw' => $this->descriptionRaw,
|
||||||
'unit' => $this->unit ?? new NullUnit(),
|
'unit' => $this->unit,
|
||||||
'parent' => $this->parent ?? new NullDepartment(),
|
'parent' => $this->parent ?? null,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ class Position implements \JsonSerializable, ArrayableInterface
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'descriptionRaw' => $this->descriptionRaw,
|
'descriptionRaw' => $this->descriptionRaw,
|
||||||
'department' => $this->department ?? new NullDepartment(),
|
'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,
|
'status' => $this->status,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'descriptionRaw' => $this->descriptionRaw,
|
'descriptionRaw' => $this->descriptionRaw,
|
||||||
'parent' => $this->parent,
|
'parent' => $this->parent ?? null,
|
||||||
'image' => $this->image,
|
'image' => $this->image,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,8 @@ $unitRoot = $unitTree[null][0]['children'];
|
||||||
|
|
||||||
do {
|
do {
|
||||||
++$toCloseDep;
|
++$toCloseDep;
|
||||||
$parentDep = $parentDep->parent;
|
$parentDep = $parentDep->parent ?? null;
|
||||||
$parentDepId = $parentDep->getId();
|
$parentDepId = $parentDep?->getId() ?? 0;
|
||||||
} while ($parentDepId !== 0
|
} while ($parentDepId !== 0
|
||||||
&& !isset($depTree[$unitId][$parentDepId]['children'][($depTree[$unitId][$parentDepId]['index'] ?? 0) + 1])
|
&& !isset($depTree[$unitId][$parentDepId]['children'][($depTree[$unitId][$parentDepId]['index'] ?? 0) + 1])
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user