createForm(ApplicationStatusType::class, $statusDto); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $this->eventDispatcher->dispatch(new ApplicationStatusEvent($statusDto), ApplicationStatusEvent::NAME); $application ->setStatus($statusDto->getStatus()) ->setComment($statusDto->getComment()) ->setCommentVisible($statusDto->isCommentVisible()) ; $this->entityManager->flush(); $this->addFlash('success', 'Der Status der Bewerbung wurde aktualisiert'); $this->logger->info('Update application status', [ 'application_id' => $application->getId(), 'status_new' => $statusDto->getStatus(), 'teamer' => (string) $application->getTeamer(), ]); return new HxRedirectResponse($this->generateUrl('app_administrative_assignment_detail', [ 'uuid' => $application->getAssignment()->getUuid(), ])); } return $this->render('admin/application/modal_status.html.twig', [ 'form' => $form->createView(), ]); } }