| @@ 39-56 (lines=18) @@ | ||
| 36 | /** |
|
| 37 | * @Route("", name="expense_tutor_index", methods={"GET"}) |
|
| 38 | */ |
|
| 39 | public function teacherIndexAction() |
|
| 40 | { |
|
| 41 | /** @var User $user */ |
|
| 42 | $user = $this->getUser(); |
|
| 43 | if ($this->isGranted('ROLE_FINANCIAL_MANAGER')) { |
|
| 44 | $expenses = $this->getDoctrine()->getManager()->getRepository('AppBundle:User')->getEducationalTutorsExpenseSummary(); |
|
| 45 | } elseif ($this->isGranted('ROLE_DEPARTMENT_HEAD')) { |
|
| 46 | $expenses = $this->getDoctrine()->getManager()->getRepository('AppBundle:User')->getEducationalTutorsByDepartmentsExpenseSummary($user->getDirects()); |
|
| 47 | } else { |
|
| 48 | return $this->expenseIndexAction($user); |
|
| 49 | } |
|
| 50 | ||
| 51 | return $this->render('expense/tutor_index.html.twig', [ |
|
| 52 | 'menu_item' => $this->get('app.menu_builders_chain')->getMenuItemByRouteName('expense_tutor_index'), |
|
| 53 | 'title' => null, |
|
| 54 | 'elements' => $expenses |
|
| 55 | ]); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * @Route("/{id}", name="expense_index", methods={"GET"}) |
|
| @@ 39-56 (lines=18) @@ | ||
| 36 | /** |
|
| 37 | * @Route("", name="visit_index", methods={"GET"}) |
|
| 38 | */ |
|
| 39 | public function teacherIndexAction() |
|
| 40 | { |
|
| 41 | /** @var User $user */ |
|
| 42 | $user = $this->getUser(); |
|
| 43 | if ($this->isGranted('ROLE_ADMIN')) { |
|
| 44 | $visits = $this->getDoctrine()->getManager()->getRepository('AppBundle:User')->getEducationalTutorsAgreementSummary(); |
|
| 45 | } elseif ($this->isGranted('ROLE_DEPARTMENT_HEAD')) { |
|
| 46 | $visits = $this->getDoctrine()->getManager()->getRepository('AppBundle:User')->getEducationalTutorsByDepartmentsAgreementSummary($user->getDirects()); |
|
| 47 | } else { |
|
| 48 | return $this->visitIndexAction($user); |
|
| 49 | } |
|
| 50 | ||
| 51 | return $this->render('visit/tutor_index.html.twig', [ |
|
| 52 | 'menu_item' => $this->get('app.menu_builders_chain')->getMenuItemByRouteName('visit_index'), |
|
| 53 | 'title' => null, |
|
| 54 | 'elements' => $visits |
|
| 55 | ]); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * @Route("/{id}", name="visit_workcenter_index", methods={"GET"}) |
|