Commit bd47fb54693fdcbf2437d12d06335af76c5c4c87

Authored by Wilmer
1 parent 6440d7b6f5
Exists in master

corrige el error de no preguntar primero si es un docente que todavia no ha conc…

…ursado y debe subir su constancia de oposicion al tenerla
Showing 1 changed file with 19 additions and 15 deletions   Show diff stats
src/AppBundle/Controller/AscensoController.php
@@ -378,7 +378,22 @@ class AscensoController extends Controller @@ -378,7 +378,22 @@ class AscensoController extends Controller
378 */ 378 */
379 public function reconocimientoEscalaAction(Request $request) 379 public function reconocimientoEscalaAction(Request $request)
380 { 380 {
381 - 381 +
  382 + $form = $this->createForm('AppBundle\Form\ReconocimientoEscalaType');
  383 + $concurso = $this->getDoctrine()->getRepository('AppBundle:DocumentosVerificados')->findOneBy(array(
  384 + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(),
  385 + 'idTipoDocumentos' => 4
  386 + ));
  387 +
  388 + if(!$concurso){
  389 + return $this->render(
  390 + 'solicitudes/reconocimientoEscala.html.twig',
  391 + array(
  392 + 'form' => $form->createView(),
  393 + 'tipo' => 'Concurso de Oposición'
  394 + )
  395 + );
  396 + }
382 397
383 //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios 398 //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios
384 $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( 399 $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(
@@ -402,10 +417,7 @@ class AscensoController extends Controller @@ -402,10 +417,7 @@ class AscensoController extends Controller
402 return $this->redirect($this->generateUrl('cea_index')); 417 return $this->redirect($this->generateUrl('cea_index'));
403 } 418 }
404 419
405 - $concurso = $this->getDoctrine()->getRepository('AppBundle:DocumentosVerificados')->findOneBy(array(  
406 - 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(),  
407 - 'idTipoDocumentos' => 4  
408 - )); 420 +
409 421
410 422
411 $solicitudAscenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( 423 $solicitudAscenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(
@@ -416,7 +428,7 @@ class AscensoController extends Controller @@ -416,7 +428,7 @@ class AscensoController extends Controller
416 ); 428 );
417 429
418 430
419 - $form = $this->createForm('AppBundle\Form\ReconocimientoEscalaType'); 431 +
420 432
421 $form->handleRequest($request); 433 $form->handleRequest($request);
422 $em = $this->getDoctrine()->getManager(); 434 $em = $this->getDoctrine()->getManager();
@@ -476,15 +488,7 @@ class AscensoController extends Controller @@ -476,15 +488,7 @@ class AscensoController extends Controller
476 } 488 }
477 489
478 490
479 - if(!$concurso){  
480 - return $this->render(  
481 - 'solicitudes/reconocimientoEscala.html.twig',  
482 - array(  
483 - 'form' => $form->createView(),  
484 - 'tipo' => 'Concurso de Oposición'  
485 - )  
486 - );  
487 - } 491 +
488 492
489 493
490 494