Commit 0f9c579895727646c29322c68c85d1a308c4ceab
1 parent
23e6829c78
Exists in
master
validado el año en el reconicmiento de escala para que empiece a partir del año …
…del ultimo ascenso obtenido
Showing
1 changed file
with
5 additions
and
3 deletions
Show diff stats
src/AppBundle/Controller/AscensoController.php
@@ -546,24 +546,26 @@ class AscensoController extends Controller | @@ -546,24 +546,26 @@ class AscensoController extends Controller | ||
546 | 546 | ||
547 | $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array( | 547 | $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array( |
548 | 'idRolInstitucion' => $servicio->getIdRolInstitucion(), | 548 | 'idRolInstitucion' => $servicio->getIdRolInstitucion(), |
549 | - 'idEstatus' => 1 | 549 | + 'idEstatus' => 1 |
550 | )); | 550 | )); |
551 | 551 | ||
552 | $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | 552 | $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); |
553 | - | 553 | + $ano = 2003; |
554 | if($ascenso == NULL){ | 554 | if($ascenso == NULL){ |
555 | $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findAll(); | 555 | $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findAll(); |
556 | }else{ | 556 | }else{ |
557 | $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($ascenso->getIdEscalafones()->getId()); | 557 | $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($ascenso->getIdEscalafones()->getId()); |
558 | + $ano = end($escala)->getFechaEscala()->format('Y');; | ||
558 | } | 559 | } |
559 | 560 | ||
560 | 561 | ||
562 | + | ||
561 | $form = $this->createFormBuilder() | 563 | $form = $this->createFormBuilder() |
562 | 564 | ||
563 | ->add('fechaAscenso', BirthdayType::class, array( | 565 | ->add('fechaAscenso', BirthdayType::class, array( |
564 | 'widget' => 'choice', | 566 | 'widget' => 'choice', |
565 | 'label' => 'Fecha de Ascenso', | 567 | 'label' => 'Fecha de Ascenso', |
566 | - 'years' => range(2003, date("Y")), | 568 | + 'years' => range($ano, date("Y")), |
567 | 'placeholder' => array( | 569 | 'placeholder' => array( |
568 | 'year' => 'Año', 'month' => 'Mes', 'day' => 'Día', | 570 | 'year' => 'Año', 'month' => 'Mes', 'day' => 'Día', |
569 | ), | 571 | ), |