| @@ 170-174 (lines=5) @@ | ||
| 167 | $form = $this->createForm('AppBundle\Form\Type\WorkdayType', $workday); |
|
| 168 | $form->handleRequest($request); |
|
| 169 | ||
| 170 | if ($form->isValid() && $form->isSubmitted()) { |
|
| 171 | $this->getDoctrine()->getManager()->flush(); |
|
| 172 | $this->addFlash('success', $this->get('translator')->trans('alert.saved', [], 'calendar')); |
|
| 173 | return $this->redirectToRoute('agreement_calendar', ['id' => $workday->getAgreement()->getId()]); |
|
| 174 | } |
|
| 175 | return $this->render('calendar/agreement_calendar_form.html.twig', [ |
|
| 176 | 'menu_item' => $this->get('app.menu_builders_chain')->getMenuItemByRouteName('admin_agreement'), |
|
| 177 | 'breadcrumb' => [ |
|
| @@ 363-367 (lines=5) @@ | ||
| 360 | $form = $this->createForm('AppBundle\Form\Type\WorkdayType', $workday); |
|
| 361 | $form->handleRequest($request); |
|
| 362 | ||
| 363 | if ($form->isValid() && $form->isSubmitted()) { |
|
| 364 | $this->getDoctrine()->getManager()->flush(); |
|
| 365 | $this->addFlash('success', $this->get('translator')->trans('alert.saved', [], 'calendar')); |
|
| 366 | return $this->redirectToRoute('admin_group_student_calendar', ['id' => $workday->getAgreement()->getId()]); |
|
| 367 | } |
|
| 368 | $student = $workday->getAgreement()->getStudent(); |
|
| 369 | ||
| 370 | $dow = ((6 + (int) $workday->getDate()->format('w')) % 7); |
|