mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-01-27 23:28:41 +00:00
Improve settings and settings tests
This commit is contained in:
parent
f28742d609
commit
8395800aed
|
|
@ -183,7 +183,7 @@ final class ApiController extends Controller
|
|||
$unit = $this->createUnitFromRequest($request);
|
||||
$this->createModel($request->getHeader()->getAccount(), $unit, UnitMapper::class, 'unit', $request->getOrigin());
|
||||
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_UNIT) === '1') {
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_UNIT)['content'] === '1') {
|
||||
$newRequest = new HttpRequest();
|
||||
$newRequest->setData('name', 'org:unit:' . \strtolower($unit->getName()));
|
||||
$newRequest->setData('status', GroupStatus::ACTIVE);
|
||||
|
|
@ -397,7 +397,7 @@ final class ApiController extends Controller
|
|||
$position = $this->createPositionFromRequest($request);
|
||||
$this->createModel($request->getHeader()->getAccount(), $position, PositionMapper::class, 'position', $request->getOrigin());
|
||||
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_POSITION) === '1') {
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_POSITION)['content'] === '1') {
|
||||
$newRequest = new HttpRequest();
|
||||
$newRequest->setData('name', 'org:pos:' . \strtolower($position->getName()));
|
||||
$newRequest->setData('status', GroupStatus::ACTIVE);
|
||||
|
|
@ -574,7 +574,7 @@ final class ApiController extends Controller
|
|||
$department = $this->createDepartmentFromRequest($request);
|
||||
$this->createModel($request->getHeader()->getAccount(), $department, DepartmentMapper::class, 'department', $request->getOrigin());
|
||||
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT) === '1') {
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT)['content'] === '1') {
|
||||
$newRequest = new HttpRequest();
|
||||
$newRequest->setData('name', 'org:dep:' . \strtolower($department->getName()));
|
||||
$newRequest->setData('status', GroupStatus::ACTIVE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user