Commit 68bcc844f51a7f2cc36e61006dd076e2b4ff1d47

Authored by Wilmer
1 parent 6e3c2f05d9
Exists in master

corrige detalle de colocar la fecha actual al ascenso en vez de colocar la fecha…

… cuando lo obtuvo; corrige detalle de actualizar el servicio de defensa al aprobar la nueva escala
Showing 1 changed file with 18 additions and 3 deletions   Show diff stats
src/AppBundle/Controller/AscensoController.php
@@ -686,6 +686,7 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( @@ -686,6 +686,7 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(
686 $form->handleRequest($request); 686 $form->handleRequest($request);
687 687
688 if($form->isSubmitted() && $form->isValid()){ 688 if($form->isSubmitted() && $form->isValid()){
  689 + $data = $form->getData();
689 $parametros = $request->request->all(); 690 $parametros = $request->request->all();
690 $verificado = $this->getDoctrine()->getRepository("AppBundle:DocumentosVerificados")->findOneByIdServicio($servicio); 691 $verificado = $this->getDoctrine()->getRepository("AppBundle:DocumentosVerificados")->findOneByIdServicio($servicio);
691 $ServicioAscenso = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( 692 $ServicioAscenso = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array(
@@ -699,19 +700,26 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( @@ -699,19 +700,26 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(
699 'idRolInstitucion' => $servicio->getIdRolInstitucion(), 700 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
700 'idEstatus' => 1 701 'idEstatus' => 1
701 )); 702 ));
  703 +
  704 + $servicioDefensa = $this->getDoctrine()->getRepository("AppBundle:DocenteServicio")->findOneBy(array(
  705 + 'idRolInstitucion' => $docente,
  706 + 'idServicioCe' => 7),
  707 + array('id' => 'DESC')
  708 + );
  709 +
702 if(isset($parametros['aprobado'])) { 710 if(isset($parametros['aprobado'])) {
703 $verificado->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1)); 711 $verificado->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1));
704 $escala_docente = new DocenteEscala(); 712 $escala_docente = new DocenteEscala();
705 $escala_docente->setIdRolInstitucion($servicio->getIdRolInstitucion()); 713 $escala_docente->setIdRolInstitucion($servicio->getIdRolInstitucion());
706 $escala_docente->setidEscala($this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($this->get('request')->request->get('escala'))); 714 $escala_docente->setidEscala($this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($this->get('request')->request->get('escala')));
707 - $escala_docente->setFechaEscala($this->get('request')->request->get('fecha_escala')); 715 + $escala_docente->setFechaEscala($data['fechaAscenso']);
708 $escala_docente->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById($this->get('request')->request->get('tipo'))); 716 $escala_docente->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById($this->get('request')->request->get('tipo')));
709 $em->persist($escala_docente); 717 $em->persist($escala_docente);
710 718
711 719
712 $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); 720 $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4));
713 721
714 - 722 + $servicioDefensa->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4));
715 $ServicioAscenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); 723 $ServicioAscenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4));
716 $ascenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); 724 $ascenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4));
717 725
@@ -730,6 +738,7 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( @@ -730,6 +738,7 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(
730 } 738 }
731 739
732 $em->persist($ServicioAscenso); 740 $em->persist($ServicioAscenso);
  741 + $em->persist($servicioDefensa);
733 $em->persist($ascenso); 742 $em->persist($ascenso);
734 $em->persist($verificado); 743 $em->persist($verificado);
735 $em->flush(); 744 $em->flush();
@@ -787,6 +796,9 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( @@ -787,6 +796,9 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(
787 'idServicioCe' => 4), 796 'idServicioCe' => 4),
788 array('id' => 'DESC') 797 array('id' => 'DESC')
789 ); 798 );
  799 +
  800 +
  801 +
790 //$pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); 802 //$pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
791 $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( 803 $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array(
792 'idRolInstitucion' => $servicio->getIdRolInstitucion(), 804 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
@@ -1072,7 +1084,10 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( @@ -1072,7 +1084,10 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(
1072 if ($servicio->getIdEstatus()->getId() == 1){ 1084 if ($servicio->getIdEstatus()->getId() == 1){
1073 1085
1074 1086
1075 - $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); 1087 + $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array(
  1088 + 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
  1089 + 'idEstatus' => 1
  1090 + ));
1076 $eje = $ascenso->getIdRolInstitucion()->getIdInstitucion()->getIdEjeParroquia()->getIdEje()->getNombre(); 1091 $eje = $ascenso->getIdRolInstitucion()->getIdInstitucion()->getIdEjeParroquia()->getIdEje()->getNombre();
1077 $estado = $ascenso->getIdRolInstitucion()->getIdInstitucion()->getIdEjeParroquia()->getIdParroquia()->getIdMunicipio()->getIdEstado()->getNombre(); 1092 $estado = $ascenso->getIdRolInstitucion()->getIdInstitucion()->getIdEjeParroquia()->getIdParroquia()->getIdMunicipio()->getIdEstado()->getNombre();
1078 $tutores = $ascenso->getTutores(); 1093 $tutores = $ascenso->getTutores();