| @@ 60-71 (lines=12) @@ | ||
| 57 | ||
| 58 | $workdays = new ArrayCollection(); |
|
| 59 | ||
| 60 | if ($form->isValid() && $form->isSubmitted()) { |
|
| 61 | $workdays = $this->getDoctrine()->getManager()->getRepository('AppBundle:Workday')->createCalendar($calendar, $agreement); |
|
| 62 | ||
| 63 | if ($request->request->has('submit')) { |
|
| 64 | $this->getDoctrine()->getManager()->flush(); |
|
| 65 | $agreement->setFromDate($this->getDoctrine()->getManager()->getRepository('AppBundle:Agreement')->getRealFromDate($agreement)); |
|
| 66 | $agreement->setToDate($this->getDoctrine()->getManager()->getRepository('AppBundle:Agreement')->getRealToDate($agreement)); |
|
| 67 | $this->getDoctrine()->getManager()->flush(); |
|
| 68 | $this->addFlash('success', $this->get('translator')->trans('alert.saved', [], 'calendar')); |
|
| 69 | return $this->redirectToRoute('agreement_calendar', ['id' => $agreement->getId()]); |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| 73 | $calendar = $this->getDoctrine()->getManager()->getRepository('AppBundle:Workday')->getArrayCalendar($workdays); |
|
| 74 | ||
| @@ 263-274 (lines=12) @@ | ||
| 260 | ||
| 261 | $workdays = new ArrayCollection(); |
|
| 262 | ||
| 263 | if ($form->isValid() && $form->isSubmitted()) { |
|
| 264 | $workdays = $this->getDoctrine()->getManager()->getRepository('AppBundle:Workday')->createCalendar($calendar, $agreement); |
|
| 265 | ||
| 266 | if ($request->request->has('submit')) { |
|
| 267 | $this->getDoctrine()->getManager()->flush(); |
|
| 268 | $agreement->setFromDate($this->getDoctrine()->getManager()->getRepository('AppBundle:Agreement')->getRealFromDate($agreement)); |
|
| 269 | $agreement->setToDate($this->getDoctrine()->getManager()->getRepository('AppBundle:Agreement')->getRealToDate($agreement)); |
|
| 270 | $this->getDoctrine()->getManager()->flush(); |
|
| 271 | $this->addFlash('success', $this->get('translator')->trans('alert.saved', [], 'calendar')); |
|
| 272 | return $this->redirectToRoute('admin_group_student_calendar', ['id' => $agreement->getId()]); |
|
| 273 | } |
|
| 274 | } |
|
| 275 | ||
| 276 | $student = $agreement->getStudent(); |
|
| 277 | ||