Commit 390ad14e76b0080b1a6ea3ef21f2c4159fa688fc
1 parent
32adfbad7b
Exists in
master
mostrar el escalafon actual y el proximo a ascender y evitar solicitar otro esca…
…lafon si ya tiene una solicitud en espera
Showing
2 changed files
with
18 additions
and
2 deletions
Show diff stats
app/Resources/views/solicitudes/ascenso.html.twig
... | ... | @@ -27,6 +27,10 @@ |
27 | 27 | <strong>{{app.user.idRolInstitucion.idRol.idPersona.primerNombre}} |
28 | 28 | {{app.user.idRolInstitucion.idRol.idPersona.primerApellido}}</strong>, |
29 | 29 | En este apartado usted podrá solicitar el ascenso al siguiente escalafón. |
30 | + <ul> | |
31 | + <li>Escalafón Actual: {{ ultima_escala.idEscala.nombre }}</li> | |
32 | + <li>Escalafón Solicitud: {{ nueva_escala.nombre }}</li> | |
33 | + </ul> | |
30 | 34 | |
31 | 35 | </h4> |
32 | 36 | </div> | ... | ... |
src/AppBundle/Controller/AscensoController.php
... | ... | @@ -32,7 +32,15 @@ class AscensoController extends Controller |
32 | 32 | { |
33 | 33 | |
34 | 34 | |
35 | - $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findOneBy( | |
35 | + $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( | |
36 | + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5) | |
37 | + ); | |
38 | + | |
39 | + if($solicitud){ | |
40 | + return $this->redirect($this->generateUrl('servicios_index')); | |
41 | + } | |
42 | + | |
43 | + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findOneBy( | |
36 | 44 | array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion()), |
37 | 45 | array('id' => 'DESC') |
38 | 46 | ); |
... | ... | @@ -163,7 +171,11 @@ class AscensoController extends Controller |
163 | 171 | |
164 | 172 | return $this->render( |
165 | 173 | 'solicitudes/ascenso.html.twig', |
166 | - array('form' => $form->createView()) | |
174 | + array( | |
175 | + 'form' => $form->createView(), | |
176 | + 'ultima_escala' => $escala, | |
177 | + 'nueva_escala' => $nueva_escala | |
178 | + ) | |
167 | 179 | ); |
168 | 180 | } |
169 | 181 | ... | ... |