Fixed tour storno flagging

This commit is contained in:
Torsten 2024-02-03 21:33:13 +01:00
parent 1b6dc17ead
commit ebd663e842
6 changed files with 936 additions and 7 deletions

View file

@ -274,7 +274,7 @@
public function update(Request $request, Tour $tour)
{
Log::info("Tour:update");
Log::info("Tour:update !");
$tour = Tour::find($request->input('tour_id'));
$request->validate(
@ -313,13 +313,22 @@
*/
}
$tour->name = $request->input('name');
if ($request->beschreibung) $tour->beschreibung = $request->input('beschreibung');
if ($request->start) $tour->start = Tour::toDBDate($request->input('start'));
if ($request->deadline) $tour->deadline = Tour::toDBDate($request->input('deadline'));
if ($request->max_participants) $tour->max_participants = $request->input('max_participants');
$tour->is_cancelled = ($request->has('is_cancelled'));
if ($request->is_cancelled) {
$tour->is_cancelled = true;
$tour->status="STORNIERT";
} else {
$tour->is_cancelled=false;
$tour->status="FINDET STATT";
}
if ($request->bericht) $tour->bericht = $request->bericht;
$tour->save();
@ -460,4 +469,4 @@
Log::info("Image saved as $dirPath/$name" . '.jpg');
}
}
}