From e16d443815c5da16ed57c78f1420a652b4062ce4 Mon Sep 17 00:00:00 2001 From: Wilmer Date: Tue, 17 Oct 2017 13:15:29 -0400 Subject: [PATCH] =?UTF-8?q?corrige=20errores=20menores=20de=20comprobaci?= =?UTF-8?q?=C3=B3n=20de=20adscripci=C3=B3n=20para=20los=20servicios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- app/Resources/views/cea/index.html.twig | 3 ++- app/Resources/views/cea/servicios_mostar.html.twig | 2 +- src/AppBundle/Controller/AppController.php | 3 ++- src/AppBundle/Controller/AscensoController.php | 11 +++++++++++ src/AppBundle/Controller/PermisosController.php | 11 +++++++++++ 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2599fac..e363eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ /bin/ /composer.phar /nbproject/private/ - +!AppController.php # Linux .* !.gitignore diff --git a/app/Resources/views/cea/index.html.twig b/app/Resources/views/cea/index.html.twig index 20a0eb1..3b2b70a 100644 --- a/app/Resources/views/cea/index.html.twig +++ b/app/Resources/views/cea/index.html.twig @@ -25,7 +25,7 @@ Tan pronto sea activada, se le notificará por el correo institucional y podrá disfrutar de los servicios que ofrecemos - {%endif %} + {% else %} {% if ascenso %} @@ -63,6 +63,7 @@ {% endif %} {% endif %} + {% endif %}
diff --git a/app/Resources/views/cea/servicios_mostar.html.twig b/app/Resources/views/cea/servicios_mostar.html.twig index 40e8fe8..d44cacd 100644 --- a/app/Resources/views/cea/servicios_mostar.html.twig +++ b/app/Resources/views/cea/servicios_mostar.html.twig @@ -208,7 +208,7 @@
- {% if servicio.idServicioCe.id == 1 %} + {% if servicio.idServicioCe.id == 1 or servicio.idServicioCe.id == 2 %}

Documentos Para confirmar

diff --git a/src/AppBundle/Controller/AppController.php b/src/AppBundle/Controller/AppController.php index 6966881..b33a936 100644 --- a/src/AppBundle/Controller/AppController.php +++ b/src/AppBundle/Controller/AppController.php @@ -79,7 +79,8 @@ class AppController extends Controller { $vigente = $tiempo->invert ? false : true; if($tiempo->format('%a%') <= 60 && $tiempo->format('%a%') >= 30){ $suffix = ( $tiempo->invert ? ' venció hace' : 'estará viegene por' ); - $this->addFlash('warning', 'Estimado docente su PIDA ' . $suffix . $tiempo->format('%a%') . ' días más' ); + $this->addFlash('warning', 'E12345 + stimado docente su PIDA ' . $suffix . $tiempo->format('%a%') . ' días más' ); }else if($tiempo->format('%a%') <= 29 && $vigente){ $this->addFlash('danger', 'Estimado docente dentro de ' . $tiempo->format('%a%') . ' días su PIDA caducará y deberá crear uno nuevo'); } diff --git a/src/AppBundle/Controller/AscensoController.php b/src/AppBundle/Controller/AscensoController.php index 065f2bb..b812664 100644 --- a/src/AppBundle/Controller/AscensoController.php +++ b/src/AppBundle/Controller/AscensoController.php @@ -39,6 +39,17 @@ class AscensoController extends Controller public function ascensoAction(Request $request) { $formalizarTiempo = false; + + $adscrito = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 2, 'idEstatus' => 1), + array('id' => 'DESC') + ); + + if(!$adscrito){ + $this->addFlash('warning', 'Su Adscripción está en Espera, Al cambiar a aprobada se le notifcará por correo'); + return $this->redirect($this->generateUrl('servicios_index')); + } + //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5), diff --git a/src/AppBundle/Controller/PermisosController.php b/src/AppBundle/Controller/PermisosController.php index 5aea457..7c59a8e 100644 --- a/src/AppBundle/Controller/PermisosController.php +++ b/src/AppBundle/Controller/PermisosController.php @@ -39,6 +39,17 @@ class PermisosController extends Controller { $em = $this->getDoctrine()->getManager(); $docente = $this->getUser()->getIdRolInstitucion(); + + $adscrito = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 2, 'idEstatus' => 1), + array('id' => 'DESC') + ); + + if(!$adscrito){ + $this->addFlash('warning', 'Su Adscripción está en Espera, Al cambiar a aprobada se le notifcará por correo'); + return $this->redirect($this->generateUrl('servicios_index')); + } + $escalafones = $em->getRepository("AppBundle:DocenteEscala")->findOneBy(array( 'idRolInstitucion' => $docente, 'idEscala' => $em->getRepository("AppBundle:Escalafones")->findOneById(2) -- 2.0.0