Commit 6d0261f2bd44bcd5e3c590aa93e41c7113d333a1

Authored by Wilmer Ramones
1 parent bd23faf14f
Exists in master

se muestra el pida al coordinador y se aprueba o se rechaza la adscripcion

app/Resources/views/cea/solicitudes_mostar.html.twig
... ... @@ -45,7 +45,7 @@
45 45  
46 46 <div class="col-md-8">
47 47  
48   - <form action="{{ path('login') }}" method="post" role="form" >
  48 +
49 49  
50 50 <div class="form-group">
51 51 <label for="username">Fecha de Ingreso UBV:</label>
... ... @@ -89,12 +89,7 @@
89 89 <input type="text" class="form-control" value="{{adscripcion.tituloTrabajo}}" />
90 90 </div>
91 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>&nbsp;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>&nbsp;Rechazar</a>
96   - </form>
97   - <hr />
98 93 </div>
99 94 </div>
100 95  
... ... @@ -178,9 +173,30 @@
178 173  
179 174 </div>
180 175 </div>
  176 +
  177 +
181 178  
182 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>&nbsp;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>&nbsp;Rechazar</a>
183 198 </div>
  199 +
184 200 </div>
185 201  
186 202 {% endblock %}
... ...
src/AppBundle/Controller/AdscripcionController.php
... ... @@ -17,6 +17,7 @@ use AppBundle\Entity\Adscripcion;
17 17 use AppBundle\Entity\DocenteEscala;
18 18 use AppBundle\Entity\Memorando;
19 19 use AppBundle\Entity\DocenteServicio;
  20 +use AppBundle\Entity\AdscripcionPida;
20 21  
21 22 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
22 23 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
... ... @@ -226,6 +227,7 @@ class AdscripcionController extends Controller
226 227 * Solicita información al docente sobre su PIDA
227 228 *
228 229 * @Route("/solicitud/pida", name="solicitud_pida")
  230 + * @Method({"GET", "POST"})
229 231 */
230 232 public function pidaAction(Request $request)
231 233 {
... ... @@ -244,7 +246,24 @@ class AdscripcionController extends Controller
244 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 268 return $this->render(
250 269 'solicitudes/pida.html.twig',
... ... @@ -330,12 +349,14 @@ class AdscripcionController extends Controller
330 349 ));
331 350  
332 351 $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  352 + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
333 353  
334 354 return $this->render('cea/solicitudes_mostar.html.twig', array(
335 355 'adscripcion' => $adscripcion,
336 356 'servicio' => $servicio,
337 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 376 'idRolInstitucion' => $adscripcion->getIdRolInstitucion(),
356 377 'idServicioCe' => 2
357 378 ));
  379 +
  380 + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion());
  381 +
358 382 if($estatus == "true") {
359 383 $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1));
360 384 $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion());
361 385 $user->addRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO"));
  386 + $pida->setIdEstatus($servicios->getIdEstatus());
362 387  
363 388 }else{
364 389 $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3));
365 390 $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion());
366 391 $user->removeRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO"));
  392 + $pida->setIdEstatus($servicios->getIdEstatus());
367 393 }
368 394  
369 395 $em = $this->getDoctrine()->getManager();
370 396 $em->persist($servicios);
371 397 $em->persist($user);
  398 + $em->persist($pida);
372 399 $em->flush();
373 400  
374 401 $message = \Swift_Message::newInstance()
... ... @@ -398,7 +425,8 @@ class AdscripcionController extends Controller
398 425 return $this->render('cea/solicitudes_mostar.html.twig', array(
399 426 'servicio' => $servicios,
400 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 45 //si no ha solicitado adscripción regresa a la pagina de adscripcion
46 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 49 findOneBy(array(
50   - 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion()->getId(),
51   - 'idServicioCe' => 4
  50 + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion()->getId()
52 51 ));
53 52  
54 53 if(!$pida){ return $this->redirect($this->generateUrl('solicitud_pida')); }
... ...
src/AppBundle/Form/PidaType.php
... ... @@ -22,7 +22,7 @@ class PidaType extends AbstractType
22 22 {
23 23 $builder
24 24  
25   - ->add('plan_historico_nacional_estrategico', EntityType::class, array(
  25 + ->add('id_plan_historico_nacional_estrategico', EntityType::class, array(
26 26 'label' => false,
27 27 'attr' => array(
28 28 'class' => 'select2'
... ... @@ -34,7 +34,7 @@ class PidaType extends AbstractType
34 34 'group_by' => 'getIdPlanHistoricoNacional'
35 35 ))
36 36  
37   - ->add('actividad_docente', EntityType::class, array(
  37 + ->add('id_actividad_docente', EntityType::class, array(
38 38 'label' => false,
39 39 'attr' => array(
40 40 'class' => 'select2'
... ...