|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
ÁTICA - Aplicación web para la gestión documental de centros educativos |
|
4
|
|
|
|
|
5
|
|
|
Copyright (C) 2015-2016: Luis Ramón López López |
|
6
|
|
|
|
|
7
|
|
|
This program is free software: you can redistribute it and/or modify |
|
8
|
|
|
it under the terms of the GNU Affero General Public License as published by |
|
9
|
|
|
the Free Software Foundation, either version 3 of the License, or |
|
10
|
|
|
(at your option) any later version. |
|
11
|
|
|
|
|
12
|
|
|
This program is distributed in the hope that it will be useful, |
|
13
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15
|
|
|
GNU Affero General Public License for more details. |
|
16
|
|
|
|
|
17
|
|
|
You should have received a copy of the GNU Affero General Public License |
|
18
|
|
|
along with this program. If not, see [http://www.gnu.org/licenses/]. |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
namespace AppBundle\Controller; |
|
22
|
|
|
|
|
23
|
|
|
use Doctrine\ORM\EntityManager; |
|
24
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
|
25
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
|
26
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @Route("/programa") |
|
30
|
|
|
* @Security("is_granted('ROLE_ADMIN')") |
|
31
|
|
|
*/ |
|
32
|
|
|
class ProgramController extends Controller |
|
33
|
|
|
{ |
|
34
|
|
|
/** |
|
35
|
|
|
* @Route("", name="admin_program", methods={"GET"}) |
|
36
|
|
|
*/ |
|
37
|
|
|
public function teachingIndexAction() |
|
38
|
|
|
{ |
|
39
|
|
|
/** @var EntityManager $em */ |
|
40
|
|
|
$em = $this->getDoctrine()->getManager(); |
|
41
|
|
|
|
|
42
|
|
|
$teachingQuery = $em->createQuery('SELECT t FROM AppBundle:Training t ORDER BY t.name'); |
|
43
|
|
|
|
|
44
|
|
|
$items = $teachingQuery->getResult(); |
|
45
|
|
|
|
|
46
|
|
|
return $this->render('activity/training_index.html.twig', |
|
47
|
|
|
[ |
|
48
|
|
|
'menu_item' => $this->get('app.menu_builders_chain')->getMenuItemByRouteName('admin_program'), |
|
49
|
|
|
'title' => null, |
|
50
|
|
|
'elements' => $items |
|
51
|
|
|
]); |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|