mirror of
https://github.com/Karaka-Management/oms-RiskManagement.git
synced 2026-01-10 19:08:40 +00:00
template fixes + bug fixes + style fixes
This commit is contained in:
parent
5f42f821fa
commit
fb54903257
|
|
@ -219,7 +219,7 @@ final class ApiController extends Controller
|
|||
private function validateRiskProcessCreate(RequestAbstract $request) : array
|
||||
{
|
||||
$val = [];
|
||||
if ($val['name'] = !$request->hasData('name')
|
||||
if ($val['name'] = !$request->hasData('name')
|
||||
|| $val['unit'] = !$request->hasData('unit')
|
||||
) {
|
||||
return $val;
|
||||
|
|
@ -241,8 +241,8 @@ final class ApiController extends Controller
|
|||
{
|
||||
$process = new Process();
|
||||
|
||||
$process->title = $request->getDataString('name') ?? '';
|
||||
$process->unit = $request->getDataInt('unit') ?? 1;
|
||||
$process->title = $request->getDataString('name') ?? '';
|
||||
$process->unit = $request->getDataInt('unit') ?? 1;
|
||||
$process->department = $request->hasData('department') ? new NullDepartment((int) $request->getData('department')) : null;
|
||||
|
||||
return $process;
|
||||
|
|
@ -287,7 +287,7 @@ final class ApiController extends Controller
|
|||
private function validateRiskCreate(RequestAbstract $request) : array
|
||||
{
|
||||
$val = [];
|
||||
if ($val['name'] = !$request->hasData('name')
|
||||
if ($val['name'] = !$request->hasData('name')
|
||||
|| $val['unit'] = !$request->hasData('unit')
|
||||
) {
|
||||
return $val;
|
||||
|
|
@ -309,29 +309,29 @@ final class ApiController extends Controller
|
|||
{
|
||||
$risk = new Risk();
|
||||
|
||||
$risk->name = $request->getDataString('name') ?? '';
|
||||
$risk->name = $request->getDataString('name') ?? '';
|
||||
$risk->descriptionRaw = $request->getDataString('description') ?? '';
|
||||
|
||||
$risk->responsible = $request->hasData('responsible') ? new NullAccount((int) $request->getData('responsible')) : null;
|
||||
$risk->deputy = $request->hasData('deputy') ? new NullAccount((int) $request->getData('deputy')) : null;
|
||||
$risk->deputy = $request->hasData('deputy') ? new NullAccount((int) $request->getData('deputy')) : null;
|
||||
|
||||
$risk->unit = $request->getDataInt('unit') ?? 1;
|
||||
$risk->category = $request->hasData('category') ? new NullCategory((int) $request->getData('category')) : null;
|
||||
$risk->unit = $request->getDataInt('unit') ?? 1;
|
||||
$risk->category = $request->hasData('category') ? new NullCategory((int) $request->getData('category')) : null;
|
||||
$risk->department = $request->hasData('department') ? new NullDepartment((int) $request->getData('department')) : null;
|
||||
$risk->process = $request->hasData('process') ? new NullProcess((int) $request->getData('process')) : null;
|
||||
$risk->project = $request->hasData('project') ? new NullProject((int) $request->getData('project')) : null;
|
||||
$risk->process = $request->hasData('process') ? new NullProcess((int) $request->getData('process')) : null;
|
||||
$risk->project = $request->hasData('project') ? new NullProject((int) $request->getData('project')) : null;
|
||||
|
||||
$risk->grossLikelihoodR = $request->getDataFloat('grosslikelihoodratio') ?? 0.0;
|
||||
$risk->grossLikelihoodR = $request->getDataFloat('grosslikelihoodratio') ?? 0.0;
|
||||
$risk->grossLikelihoodLevel = $request->getDataInt('grosslikelihoodlevel') ?? 0;
|
||||
$risk->grossCostLevel = $request->getDataInt('grosscostlevel') ?? 0;
|
||||
$risk->grossCost = new FloatInt($request->getDataString('grosscost') ?? 0);
|
||||
$risk->grossExpectedCost = new FloatInt((int) ($risk->grossLikelihoodR / 100 * $risk->grossCost->value));
|
||||
$risk->grossCostLevel = $request->getDataInt('grosscostlevel') ?? 0;
|
||||
$risk->grossCost = new FloatInt($request->getDataString('grosscost') ?? 0);
|
||||
$risk->grossExpectedCost = new FloatInt((int) ($risk->grossLikelihoodR / 100 * $risk->grossCost->value));
|
||||
|
||||
$risk->netLikelihoodR = $request->getDataFloat('netlikelihoodratio') ?? 0.0;
|
||||
$risk->netLikelihoodR = $request->getDataFloat('netlikelihoodratio') ?? 0.0;
|
||||
$risk->netLikelihoodLevel = $request->getDataInt('netlikelihoodlevel') ?? 0;
|
||||
$risk->netCostLevel = $request->getDataInt('netcostlevel') ?? 0;
|
||||
$risk->netCost = new FloatInt($request->getDataString('netcost') ?? 0);
|
||||
$risk->netExpectedCost = new FloatInt((int) ($risk->netLikelihoodR / 100 * $risk->netCost->value));
|
||||
$risk->netCostLevel = $request->getDataInt('netcostlevel') ?? 0;
|
||||
$risk->netCost = new FloatInt($request->getDataString('netcost') ?? 0);
|
||||
$risk->netExpectedCost = new FloatInt((int) ($risk->netLikelihoodR / 100 * $risk->netCost->value));
|
||||
|
||||
return $risk;
|
||||
}
|
||||
|
|
@ -405,26 +405,26 @@ final class ApiController extends Controller
|
|||
) {
|
||||
$history = new RiskHistory();
|
||||
|
||||
$history->risk = $risk;
|
||||
$history->unit = $risk->unit;
|
||||
$history->risk = $risk;
|
||||
$history->unit = $risk->unit;
|
||||
$history->createdAt = $now;
|
||||
|
||||
$history->category = $risk->category;
|
||||
$history->category = $risk->category;
|
||||
$history->department = $risk->department;
|
||||
$history->process = $risk->process;
|
||||
$history->project = $risk->project;
|
||||
$history->process = $risk->process;
|
||||
$history->project = $risk->project;
|
||||
|
||||
$history->grossLikelihoodR = $risk->grossLikelihoodR;
|
||||
$history->grossLikelihoodR = $risk->grossLikelihoodR;
|
||||
$history->grossLikelihoodLevel = $risk->grossLikelihoodLevel;
|
||||
$history->grossCostLevel = $risk->grossCostLevel;
|
||||
$history->grossCost = $risk->grossCost;
|
||||
$history->grossExpectedCost = $risk->grossExpectedCost;
|
||||
$history->grossCostLevel = $risk->grossCostLevel;
|
||||
$history->grossCost = $risk->grossCost;
|
||||
$history->grossExpectedCost = $risk->grossExpectedCost;
|
||||
|
||||
$history->netLikelihoodR = $risk->netLikelihoodR;
|
||||
$history->netLikelihoodR = $risk->netLikelihoodR;
|
||||
$history->netLikelihoodLevel = $risk->netLikelihoodLevel;
|
||||
$history->netCostLevel = $risk->netCostLevel;
|
||||
$history->netCost = $risk->netCost;
|
||||
$history->netExpectedCost = $risk->netExpectedCost;
|
||||
$history->netCostLevel = $risk->netCostLevel;
|
||||
$history->netCost = $risk->netCost;
|
||||
$history->netExpectedCost = $risk->netExpectedCost;
|
||||
|
||||
yield $history;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ final class BackendController extends Controller
|
|||
$view->data['unit'] = $this->app->unitId;
|
||||
|
||||
$statsDepartments = [];
|
||||
$statsCategories = [];
|
||||
$statsCategories = [];
|
||||
foreach ($view->data['risks'] as $risk) {
|
||||
if ($risk->department->id !== 0) {
|
||||
if (!isset($statsDepartments[$risk->department->name])) {
|
||||
|
|
@ -117,8 +117,8 @@ final class BackendController extends Controller
|
|||
}
|
||||
|
||||
$view->data['stats-departments'] = $statsDepartments;
|
||||
$view->data['stats-categories'] = $statsCategories;
|
||||
$view->data['history'] = RiskHistoryMapper::getHistory($this->app->unitId, new \DateTime(), new \DateTime());
|
||||
$view->data['stats-categories'] = $statsCategories;
|
||||
$view->data['history'] = RiskHistoryMapper::getHistory($this->app->unitId, new \DateTime(), new \DateTime());
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/RiskManagement/Theme/Backend/risk-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003001001, $request, $response);
|
||||
|
||||
$risks = RiskMapper::getAll()->execute();
|
||||
$risks = RiskMapper::getAll()->executeGetArray();
|
||||
$view->data['risks'] = $risks;
|
||||
|
||||
return $view;
|
||||
|
|
@ -210,7 +210,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/RiskManagement/Theme/Backend/cause-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003001001, $request, $response);
|
||||
|
||||
$causes = CauseMapper::getAll()->with('risk')->execute();
|
||||
$causes = CauseMapper::getAll()->with('risk')->executeGetArray();
|
||||
$view->data['causes'] = $causes;
|
||||
|
||||
return $view;
|
||||
|
|
@ -258,7 +258,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/RiskManagement/Theme/Backend/solution-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003001001, $request, $response);
|
||||
|
||||
$solutions = SolutionMapper::getAll()->with('risk')->with('cause')->execute();
|
||||
$solutions = SolutionMapper::getAll()->with('risk')->with('cause')->executeGetArray();
|
||||
$view->data['solutions'] = $solutions;
|
||||
|
||||
return $view;
|
||||
|
|
@ -367,7 +367,7 @@ final class BackendController extends Controller
|
|||
$view->data['categories'] = CategoryMapper::getAll()
|
||||
->with('title')
|
||||
->where('title/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -462,7 +462,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/RiskManagement/Theme/Backend/process-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003001001, $request, $response);
|
||||
|
||||
$processes = ProcessMapper::getAll()->execute();
|
||||
$processes = ProcessMapper::getAll()->executeGetArray();
|
||||
$view->data['processes'] = $processes;
|
||||
|
||||
return $view;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ final class CategoryL11nMapper extends DataMapperFactory
|
|||
public const COLUMNS = [
|
||||
'riskmngmt_category_l11n_id' => ['name' => 'riskmngmt_category_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_category_l11n_title' => ['name' => 'riskmngmt_category_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
||||
'riskmngmt_category_l11n_category' => ['name' => 'riskmngmt_category_l11n_category', 'type' => 'int', 'internal' => 'ref'],
|
||||
'riskmngmt_category_l11n_category' => ['name' => 'riskmngmt_category_l11n_category', 'type' => 'int', 'internal' => 'ref'],
|
||||
'riskmngmt_category_l11n_language' => ['name' => 'riskmngmt_category_l11n_language', 'type' => 'string', 'internal' => 'language'],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ final class CategoryMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'riskmngmt_category_id' => ['name' => 'riskmngmt_category_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_category_parent' => ['name' => 'riskmngmt_category_parent', 'type' => 'int', 'internal' => 'parent'],
|
||||
'riskmngmt_category_responsible' => ['name' => 'riskmngmt_category_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'riskmngmt_category_deputy' => ['name' => 'riskmngmt_category_deputy', 'type' => 'int', 'internal' => 'deputy'],
|
||||
'riskmngmt_category_id' => ['name' => 'riskmngmt_category_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_category_parent' => ['name' => 'riskmngmt_category_parent', 'type' => 'int', 'internal' => 'parent'],
|
||||
'riskmngmt_category_responsible' => ['name' => 'riskmngmt_category_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'riskmngmt_category_deputy' => ['name' => 'riskmngmt_category_deputy', 'type' => 'int', 'internal' => 'deputy'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ declare(strict_types=1);
|
|||
namespace Modules\RiskManagement\Models;
|
||||
|
||||
use Modules\Organization\Models\Department;
|
||||
use Modules\Organization\Models\Unit;
|
||||
|
||||
/**
|
||||
* Risk Management class.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ declare(strict_types=1);
|
|||
namespace Modules\RiskManagement\Models;
|
||||
|
||||
use Modules\Organization\Models\DepartmentMapper;
|
||||
use Modules\Organization\Models\UnitMapper;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
|
|
@ -38,12 +37,12 @@ final class ProcessMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'riskmngmt_process_id' => ['name' => 'riskmngmt_process_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_process_name' => ['name' => 'riskmngmt_process_name', 'type' => 'string', 'internal' => 'title'],
|
||||
'riskmngmt_process_department' => ['name' => 'riskmngmt_process_department', 'type' => 'int', 'internal' => 'department'],
|
||||
'riskmngmt_process_unit' => ['name' => 'riskmngmt_process_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'riskmngmt_process_responsible' => ['name' => 'riskmngmt_process_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'riskmngmt_process_deputy' => ['name' => 'riskmngmt_process_deputy', 'type' => 'int', 'internal' => 'deputy'],
|
||||
'riskmngmt_process_id' => ['name' => 'riskmngmt_process_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_process_name' => ['name' => 'riskmngmt_process_name', 'type' => 'string', 'internal' => 'title'],
|
||||
'riskmngmt_process_department' => ['name' => 'riskmngmt_process_department', 'type' => 'int', 'internal' => 'department'],
|
||||
'riskmngmt_process_unit' => ['name' => 'riskmngmt_process_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'riskmngmt_process_responsible' => ['name' => 'riskmngmt_process_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'riskmngmt_process_deputy' => ['name' => 'riskmngmt_process_deputy', 'type' => 'int', 'internal' => 'deputy'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -88,15 +88,23 @@ class Risk
|
|||
public \DateTimeImmutable $createdAt;
|
||||
|
||||
public float $grossLikelihoodR = 0.0;
|
||||
|
||||
public int $grossLikelihoodLevel = 0;
|
||||
|
||||
public int $grossCostLevel = 0;
|
||||
|
||||
public FloatInt $grossCost;
|
||||
|
||||
public FloatInt $grossExpectedCost;
|
||||
|
||||
public float $netLikelihoodR = 0.0;
|
||||
|
||||
public int $netLikelihoodLevel = 0;
|
||||
|
||||
public int $netCostLevel = 0;
|
||||
|
||||
public FloatInt $netCost;
|
||||
|
||||
public FloatInt $netExpectedCost;
|
||||
|
||||
/**
|
||||
|
|
@ -106,11 +114,11 @@ class Risk
|
|||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->createdAt = new \DateTimeImmutable('now');
|
||||
$this->grossCost = new FloatInt();
|
||||
$this->createdAt = new \DateTimeImmutable('now');
|
||||
$this->grossCost = new FloatInt();
|
||||
$this->grossExpectedCost = new FloatInt();
|
||||
$this->netCost = new FloatInt();
|
||||
$this->netExpectedCost = new FloatInt();
|
||||
$this->netCost = new FloatInt();
|
||||
$this->netExpectedCost = new FloatInt();
|
||||
}
|
||||
|
||||
use \Modules\Media\Models\MediaListTrait;
|
||||
|
|
|
|||
|
|
@ -51,15 +51,23 @@ class RiskHistory
|
|||
public \DateTimeImmutable $createdAt;
|
||||
|
||||
public float $grossLikelihoodR = 0.0;
|
||||
|
||||
public int $grossLikelihoodLevel = 0;
|
||||
|
||||
public int $grossCostLevel = 0;
|
||||
|
||||
public FloatInt $grossCost;
|
||||
|
||||
public FloatInt $grossExpectedCost;
|
||||
|
||||
public float $netLikelihoodR = 0.0;
|
||||
|
||||
public int $netLikelihoodLevel = 0;
|
||||
|
||||
public int $netCostLevel = 0;
|
||||
|
||||
public FloatInt $netCost;
|
||||
|
||||
public FloatInt $netExpectedCost;
|
||||
|
||||
/**
|
||||
|
|
@ -69,13 +77,12 @@ class RiskHistory
|
|||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->risk = new NullRisk();
|
||||
$this->createdAt = new \DateTimeImmutable('now');
|
||||
$this->grossCost = new FloatInt();
|
||||
$this->risk = new NullRisk();
|
||||
$this->createdAt = new \DateTimeImmutable('now');
|
||||
$this->grossCost = new FloatInt();
|
||||
$this->grossExpectedCost = new FloatInt();
|
||||
$this->netCost = new FloatInt();
|
||||
$this->netExpectedCost = new FloatInt();
|
||||
|
||||
$this->netCost = new FloatInt();
|
||||
$this->netExpectedCost = new FloatInt();
|
||||
}
|
||||
|
||||
use \Modules\Media\Models\MediaListTrait;
|
||||
|
|
|
|||
|
|
@ -39,23 +39,23 @@ final class RiskHistoryMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'riskmngmt_history_id' => ['name' => 'riskmngmt_history_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_history_grosslikelihoodr' => ['name' => 'riskmngmt_history_grosslikelihoodr', 'type' => 'float', 'internal' => 'grossLikelihoodR'],
|
||||
'riskmngmt_history_grosslikelihoodlevel' => ['name' => 'riskmngmt_history_grosslikelihoodlevel', 'type' => 'int', 'internal' => 'grossLikelihoodLevel'],
|
||||
'riskmngmt_history_grosscostlevel' => ['name' => 'riskmngmt_history_grosscostlevel', 'type' => 'int', 'internal' => 'grossCostLevel'],
|
||||
'riskmngmt_history_grosscost' => ['name' => 'riskmngmt_history_grosscost', 'type' => 'Serializable', 'internal' => 'grossCost'],
|
||||
'riskmngmt_history_grossexpectedcost' => ['name' => 'riskmngmt_history_grossexpectedcost', 'type' => 'Serializable', 'internal' => 'grossExpectedCost'],
|
||||
'riskmngmt_history_netlikelihoodr' => ['name' => 'riskmngmt_history_netlikelihoodr', 'type' => 'float', 'internal' => 'netLikelihoodR'],
|
||||
'riskmngmt_history_netlikelihoodlevel' => ['name' => 'riskmngmt_history_netlikelihoodlevel', 'type' => 'int', 'internal' => 'netLikelihoodLevel'],
|
||||
'riskmngmt_history_netcostlevel' => ['name' => 'riskmngmt_history_netcostlevel', 'type' => 'int', 'internal' => 'netCostLevel'],
|
||||
'riskmngmt_history_netcost' => ['name' => 'riskmngmt_history_netcost', 'type' => 'Serializable', 'internal' => 'netCost'],
|
||||
'riskmngmt_history_netexpectedcost' => ['name' => 'riskmngmt_history_netexpectedcost', 'type' => 'Serializable', 'internal' => 'netExpectedCost'],
|
||||
'riskmngmt_history_unit' => ['name' => 'riskmngmt_history_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'riskmngmt_history_department' => ['name' => 'riskmngmt_history_department', 'type' => 'int', 'internal' => 'department'],
|
||||
'riskmngmt_history_category' => ['name' => 'riskmngmt_history_category', 'type' => 'int', 'internal' => 'category'],
|
||||
'riskmngmt_history_project' => ['name' => 'riskmngmt_history_project', 'type' => 'int', 'internal' => 'project'],
|
||||
'riskmngmt_history_process' => ['name' => 'riskmngmt_history_process', 'type' => 'int', 'internal' => 'process'],
|
||||
'riskmngmt_history_created_at' => ['name' => 'riskmngmt_history_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
'riskmngmt_history_id' => ['name' => 'riskmngmt_history_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_history_grosslikelihoodr' => ['name' => 'riskmngmt_history_grosslikelihoodr', 'type' => 'float', 'internal' => 'grossLikelihoodR'],
|
||||
'riskmngmt_history_grosslikelihoodlevel' => ['name' => 'riskmngmt_history_grosslikelihoodlevel', 'type' => 'int', 'internal' => 'grossLikelihoodLevel'],
|
||||
'riskmngmt_history_grosscostlevel' => ['name' => 'riskmngmt_history_grosscostlevel', 'type' => 'int', 'internal' => 'grossCostLevel'],
|
||||
'riskmngmt_history_grosscost' => ['name' => 'riskmngmt_history_grosscost', 'type' => 'Serializable', 'internal' => 'grossCost'],
|
||||
'riskmngmt_history_grossexpectedcost' => ['name' => 'riskmngmt_history_grossexpectedcost', 'type' => 'Serializable', 'internal' => 'grossExpectedCost'],
|
||||
'riskmngmt_history_netlikelihoodr' => ['name' => 'riskmngmt_history_netlikelihoodr', 'type' => 'float', 'internal' => 'netLikelihoodR'],
|
||||
'riskmngmt_history_netlikelihoodlevel' => ['name' => 'riskmngmt_history_netlikelihoodlevel', 'type' => 'int', 'internal' => 'netLikelihoodLevel'],
|
||||
'riskmngmt_history_netcostlevel' => ['name' => 'riskmngmt_history_netcostlevel', 'type' => 'int', 'internal' => 'netCostLevel'],
|
||||
'riskmngmt_history_netcost' => ['name' => 'riskmngmt_history_netcost', 'type' => 'Serializable', 'internal' => 'netCost'],
|
||||
'riskmngmt_history_netexpectedcost' => ['name' => 'riskmngmt_history_netexpectedcost', 'type' => 'Serializable', 'internal' => 'netExpectedCost'],
|
||||
'riskmngmt_history_unit' => ['name' => 'riskmngmt_history_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'riskmngmt_history_department' => ['name' => 'riskmngmt_history_department', 'type' => 'int', 'internal' => 'department'],
|
||||
'riskmngmt_history_category' => ['name' => 'riskmngmt_history_category', 'type' => 'int', 'internal' => 'category'],
|
||||
'riskmngmt_history_project' => ['name' => 'riskmngmt_history_project', 'type' => 'int', 'internal' => 'project'],
|
||||
'riskmngmt_history_process' => ['name' => 'riskmngmt_history_process', 'type' => 'int', 'internal' => 'process'],
|
||||
'riskmngmt_history_created_at' => ['name' => 'riskmngmt_history_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -84,7 +84,7 @@ final class RiskHistoryMapper extends DataMapperFactory
|
|||
'risk' => [
|
||||
'mapper' => RiskMapper::class,
|
||||
'external' => 'riskmngmt_history_risk',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,29 +40,29 @@ final class RiskMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'riskmngmt_risk_id' => ['name' => 'riskmngmt_risk_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_risk_status' => ['name' => 'riskmngmt_risk_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'riskmngmt_risk_name' => ['name' => 'riskmngmt_risk_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'riskmngmt_risk_description' => ['name' => 'riskmngmt_risk_description', 'type' => 'string', 'internal' => 'description'],
|
||||
'riskmngmt_risk_descriptionraw' => ['name' => 'riskmngmt_risk_descriptionraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
|
||||
'riskmngmt_risk_grosslikelihoodr' => ['name' => 'riskmngmt_risk_grosslikelihoodr', 'type' => 'float', 'internal' => 'grossLikelihoodR'],
|
||||
'riskmngmt_risk_grosslikelihoodlevel' => ['name' => 'riskmngmt_risk_grosslikelihoodlevel', 'type' => 'int', 'internal' => 'grossLikelihoodLevel'],
|
||||
'riskmngmt_risk_grosscostlevel' => ['name' => 'riskmngmt_risk_grosscostlevel', 'type' => 'int', 'internal' => 'grossCostLevel'],
|
||||
'riskmngmt_risk_grosscost' => ['name' => 'riskmngmt_risk_grosscost', 'type' => 'Serializable', 'internal' => 'grossCost'],
|
||||
'riskmngmt_risk_grossexpectedcost' => ['name' => 'riskmngmt_risk_grossexpectedcost', 'type' => 'Serializable', 'internal' => 'grossExpectedCost'],
|
||||
'riskmngmt_risk_netlikelihoodr' => ['name' => 'riskmngmt_risk_netlikelihoodr', 'type' => 'float', 'internal' => 'netLikelihoodR'],
|
||||
'riskmngmt_risk_netlikelihoodlevel' => ['name' => 'riskmngmt_risk_netlikelihoodlevel', 'type' => 'int', 'internal' => 'netLikelihoodLevel'],
|
||||
'riskmngmt_risk_netcostlevel' => ['name' => 'riskmngmt_risk_netcostlevel', 'type' => 'int', 'internal' => 'netCostLevel'],
|
||||
'riskmngmt_risk_netcost' => ['name' => 'riskmngmt_risk_netcost', 'type' => 'Serializable', 'internal' => 'netCost'],
|
||||
'riskmngmt_risk_netexpectedcost' => ['name' => 'riskmngmt_risk_netexpectedcost', 'type' => 'Serializable', 'internal' => 'netExpectedCost'],
|
||||
'riskmngmt_risk_unit' => ['name' => 'riskmngmt_risk_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'riskmngmt_risk_department' => ['name' => 'riskmngmt_risk_department', 'type' => 'int', 'internal' => 'department'],
|
||||
'riskmngmt_risk_category' => ['name' => 'riskmngmt_risk_category', 'type' => 'int', 'internal' => 'category'],
|
||||
'riskmngmt_risk_project' => ['name' => 'riskmngmt_risk_project', 'type' => 'int', 'internal' => 'project'],
|
||||
'riskmngmt_risk_process' => ['name' => 'riskmngmt_risk_process', 'type' => 'int', 'internal' => 'process'],
|
||||
'riskmngmt_risk_responsible' => ['name' => 'riskmngmt_risk_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'riskmngmt_risk_deputy' => ['name' => 'riskmngmt_risk_deputy', 'type' => 'int', 'internal' => 'deputy'],
|
||||
'riskmngmt_risk_created_at' => ['name' => 'riskmngmt_risk_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
'riskmngmt_risk_id' => ['name' => 'riskmngmt_risk_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'riskmngmt_risk_status' => ['name' => 'riskmngmt_risk_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'riskmngmt_risk_name' => ['name' => 'riskmngmt_risk_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'riskmngmt_risk_description' => ['name' => 'riskmngmt_risk_description', 'type' => 'string', 'internal' => 'description'],
|
||||
'riskmngmt_risk_descriptionraw' => ['name' => 'riskmngmt_risk_descriptionraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
|
||||
'riskmngmt_risk_grosslikelihoodr' => ['name' => 'riskmngmt_risk_grosslikelihoodr', 'type' => 'float', 'internal' => 'grossLikelihoodR'],
|
||||
'riskmngmt_risk_grosslikelihoodlevel' => ['name' => 'riskmngmt_risk_grosslikelihoodlevel', 'type' => 'int', 'internal' => 'grossLikelihoodLevel'],
|
||||
'riskmngmt_risk_grosscostlevel' => ['name' => 'riskmngmt_risk_grosscostlevel', 'type' => 'int', 'internal' => 'grossCostLevel'],
|
||||
'riskmngmt_risk_grosscost' => ['name' => 'riskmngmt_risk_grosscost', 'type' => 'Serializable', 'internal' => 'grossCost'],
|
||||
'riskmngmt_risk_grossexpectedcost' => ['name' => 'riskmngmt_risk_grossexpectedcost', 'type' => 'Serializable', 'internal' => 'grossExpectedCost'],
|
||||
'riskmngmt_risk_netlikelihoodr' => ['name' => 'riskmngmt_risk_netlikelihoodr', 'type' => 'float', 'internal' => 'netLikelihoodR'],
|
||||
'riskmngmt_risk_netlikelihoodlevel' => ['name' => 'riskmngmt_risk_netlikelihoodlevel', 'type' => 'int', 'internal' => 'netLikelihoodLevel'],
|
||||
'riskmngmt_risk_netcostlevel' => ['name' => 'riskmngmt_risk_netcostlevel', 'type' => 'int', 'internal' => 'netCostLevel'],
|
||||
'riskmngmt_risk_netcost' => ['name' => 'riskmngmt_risk_netcost', 'type' => 'Serializable', 'internal' => 'netCost'],
|
||||
'riskmngmt_risk_netexpectedcost' => ['name' => 'riskmngmt_risk_netexpectedcost', 'type' => 'Serializable', 'internal' => 'netExpectedCost'],
|
||||
'riskmngmt_risk_unit' => ['name' => 'riskmngmt_risk_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'riskmngmt_risk_department' => ['name' => 'riskmngmt_risk_department', 'type' => 'int', 'internal' => 'department'],
|
||||
'riskmngmt_risk_category' => ['name' => 'riskmngmt_risk_category', 'type' => 'int', 'internal' => 'category'],
|
||||
'riskmngmt_risk_project' => ['name' => 'riskmngmt_risk_project', 'type' => 'int', 'internal' => 'project'],
|
||||
'riskmngmt_risk_process' => ['name' => 'riskmngmt_risk_process', 'type' => 'int', 'internal' => 'process'],
|
||||
'riskmngmt_risk_responsible' => ['name' => 'riskmngmt_risk_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'riskmngmt_risk_deputy' => ['name' => 'riskmngmt_risk_deputy', 'type' => 'int', 'internal' => 'deputy'],
|
||||
'riskmngmt_risk_created_at' => ['name' => 'riskmngmt_risk_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -128,7 +128,7 @@ final class RiskMapper extends DataMapperFactory
|
|||
'department' => [
|
||||
'mapper' => DepartmentMapper::class,
|
||||
'external' => 'riskmngmt_risk_department',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ return ['RiskManagement' => [
|
|||
'UserGroup' => 'Benutzergruppe',
|
||||
'Value' => 'Wert',
|
||||
'Watchlist' => 'Beobachtungsliste',
|
||||
'Net' => 'Netto',
|
||||
'Gross' => 'Brutto',
|
||||
'Likelihood' => 'Wahrscheinlichkeit',
|
||||
'Net' => 'Netto',
|
||||
'Gross' => 'Brutto',
|
||||
'Likelihood' => 'Wahrscheinlichkeit',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ return ['RiskManagement' => [
|
|||
'UserGroup' => 'User/Group',
|
||||
'Value' => 'Value',
|
||||
'Watchlist' => 'Watchlist',
|
||||
'Net' => 'Net',
|
||||
'Gross' => 'Gross',
|
||||
'Likelihood' => 'Likelihood',
|
||||
'Net' => 'Net',
|
||||
'Gross' => 'Gross',
|
||||
'Likelihood' => 'Likelihood',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -15,15 +15,15 @@ declare(strict_types=1);
|
|||
$department = $this->data['department'];
|
||||
|
||||
$categories = [];
|
||||
$projects = [];
|
||||
$processes = [];
|
||||
$projects = [];
|
||||
$processes = [];
|
||||
|
||||
$causes = [];
|
||||
$causes = [];
|
||||
$solutions = [];
|
||||
foreach ($this->data['risks'] as $risk) {
|
||||
$categories[$risk->category?->id] = $risk->category;
|
||||
$projects[$risk->project?->id] = $risk->project;
|
||||
$processes[$risk->process?->id] = $risk->process;
|
||||
$projects[$risk->project?->id] = $risk->project;
|
||||
$processes[$risk->process?->id] = $risk->process;
|
||||
|
||||
foreach ($risk->causes as $cause) {
|
||||
$causes[$cause->id] = $cause;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user