Skip to content
Snippets Groups Projects
Commit d24eedc1 authored by Seb's avatar Seb
Browse files

correctifs sauvegarde measure_level

parent ecf9f854
Branches dev-soluris
No related tags found
No related merge requests found
Pipeline #29175 failed
......@@ -112,19 +112,19 @@ public function save(EvaluationRequest $request, $id = null)
// get list of actuals measures
$previous_measures_array = MeasureLevel::where('evaluation_id', $evaluation['id'])->pluck('id')->toArray();
// dd($data['measure_levels']);
foreach ($data['measure_levels'] as $measure_level) {
if (null !== $measure_level['id']) {
$measure_level = MeasureLevel::find($measure_level['id']);
foreach ($data['measure_levels'] as $put_measure_level) {
if (isset($put_measure_level['id'])) {
$measure_level = MeasureLevel::find($put_measure_level['id']);
} else {
$measure_level = new MeasureLevel();
}
$measure_level->measure_id = $measure_level['measure_id'];
$measure_level->measure_id = $put_measure_level['measure_id'];
$measure_level->evaluation_id = $evaluation['id'];
$measure_level->actual_level = $measure_level['actual_level'];
$measure_level->expected_level = $measure_level['expected_level'] ? $measure_level['expected_level'] : null;
$measure_level->manager_id = $measure_level['manager_id'] ? $measure_level['manager_id'] : null;
$measure_level->end_date = $measure_level['end_date'] ? $measure_level['end_date'] : null;
$measure_level->actual_level = $put_measure_level['actual_level'] ?? null;
$measure_level->expected_level = $put_measure_level['expected_level'] ?? null;
$measure_level->manager_id = $put_measure_level['manager_id'] ?? null;
$measure_level->end_date = $put_measure_level['end_date'] ?? null;
$measure_level->save();
if (in_array($measure_level['id'], $previous_measures_array)) {
......
......@@ -5,9 +5,5 @@
"/images/logo_madis_2020_couleur.png": "/images/logo_madis_2020_couleur.png",
"/images/logo_madis_2020_favicon.png": "/images/logo_madis_2020_favicon.png",
"/images/logo_madis_2020_favicon_white.png": "/images/logo_madis_2020_favicon_white.png",
"/images/soluris-logo-white.png": "/images/soluris-logo-white.png",
"/images/vendor/vuejs-datatable/docs/icons.png": "/images/vendor/vuejs-datatable/docs/icons.png",
"/images/vendor/vuejs-datatable/docs/icons@2x.png": "/images/vendor/vuejs-datatable/docs/icons@2x.png",
"/images/vendor/vuejs-datatable/docs/widgets.png": "/images/vendor/vuejs-datatable/docs/widgets.png",
"/images/vendor/vuejs-datatable/docs/widgets@2x.png": "/images/vendor/vuejs-datatable/docs/widgets@2x.png"
"/images/soluris-logo-white.png": "/images/soluris-logo-white.png"
}
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