From 68e1a5ef7c6425ea7cc176753d49b00bd71e81c1 Mon Sep 17 00:00:00 2001 From: Wilmer Date: Mon, 27 Mar 2017 09:25:24 -0400 Subject: [PATCH] corregida las vistas de la adscripcion en los demas modulos --- app/Resources/views/cea/ascenso_mostar.html.twig | 5 ++++- .../views/cea/solicitudes_mostar.html.twig | 4 ++-- .../views/solicitudes/adscripcion_show.twig | 3 +++ src/AppBundle/Controller/AdscripcionController.php | 23 +++++++++++++++++----- src/AppBundle/Controller/AscensoController.php | 21 +++++++++----------- 5 files changed, 36 insertions(+), 20 deletions(-) diff --git a/app/Resources/views/cea/ascenso_mostar.html.twig b/app/Resources/views/cea/ascenso_mostar.html.twig index 2562290..79b6c06 100644 --- a/app/Resources/views/cea/ascenso_mostar.html.twig +++ b/app/Resources/views/cea/ascenso_mostar.html.twig @@ -316,7 +316,7 @@
- {% if not todo.pida %} + {% if not servicioPida %}

El Docente no ha registrado todavía su actividad PIDA

{% else %} @@ -290,7 +290,7 @@ Tarea Específica Plazo Estatus - {% for pid in todo.pida | sort %} + {% for pid in pida | sort %} {{ pid.idPlanHistoricoNacionalEstrategico.nombre }} diff --git a/app/Resources/views/solicitudes/adscripcion_show.twig b/app/Resources/views/solicitudes/adscripcion_show.twig index d310847..3a7434d 100644 --- a/app/Resources/views/solicitudes/adscripcion_show.twig +++ b/app/Resources/views/solicitudes/adscripcion_show.twig @@ -266,6 +266,8 @@ Plazo Estatus {% for pid in todo.pida | sort %} + {#solo muestre la vigente #} + {% if pid.idDocenteServicio.id == servicioPida.id %} {{ pid.idPlanHistoricoNacionalEstrategico.nombre }} @@ -289,6 +291,7 @@ {% endfor %} + {% endif %} {% endfor %}
diff --git a/src/AppBundle/Controller/AdscripcionController.php b/src/AppBundle/Controller/AdscripcionController.php index 536b9f8..43a3ec3 100644 --- a/src/AppBundle/Controller/AdscripcionController.php +++ b/src/AppBundle/Controller/AdscripcionController.php @@ -676,14 +676,26 @@ class AdscripcionController extends Controller $todo = $em->getRepository("AppBundle:RolInstitucion")->findOneById($servicio->getIdRolInstitucion()); $servicioPida = $this->getDoctrine()->getRepository("AppBundle:DocenteServicio")->findOneBy(array( 'idRolInstitucion' => $todo, - 'idServicioCe' => 4 - )); + 'idServicioCe' => 4), + array ('id' => 'DESC') + ); + $pida = false; + + if($servicioPida){ + $pida = $this->getDoctrine()->getRepository("AppBundle:AdscripcionPida")->findBy(array( + 'idRolInstitucion' => $servicio->getIdRolInstitucion(), + 'idDocenteServicio' => $servicioPida + )); + } + + return $this->render('cea/solicitudes_mostar.html.twig', array( 'servicio' => $servicio, 'servicioPida' => $servicioPida, - 'todo' => $todo + 'todo' => $todo, + 'pida' => $pida )); } @@ -702,8 +714,9 @@ class AdscripcionController extends Controller $todo = $servicio->getIdRolInstitucion(); $servicioPida = $this->getDoctrine()->getRepository("AppBundle:DocenteServicio")->findOneBy(array( 'idRolInstitucion' => $todo, - 'idServicioCe' => 4 - )); + 'idServicioCe' => 4), + array('id' => 'DESC') + ); $form = $this->createForm('AppBundle\Form\AdscripcionEditType'); diff --git a/src/AppBundle/Controller/AscensoController.php b/src/AppBundle/Controller/AscensoController.php index 387e5c2..156723d 100644 --- a/src/AppBundle/Controller/AscensoController.php +++ b/src/AppBundle/Controller/AscensoController.php @@ -501,9 +501,13 @@ class AscensoController extends Controller array('id' => 'DESC') ); } - - - $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); + + $servicioPida = $this->getDoctrine()->getRepository("AppBundle:DocenteServicio")->findOneBy(array( + 'idRolInstitucion' => $docente, + 'idServicioCe' => 4), + array('id' => 'DESC') + ); + //$pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( 'idRolInstitucion' => $servicio->getIdRolInstitucion(), 'idServicioCe' => 1 @@ -515,7 +519,7 @@ class AscensoController extends Controller 'ascenso' => $ascenso, 'servicio' => $servicio, 'escalas' => $escala, - 'pida' => $pida, + 'servicioPida' => $servicioPida, 'antiguedad' => $antiguedad, 'form' => $form->createView(), 'docente' => $docente @@ -737,14 +741,7 @@ class AscensoController extends Controller $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($serviciosAscenso->getIdRolInstitucion()); $docente = $this->getDoctrine()->getRepository("AppBundle:RolInstitucion")->findOneById($ascenso->getIdRolInstitucion()->getId()); - return $this->render('cea/ascenso_mostar.html.twig', array( - 'ascenso' => $ascenso, - 'servicio' => $serviciosAscenso, - 'escalas' => $escala, - 'pida' => $pida, - 'antiguedad' => $antiguedad, - 'docente' => $docente - )); + return $this->redirect($this->generateUrl('cea_ascenso_show', array('id' => $ascenso->getId()))); } -- 2.0.0