Commit d2454b0a45db223e24c5097ada20a88cf663382f
1 parent
a2b0cd943a
Exists in
master
atrapado el error de que si no tiene la solicitud y si no ha concursado, entonce…
…s no puede ascender hasta que concurse
Showing
1 changed file
with
9 additions
and
3 deletions
Show diff stats
src/AppBundle/Controller/AscensoController.php
... | ... | @@ -35,9 +35,10 @@ class AscensoController extends Controller |
35 | 35 | $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( |
36 | 36 | array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5) |
37 | 37 | ); |
38 | - | |
39 | - if($solicitud->getIdEstatus()->getId() != 5 ){ | |
40 | - return $this->redirect($this->generateUrl('servicios_index')); | |
38 | + if($solicitud){ | |
39 | + if($solicitud->getIdEstatus()->getId() != 5 ){ | |
40 | + return $this->redirect($this->generateUrl('servicios_index')); | |
41 | + } | |
41 | 42 | } |
42 | 43 | |
43 | 44 | |
... | ... | @@ -47,6 +48,11 @@ class AscensoController extends Controller |
47 | 48 | array('id' => 'DESC') |
48 | 49 | ); |
49 | 50 | |
51 | + if(!$escala){ | |
52 | + $this->addFlash('danger', 'Estimado Docente, todavia no ha concursado, debe concursar primero para poder realizar una solicitud de ascenso.'); | |
53 | + return $this->redirect($this->generateUrl('cea_index')); | |
54 | + } | |
55 | + | |
50 | 56 | $siguiente = $escala->getIdEscala()->getId() + 1; |
51 | 57 | $ascenso = new Ascenso(); |
52 | 58 | if($siguiente < 6){ | ... | ... |