| @@ 95-110 (lines=16) @@ | ||
| 92 | { |
|
| 93 | $em = $this->getDoctrine()->getManager(); |
|
| 94 | ||
| 95 | if ($request->request->has('ids')) { |
|
| 96 | try { |
|
| 97 | $ids = $request->request->get('ids'); |
|
| 98 | ||
| 99 | $em->createQuery('UPDATE AppBundle:Workday w SET w.locked = :locked WHERE w.id IN (:ids) AND w.agreement = :agreement') |
|
| 100 | ->setParameter('locked', $status) |
|
| 101 | ->setParameter('ids', $ids) |
|
| 102 | ->setParameter('agreement', $agreement) |
|
| 103 | ->execute(); |
|
| 104 | ||
| 105 | $em->flush(); |
|
| 106 | $this->addFlash('success', $this->get('translator')->trans('alert.locked', [], 'calendar')); |
|
| 107 | } catch (\Exception $e) { |
|
| 108 | $this->addFlash('error', $this->get('translator')->trans('alert.locked_error', [], 'calendar')); |
|
| 109 | } |
|
| 110 | } |
|
| 111 | return $this->redirectToRoute('agreement_calendar', ['id' => $agreement->getId()]); |
|
| 112 | } |
|
| 113 | ||
| @@ 172-187 (lines=16) @@ | ||
| 169 | ||
| 170 | $em = $this->getDoctrine()->getManager(); |
|
| 171 | ||
| 172 | if ($request->request->has('ids')) { |
|
| 173 | try { |
|
| 174 | $ids = $request->request->get('ids'); |
|
| 175 | ||
| 176 | $em->createQuery('UPDATE AppBundle:Workday w SET w.locked = :locked WHERE w.id IN (:ids) AND w.agreement = :agreement') |
|
| 177 | ->setParameter('locked', $status) |
|
| 178 | ->setParameter('ids', $ids) |
|
| 179 | ->setParameter('agreement', $agreement) |
|
| 180 | ->execute(); |
|
| 181 | ||
| 182 | $em->flush(); |
|
| 183 | $this->addFlash('success', $this->get('translator')->trans('alert.locked', [], 'calendar')); |
|
| 184 | } catch (\Exception $e) { |
|
| 185 | $this->addFlash('error', $this->get('translator')->trans('alert.locked_error', [], 'calendar')); |
|
| 186 | } |
|
| 187 | } |
|
| 188 | return $this->redirectToRoute('admin_group_student_calendar', ['id' => $agreement->getId()]); |
|
| 189 | } |
|
| 190 | ||