|
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 AppBundle\Entity\Agreement; |
|
24
|
|
|
use AppBundle\Entity\Company; |
|
25
|
|
|
use AppBundle\Entity\Department; |
|
26
|
|
|
use AppBundle\Entity\Group; |
|
27
|
|
|
use AppBundle\Entity\NonSchoolDay; |
|
28
|
|
|
use AppBundle\Entity\Person; |
|
29
|
|
|
use AppBundle\Entity\Student; |
|
30
|
|
|
use AppBundle\Entity\Teacher; |
|
31
|
|
|
use AppBundle\Entity\Training; |
|
32
|
|
|
use AppBundle\Entity\Workcenter; |
|
33
|
|
|
use Doctrine\ORM\EntityManager; |
|
34
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
|
35
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
|
36
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
|
37
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @Route("/admin") |
|
41
|
|
|
*/ |
|
42
|
|
|
class AdminController extends Controller |
|
43
|
|
|
{ |
|
44
|
|
|
public static $DEPARTMENT_ENTITY_DATA = [ |
|
45
|
|
|
'entity' => 'department', |
|
46
|
|
|
'entityClassName' => 'AppBundle\Entity\Department', |
|
47
|
|
|
'entityFormType' => 'AppBundle\Form\Type\DepartmentType', |
|
48
|
|
|
'query' => 'SELECT d FROM AppBundle:Department d LEFT JOIN d.head h LEFT JOIN h.person p', |
|
49
|
|
|
'defaultSortFieldName' => 'd.name', |
|
50
|
|
|
'columns' => [ |
|
51
|
|
|
['size' => '5', 'sort_field' => 'd.name', 'name' => 'department.name'], |
|
52
|
|
|
['size' => '4', 'sort_field' => 'p.displayName', 'name' => 'department.head'], |
|
53
|
|
|
], |
|
54
|
|
|
'data_columns' => ['name', 'head'] |
|
55
|
|
|
]; |
|
56
|
|
|
|
|
57
|
|
|
public static $COMPANY_ENTITY_DATA = [ |
|
58
|
|
|
'entity' => 'company', |
|
59
|
|
|
'entityClassName' => 'AppBundle\Entity\Company', |
|
60
|
|
|
'entityFormType' => 'AppBundle\Form\Type\CompanyType', |
|
61
|
|
|
'query' => 'SELECT c FROM AppBundle:Company c', |
|
62
|
|
|
'defaultSortFieldName' => 'c.name', |
|
63
|
|
|
'columns' => [ |
|
64
|
|
|
['size' => '2', 'sort_field' => 'c.code', 'name' => 'company.code'], |
|
65
|
|
|
['size' => '7', 'sort_field' => 'c.name', 'name' => 'company.name'], |
|
66
|
|
|
], |
|
67
|
|
|
'data_columns' => ['code', 'name'] |
|
68
|
|
|
]; |
|
69
|
|
|
|
|
70
|
|
|
public static $WORKCENTER_ENTITY_DATA = [ |
|
71
|
|
|
'entity' => 'workcenter', |
|
72
|
|
|
'entityClassName' => 'AppBundle\Entity\Workcenter', |
|
73
|
|
|
'entityFormType' => 'AppBundle\Form\Type\WorkcenterType', |
|
74
|
|
|
'query' => 'SELECT w FROM AppBundle:Workcenter w JOIN w.company c', |
|
75
|
|
|
'defaultSortFieldName' => 'c.name', |
|
76
|
|
|
'columns' => [ |
|
77
|
|
|
['size' => '4', 'sort_field' => 'c.name', 'name' => 'form.company'], |
|
78
|
|
|
['size' => '5', 'sort_field' => 'w.name', 'name' => 'form.name'], |
|
79
|
|
|
], |
|
80
|
|
|
'data_columns' => ['company', 'name'] |
|
81
|
|
|
]; |
|
82
|
|
|
|
|
83
|
|
|
public static $GROUP_ENTITY_DATA = [ |
|
84
|
|
|
'entity' => 'group', |
|
85
|
|
|
'entityClassName' => 'AppBundle\Entity\Group', |
|
86
|
|
|
'entityFormType' => 'AppBundle\Form\Type\GroupType', |
|
87
|
|
|
'query' => 'SELECT g FROM AppBundle:Group g JOIN g.training t', |
|
88
|
|
|
'defaultSortFieldName' => 'g.name', |
|
89
|
|
|
'columns' => [ |
|
90
|
|
|
['size' => '4', 'sort_field' => 'g.name', 'name' => 'form.name'], |
|
91
|
|
|
['size' => '5', 'sort_field' => 'g.training', 'name' => 'form.training'] |
|
92
|
|
|
], |
|
93
|
|
|
'data_columns' => ['name', 'training'] |
|
94
|
|
|
]; |
|
95
|
|
|
|
|
96
|
|
|
public static $TRAINING_ENTITY_DATA = [ |
|
97
|
|
|
'entity' => 'training', |
|
98
|
|
|
'entityClassName' => 'AppBundle\Entity\Training', |
|
99
|
|
|
'entityFormType' => 'AppBundle\Form\Type\TrainingType', |
|
100
|
|
|
'query' => 'SELECT t FROM AppBundle:Training t JOIN t.department d', |
|
101
|
|
|
'defaultSortFieldName' => 't.name', |
|
102
|
|
|
'columns' => [ |
|
103
|
|
|
['size' => '4', 'sort_field' => 't.name', 'name' => 'form.name'], |
|
104
|
|
|
['size' => '3', 'sort_field' => 't.department', 'name' => 'form.department'], |
|
105
|
|
|
['size' => '2', 'sort_field' => 't.programHours', 'name' => 'form.program_hours'] |
|
106
|
|
|
], |
|
107
|
|
|
'data_columns' => ['name', 'department', 'programHours'] |
|
108
|
|
|
]; |
|
109
|
|
|
|
|
110
|
|
|
public static $NON_SCHOOL_DAY_ENTITY_DATA = [ |
|
111
|
|
|
'entity' => 'non_school_day', |
|
112
|
|
|
'entityClassName' => 'AppBundle\Entity\NonSchoolDay', |
|
113
|
|
|
'entityFormType' => 'AppBundle\Form\Type\NonSchoolDayType', |
|
114
|
|
|
'query' => 'SELECT n FROM AppBundle:NonSchoolDay n', |
|
115
|
|
|
'defaultSortFieldName' => 'n.date', |
|
116
|
|
|
'columns' => [ |
|
117
|
|
|
['size' => '2', 'sort_field' => 'n.date', 'name' => 'form.date'], |
|
118
|
|
|
['size' => '7', 'sort_field' => 'n.name', 'name' => 'form.name'] |
|
119
|
|
|
], |
|
120
|
|
|
'data_columns' => ['date', 'name'] |
|
121
|
|
|
]; |
|
122
|
|
|
|
|
123
|
|
|
public static $TEACHER_ENTITY_DATA = [ |
|
124
|
|
|
'entity' => 'teacher', |
|
125
|
|
|
'entityClassName' => 'AppBundle\Entity\Teacher', |
|
126
|
|
|
'entityFormType' => 'AppBundle\Form\Type\TeacherType', |
|
127
|
|
|
'query' => 'SELECT t FROM AppBundle:Teacher t JOIN t.person p', |
|
128
|
|
|
'defaultSortFieldName' => 'p.lastName', |
|
129
|
|
|
'columns' => [ |
|
130
|
|
|
['size' => '5', 'sort_field' => 'p.lastName', 'name' => 'form.last_name'], |
|
131
|
|
|
['size' => '4', 'sort_field' => 'p.firstName', 'name' => 'form.first_name'] |
|
132
|
|
|
], |
|
133
|
|
|
'data_columns' => ['lastName', 'firstName'] |
|
134
|
|
|
]; |
|
135
|
|
|
|
|
136
|
|
|
public static $STUDENT_ENTITY_DATA = [ |
|
137
|
|
|
'entity' => 'student', |
|
138
|
|
|
'entityClassName' => 'AppBundle\Entity\Student', |
|
139
|
|
|
'entityFormType' => 'AppBundle\Form\Type\StudentType', |
|
140
|
|
|
'query' => 'SELECT s FROM AppBundle:Student s JOIN s.person p', |
|
141
|
|
|
'defaultSortFieldName' => 'p.lastName', |
|
142
|
|
|
'columns' => [ |
|
143
|
|
|
['size' => '4', 'sort_field' => 'p.lastName', 'name' => 'form.last_name'], |
|
144
|
|
|
['size' => '3', 'sort_field' => 'p.firstName', 'name' => 'form.first_name'], |
|
145
|
|
|
['size' => '2', 'sort_field' => 's.group', 'name' => 'form.group'] |
|
146
|
|
|
], |
|
147
|
|
|
'data_columns' => ['lastName', 'firstName', 'group'] |
|
148
|
|
|
]; |
|
149
|
|
|
|
|
150
|
|
|
public static $AGREEMENT_ENTITY_DATA = [ |
|
151
|
|
|
'entity' => 'agreement', |
|
152
|
|
|
'entityClassName' => 'AppBundle\Entity\Agreement', |
|
153
|
|
|
'entityFormType' => 'AppBundle\Form\Type\AgreementType', |
|
154
|
|
|
'query' => 'SELECT a FROM AppBundle:Agreement a JOIN a.student s JOIN s.person p', |
|
155
|
|
|
'defaultSortFieldName' => 'p.lastName', |
|
156
|
|
|
'columns' => [ |
|
157
|
|
|
['size' => '4', 'sort_field' => 'p.displayName', 'name' => 'form.student'], |
|
158
|
|
|
['size' => '5', 'sort_field' => 'a.workcenter', 'name' => 'form.workcenter'] |
|
159
|
|
|
], |
|
160
|
|
|
'data_columns' => ['student', 'workcenter'] |
|
161
|
|
|
]; |
|
162
|
|
|
|
|
163
|
|
|
public static $WORKTUTOR_ENTITY_DATA = [ |
|
164
|
|
|
'entity' => 'work_tutor', |
|
165
|
|
|
'entityClassName' => 'AppBundle\Entity\WorkTutor', |
|
166
|
|
|
'entityFormType' => 'AppBundle\Form\Type\WorkTutorType', |
|
167
|
|
|
'query' => 'SELECT w FROM AppBundle:WorkTutor w JOIN w.person p', |
|
168
|
|
|
'defaultSortFieldName' => 'p.lastName', |
|
169
|
|
|
'columns' => [ |
|
170
|
|
|
['size' => '4', 'sort_field' => 'p.lastName', 'name' => 'form.last_name'], |
|
171
|
|
|
['size' => '5', 'sort_field' => 'w.company', 'name' => 'form.company'] |
|
172
|
|
|
], |
|
173
|
|
|
'data_columns' => ['person', 'company',] |
|
174
|
|
|
]; |
|
175
|
|
|
|
|
176
|
|
|
/** |
|
177
|
|
|
* @Route("/", name="admin_menu", methods={"GET"}) |
|
178
|
|
|
* @Security("is_granted('ROLE_ADMIN')") |
|
179
|
|
|
*/ |
|
180
|
|
|
public function indexAction() |
|
181
|
|
|
{ |
|
182
|
|
|
$menuItem = $this->get('app.menu_builders_chain')->getMenuItemByRouteName('admin_menu'); |
|
183
|
|
|
|
|
184
|
|
|
return $this->render('admin/menu.html.twig', |
|
185
|
|
|
[ |
|
186
|
|
|
'menu_item' => $menuItem |
|
187
|
|
|
]); |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
public function genericIndexAction($entityData, Request $request) |
|
191
|
|
|
{ |
|
192
|
|
|
/** @var EntityManager $em */ |
|
193
|
|
|
$em = $this->getDoctrine()->getManager(); |
|
194
|
|
|
|
|
195
|
|
|
$query = $em->createQuery($entityData['query']); |
|
196
|
|
|
|
|
197
|
|
|
$paginator = $this->get('knp_paginator'); |
|
198
|
|
|
$pagination = $paginator->paginate( |
|
199
|
|
|
$query, |
|
200
|
|
|
$request->query->getInt('page', 1), |
|
201
|
|
|
$this->getParameter('page.size'), |
|
202
|
|
|
[ |
|
203
|
|
|
'defaultSortFieldName' => $entityData['defaultSortFieldName'], |
|
204
|
|
|
'defaultSortDirection' => 'asc' |
|
205
|
|
|
] |
|
206
|
|
|
); |
|
207
|
|
|
|
|
208
|
|
|
return $this->render('admin/manage_generic.html.twig', |
|
209
|
|
|
[ |
|
210
|
|
|
'menu_item' => $this->get('app.menu_builders_chain')->getMenuItemByRouteName($request->get('_route')), |
|
211
|
|
|
'title' => null, |
|
212
|
|
|
'pagination' => $pagination, |
|
213
|
|
|
'entity' => $entityData['entity'], |
|
214
|
|
|
'columns' => $entityData['columns'], |
|
215
|
|
|
'data_columns' => $entityData['data_columns'] |
|
216
|
|
|
]); |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
public function genericFormAction($entityData, $element, Request $request) |
|
220
|
|
|
{ |
|
221
|
|
|
$em = $this->getDoctrine()->getManager(); |
|
222
|
|
|
|
|
223
|
|
|
$new = (null === $element); |
|
224
|
|
|
if ($new) { |
|
225
|
|
|
$element = new $entityData['entityClassName']; |
|
226
|
|
|
if (method_exists($element, 'setPerson')) { |
|
227
|
|
|
$person = new Person(); |
|
228
|
|
|
$element->setPerson($person); |
|
229
|
|
|
$em->persist($person); |
|
230
|
|
|
} |
|
231
|
|
|
$em->persist($element); |
|
232
|
|
|
} |
|
233
|
|
|
|
|
234
|
|
|
$form = $this->createForm($entityData['entityFormType'], $element); |
|
235
|
|
|
|
|
236
|
|
|
$form->handleRequest($request); |
|
237
|
|
|
|
|
238
|
|
|
$menuItem = $this->get('app.menu_builders_chain')->getMenuItemByRouteName('admin_' . $entityData['entity']); |
|
239
|
|
|
|
|
240
|
|
|
if ($form->isSubmitted() && $form->isValid()) { |
|
241
|
|
|
|
|
242
|
|
|
// Probar a guardar los cambios |
|
243
|
|
|
try { |
|
244
|
|
|
$em->flush(); |
|
245
|
|
|
$this->addFlash('success', $this->get('translator')->trans('alert.saved', [], 'user')); |
|
246
|
|
|
return $this->redirectToRoute($menuItem->getRouteName(), $menuItem->getRouteParams()); |
|
247
|
|
|
} catch (\Exception $e) { |
|
248
|
|
|
$this->addFlash('error', $this->get('translator')->trans('alert.not_saved', [], 'user')); |
|
249
|
|
|
} |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
$title = ((string) $element) ?: $this->get('translator')->trans('form.new', [], $entityData['entity']); |
|
253
|
|
|
|
|
254
|
|
|
return $this->render('admin/form_generic.html.twig', [ |
|
255
|
|
|
'form' => $form->createView(), |
|
256
|
|
|
'new' => $new, |
|
257
|
|
|
'menu_item' => $menuItem, |
|
258
|
|
|
'breadcrumb' => [ |
|
259
|
|
|
['fixed' => $title] |
|
260
|
|
|
], |
|
261
|
|
|
'element' => $element, |
|
262
|
|
|
'title' => $title, |
|
263
|
|
|
'entity' => $entityData['entity'] |
|
264
|
|
|
]); |
|
265
|
|
|
} |
|
266
|
|
|
|
|
267
|
|
|
public function genericDeleteAction($entityData, $element, Request $request) |
|
268
|
|
|
{ |
|
269
|
|
|
if ('POST' === $request->getMethod() && $request->request->has('delete')) { |
|
270
|
|
|
|
|
271
|
|
|
// Eliminar el departamento de la base de datos |
|
272
|
|
|
$this->getDoctrine()->getManager()->remove($element); |
|
273
|
|
|
try { |
|
274
|
|
|
$this->getDoctrine()->getManager()->flush(); |
|
275
|
|
|
$this->addFlash('success', $this->get('translator')->trans('alert.deleted', [], $entityData['entity'])); |
|
276
|
|
|
} |
|
277
|
|
|
catch(\Exception $e) { |
|
278
|
|
|
$this->addFlash('error', $this->get('translator')->trans('alert.not_deleted', [], $entityData['entity'])); |
|
279
|
|
|
} |
|
280
|
|
|
return $this->redirectToRoute('admin_' . $entityData['entity']); |
|
281
|
|
|
} |
|
282
|
|
|
|
|
283
|
|
|
$title = (string) $element; |
|
284
|
|
|
|
|
285
|
|
|
$breadcrumb = [ |
|
286
|
|
|
['fixed' => $title, 'path' => 'admin_' . $entityData['entity'] . '_form', 'options' => ['id' => $element->getId()]], |
|
287
|
|
|
['caption' => 'menu.delete'] |
|
288
|
|
|
]; |
|
289
|
|
|
|
|
290
|
|
|
return $this->render(':admin:delete_generic.html.twig', [ |
|
291
|
|
|
'menu_item' => $this->get('app.menu_builders_chain')->getMenuItemByRouteName('admin_departments'), |
|
292
|
|
|
'breadcrumb' => $breadcrumb, |
|
293
|
|
|
'title' => $title, |
|
294
|
|
|
'element' => $element, |
|
295
|
|
|
'entity' => $entityData['entity'] |
|
296
|
|
|
]); |
|
297
|
|
|
} |
|
298
|
|
|
|
|
299
|
|
|
/** |
|
300
|
|
|
* @Route("/departamentos", name="admin_department", methods={"GET"}) |
|
301
|
|
|
*/ |
|
302
|
|
|
public function departmentsIndexAction(Request $request) |
|
303
|
|
|
{ |
|
304
|
|
|
return $this->genericIndexAction(self::$DEPARTMENT_ENTITY_DATA, $request); |
|
305
|
|
|
} |
|
306
|
|
|
|
|
307
|
|
|
/** |
|
308
|
|
|
* @Route("/departamentos/nuevo", name="admin_department_new", methods={"GET", "POST"}) |
|
309
|
|
|
* @Route("/departamentos/{id}", name="admin_department_form", methods={"GET", "POST"}, requirements={"id": "\d+"}) |
|
310
|
|
|
*/ |
|
311
|
|
|
public function departmentsFormAction(Department $element = null, Request $request) |
|
312
|
|
|
{ |
|
313
|
|
|
return $this->genericFormAction(self::$DEPARTMENT_ENTITY_DATA, $element, $request); |
|
314
|
|
|
} |
|
315
|
|
|
|
|
316
|
|
|
/** |
|
317
|
|
|
* @Route("/departamentos/eliminar/{id}", name="admin_department_delete", methods={"GET", "POST"}, requirements={"id": "\d+"} ) |
|
318
|
|
|
*/ |
|
319
|
|
|
public function deleteElementAction(Department $element, Request $request) |
|
320
|
|
|
{ |
|
321
|
|
|
return $this->genericDeleteAction(self::$DEPARTMENT_ENTITY_DATA, $element, $request); |
|
322
|
|
|
} |
|
323
|
|
|
|
|
324
|
|
|
/** |
|
325
|
|
|
* @Route("/empresas", name="admin_company", methods={"GET"}) |
|
326
|
|
|
*/ |
|
327
|
|
|
public function companiesIndexAction(Request $request) |
|
328
|
|
|
{ |
|
329
|
|
|
return $this->genericIndexAction(self::$COMPANY_ENTITY_DATA, $request); |
|
330
|
|
|
} |
|
331
|
|
|
|
|
332
|
|
|
/** |
|
333
|
|
|
* @Route("/empresas/nueva", name="admin_company_new", methods={"GET", "POST"}) |
|
334
|
|
|
* @Route("/empresas/{id}", name="admin_company_form", methods={"GET", "POST"}, requirements={"id": "\d+"}) |
|
335
|
|
|
*/ |
|
336
|
|
|
public function companyFormAction(Company $element = null, Request $request) |
|
337
|
|
|
{ |
|
338
|
|
|
return $this->genericFormAction(self::$COMPANY_ENTITY_DATA, $element, $request); |
|
339
|
|
|
} |
|
340
|
|
|
|
|
341
|
|
|
/** |
|
342
|
|
|
* @Route("/empresas/eliminar/{id}", name="admin_company_delete", methods={"GET", "POST"}, requirements={"id": "\d+"} ) |
|
343
|
|
|
*/ |
|
344
|
|
|
public function companyDeleteAction(Company $element, Request $request) |
|
345
|
|
|
{ |
|
346
|
|
|
return $this->genericDeleteAction(self::$COMPANY_ENTITY_DATA, $element, $request); |
|
347
|
|
|
} |
|
348
|
|
|
|
|
349
|
|
|
/** |
|
350
|
|
|
* @Route("/grupos", name="admin_group", methods={"GET"}) |
|
351
|
|
|
*/ |
|
352
|
|
|
public function groupIndexAction(Request $request) |
|
353
|
|
|
{ |
|
354
|
|
|
return $this->genericIndexAction(self::$GROUP_ENTITY_DATA, $request); |
|
355
|
|
|
} |
|
356
|
|
|
|
|
357
|
|
|
/** |
|
358
|
|
|
* @Route("/grupos/nuevo", name="admin_group_new", methods={"GET", "POST"}) |
|
359
|
|
|
* @Route("/grupos/{id}", name="admin_group_form", methods={"GET", "POST"}, requirements={"id": "\d+"}) |
|
360
|
|
|
*/ |
|
361
|
|
|
public function groupFormAction(Group $element = null, Request $request) |
|
362
|
|
|
{ |
|
363
|
|
|
return $this->genericFormAction(self::$GROUP_ENTITY_DATA, $element, $request); |
|
364
|
|
|
} |
|
365
|
|
|
|
|
366
|
|
|
/** |
|
367
|
|
|
* @Route("/grupos/eliminar/{id}", name="admin_group_delete", methods={"GET", "POST"}, requirements={"id": "\d+"} ) |
|
368
|
|
|
*/ |
|
369
|
|
|
public function groupDeleteAction(Group $element, Request $request) |
|
370
|
|
|
{ |
|
371
|
|
|
return $this->genericDeleteAction(self::$GROUP_ENTITY_DATA, $element, $request); |
|
372
|
|
|
} |
|
373
|
|
|
|
|
374
|
|
|
/** |
|
375
|
|
|
* @Route("/ensenanzas", name="admin_training", methods={"GET"}) |
|
376
|
|
|
*/ |
|
377
|
|
|
public function trainingIndexAction(Request $request) |
|
378
|
|
|
{ |
|
379
|
|
|
return $this->genericIndexAction(self::$TRAINING_ENTITY_DATA, $request); |
|
380
|
|
|
} |
|
381
|
|
|
|
|
382
|
|
|
/** |
|
383
|
|
|
* @Route("/ensenanzas/nueva", name="admin_training_new", methods={"GET", "POST"}) |
|
384
|
|
|
* @Route("/ensenanzas/{id}", name="admin_training_form", methods={"GET", "POST"}, requirements={"id": "\d+"}) |
|
385
|
|
|
*/ |
|
386
|
|
|
public function trainingFormAction(Training $element = null, Request $request) |
|
387
|
|
|
{ |
|
388
|
|
|
return $this->genericFormAction(self::$TRAINING_ENTITY_DATA, $element, $request); |
|
389
|
|
|
} |
|
390
|
|
|
|
|
391
|
|
|
/** |
|
392
|
|
|
* @Route("/ensenanzas/eliminar/{id}", name="admin_training_delete", methods={"GET", "POST"}, requirements={"id": "\d+"} ) |
|
393
|
|
|
*/ |
|
394
|
|
|
public function trainingDeleteAction(Training $element, Request $request) |
|
395
|
|
|
{ |
|
396
|
|
|
return $this->genericDeleteAction(self::$TRAINING_ENTITY_DATA, $element, $request); |
|
397
|
|
|
} |
|
398
|
|
|
|
|
399
|
|
|
/** |
|
400
|
|
|
* @Route("/diasnolectivos", name="admin_non_school_day", methods={"GET"}) |
|
401
|
|
|
*/ |
|
402
|
|
|
public function nonSchoolDayIndexAction(Request $request) |
|
403
|
|
|
{ |
|
404
|
|
|
return $this->genericIndexAction(self::$NON_SCHOOL_DAY_ENTITY_DATA, $request); |
|
405
|
|
|
} |
|
406
|
|
|
|
|
407
|
|
|
/** |
|
408
|
|
|
* @Route("/diasnolectivos/nuevo", name="admin_non_school_day_new", methods={"GET", "POST"}) |
|
409
|
|
|
* @Route("/diasnolectivos/{id}", name="admin_non_school_day_form", methods={"GET", "POST"}) |
|
410
|
|
|
*/ |
|
411
|
|
|
public function nonSchoolDayFormAction(NonSchoolDay $element = null, Request $request) |
|
412
|
|
|
{ |
|
413
|
|
|
return $this->genericFormAction(self::$NON_SCHOOL_DAY_ENTITY_DATA, $element, $request); |
|
414
|
|
|
} |
|
415
|
|
|
|
|
416
|
|
|
/** |
|
417
|
|
|
* @Route("/diasnolectivos/eliminar/{id}", name="admin_non_school_day_delete", methods={"GET", "POST"}) |
|
418
|
|
|
*/ |
|
419
|
|
|
public function workcenterDeleteAction(Workcenter $element, Request $request) |
|
420
|
|
|
{ |
|
421
|
|
|
return $this->genericDeleteAction(self::$WORKCENTER_ENTITY_DATA, $element, $request); |
|
422
|
|
|
} |
|
423
|
|
|
|
|
424
|
|
|
/** |
|
425
|
|
|
* @Route("/centros", name="admin_workcenter", methods={"GET"}) |
|
426
|
|
|
*/ |
|
427
|
|
|
public function workcenterIndexAction(Request $request) |
|
428
|
|
|
{ |
|
429
|
|
|
return $this->genericIndexAction(self::$WORKCENTER_ENTITY_DATA, $request); |
|
430
|
|
|
} |
|
431
|
|
|
|
|
432
|
|
|
/** |
|
433
|
|
|
* @Route("/centros/nuevo", name="admin_workcenter_new", methods={"GET", "POST"}) |
|
434
|
|
|
* @Route("/centros/{id}", name="admin_workcenter_form", methods={"GET", "POST"}) |
|
435
|
|
|
*/ |
|
436
|
|
|
public function workcenterFormAction(Workcenter $element = null, Request $request) |
|
437
|
|
|
{ |
|
438
|
|
|
return $this->genericFormAction(self::$WORKCENTER_ENTITY_DATA, $element, $request); |
|
439
|
|
|
} |
|
440
|
|
|
|
|
441
|
|
|
/** |
|
442
|
|
|
* @Route("/centros/eliminar/{id}", name="admin_workcenter_delete", methods={"GET", "POST"}) |
|
443
|
|
|
*/ |
|
444
|
|
|
public function nonSchoolDayDeleteAction(Workcenter $element, Request $request) |
|
445
|
|
|
{ |
|
446
|
|
|
return $this->genericDeleteAction(self::$WORKCENTER_ENTITY_DATA, $element, $request); |
|
447
|
|
|
} |
|
448
|
|
|
|
|
449
|
|
|
/** |
|
450
|
|
|
* @Route("/profesorado", name="admin_teacher", methods={"GET"}) |
|
451
|
|
|
*/ |
|
452
|
|
|
public function teacherIndexAction(Request $request) |
|
453
|
|
|
{ |
|
454
|
|
|
return $this->genericIndexAction(self::$TEACHER_ENTITY_DATA, $request); |
|
455
|
|
|
} |
|
456
|
|
|
|
|
457
|
|
|
/** |
|
458
|
|
|
* @Route("/profesorado/nuevo", name="admin_teacher_new", methods={"GET", "POST"}) |
|
459
|
|
|
* @Route("/profesorado/{id}", name="admin_teacher_form", methods={"GET", "POST"}) |
|
460
|
|
|
*/ |
|
461
|
|
|
public function teacherFormAction(Teacher $element = null, Request $request) |
|
462
|
|
|
{ |
|
463
|
|
|
return $this->genericFormAction(self::$TEACHER_ENTITY_DATA, $element, $request); |
|
464
|
|
|
} |
|
465
|
|
|
|
|
466
|
|
|
/** |
|
467
|
|
|
* @Route("/profesorado/eliminar/{id}", name="admin_teacher_delete", methods={"GET", "POST"}) |
|
468
|
|
|
*/ |
|
469
|
|
|
public function teacherDeleteAction(Teacher $element, Request $request) |
|
470
|
|
|
{ |
|
471
|
|
|
return $this->genericDeleteAction(self::$TEACHER_ENTITY_DATA, $element, $request); |
|
472
|
|
|
} |
|
473
|
|
|
|
|
474
|
|
|
/** |
|
475
|
|
|
* @Route("/alumnado", name="admin_student", methods={"GET"}) |
|
476
|
|
|
*/ |
|
477
|
|
|
public function studentIndexAction(Request $request) |
|
478
|
|
|
{ |
|
479
|
|
|
return $this->genericIndexAction(self::$STUDENT_ENTITY_DATA, $request); |
|
480
|
|
|
} |
|
481
|
|
|
|
|
482
|
|
|
/** |
|
483
|
|
|
* @Route("/alumnado/nuevo", name="admin_student_new", methods={"GET", "POST"}) |
|
484
|
|
|
* @Route("/alumnado/{id}", name="admin_student_form", methods={"GET", "POST"}) |
|
485
|
|
|
*/ |
|
486
|
|
|
public function studentFormAction(Student $element = null, Request $request) |
|
487
|
|
|
{ |
|
488
|
|
|
return $this->genericFormAction(self::$STUDENT_ENTITY_DATA, $element, $request); |
|
489
|
|
|
} |
|
490
|
|
|
|
|
491
|
|
|
/** |
|
492
|
|
|
* @Route("/alumnado/eliminar/{id}", name="admin_student_delete", methods={"GET", "POST"}) |
|
493
|
|
|
*/ |
|
494
|
|
|
public function studentDeleteAction(Student $element, Request $request) |
|
495
|
|
|
{ |
|
496
|
|
|
return $this->genericDeleteAction(self::$STUDENT_ENTITY_DATA, $element, $request); |
|
497
|
|
|
} |
|
498
|
|
|
|
|
499
|
|
|
/** |
|
500
|
|
|
* @Route("/acuerdos", name="admin_agreement", methods={"GET"}) |
|
501
|
|
|
*/ |
|
502
|
|
|
public function agreementIndexAction(Request $request) |
|
503
|
|
|
{ |
|
504
|
|
|
return $this->genericIndexAction(self::$AGREEMENT_ENTITY_DATA, $request); |
|
505
|
|
|
} |
|
506
|
|
|
|
|
507
|
|
|
/** |
|
508
|
|
|
* @Route("/acuerdos/nuevo", name="admin_agreement_new", methods={"GET", "POST"}) |
|
509
|
|
|
* @Route("/acuerdos/{id}", name="admin_agreement_form", methods={"GET", "POST"}) |
|
510
|
|
|
*/ |
|
511
|
|
|
public function agreementFormAction(Agreement $element = null, Request $request) |
|
512
|
|
|
{ |
|
513
|
|
|
return $this->genericFormAction(self::$AGREEMENT_ENTITY_DATA, $element, $request); |
|
514
|
|
|
} |
|
515
|
|
|
|
|
516
|
|
|
/** |
|
517
|
|
|
* @Route("/acuerdos/eliminar/{id}", name="admin_agreement_delete", methods={"GET", "POST"}) |
|
518
|
|
|
*/ |
|
519
|
|
|
public function agreementDeleteAction(Agreement $element, Request $request) |
|
520
|
|
|
{ |
|
521
|
|
|
return $this->genericDeleteAction(self::$AGREEMENT_ENTITY_DATA, $element, $request); |
|
522
|
|
|
} |
|
523
|
|
|
|
|
524
|
|
|
/** |
|
525
|
|
|
* @Route("/tutorialaboral", name="admin_work_tutor", methods={"GET"}) |
|
526
|
|
|
*/ |
|
527
|
|
|
public function workTutorIndexAction(Request $request) |
|
528
|
|
|
{ |
|
529
|
|
|
return $this->genericIndexAction(self::$WORKTUTOR_ENTITY_DATA, $request); |
|
530
|
|
|
} |
|
531
|
|
|
|
|
532
|
|
|
/** |
|
533
|
|
|
* @Route("/tutorialaboral/nuevo", name="admin_work_tutor_new", methods={"GET", "POST"}) |
|
534
|
|
|
* @Route("/tutorialaboral/{id}", name="admin_work_tutor_form", methods={"GET", "POST"}) |
|
535
|
|
|
*/ |
|
536
|
|
|
public function workTutorFormAction(Agreement $element = null, Request $request) |
|
537
|
|
|
{ |
|
538
|
|
|
return $this->genericFormAction(self::$WORKTUTOR_ENTITY_DATA, $element, $request); |
|
539
|
|
|
} |
|
540
|
|
|
|
|
541
|
|
|
/** |
|
542
|
|
|
* @Route("/tutorialaboral/eliminar/{id}", name="admin_work_tutor_delete", methods={"GET", "POST"}) |
|
543
|
|
|
*/ |
|
544
|
|
|
public function workTutorDeleteAction(Agreement $element, Request $request) |
|
545
|
|
|
{ |
|
546
|
|
|
return $this->genericDeleteAction(self::$WORKTUTOR_ENTITY_DATA, $element, $request); |
|
547
|
|
|
} |
|
548
|
|
|
} |
|
549
|
|
|
|