| @@ 338-342 (lines=5) @@ | ||
| 335 | $form = $this->createForm('AppBundle\Form\Type\WorkdayType', $workday); |
|
| 336 | $form->handleRequest($request); |
|
| 337 | ||
| 338 | if ($form->isValid() && $form->isSubmitted()) { |
|
| 339 | $this->getDoctrine()->getManager()->flush(); |
|
| 340 | $this->addFlash('success', $this->get('translator')->trans('alert.saved', [], 'calendar')); |
|
| 341 | return $this->redirectToRoute('admin_group_student_calendar', ['id' => $workday->getAgreement()->getId()]); |
|
| 342 | } |
|
| 343 | $student = $workday->getAgreement()->getStudent(); |
|
| 344 | ||
| 345 | $dow = ((6 + (int) $workday->getDate()->format('w')) % 7); |
|
| @@ 112-117 (lines=6) @@ | ||
| 109 | $form = $this->createForm('AppBundle\Form\Type\VisitType', $visit); |
|
| 110 | $form->handleRequest($request); |
|
| 111 | ||
| 112 | if ($form->isValid() && $form->isSubmitted()) { |
|
| 113 | $this->getDoctrine()->getManager()->persist($visit); |
|
| 114 | $this->getDoctrine()->getManager()->flush(); |
|
| 115 | $this->addFlash('success', $this->get('translator')->trans('alert.saved', [], 'visit')); |
|
| 116 | return $this->redirectToRoute('visit_workcenter_index', ['id' => $tutor->getId()]); |
|
| 117 | } |
|
| 118 | $title = $this->get('translator')->trans($visit->getId() ? 'form.view' : 'form.new', [], 'visit'); |
|
| 119 | ||
| 120 | return $this->render('visit/form_visit.html.twig', [ |
|