Commit 68bcc844f51a7f2cc36e61006dd076e2b4ff1d47
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 | 686 | $form->handleRequest($request); |
687 | 687 | |
688 | 688 | if($form->isSubmitted() && $form->isValid()){ |
689 | + $data = $form->getData(); | |
689 | 690 | $parametros = $request->request->all(); |
690 | 691 | $verificado = $this->getDoctrine()->getRepository("AppBundle:DocumentosVerificados")->findOneByIdServicio($servicio); |
691 | 692 | $ServicioAscenso = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( |
... | ... | @@ -699,19 +700,26 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( |
699 | 700 | 'idRolInstitucion' => $servicio->getIdRolInstitucion(), |
700 | 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 | 710 | if(isset($parametros['aprobado'])) { |
703 | 711 | $verificado->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1)); |
704 | 712 | $escala_docente = new DocenteEscala(); |
705 | 713 | $escala_docente->setIdRolInstitucion($servicio->getIdRolInstitucion()); |
706 | 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 | 716 | $escala_docente->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById($this->get('request')->request->get('tipo'))); |
709 | 717 | $em->persist($escala_docente); |
710 | 718 | |
711 | 719 | |
712 | 720 | $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); |
713 | 721 | |
714 | - | |
722 | + $servicioDefensa->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); | |
715 | 723 | $ServicioAscenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); |
716 | 724 | $ascenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4)); |
717 | 725 | |
... | ... | @@ -730,6 +738,7 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( |
730 | 738 | } |
731 | 739 | |
732 | 740 | $em->persist($ServicioAscenso); |
741 | + $em->persist($servicioDefensa); | |
733 | 742 | $em->persist($ascenso); |
734 | 743 | $em->persist($verificado); |
735 | 744 | $em->flush(); |
... | ... | @@ -787,6 +796,9 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( |
787 | 796 | 'idServicioCe' => 4), |
788 | 797 | array('id' => 'DESC') |
789 | 798 | ); |
799 | + | |
800 | + | |
801 | + | |
790 | 802 | //$pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); |
791 | 803 | $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( |
792 | 804 | 'idRolInstitucion' => $servicio->getIdRolInstitucion(), |
... | ... | @@ -1072,7 +1084,10 @@ $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( |
1072 | 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 | 1091 | $eje = $ascenso->getIdRolInstitucion()->getIdInstitucion()->getIdEjeParroquia()->getIdEje()->getNombre(); |
1077 | 1092 | $estado = $ascenso->getIdRolInstitucion()->getIdInstitucion()->getIdEjeParroquia()->getIdParroquia()->getIdMunicipio()->getIdEstado()->getNombre(); |
1078 | 1093 | $tutores = $ascenso->getTutores(); | ... | ... |