From bd47fb54693fdcbf2437d12d06335af76c5c4c87 Mon Sep 17 00:00:00 2001 From: Wilmer Date: Wed, 31 May 2017 10:31:00 -0400 Subject: [PATCH] corrige el error de no preguntar primero si es un docente que todavia no ha concursado y debe subir su constancia de oposicion al tenerla --- src/AppBundle/Controller/AscensoController.php | 34 ++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/AppBundle/Controller/AscensoController.php b/src/AppBundle/Controller/AscensoController.php index f55c200..86e34ac 100644 --- a/src/AppBundle/Controller/AscensoController.php +++ b/src/AppBundle/Controller/AscensoController.php @@ -378,7 +378,22 @@ class AscensoController extends Controller */ public function reconocimientoEscalaAction(Request $request) { - + + $form = $this->createForm('AppBundle\Form\ReconocimientoEscalaType'); + $concurso = $this->getDoctrine()->getRepository('AppBundle:DocumentosVerificados')->findOneBy(array( + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), + 'idTipoDocumentos' => 4 + )); + + if(!$concurso){ + return $this->render( + 'solicitudes/reconocimientoEscala.html.twig', + array( + 'form' => $form->createView(), + 'tipo' => 'Concurso de Oposición' + ) + ); + } //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( @@ -402,10 +417,7 @@ class AscensoController extends Controller return $this->redirect($this->generateUrl('cea_index')); } - $concurso = $this->getDoctrine()->getRepository('AppBundle:DocumentosVerificados')->findOneBy(array( - 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), - 'idTipoDocumentos' => 4 - )); + $solicitudAscenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( @@ -416,7 +428,7 @@ class AscensoController extends Controller ); - $form = $this->createForm('AppBundle\Form\ReconocimientoEscalaType'); + $form->handleRequest($request); $em = $this->getDoctrine()->getManager(); @@ -476,15 +488,7 @@ class AscensoController extends Controller } - if(!$concurso){ - return $this->render( - 'solicitudes/reconocimientoEscala.html.twig', - array( - 'form' => $form->createView(), - 'tipo' => 'Concurso de Oposición' - ) - ); - } + -- 2.0.0