From 0f9c579895727646c29322c68c85d1a308c4ceab Mon Sep 17 00:00:00 2001 From: Wilmer Date: Mon, 13 Mar 2017 09:46:14 -0400 Subject: [PATCH] =?UTF-8?q?validado=20el=20a=C3=B1o=20en=20el=20reconicmie?= =?UTF-8?q?nto=20de=20escala=20para=20que=20empiece=20a=20partir=20del=20a?= =?UTF-8?q?=C3=B1o=20del=20ultimo=20ascenso=20obtenido?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppBundle/Controller/AscensoController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AppBundle/Controller/AscensoController.php b/src/AppBundle/Controller/AscensoController.php index 07a2570..387e5c2 100644 --- a/src/AppBundle/Controller/AscensoController.php +++ b/src/AppBundle/Controller/AscensoController.php @@ -546,24 +546,26 @@ class AscensoController extends Controller $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array( 'idRolInstitucion' => $servicio->getIdRolInstitucion(), - 'idEstatus' => 1 + 'idEstatus' => 1 )); $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); - + $ano = 2003; if($ascenso == NULL){ $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findAll(); }else{ $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($ascenso->getIdEscalafones()->getId()); + $ano = end($escala)->getFechaEscala()->format('Y');; } + $form = $this->createFormBuilder() ->add('fechaAscenso', BirthdayType::class, array( 'widget' => 'choice', 'label' => 'Fecha de Ascenso', - 'years' => range(2003, date("Y")), + 'years' => range($ano, date("Y")), 'placeholder' => array( 'year' => 'Año', 'month' => 'Mes', 'day' => 'Día', ), -- 2.0.0