Commit 6d0261f2bd44bcd5e3c590aa93e41c7113d333a1
1 parent
bd23faf14f
Exists in
master
se muestra el pida al coordinador y se aprueba o se rechaza la adscripcion
Showing
4 changed files
with
57 additions
and
14 deletions
Show diff stats
app/Resources/views/cea/solicitudes_mostar.html.twig
@@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
45 | 45 | ||
46 | <div class="col-md-8"> | 46 | <div class="col-md-8"> |
47 | 47 | ||
48 | - <form action="{{ path('login') }}" method="post" role="form" > | 48 | + |
49 | 49 | ||
50 | <div class="form-group"> | 50 | <div class="form-group"> |
51 | <label for="username">Fecha de Ingreso UBV:</label> | 51 | <label for="username">Fecha de Ingreso UBV:</label> |
@@ -89,12 +89,7 @@ | @@ -89,12 +89,7 @@ | ||
89 | <input type="text" class="form-control" value="{{adscripcion.tituloTrabajo}}" /> | 89 | <input type="text" class="form-control" value="{{adscripcion.tituloTrabajo}}" /> |
90 | </div> | 90 | </div> |
91 | {% endif %} | 91 | {% endif %} |
92 | - | ||
93 | 92 | ||
94 | - <a class="btn btn-success btn-sm" href="{{ path('cea_solicitudes_actualizar', { 'id': adscripcion.id, 'estatus' : 'true' }) }}" ><span class="fa fa-check"></span> Aprobar</a> | ||
95 | - <a class="btn btn-danger btn-sm" href="{{ path('cea_solicitudes_actualizar', { 'id': adscripcion.id, 'estatus' : 'false' }) }}" ><span class="fa fa-close"></span> Rechazar</a> | ||
96 | - </form> | ||
97 | - <hr /> | ||
98 | </div> | 93 | </div> |
99 | </div> | 94 | </div> |
100 | 95 | ||
@@ -178,9 +173,30 @@ | @@ -178,9 +173,30 @@ | ||
178 | 173 | ||
179 | </div> | 174 | </div> |
180 | </div> | 175 | </div> |
176 | + | ||
177 | + | ||
181 | 178 | ||
182 | </div> | 179 | </div> |
180 | + <!-- MOSTRAR ACTIVIDAD PIDA DEL DOCENTE --> | ||
181 | + {% if not pida %} | ||
182 | + <p class="alert alert-warning">El Docente no ha registrado todavía su actividad PIDA</p> | ||
183 | + {% else %} | ||
184 | + <div class="form-group"> | ||
185 | + <label for="pida">PIDA:</label> | ||
186 | + <ul> | ||
187 | + <li>Objetivo Estratégico: {{pida.idPlanHistoricoNacionalEstrategico.nombre}}</li> | ||
188 | + <li>Ámbito: {{ pida.idActividadDocente.nombre }}</li> | ||
189 | + <li>Objetivo Específico: {{ pida.ObjetivoEspecifico }}</li> | ||
190 | + <li>Fecha inicio: {{ pida.fechaInicio | date('d-m-Y') }} </li> | ||
191 | + <li>Fecha final: {{ pida.fechaFinal | date('d-m-Y') }} </li> | ||
192 | + | ||
193 | + </ul> | ||
194 | + </div> | ||
195 | + {% endif %} | ||
196 | + <a class="btn btn-success btn-sm" href="{{ path('cea_solicitudes_actualizar', { 'id': adscripcion.id, 'estatus' : 'true' }) }}" ><span class="fa fa-check"></span> Aprobar</a> | ||
197 | + <a class="btn btn-danger btn-sm" href="{{ path('cea_solicitudes_actualizar', { 'id': adscripcion.id, 'estatus' : 'false' }) }}" ><span class="fa fa-close"></span> Rechazar</a> | ||
183 | </div> | 198 | </div> |
199 | + | ||
184 | </div> | 200 | </div> |
185 | 201 | ||
186 | {% endblock %} | 202 | {% endblock %} |
src/AppBundle/Controller/AdscripcionController.php
@@ -17,6 +17,7 @@ use AppBundle\Entity\Adscripcion; | @@ -17,6 +17,7 @@ use AppBundle\Entity\Adscripcion; | ||
17 | use AppBundle\Entity\DocenteEscala; | 17 | use AppBundle\Entity\DocenteEscala; |
18 | use AppBundle\Entity\Memorando; | 18 | use AppBundle\Entity\Memorando; |
19 | use AppBundle\Entity\DocenteServicio; | 19 | use AppBundle\Entity\DocenteServicio; |
20 | +use AppBundle\Entity\AdscripcionPida; | ||
20 | 21 | ||
21 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | 22 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
22 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; | 23 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
@@ -226,6 +227,7 @@ class AdscripcionController extends Controller | @@ -226,6 +227,7 @@ class AdscripcionController extends Controller | ||
226 | * Solicita información al docente sobre su PIDA | 227 | * Solicita información al docente sobre su PIDA |
227 | * | 228 | * |
228 | * @Route("/solicitud/pida", name="solicitud_pida") | 229 | * @Route("/solicitud/pida", name="solicitud_pida") |
230 | + * @Method({"GET", "POST"}) | ||
229 | */ | 231 | */ |
230 | public function pidaAction(Request $request) | 232 | public function pidaAction(Request $request) |
231 | { | 233 | { |
@@ -244,7 +246,24 @@ class AdscripcionController extends Controller | @@ -244,7 +246,24 @@ class AdscripcionController extends Controller | ||
244 | return $this->redirect($this->generateUrl('cea_index')); | 246 | return $this->redirect($this->generateUrl('cea_index')); |
245 | } | 247 | } |
246 | 248 | ||
247 | - $form = $this->createForm('AppBundle\Form\PidaType'); | 249 | + $pida = new AdscripcionPida(); |
250 | + $form = $this->createForm('AppBundle\Form\PidaType', $pida); | ||
251 | + $form->handleRequest($request); | ||
252 | + | ||
253 | + | ||
254 | + if ($form->isSubmitted() && $form->isValid()) { | ||
255 | + | ||
256 | + $pida->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | ||
257 | + $pida->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(2)); | ||
258 | + | ||
259 | + $em = $this->getDoctrine()->getManager(); | ||
260 | + $em->persist($pida); | ||
261 | + $em->flush(); | ||
262 | + | ||
263 | + return $this->redirectToRoute('cea_index'); | ||
264 | + | ||
265 | + } | ||
266 | + | ||
248 | 267 | ||
249 | return $this->render( | 268 | return $this->render( |
250 | 'solicitudes/pida.html.twig', | 269 | 'solicitudes/pida.html.twig', |
@@ -330,12 +349,14 @@ class AdscripcionController extends Controller | @@ -330,12 +349,14 @@ class AdscripcionController extends Controller | ||
330 | )); | 349 | )); |
331 | 350 | ||
332 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | 351 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); |
352 | + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | ||
333 | 353 | ||
334 | return $this->render('cea/solicitudes_mostar.html.twig', array( | 354 | return $this->render('cea/solicitudes_mostar.html.twig', array( |
335 | 'adscripcion' => $adscripcion, | 355 | 'adscripcion' => $adscripcion, |
336 | 'servicio' => $servicio, | 356 | 'servicio' => $servicio, |
337 | 'escalas' => $escala, | 357 | 'escalas' => $escala, |
338 | - 'servicio' => $servicio | 358 | + 'servicio' => $servicio, |
359 | + 'pida' => $pida | ||
339 | )); | 360 | )); |
340 | } | 361 | } |
341 | 362 | ||
@@ -355,20 +376,26 @@ class AdscripcionController extends Controller | @@ -355,20 +376,26 @@ class AdscripcionController extends Controller | ||
355 | 'idRolInstitucion' => $adscripcion->getIdRolInstitucion(), | 376 | 'idRolInstitucion' => $adscripcion->getIdRolInstitucion(), |
356 | 'idServicioCe' => 2 | 377 | 'idServicioCe' => 2 |
357 | )); | 378 | )); |
379 | + | ||
380 | + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); | ||
381 | + | ||
358 | if($estatus == "true") { | 382 | if($estatus == "true") { |
359 | $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1)); | 383 | $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1)); |
360 | $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); | 384 | $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); |
361 | $user->addRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO")); | 385 | $user->addRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO")); |
386 | + $pida->setIdEstatus($servicios->getIdEstatus()); | ||
362 | 387 | ||
363 | }else{ | 388 | }else{ |
364 | $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3)); | 389 | $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3)); |
365 | $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); | 390 | $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); |
366 | $user->removeRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO")); | 391 | $user->removeRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO")); |
392 | + $pida->setIdEstatus($servicios->getIdEstatus()); | ||
367 | } | 393 | } |
368 | 394 | ||
369 | $em = $this->getDoctrine()->getManager(); | 395 | $em = $this->getDoctrine()->getManager(); |
370 | $em->persist($servicios); | 396 | $em->persist($servicios); |
371 | $em->persist($user); | 397 | $em->persist($user); |
398 | + $em->persist($pida); | ||
372 | $em->flush(); | 399 | $em->flush(); |
373 | 400 | ||
374 | $message = \Swift_Message::newInstance() | 401 | $message = \Swift_Message::newInstance() |
@@ -398,7 +425,8 @@ class AdscripcionController extends Controller | @@ -398,7 +425,8 @@ class AdscripcionController extends Controller | ||
398 | return $this->render('cea/solicitudes_mostar.html.twig', array( | 425 | return $this->render('cea/solicitudes_mostar.html.twig', array( |
399 | 'servicio' => $servicios, | 426 | 'servicio' => $servicios, |
400 | 'adscripcion' => $adscripcion, | 427 | 'adscripcion' => $adscripcion, |
401 | - 'escalas' => $escala | 428 | + 'escalas' => $escala, |
429 | + 'pida' => $pida | ||
402 | )); | 430 | )); |
403 | 431 | ||
404 | } | 432 | } |
src/AppBundle/Controller/AppController.php
@@ -45,10 +45,9 @@ class AppController extends Controller { | @@ -45,10 +45,9 @@ class AppController extends Controller { | ||
45 | //si no ha solicitado adscripción regresa a la pagina de adscripcion | 45 | //si no ha solicitado adscripción regresa a la pagina de adscripcion |
46 | if(!$adscripcion){ return $this->redirect($this->generateUrl('solicitud_adscripcion')); } | 46 | if(!$adscripcion){ return $this->redirect($this->generateUrl('solicitud_adscripcion')); } |
47 | 47 | ||
48 | - $pida = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')-> | 48 | + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')-> |
49 | findOneBy(array( | 49 | findOneBy(array( |
50 | - 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion()->getId(), | ||
51 | - 'idServicioCe' => 4 | 50 | + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion()->getId() |
52 | )); | 51 | )); |
53 | 52 | ||
54 | if(!$pida){ return $this->redirect($this->generateUrl('solicitud_pida')); } | 53 | if(!$pida){ return $this->redirect($this->generateUrl('solicitud_pida')); } |
src/AppBundle/Form/PidaType.php
@@ -22,7 +22,7 @@ class PidaType extends AbstractType | @@ -22,7 +22,7 @@ class PidaType extends AbstractType | ||
22 | { | 22 | { |
23 | $builder | 23 | $builder |
24 | 24 | ||
25 | - ->add('plan_historico_nacional_estrategico', EntityType::class, array( | 25 | + ->add('id_plan_historico_nacional_estrategico', EntityType::class, array( |
26 | 'label' => false, | 26 | 'label' => false, |
27 | 'attr' => array( | 27 | 'attr' => array( |
28 | 'class' => 'select2' | 28 | 'class' => 'select2' |
@@ -34,7 +34,7 @@ class PidaType extends AbstractType | @@ -34,7 +34,7 @@ class PidaType extends AbstractType | ||
34 | 'group_by' => 'getIdPlanHistoricoNacional' | 34 | 'group_by' => 'getIdPlanHistoricoNacional' |
35 | )) | 35 | )) |
36 | 36 | ||
37 | - ->add('actividad_docente', EntityType::class, array( | 37 | + ->add('id_actividad_docente', EntityType::class, array( |
38 | 'label' => false, | 38 | 'label' => false, |
39 | 'attr' => array( | 39 | 'attr' => array( |
40 | 'class' => 'select2' | 40 | 'class' => 'select2' |