Commit d6b35223b52941c176f54f27ab36f18a3c8bd61e
1 parent
7e525a06b1
Exists in
master
Creando a la solicitud de adscripcion como un servicio mas y cambiar todo los scripts relacionados
Showing
11 changed files
with
221 additions
and
61 deletions
Show diff stats
app/Resources/views/base_app.html.twig
... | ... | @@ -67,15 +67,7 @@ |
67 | 67 | </ul> |
68 | 68 | <ul class="pull-right"> |
69 | 69 | {% if is_granted('ROLE_COORDINADOR_REGIONAL') %} |
70 | - <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-list"></i><span>Ver Adscripciones</span> <b class="caret"></b></a> | |
71 | - <ul class="dropdown-menu"> | |
72 | - <li> <a data-toggle="modal" data-target="#buscarAdscripcion">Buscar Adscripcion</a></li> | |
73 | - <li><a href="{{ path('cea_adscripciones')}}">En espera de Aprobación</a></li> | |
74 | - <li><a href="{{ path('cea_adscripciones', { 'estatus': 1 })}}">Aprobadas</a></li> | |
75 | - <li><a href="{{ path('cea_adscripciones', { 'estatus': 3 })}}">Rechazadas</a></li> | |
76 | - </ul> | |
77 | - </li> | |
78 | - | |
70 | + | |
79 | 71 | <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-group"></i><span>Ver Solicitudes</span> <b class="caret"></b></a> |
80 | 72 | <ul class="dropdown-menu"> |
81 | 73 | <li> <a data-toggle="modal" data-target="#buscarServicios">Buscar Servicios</a></li> | ... | ... |
app/Resources/views/base_memo.html.twig
... | ... | @@ -124,7 +124,7 @@ |
124 | 124 | </table> |
125 | 125 | </div> |
126 | 126 | |
127 | - <p class="text-justify cuerpo-memo">Reciba un cordial saludo bolivariano y revolucionario de parte del equipo | |
127 | + {%block cuerpo %} <p class="text-justify cuerpo-memo"> Reciba un cordial saludo bolivariano y revolucionario de parte del equipo | |
128 | 128 | de trabajo de este Centro de Estudios Ambientales. La presente es para |
129 | 129 | informar que este Centro reconoce su antigüedad con fines de ascenso en |
130 | 130 | escalafones de la carrera universitaria en esta Institución tomando en cuenta |
... | ... | @@ -137,7 +137,7 @@ |
137 | 137 | por única vez, los años, los meses y los días faltantes para satisfacer |
138 | 138 | la permanencia legal exigida en el correspondiente escalafón que tuviese |
139 | 139 | el trabajador académico en el momento de hacer su solicitud de ascenso |
140 | - inmediato".</i> | |
140 | + inmediato".</i> | |
141 | 141 | |
142 | 142 | <br> En tal sentido, tomando la información |
143 | 143 | suministrada por Usted se tiene que: </p> |
... | ... | @@ -164,6 +164,7 @@ |
164 | 164 | <p class="text-justify"> Por lo tanto desde su primera contratación |
165 | 165 | en la UBV hasta el Concurso de Oposición <strong>se reconoce una antigüedad de |
166 | 166 | {%block antiguedad %}{%endblock%}</strong></p> |
167 | + {% endblock %} | |
167 | 168 | <p class="text-justify">Sin más a que hacer referencia, y dándole las gracias por su atención se despide. </p> |
168 | 169 | <div class="text-center firma"> |
169 | 170 | ... | ... |
app/Resources/views/cea/servicios.html.twig
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <div class="container"> |
5 | 5 | <div class="widget widget-table action-table"> |
6 | 6 | <div class="widget-header"> <i class="icon-th-list"></i> |
7 | - <h3>Solicitudes de {{ tipo }}: Estatus {{ estatus_servicio }}</h3> | |
7 | + <h3>Solicitudes al CEA con Estatus {{ estatus_servicio }}</h3> | |
8 | 8 | </div> |
9 | 9 | <!-- /widget-header --> |
10 | 10 | <div class="widget-content"> |
... | ... | @@ -13,14 +13,15 @@ |
13 | 13 | <tr> |
14 | 14 | <th> Id </th> |
15 | 15 | <th> Datos del Docente </th> |
16 | - <th> Area de Adscripción</th> | |
17 | - <th> Eje Adscripción</th> | |
18 | - <th> Estado</th> | |
16 | + <th> Tipo de Solicitud</th> | |
17 | + <th> Area / PfG Docente</th> | |
18 | + <th> Eje del Docente</th> | |
19 | + <th> Estado del Eje</th> | |
19 | 20 | <th> Acciones</th> |
20 | 21 | </tr> |
21 | 22 | </thead> |
22 | 23 | <tbody> |
23 | - {% for servicio in servicios %} | |
24 | + {%for servicio in servicios %} | |
24 | 25 | {% if not is_granted('ROLE_COORDINADOR_NACIONAL') %} |
25 | 26 | {% if servicio.idRolInstitucion.idInstitucion.idEjeParroquia.idEje == app.user.idRolInstitucion.idInstitucion.idEjeParroquia.idEje %} |
26 | 27 | <tr> |
... | ... | @@ -32,6 +33,7 @@ |
32 | 33 | |
33 | 34 | |
34 | 35 | </td> |
36 | + <td>{{servicio.idRolInstitucion}}</td> | |
35 | 37 | <td> |
36 | 38 | {{servicio.idRolInstitucion.IdRol.IdAreaInstitucion.nombre}} |
37 | 39 | </td> |
... | ... | @@ -41,8 +43,7 @@ |
41 | 43 | <td>{{servicio.idRolInstitucion.idInstitucion.idEjeParroquia.idParroquia.idMunicipio.idEstado}} </td> |
42 | 44 | <td> |
43 | 45 | <a href="{{ path('cea_servicio_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a> |
44 | - <a href="javascript:;" class="btn btn-xs btn-success"><i class="fa fa-check"> </i></a> | |
45 | - <a href="javascript:;" class="btn btn-danger btn-xs"><i class="fa fa-times"> </i></a></td> | |
46 | + | |
46 | 47 | </td> |
47 | 48 | |
48 | 49 | </tr> |
... | ... | @@ -58,6 +59,7 @@ |
58 | 59 | |
59 | 60 | |
60 | 61 | </td> |
62 | + <td>{{servicio.idServicioCe.nombre}}</td> | |
61 | 63 | <td> |
62 | 64 | {{servicio.idRolInstitucion.IdRol.IdAreaInstitucion.nombre}} |
63 | 65 | </td> |
... | ... | @@ -66,11 +68,12 @@ |
66 | 68 | </td> |
67 | 69 | <td>{{servicio.idRolInstitucion.idInstitucion.idEjeParroquia.idParroquia.idMunicipio.idEstado}} </td> |
68 | 70 | <td> |
69 | - <a href="{{ path('cea_servicio_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a> | |
70 | - <a href="javascript:;" class="btn btn-xs btn-success"><i class="fa fa-check"> </i></a> | |
71 | - <a href="javascript:;" class="btn btn-danger btn-xs"><i class="fa fa-times"> </i></a></td> | |
71 | + {% if servicio.idServicioCe.id == 1 %} | |
72 | + <a href="{{ path('cea_servicio_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a> | |
73 | + {% elseif servicio.idServicioCe.id == 2 %} | |
74 | + <a href="{{ path('cea_adscripcion_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a> | |
75 | + {% endif %} | |
72 | 76 | </td> |
73 | - | |
74 | 77 | </tr> |
75 | 78 | {%endif%} |
76 | 79 | {% endfor %} | ... | ... |
app/Resources/views/cea/solicitudes_mostar.html.twig
... | ... | @@ -20,12 +20,12 @@ |
20 | 20 | </h4> |
21 | 21 | </div> |
22 | 22 | <div class="col-md-3"> |
23 | - {% if adscripcion.idEstatus.id == 1 %} | |
24 | - <h4 class="alert alert-success">Estatus <strong>{{adscripcion.idEstatus}}</strong> | |
25 | - {% elseif adscripcion.idEstatus.id == 3 %} | |
26 | - <h4 class="alert alert-danger">Estatus <strong>{{adscripcion.idEstatus}}</strong> | |
23 | + {% if servicio.idEstatus.id == 1 %} | |
24 | + <h4 class="alert alert-success">Estatus <strong>{{servicio.idEstatus}}</strong> | |
25 | + {% elseif servicio.idEstatus.id == 3 %} | |
26 | + <h4 class="alert alert-danger">Estatus <strong>{{servicio.idEstatus}}</strong> | |
27 | 27 | {% else %} |
28 | - <h4 class="alert alert-warning">Estatus <strong>{{adscripcion.idEstatus}}</strong> | |
28 | + <h4 class="alert alert-warning">Estatus <strong>{{servicio.idEstatus}}</strong> | |
29 | 29 | {% endif %} |
30 | 30 | </h4> |
31 | 31 | </div> | ... | ... |
app/Resources/views/memorando/adscripcion.html.twig
... | ... | @@ -0,0 +1,71 @@ |
1 | +{% extends 'base_memo.html.twig' %} | |
2 | + | |
3 | +{% block para %} | |
4 | + {{adscripcion.idRolInstitucion.idRol.idPersona.primerNombre}} | |
5 | + {{adscripcion.idRolInstitucion.idRol.idPersona.segundoNombre}} | |
6 | + {{adscripcion.idRolInstitucion.idRol.idPersona.primerApellido}} | |
7 | + {{adscripcion.idRolInstitucion.idRol.idPersona.segundoApellido}} | |
8 | + ({{adscripcion.idRolInstitucion.idRol.idPersona.cedulaPasaporte}}) | |
9 | + <br>Trabajador Académico adscrito al Centro de Estudios Ambientales | |
10 | +{%endblock %} | |
11 | + | |
12 | +{% block numero %}{{ correlativo }}{% endblock %} | |
13 | + | |
14 | +{% block coordinador %} | |
15 | + Prof. Alexis Lozada | |
16 | + <br>Director (E) Del Centro de Estudios Ambientales. | |
17 | +{% endblock %} | |
18 | + | |
19 | + | |
20 | +{% block asunto %} | |
21 | + Adscripción al Centro de Estudios Ambientales | |
22 | +{%endblock%} | |
23 | + | |
24 | +{% block fecha %} | |
25 | + {{ "now"|date("d/m/Y") }} | |
26 | +{%endblock%} | |
27 | + | |
28 | + {% block cuerpo %} | |
29 | + <p class="text-justify cuerpo-memo"> | |
30 | + Reciba un cordial saludo bolivariano y revolucionario de parte del equipo | |
31 | + de trabajo de este Centro de Estudios Ambientales. La presente es para | |
32 | + informar que este Centro reconoce, basado en su interés en el área de | |
33 | + <i>{{adscripcion.idLineaInvestigacion.idAreaInvestigacion |capitalize }}</i> | |
34 | + bajo la línea <i>{{adscripcion.idLineaInvestigacion}}</i> | |
35 | + con su trabajo de investigación titulado <i>{{adscripcion.tituloTrabajo}}</i> para así dar | |
36 | + cumplimiento al artículo N° 91 de Reglamento General de la Universidad Bolivariana de | |
37 | + Venezuela, que estable en su segundo párrafo <i>"Estarán adscritos a cada Centro de Estudios | |
38 | + , los trabajadores académicos, según el interés, formación y experiencia desarrollada en su | |
39 | + trayectoria político-académica" y al Artículo N°3 del Reglamento Del Sistema Integrado Para | |
40 | +El Desarrollo De Los Trabajadores Académicos De | |
41 | +La Universidad Bolivariana De Venezuela que dictamina en su primer párrafo <i>"Se entiende por trabajadores | |
42 | + académicos de la Universidad Bolivariana de Venezuela, para efectos de este Reglamento, | |
43 | + a las ciudadanas y ciudadanos encargados de desarrollar las actividades de formación, | |
44 | + creación y recreación de saberes e integración socioeducativa, adscritos a los Centros de Estudios y | |
45 | + Núcleos Académicos" </i> | |
46 | + | |
47 | +<br> En tal sentido, tomando en cuenta la fecha de Adscripción solicitada a través del sistema,: </p> | |
48 | + | |
49 | + <table class="table table-bordered table-condensed"> | |
50 | + <tr> | |
51 | + <td> | |
52 | + Adscrito al Centro de Estudios Avanzados desde | |
53 | + </td> | |
54 | + <td> | |
55 | + {{ adscripcion.fechaCreacion | date('m-d-Y')}} | |
56 | + </td> | |
57 | + </tr> | |
58 | + </table> | |
59 | + | |
60 | + {% endblock %} | |
61 | + | |
62 | + {%block javascripts %} | |
63 | + {{ parent() }} | |
64 | + <script type="text/javascript"> | |
65 | + | |
66 | + window.onload = function () { | |
67 | + window.print(); //invoca la impresora tan pronto se carga el documento | |
68 | + setTimeout(function () { window.close(); }, 100); //cierra la venta si cierra el dialog de imprimir | |
69 | + } | |
70 | +</script> | |
71 | + {% endblock %} | ... | ... |
app/Resources/views/solicitudes/index.html.twig
... | ... | @@ -30,16 +30,19 @@ |
30 | 30 | </tr> |
31 | 31 | </thead> |
32 | 32 | <tbody> |
33 | + | |
33 | 34 | {% for servicio in servicios %} |
34 | 35 | <tr> |
35 | 36 | <td>{{servicio.id}}</td> |
36 | 37 | <td>{{servicio.idServicioCe.Nombre}}</td> |
37 | - <td>{{servicio.fechaSolicitud | date('Y-m-d')}}</td> | |
38 | + <td>{{servicio.fechaSolicitud | date('d-m-Y')}}</td> | |
38 | 39 | <td>{{servicio.idEstatus}}</td> |
39 | 40 | <td> |
40 | - <a href="{{ path('servicio_antiguedad_imprimir', { 'id': servicio.id }) }}" target="_blank" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a> | |
41 | - <a href="javascript:;" class="btn btn-xs btn-success"><i class="fa fa-check"> </i></a> | |
42 | - <a href="javascript:;" class="btn btn-danger btn-xs"><i class="fa fa-times"> </i></a> | |
41 | + {%if servicio.idServicioCe.id == 1 %} | |
42 | + <a href="{{ path('servicio_antiguedad_imprimir', { 'id': servicio.id }) }}" target="_blank" class="btn btn-xs btn-info"><i class="fa fa-print"> </i></a> | |
43 | + {% elseif servicio.idServicioCe.id == 2 %} | |
44 | + <a href="{{ path('servicio_adscripcion_imprimir', { 'id': servicio.id }) }}" target="_blank" class="btn btn-xs btn-info"><i class="fa fa-print"> </i></a> | |
45 | + {%endif%} | |
43 | 46 | </td> |
44 | 47 | </tr> |
45 | 48 | {% endfor %} | ... | ... |
src/AppBundle/Controller/AdscripcionController.php
... | ... | @@ -15,6 +15,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
15 | 15 | use Symfony\Component\HttpFoundation\Request; |
16 | 16 | use AppBundle\Entity\Adscripcion; |
17 | 17 | use AppBundle\Entity\DocenteEscala; |
18 | +use AppBundle\Entity\Memorando; | |
19 | +use AppBundle\Entity\DocenteServicio; | |
20 | + | |
18 | 21 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
19 | 22 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
20 | 23 | |
... | ... | @@ -193,10 +196,17 @@ class AdscripcionController extends Controller |
193 | 196 | } |
194 | 197 | |
195 | 198 | } |
199 | + | |
200 | + //Crear la solicitud de Servicio | |
201 | + $servicios = new DocenteServicio(); | |
202 | + | |
203 | + $servicios->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
204 | + $servicios->setIdServicioCe($this->getDoctrine()->getRepository('AppBundle:ServiciosCe')->findOneById(2)); | |
205 | + $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:estatus')->findOneById(2)); | |
196 | 206 | |
207 | + $em->persist($servicios); | |
197 | 208 | $em->persist($adscripcion); |
198 | 209 | |
199 | - | |
200 | 210 | $em->flush(); //guarda en la base de datos |
201 | 211 | |
202 | 212 | |
... | ... | @@ -221,9 +231,13 @@ class AdscripcionController extends Controller |
221 | 231 | */ |
222 | 232 | public function verSolicitudesAdscripcionAction($estatus = 2, Request $request) |
223 | 233 | { |
234 | + $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findBy(array( | |
235 | + 'idEstatus' => $estatus, | |
236 | + 'idServicioCe' => 2 | |
237 | + )); | |
224 | 238 | |
225 | 239 | if ($request->getMethod() != 'POST') { |
226 | - $adscripciones = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findBy(array('idEstatus' => $estatus)); | |
240 | + | |
227 | 241 | switch ($estatus){ |
228 | 242 | case 1: |
229 | 243 | $mensaje = "activas"; |
... | ... | @@ -263,8 +277,8 @@ class AdscripcionController extends Controller |
263 | 277 | $adscripciones = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findByIdRolInstitucion($rol->getId()); |
264 | 278 | $mensaje = "Busqueda : " . $request->get('docente'); |
265 | 279 | } |
266 | - return $this->render('cea/solicitudes.html.twig', array( | |
267 | - 'adscripciones' => $adscripciones, | |
280 | + return $this->render('cea/servicios.html.twig', array( | |
281 | + 'servicios' => $servicios, | |
268 | 282 | 'estatus_adscripciones' => $mensaje |
269 | 283 | )); |
270 | 284 | } |
... | ... | @@ -272,20 +286,23 @@ class AdscripcionController extends Controller |
272 | 286 | /** |
273 | 287 | * Encuentra y muestra una entidad de tipo Adscripción. |
274 | 288 | * |
275 | - * @Route("/solicitudes/{id}", name="cea_solicitudes_show") | |
289 | + * @Route("/adscripcion/{id}", name="cea_adscripcion_show") | |
276 | 290 | * @Method("GET") |
277 | 291 | * @Security("has_role('ROLE_COORDINADOR_REGIONAL')") |
278 | 292 | */ |
279 | - public function solicitudesAdscripcionShowAction(Adscripcion $adscripcion) | |
280 | - { | |
281 | - //$deleteForm = $this->createDeleteForm($usuario); | |
293 | + public function solicitudesAdscripcionShowAction(DocenteServicio $servicio) | |
294 | + { | |
282 | 295 | $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array( |
283 | - 'idRolInstitucion' => $adscripcion->getIdRolInstitucion()->getId() | |
296 | + 'idRolInstitucion' => $servicio->getIdRolInstitucion()->getId() | |
284 | 297 | )); |
298 | + | |
299 | + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | |
285 | 300 | |
286 | 301 | return $this->render('cea/solicitudes_mostar.html.twig', array( |
287 | 302 | 'adscripcion' => $adscripcion, |
288 | - 'escalas' => $escala | |
303 | + 'servicio' => $servicio, | |
304 | + 'escalas' => $escala, | |
305 | + 'servicio' => $servicio | |
289 | 306 | )); |
290 | 307 | } |
291 | 308 | |
... | ... | @@ -300,21 +317,24 @@ class AdscripcionController extends Controller |
300 | 317 | public function solicitudesAdscripcionEditAction(Adscripcion $adscripcion, $estatus) |
301 | 318 | { |
302 | 319 | |
303 | - $adscripciones = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneById($adscripcion->getId()); | |
304 | - | |
320 | + //$adscripciones = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneById($adscripcion->getId()); | |
321 | + $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( | |
322 | + 'idRolInstitucion' => $adscripcion->getIdRolInstitucion(), | |
323 | + 'idServicioCe' => 2 | |
324 | + )); | |
305 | 325 | if($estatus == "true") { |
306 | - $adscripciones->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1)); | |
326 | + $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1)); | |
307 | 327 | $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); |
308 | 328 | $user->addRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO")); |
309 | 329 | |
310 | 330 | }else{ |
311 | - $adscripciones->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3)); | |
331 | + $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3)); | |
312 | 332 | $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); |
313 | 333 | $user->removeRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO")); |
314 | 334 | } |
315 | 335 | |
316 | 336 | $em = $this->getDoctrine()->getManager(); |
317 | - $em->persist($adscripciones); | |
337 | + $em->persist($servicios); | |
318 | 338 | $em->persist($user); |
319 | 339 | $em->flush(); |
320 | 340 | |
... | ... | @@ -328,7 +348,7 @@ class AdscripcionController extends Controller |
328 | 348 | array( |
329 | 349 | 'nombres' => $user->getIdRolInstitucion()->getIdRol()->getIdPersona()->getPrimerNombre(), |
330 | 350 | 'apellidos' => $user->getIdRolInstitucion()->getIdRol()->getIdPersona()->getPrimerApellido(), |
331 | - 'estatus' => $adscripciones->getIdEstatus() | |
351 | + 'estatus' => $servicios->getIdEstatus() | |
332 | 352 | ) |
333 | 353 | ), |
334 | 354 | 'text/html' |
... | ... | @@ -339,18 +359,74 @@ class AdscripcionController extends Controller |
339 | 359 | $this->addFlash('notice', 'Solicitud Actualizada Correctamente, hemos enviado un correo al docente notificandole los cambios.'); |
340 | 360 | |
341 | 361 | $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array( |
342 | - 'idRolInstitucion' => $adscripciones->getIdRolInstitucion()->getId() | |
362 | + 'idRolInstitucion' => $adscripcion->getIdRolInstitucion()->getId() | |
343 | 363 | )); |
344 | 364 | |
345 | 365 | return $this->render('cea/solicitudes_mostar.html.twig', array( |
346 | - 'adscripcion' => $adscripciones, | |
347 | - 'escalas' => $escala | |
366 | + 'servicio' => $servicios, | |
367 | + 'adscripcion' => $adscripcion, | |
368 | + 'escalas' => $escala | |
348 | 369 | )); |
349 | 370 | |
350 | 371 | } |
351 | 372 | |
352 | 373 | |
374 | + /** | |
375 | + * Muestra la página donde explica brevemente el reconocimiento de Antiguedad | |
376 | + * y permite realizar la solicitud | |
377 | + * | |
378 | + * @Route("/mis_servicios/adscripcion/imprimir/{id}", name="servicio_adscripcion_imprimir") | |
379 | + * @Method({"GET", "POST"}) | |
380 | + */ | |
381 | + public function serviciosAdscripcionImprimirAction(DocenteServicio $servicio){ | |
382 | + | |
383 | + | |
384 | + if ($servicio->getIdEstatus()->getId() == 1){ | |
385 | + | |
386 | + $correlativo = $this->getDoctrine()->getRepository('AppBundle:Memorando')->findOneByIdDocenteServicio($servicio); | |
387 | + if(!$correlativo){ | |
388 | + $correlativo = $this->getDoctrine()->getRepository('AppBundle:Memorando')->findOneBy( | |
389 | + array('ano'=> date("Y")), | |
390 | + array('id' => 'DESC') | |
391 | + ); | |
392 | + $numero = 1; | |
393 | + if ($correlativo) $numero = $correlativo->getCorrelativo() + 1; | |
394 | + $memo = new Memorando(); | |
395 | + $memo->setCorrelativo($numero); | |
396 | + $memo->setIdDocenteServicio($servicio); | |
397 | + $memo->setAno(date("Y")); | |
398 | + $memo->setIdEstatus($this->getDoctrine()->getRepository("AppBundle:Estatus")->findOneById(1)); | |
399 | + | |
400 | + $em = $this->getDoctrine()->getManager(); | |
401 | + $em->persist($memo); | |
402 | + $em->flush(); | |
403 | + $memorando = $memo->getCorrelativo() . "-" . $memo->getAno(); | |
404 | + }else{ | |
405 | + $memorando = $correlativo->getCorrelativo() . "-" . $correlativo->getAno(); | |
406 | + } | |
407 | + | |
408 | + | |
409 | + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | |
410 | + return $this->render('memorando/adscripcion.html.twig', array( | |
411 | + 'adscripcion' => $adscripcion, | |
412 | + 'correlativo' => $memorando | |
413 | + )); | |
414 | + | |
415 | + }else{ | |
416 | + $this->addFlash('danger', 'No Puede Imprimir el reconocimiento de Adscripcion hasta que esté aprobado por el coordinador del CEA.'); | |
417 | + | |
418 | + $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
419 | + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
420 | + | |
421 | + | |
422 | + return $this->render('solicitudes/index.html.twig', array( | |
423 | + 'servicios' => $servicios, | |
424 | + 'adscripcion' => $adscripcion | |
425 | + )); | |
426 | + } | |
427 | + | |
353 | 428 | |
429 | + } | |
354 | 430 | } |
355 | 431 | |
356 | 432 | /*funcion para crear miniaturas de las imagenes y carga más rapido la página */ | ... | ... |
src/AppBundle/Controller/AntiguedadController.php
... | ... | @@ -46,7 +46,10 @@ class AntiguedadController extends Controller { |
46 | 46 | */ |
47 | 47 | public function serviciosAntiguedadIndexAction(){ |
48 | 48 | |
49 | - $servicio = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
49 | + $servicio = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( | |
50 | + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), | |
51 | + 'idServicioCe' => 1 | |
52 | + )); | |
50 | 53 | |
51 | 54 | if(!$servicio){ |
52 | 55 | return $this->render('solicitudes/reconocimiento_antiguedad.html.twig'); |
... | ... | @@ -67,9 +70,9 @@ class AntiguedadController extends Controller { |
67 | 70 | * @Route("/mis_servicios/antiguedad/imprimir/{id}", name="servicio_antiguedad_imprimir") |
68 | 71 | * @Method({"GET", "POST"}) |
69 | 72 | */ |
70 | - public function serviciosAntiguedadImprimirAction(){ | |
73 | + public function serviciosAntiguedadImprimirAction(DocenteServicio $antiguedad){ | |
71 | 74 | |
72 | - $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
75 | + | |
73 | 76 | |
74 | 77 | if($antiguedad->getIdEstatus()->getId() == 1){ |
75 | 78 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($antiguedad->getIdRolInstitucion()); |
... | ... | @@ -124,9 +127,7 @@ class AntiguedadController extends Controller { |
124 | 127 | |
125 | 128 | }else{ |
126 | 129 | |
127 | - } | |
128 | - | |
129 | - $this->addFlash('danger', 'No Puede Imprimir el reconocimiento de Antiguedad hasta que esté aprobado por el coordinador del CEA.'); | |
130 | + $this->addFlash('danger', 'No Puede Imprimir el reconocimiento de Antiguedad hasta que esté aprobado por el coordinador del CEA.'); | |
130 | 131 | |
131 | 132 | $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); |
132 | 133 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); |
... | ... | @@ -136,6 +137,10 @@ class AntiguedadController extends Controller { |
136 | 137 | 'servicios' => $servicios, |
137 | 138 | 'adscripcion' => $adscripcion |
138 | 139 | )); |
140 | + | |
141 | + } | |
142 | + | |
143 | + | |
139 | 144 | |
140 | 145 | } |
141 | 146 | ... | ... |
src/AppBundle/Controller/AppController.php
... | ... | @@ -36,8 +36,11 @@ class AppController extends Controller { |
36 | 36 | */ |
37 | 37 | public function indexAction() |
38 | 38 | { |
39 | - $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')-> | |
40 | - findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()->getId()); | |
39 | + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')-> | |
40 | + findOneBy(array( | |
41 | + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion()->getId(), | |
42 | + 'idServicioCe' => 2 | |
43 | + )); | |
41 | 44 | //si no ha solicitado adscripción regresa a la pagina de adscripcion |
42 | 45 | if(!$adscripcion) return $this->redirect($this->generateUrl('solicitud_adscripcion')); |
43 | 46 | //solicitud aprobada está en falso |
... | ... | @@ -65,7 +68,6 @@ class AppController extends Controller { |
65 | 68 | if ($request->getMethod() != 'POST') { |
66 | 69 | $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findBy(array( |
67 | 70 | 'idEstatus' => $estatus, |
68 | - 'idServicioCe' => $tipo_servicio, | |
69 | 71 | )); |
70 | 72 | switch ($estatus){ |
71 | 73 | case 1: |
... | ... | @@ -147,7 +149,7 @@ class AppController extends Controller { |
147 | 149 | public function serviciosIndexAction(){ |
148 | 150 | |
149 | 151 | $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); |
150 | - $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
152 | + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
151 | 153 | |
152 | 154 | |
153 | 155 | return $this->render('solicitudes/index.html.twig', array( | ... | ... |
src/AppBundle/Entity/Adscripcion.php
... | ... | @@ -373,6 +373,13 @@ class Adscripcion |
373 | 373 | $this->fecha_creacion = new \DateTime(); |
374 | 374 | $this->fecha_ultima_actualizacion = new \DateTime(); |
375 | 375 | } |
376 | + | |
377 | + public function getFechaCreacion() | |
378 | + { | |
379 | + return $this->fecha_creacion; | |
380 | + | |
381 | + } | |
382 | + | |
376 | 383 | |
377 | 384 | /** |
378 | 385 | * @ORM\PreUpdate | ... | ... |
src/AppBundle/Entity/DocenteServicio.php
... | ... | @@ -24,7 +24,7 @@ use Symfony\Component\Validator\Constraints as Assert; |
24 | 24 | /** |
25 | 25 | * DocenteServicio |
26 | 26 | * |
27 | - * @ORM\Table(name="docente_servicio", uniqueConstraints={@ORM\UniqueConstraint(name="docente_servicio_id_rol_institucion_key", columns={"id_rol_institucion"})}) | |
27 | + * @ORM\Table(name="docente_servicio" ) | |
28 | 28 | * @ORM\Entity |
29 | 29 | * @ORM\HasLifecycleCallbacks() |
30 | 30 | */ | ... | ... |