From e5c4f05f8cfc22150407424205dc7e8e6107ef80 Mon Sep 17 00:00:00 2001 From: Wilmer Ramones Date: Mon, 17 Oct 2016 14:28:27 -0400 Subject: [PATCH] =?UTF-8?q?poder=20solicitar=20un=20ascenso=20si=20ya=20se?= =?UTF-8?q?=20formaliz=C3=B3=20el=20anterior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppBundle/Controller/AscensoController.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/AppBundle/Controller/AscensoController.php b/src/AppBundle/Controller/AscensoController.php index 0deb2a6..eddc587 100644 --- a/src/AppBundle/Controller/AscensoController.php +++ b/src/AppBundle/Controller/AscensoController.php @@ -36,7 +36,7 @@ class AscensoController extends Controller array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5) ); if($solicitud){ - if($solicitud->getIdEstatus()->getId() != 5 ){ + if($solicitud->getIdEstatus()->getId() != 4 ){ return $this->redirect($this->generateUrl('servicios_index')); } } @@ -203,7 +203,7 @@ class AscensoController extends Controller array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 6) ); if($solicitud){ - if($solicitud->getIdEstatus()->getId() != 5 ){ + if($solicitud->getIdEstatus()->getId() != 4 ){ return $this->redirect($this->generateUrl('servicios_index')); } } @@ -476,9 +476,20 @@ class AscensoController extends Controller - $em = $this->getDoctrine()->getManager(); + $em = $this->getDoctrine()->getManager(); $em->persist($escala_docente); + if ($this->get('request')->request->get('tipo') == 2 ){ + $ascenso = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), + 'idServicioCe' => 5, + 'idEstatus' => 1 + )); + + $ascenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); + $em->persist($ascenso); + } + $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); $em->persist($servicio); -- 2.0.0