Commit 91bbebb4b6d51669951fadf0b10e5a55d4d64a17
1 parent
882f8733da
Exists in
master
se esta calculando el tiempo que le falta para ascender, pendiente con los cuatr…
…o años... debe ser con el tiempo en la base de dtos en appcontroler
Showing
2 changed files
with
25 additions
and
1 deletions
Show diff stats
src/AppBundle/Controller/AppController.php
... | ... | @@ -49,9 +49,27 @@ class AppController extends Controller { |
49 | 49 | findOneBy(array( |
50 | 50 | 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion()->getId() |
51 | 51 | )); |
52 | + | |
52 | 53 | |
53 | 54 | if(!$pida){ return $this->redirect($this->generateUrl('solicitud_pida')); } |
54 | 55 | |
56 | + $escalafon = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findOneBy( | |
57 | + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion()), | |
58 | + array('id' => 'DESC') | |
59 | + ); | |
60 | + | |
61 | + if ($escalafon){ | |
62 | + $escalafones = $this->getDoctrine()->getRepository("AppBundle:Escalafones")->findOneById($escalafon->getIdEscala()->getId() + 1); //tiempo para el proximo escalafon | |
63 | + if($escalafones){ | |
64 | + //tiempo para el prox escalafon | |
65 | + $tiempoProxEscalafon = $escalafon->getFechaEscala()->modify('+4 years'); | |
66 | + $tiempoTranscurrido = $tiempoProxEscalafon->diff(new \DateTime("now")); | |
67 | + var_dump($tiempoTranscurrido); exit; | |
68 | + } | |
69 | + } | |
70 | + | |
71 | + | |
72 | + | |
55 | 73 | |
56 | 74 | //solicitud aprobada está en falso |
57 | 75 | $adscrito = false; | ... | ... |
src/AppBundle/Controller/AscensoController.php
... | ... | @@ -53,8 +53,14 @@ class AscensoController extends Controller |
53 | 53 | $this->addFlash('danger', 'Estimado Docente, todavia no ha concursado, debe concursar primero para poder realizar una solicitud de ascenso.'); |
54 | 54 | return $this->redirect($this->generateUrl('cea_index')); |
55 | 55 | } |
56 | + //busca la escala siguiente | |
57 | + $escalafones = $this->getDoctrine()->getRepository("AppBundle:Escalafones")->findOneById($escala->getIdEscala()->getId() + 1); //tiempo para el proximo escalafon | |
58 | + //si no hay escalas siguientes, es debido a que es titular | |
59 | + if(!$escalafones){ | |
60 | + $this->addFlash('notice', 'Ya usted posee el máximo escalfón docente disponible. no puede solicitar este servicio.'); | |
61 | + return $this->redirect($this->generateUrl('servicios_index')); | |
62 | + } | |
56 | 63 | |
57 | - $escalafones = $this->getDoctrine()->getRepository("AppBundle:Escalafones")->findOneById($escala->getIdEscala()->getId() + 1); //tiempo para el proximo escalafon | |
58 | 64 | $tiempoProxEscalafon = $escala->getFechaEscala()->diff(new \DateTime("now")); |
59 | 65 | |
60 | 66 | //si no cumple el tiempo para solicitar ascenso | ... | ... |