Commit f63b714981290808c73cfdd80f7cbdcfbe56fd81
1 parent
dc5c1a5ef6
Exists in
master
Corregido el bug que confundía los escalafones entre asociado y agregado a la hora de la adscripcion
Showing
1 changed file
with
22 additions
and
21 deletions
Show diff stats
src/AppBundle/Controller/AdscripcionController.php
@@ -354,30 +354,10 @@ class AdscripcionController extends Controller | @@ -354,30 +354,10 @@ class AdscripcionController extends Controller | ||
354 | 354 | ||
355 | } | 355 | } |
356 | 356 | ||
357 | - if ($form->get('documento_asociado')->getData()) { | ||
358 | - $escala3 = new DocenteEscala(); | ||
359 | - $asociado = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(3); | ||
360 | - $escala3->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | ||
361 | - $escala3->setFechaEscala($form->get('fecha_ascenso_asociado')->getData()); | ||
362 | - $escala3->setIdEscala($asociado); | ||
363 | - $escala3->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById(2)); | ||
364 | - $em->persist($escala3); | ||
365 | - | ||
366 | - | ||
367 | - $constanciaAsociado = $form->get('documento_asociado')->getData(); | ||
368 | - $nombreAsociado = md5(uniqid()).'.'.$constanciaAsociado->guessExtension(); | ||
369 | - $constanciaAsociado->move( | ||
370 | - $this->container->getParameter('ascenso_directory'), | ||
371 | - $nombreAsociado | ||
372 | - ); | ||
373 | - thumbnail($nombreAsociado, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | ||
374 | - verificar_documentos($this->getUser()->getIdRolInstitucion(), 6, 2, $em, $nombreAsociado, $servicios); | ||
375 | - } | ||
376 | - | ||
377 | 357 | ||
378 | if ($form->get('documento_agregado')->getData()) { | 358 | if ($form->get('documento_agregado')->getData()) { |
379 | $escala4 = new DocenteEscala(); | 359 | $escala4 = new DocenteEscala(); |
380 | - $agregado = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(4); | 360 | + $agregado = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(3); |
381 | $escala4->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | 361 | $escala4->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); |
382 | $escala4->setFechaEscala($form->get('fecha_ascenso_agregado')->getData()); | 362 | $escala4->setFechaEscala($form->get('fecha_ascenso_agregado')->getData()); |
383 | $escala4->setIdEscala($agregado); | 363 | $escala4->setIdEscala($agregado); |
@@ -396,6 +376,27 @@ class AdscripcionController extends Controller | @@ -396,6 +376,27 @@ class AdscripcionController extends Controller | ||
396 | } | 376 | } |
397 | 377 | ||
398 | 378 | ||
379 | + if ($form->get('documento_asociado')->getData()) { | ||
380 | + $escala3 = new DocenteEscala(); | ||
381 | + $asociado = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(4); | ||
382 | + $escala3->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | ||
383 | + $escala3->setFechaEscala($form->get('fecha_ascenso_asociado')->getData()); | ||
384 | + $escala3->setIdEscala($asociado); | ||
385 | + $escala3->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById(2)); | ||
386 | + $em->persist($escala3); | ||
387 | + | ||
388 | + | ||
389 | + $constanciaAsociado = $form->get('documento_asociado')->getData(); | ||
390 | + $nombreAsociado = md5(uniqid()).'.'.$constanciaAsociado->guessExtension(); | ||
391 | + $constanciaAsociado->move( | ||
392 | + $this->container->getParameter('ascenso_directory'), | ||
393 | + $nombreAsociado | ||
394 | + ); | ||
395 | + thumbnail($nombreAsociado, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | ||
396 | + verificar_documentos($this->getUser()->getIdRolInstitucion(), 6, 2, $em, $nombreAsociado, $servicios); | ||
397 | + } | ||
398 | + | ||
399 | + | ||
399 | if ($form->get('documento_titular')->getData()) { | 400 | if ($form->get('documento_titular')->getData()) { |
400 | $escala5 = new DocenteEscala(); | 401 | $escala5 = new DocenteEscala(); |
401 | $titular = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(5); | 402 | $titular = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById(5); |