Skip to content
Snippets Groups Projects
Commit d80e987f authored by sebastien dupuy's avatar sebastien dupuy
Browse files

issue #10 Correction #1 [Évaluation] Niveau des mesures du plan d'action incorrect

parent 0bc809b2
No related branches found
No related tags found
No related merge requests found
Pipeline #40848 failed
......@@ -194,17 +194,20 @@ public function save(EvaluationRepository $repository, EvaluationRequest $reques
$evaluation->save();
// Ajout du niveau supérieur pour les mesures preconisées
$preconizedMeasure = array_slice($this->repository->getBestMeasuresForEvaluation($evaluation), 0, 4);
foreach ($evaluation->measureLevels as $measureLevel) {
$measureLevelpreconized = MeasureLevel::whereId($measureLevel->id)
->first();
if ($measureLevelpreconized && in_array($measureLevelpreconized['measure_id'], $preconizedMeasure, true)) {
$measureLevelpreconized->expected_level = $measureLevelpreconized['actual_level'] < 3 ? $measureLevelpreconized['actual_level'] + 1 : null;
if ((Evaluation::STEP_ACTIONS === intval($evaluation->current_step))){
// Ajout du niveau supérieur pour les mesures preconisées
$preconizedMeasure = array_slice($this->repository->getBestMeasuresForEvaluation($evaluation), 0, 4);
foreach ($evaluation->measureLevels as $measureLevel) {
$measureLevelpreconized = MeasureLevel::whereId($measureLevel->id)
->first();
if ($measureLevelpreconized && in_array($measureLevelpreconized['measure_id'], $preconizedMeasure, true)) {
$measureLevelpreconized->expected_level = $measureLevelpreconized['actual_level'] < 3 ? $measureLevelpreconized['actual_level'] + 1 : null;
}
$measureLevelpreconized->save();
}
$measureLevelpreconized->save();
}
// si mofification d'un step, reinitialisation des steps suivants
if (isset($data['draft']) && $data['draft']) {
if (1 === $evaluation->current_step) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment