From f63b714981290808c73cfdd80f7cbdcfbe56fd81 Mon Sep 17 00:00:00 2001 From: Wilmer Date: Mon, 17 Apr 2017 08:17:11 -0400 Subject: [PATCH] =?UTF-8?q?Corregido=20el=20bug=20que=20confund=C3=ADa=20l?= =?UTF-8?q?os=20escalafones=20entre=20asociado=20y=20agregado=20a=20la=20h?= =?UTF-8?q?ora=20de=20la=20adscripcion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppBundle/Controller/AdscripcionController.php | 43 +++++++++++----------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/AppBundle/Controller/AdscripcionController.php b/src/AppBundle/Controller/AdscripcionController.php index 6a9aae5..97033b7 100644 --- a/src/AppBundle/Controller/AdscripcionController.php +++ b/src/AppBundle/Controller/AdscripcionController.php @@ -354,30 +354,10 @@ class AdscripcionController extends Controller } - if ($form->get('documento_asociado')->getData()) { - $escala3 = new DocenteEscala(); - $asociado = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(3); - $escala3->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); - $escala3->setFechaEscala($form->get('fecha_ascenso_asociado')->getData()); - $escala3->setIdEscala($asociado); - $escala3->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById(2)); - $em->persist($escala3); - - - $constanciaAsociado = $form->get('documento_asociado')->getData(); - $nombreAsociado = md5(uniqid()).'.'.$constanciaAsociado->guessExtension(); - $constanciaAsociado->move( - $this->container->getParameter('ascenso_directory'), - $nombreAsociado - ); - thumbnail($nombreAsociado, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); - verificar_documentos($this->getUser()->getIdRolInstitucion(), 6, 2, $em, $nombreAsociado, $servicios); - } - if ($form->get('documento_agregado')->getData()) { $escala4 = new DocenteEscala(); - $agregado = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(4); + $agregado = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(3); $escala4->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); $escala4->setFechaEscala($form->get('fecha_ascenso_agregado')->getData()); $escala4->setIdEscala($agregado); @@ -396,6 +376,27 @@ class AdscripcionController extends Controller } + if ($form->get('documento_asociado')->getData()) { + $escala3 = new DocenteEscala(); + $asociado = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(4); + $escala3->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); + $escala3->setFechaEscala($form->get('fecha_ascenso_asociado')->getData()); + $escala3->setIdEscala($asociado); + $escala3->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById(2)); + $em->persist($escala3); + + + $constanciaAsociado = $form->get('documento_asociado')->getData(); + $nombreAsociado = md5(uniqid()).'.'.$constanciaAsociado->guessExtension(); + $constanciaAsociado->move( + $this->container->getParameter('ascenso_directory'), + $nombreAsociado + ); + thumbnail($nombreAsociado, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); + verificar_documentos($this->getUser()->getIdRolInstitucion(), 6, 2, $em, $nombreAsociado, $servicios); + } + + if ($form->get('documento_titular')->getData()) { $escala5 = new DocenteEscala(); $titular = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(5); -- 2.0.0