Commit 68e1a5ef7c6425ea7cc176753d49b00bd71e81c1

Authored by Wilmer
1 parent 834f3b6622
Exists in master

corregida las vistas de la adscripcion en los demas modulos

app/Resources/views/cea/ascenso_mostar.html.twig
... ... @@ -316,7 +316,7 @@
316 316 <div class="col-md-12">
317 317 <div class="account-container full register">
318 318 <div class="content clearfix">
319   - <h2>PIDA <span class="small" style="float: right;"> Estatus: {{ servicio.idEstatus }}</span></h2>
  319 + <h2>PIDA <span class="small" style="float: right;"> Estatus: {{ servicioPida.idEstatus }}</span></h2>
320 320 <table class="table table-bordered">
321 321 <th>Objetivo Histórico</th>
322 322 <th>Actividad Docente</th>
... ... @@ -324,6 +324,8 @@
324 324 <th>Plazo</th>
325 325 <th>Estatus</th>
326 326 {% for pid in docente.pida | sort %}
  327 + {#solo muestre la vigente #}
  328 + {% if pid.idDocenteServicio.id == servicioPida.id %}
327 329 <tr>
328 330 <td rowspan="{{ pid.pidaTareaEspecifico | length }}">
329 331 {{ pid.idPlanHistoricoNacionalEstrategico.nombre }}
... ... @@ -344,6 +346,7 @@
344 346 {% endfor %}
345 347  
346 348 </tr>
  349 + {% endif %}
347 350 {% endfor %}
348 351 </table>
349 352 </div>
... ...
app/Resources/views/cea/solicitudes_mostar.html.twig
... ... @@ -269,7 +269,7 @@
269 269 </div>
270 270  
271 271 <!-- MOSTRAR ACTIVIDAD PIDA DEL DOCENTE -->
272   - {% if not todo.pida %}
  272 + {% if not servicioPida %}
273 273 <p class="alert alert-warning">El Docente no ha registrado todavía su actividad PIDA</p>
274 274 {% else %}
275 275  
... ... @@ -290,7 +290,7 @@
290 290 <th>Tarea Específica</th>
291 291 <th>Plazo</th>
292 292 <th>Estatus</th>
293   - {% for pid in todo.pida | sort %}
  293 + {% for pid in pida | sort %}
294 294 <tr>
295 295 <td rowspan="{{ pid.pidaTareaEspecifico | length }}">
296 296 {{ pid.idPlanHistoricoNacionalEstrategico.nombre }}
... ...
app/Resources/views/solicitudes/adscripcion_show.twig
... ... @@ -266,6 +266,8 @@
266 266 <th>Plazo</th>
267 267 <th>Estatus</th>
268 268 {% for pid in todo.pida | sort %}
  269 + {#solo muestre la vigente #}
  270 + {% if pid.idDocenteServicio.id == servicioPida.id %}
269 271 <tr>
270 272 <td rowspan="{{ pid.pidaTareaEspecifico | length }}">
271 273 {{ pid.idPlanHistoricoNacionalEstrategico.nombre }}
... ... @@ -289,6 +291,7 @@
289 291 {% endfor %}
290 292  
291 293 </tr>
  294 + {% endif %}
292 295 {% endfor %}
293 296 </table>
294 297 </div>
... ...
src/AppBundle/Controller/AdscripcionController.php
... ... @@ -676,14 +676,26 @@ class AdscripcionController extends Controller
676 676 $todo = $em->getRepository("AppBundle:RolInstitucion")->findOneById($servicio->getIdRolInstitucion());
677 677 $servicioPida = $this->getDoctrine()->getRepository("AppBundle:DocenteServicio")->findOneBy(array(
678 678 'idRolInstitucion' => $todo,
679   - 'idServicioCe' => 4
680   - ));
  679 + 'idServicioCe' => 4),
  680 + array ('id' => 'DESC')
  681 + );
  682 + $pida = false;
  683 +
  684 + if($servicioPida){
  685 + $pida = $this->getDoctrine()->getRepository("AppBundle:AdscripcionPida")->findBy(array(
  686 + 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
  687 + 'idDocenteServicio' => $servicioPida
  688 + ));
  689 + }
  690 +
  691 +
681 692  
682 693  
683 694 return $this->render('cea/solicitudes_mostar.html.twig', array(
684 695 'servicio' => $servicio,
685 696 'servicioPida' => $servicioPida,
686   - 'todo' => $todo
  697 + 'todo' => $todo,
  698 + 'pida' => $pida
687 699 ));
688 700 }
689 701  
... ... @@ -702,8 +714,9 @@ class AdscripcionController extends Controller
702 714 $todo = $servicio->getIdRolInstitucion();
703 715 $servicioPida = $this->getDoctrine()->getRepository("AppBundle:DocenteServicio")->findOneBy(array(
704 716 'idRolInstitucion' => $todo,
705   - 'idServicioCe' => 4
706   - ));
  717 + 'idServicioCe' => 4),
  718 + array('id' => 'DESC')
  719 + );
707 720  
708 721 $form = $this->createForm('AppBundle\Form\AdscripcionEditType');
709 722  
... ...
src/AppBundle/Controller/AscensoController.php
... ... @@ -501,9 +501,13 @@ class AscensoController extends Controller
501 501 array('id' => 'DESC')
502 502 );
503 503 }
504   -
505   -
506   - $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  504 +
  505 + $servicioPida = $this->getDoctrine()->getRepository("AppBundle:DocenteServicio")->findOneBy(array(
  506 + 'idRolInstitucion' => $docente,
  507 + 'idServicioCe' => 4),
  508 + array('id' => 'DESC')
  509 + );
  510 + //$pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
507 511 $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array(
508 512 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
509 513 'idServicioCe' => 1
... ... @@ -515,7 +519,7 @@ class AscensoController extends Controller
515 519 'ascenso' => $ascenso,
516 520 'servicio' => $servicio,
517 521 'escalas' => $escala,
518   - 'pida' => $pida,
  522 + 'servicioPida' => $servicioPida,
519 523 'antiguedad' => $antiguedad,
520 524 'form' => $form->createView(),
521 525 'docente' => $docente
... ... @@ -737,14 +741,7 @@ class AscensoController extends Controller
737 741  
738 742 $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($serviciosAscenso->getIdRolInstitucion());
739 743 $docente = $this->getDoctrine()->getRepository("AppBundle:RolInstitucion")->findOneById($ascenso->getIdRolInstitucion()->getId());
740   - return $this->render('cea/ascenso_mostar.html.twig', array(
741   - 'ascenso' => $ascenso,
742   - 'servicio' => $serviciosAscenso,
743   - 'escalas' => $escala,
744   - 'pida' => $pida,
745   - 'antiguedad' => $antiguedad,
746   - 'docente' => $docente
747   - ));
  744 + return $this->redirect($this->generateUrl('cea_ascenso_show', array('id' => $ascenso->getId())));
748 745  
749 746 }
750 747  
... ...