Commit e5c4f05f8cfc22150407424205dc7e8e6107ef80

Authored by Wilmer Ramones
1 parent 276b233001
Exists in master

poder solicitar un ascenso si ya se formalizó el anterior

Showing 1 changed file with 14 additions and 3 deletions   Show diff stats
src/AppBundle/Controller/AscensoController.php
... ... @@ -36,7 +36,7 @@ class AscensoController extends Controller
36 36 array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5)
37 37 );
38 38 if($solicitud){
39   - if($solicitud->getIdEstatus()->getId() != 5 ){
  39 + if($solicitud->getIdEstatus()->getId() != 4 ){
40 40 return $this->redirect($this->generateUrl('servicios_index'));
41 41 }
42 42 }
... ... @@ -203,7 +203,7 @@ class AscensoController extends Controller
203 203 array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 6)
204 204 );
205 205 if($solicitud){
206   - if($solicitud->getIdEstatus()->getId() != 5 ){
  206 + if($solicitud->getIdEstatus()->getId() != 4 ){
207 207 return $this->redirect($this->generateUrl('servicios_index'));
208 208 }
209 209 }
... ... @@ -476,9 +476,20 @@ class AscensoController extends Controller
476 476  
477 477  
478 478  
479   - $em = $this->getDoctrine()->getManager();
  479 + $em = $this->getDoctrine()->getManager();
480 480 $em->persist($escala_docente);
481 481  
  482 + if ($this->get('request')->request->get('tipo') == 2 ){
  483 + $ascenso = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array(
  484 + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(),
  485 + 'idServicioCe' => 5,
  486 + 'idEstatus' => 1
  487 + ));
  488 +
  489 + $ascenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4));
  490 + $em->persist($ascenso);
  491 + }
  492 +
482 493 $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4));
483 494 $em->persist($servicio);
484 495  
... ...