Commit 920d3e4181cdd176b7c5af9936cdbd743317b440
1 parent
6031902c8a
Exists in
master
aparece el texto para poder añadir tutores faltantes de los 6 que necesita
Showing
3 changed files
with
96 additions
and
9 deletions
Show diff stats
app/Resources/views/cea/ascenso_mostar.html.twig
@@ -2,10 +2,11 @@ | @@ -2,10 +2,11 @@ | ||
2 | {% block stylesheets %} | 2 | {% block stylesheets %} |
3 | {{ parent() }} | 3 | {{ parent() }} |
4 | <link href="{{ asset('assets/vendor/lightbox2/dist/css/lightbox.css') }}" rel="stylesheet"> | 4 | <link href="{{ asset('assets/vendor/lightbox2/dist/css/lightbox.css') }}" rel="stylesheet"> |
5 | + <link rel="stylesheet" href="{{ asset('assets/vendor/chosen/chosen.min.css') }}"> | ||
5 | {% endblock %} | 6 | {% endblock %} |
6 | 7 | ||
7 | {%block body %} | 8 | {%block body %} |
8 | - | 9 | + {% set cantidadJurado = 6 %} |
9 | <div class="content-wrapper"> | 10 | <div class="content-wrapper"> |
10 | <div class="container"> | 11 | <div class="container"> |
11 | {% for message in app.session.flashBag.get('notice') %} | 12 | {% for message in app.session.flashBag.get('notice') %} |
@@ -25,10 +26,9 @@ | @@ -25,10 +26,9 @@ | ||
25 | <h4 class="alert alert-danger">Estatus <strong>{{servicio.idEstatus}}</strong> | 26 | <h4 class="alert alert-danger">Estatus <strong>{{servicio.idEstatus}}</strong> |
26 | {% else %} | 27 | {% else %} |
27 | <h4 class="alert alert-warning">Estatus <strong>{{servicio.idEstatus}}</strong> | 28 | <h4 class="alert alert-warning">Estatus <strong>{{servicio.idEstatus}}</strong> |
28 | - {% endif %} | ||
29 | - </h4> | 29 | + {% endif %} |
30 | + </h4> | ||
30 | </div> | 31 | </div> |
31 | - | ||
32 | </div> | 32 | </div> |
33 | <div class="row"> | 33 | <div class="row"> |
34 | 34 | ||
@@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
45 | 45 | ||
46 | {% if escalas is not null %} | 46 | {% if escalas is not null %} |
47 | <div class="form-group"> | 47 | <div class="form-group"> |
48 | - <label for="Escalafones">Escalafones Obtenidos:</label> | 48 | + <label for="Escalafones">{{ cantidadJurado }}Escalafones Obtenidos:</label> |
49 | <table class="table table-striped table-bordered"> | 49 | <table class="table table-striped table-bordered"> |
50 | <th>Escalafón</th> | 50 | <th>Escalafón</th> |
51 | <th>Fecha</th> | 51 | <th>Fecha</th> |
@@ -60,17 +60,36 @@ | @@ -60,17 +60,36 @@ | ||
60 | {%endfor %} | 60 | {%endfor %} |
61 | </table> | 61 | </table> |
62 | 62 | ||
63 | - <p ><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p> | 63 | + <p><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p> |
64 | 64 | ||
65 | <h4>Jurados propuestos por el Docente</h4> | 65 | <h4>Jurados propuestos por el Docente</h4> |
66 | + {% set añadirJurado = true %} | ||
67 | + {% set cantidadJurado = 6 %} | ||
66 | {% for tutor in ascenso.tutoresAscenso %} | 68 | {% for tutor in ascenso.tutoresAscenso %} |
69 | + {% if loop.length >= 5 %} | ||
70 | + {% set añadirJurado = false %} | ||
71 | + {% else %} | ||
72 | + {% set cantidadJurado = cantidadJurado - loop.index %} | ||
73 | + {% endif %} | ||
67 | <p class="well"> | 74 | <p class="well"> |
75 | + | ||
68 | <strong>{{ tutor.nombres }} {{ tutor.apellidos }}:</strong> | 76 | <strong>{{ tutor.nombres }} {{ tutor.apellidos }}:</strong> |
69 | {{ tutor.institucion }} -> {{ tutor.idEscala.nombre }} | 77 | {{ tutor.institucion }} -> {{ tutor.idEscala.nombre }} |
70 | <input type="button" class="btn btn-warning btn-xs" value="act" id="actualizar_tutor"> | 78 | <input type="button" class="btn btn-warning btn-xs" value="act" id="actualizar_tutor"> |
71 | - <input type="button" class="btn btn-danger btn-xs" value="cam" id="cambiar_tutor"> | 79 | + <input type="button" class="btn btn-danger btn-xs" value="cam" id="cambiar_tutor"> |
72 | </p> | 80 | </p> |
73 | {% endfor %} | 81 | {% endfor %} |
82 | + {% if añadirJurado %} | ||
83 | + {{ dump(cantidadJurado) }} | ||
84 | + <p id="falta" class="label label-danger" data-faltaid = '{{cantidadJurado}}'> | ||
85 | + El docente no tiene o le faltó completar posibles jurados | ||
86 | + </p> | ||
87 | + {% form_theme form 'bootstrap_3_layout.html.twig' %} | ||
88 | + {{ form_start(form) }} | ||
89 | + {{ form_widget(form) }} | ||
90 | + {{ form_end(form) }} | ||
91 | + <button class="btn btn-primary btn-sm" id="añadirJurados">Añadir Jurados</button> | ||
92 | + {% endif %} | ||
74 | 93 | ||
75 | 94 | ||
76 | </div> | 95 | </div> |
@@ -247,12 +266,28 @@ | @@ -247,12 +266,28 @@ | ||
247 | 266 | ||
248 | {% block javascripts %} | 267 | {% block javascripts %} |
249 | {{ parent() }} | 268 | {{ parent() }} |
269 | + <script type="text/javascript" src="{{ asset('assets/vendor/chosen/chosen.jquery.min.js') }}"></script> | ||
250 | <script type="text/javascript" src="{{ asset('assets/vendor/lightbox2/dist/js/lightbox.min.js') }}"></script> | 270 | <script type="text/javascript" src="{{ asset('assets/vendor/lightbox2/dist/js/lightbox.min.js') }}"></script> |
251 | 271 | ||
252 | <script> | 272 | <script> |
273 | + var cantidad = $("#falta").data('faltaid'); | ||
274 | + alert(cantidad); | ||
253 | $("#actualizar_tutor").click(function(){ | 275 | $("#actualizar_tutor").click(function(){ |
254 | alert("click"); | 276 | alert("click"); |
255 | }); | 277 | }); |
278 | + | ||
279 | + $("#aadd_tutor_tutores_ascenso").on("chosen:ready", function() { | ||
280 | + $("#add_tutor_tutores_ascenso").chosen('destroy').chosen({ max_selected_options: 2 }); | ||
281 | + }); | ||
282 | + | ||
283 | + | ||
284 | + $("#add_tutor_tutores_ascenso").chosen({ | ||
285 | + no_results_text: "<a data-toggle='modal' data-target='#buscarTutores' href='#'>Tutor no registrado, click aquí para registrar!</a>", | ||
286 | + max_selected_options: cantidad | ||
287 | + | ||
288 | + }); | ||
289 | + | ||
290 | + | ||
256 | 291 | ||
257 | 292 | ||
258 | </script> | 293 | </script> |
src/AppBundle/Controller/AscensoController.php
@@ -398,7 +398,7 @@ class AscensoController extends Controller | @@ -398,7 +398,7 @@ class AscensoController extends Controller | ||
398 | 398 | ||
399 | 399 | ||
400 | /** | 400 | /** |
401 | - * Encuentra y muestra una entidad de tipo Adscripción. | 401 | + * Encuentra y muestra una entidad de tipo Ascenso. |
402 | * | 402 | * |
403 | * @Route("/ascenso/{id}", name="cea_ascenso_show") | 403 | * @Route("/ascenso/{id}", name="cea_ascenso_show") |
404 | * @Method("GET") | 404 | * @Method("GET") |
@@ -421,13 +421,16 @@ class AscensoController extends Controller | @@ -421,13 +421,16 @@ class AscensoController extends Controller | ||
421 | 'idRolInstitucion' => $servicio->getIdRolInstitucion(), | 421 | 'idRolInstitucion' => $servicio->getIdRolInstitucion(), |
422 | 'idServicioCe' => 1 | 422 | 'idServicioCe' => 1 |
423 | )); | 423 | )); |
424 | + | ||
425 | + $form = $this->createForm('AppBundle\Form\AddTutorType'); | ||
424 | 426 | ||
425 | return $this->render('cea/ascenso_mostar.html.twig', array( | 427 | return $this->render('cea/ascenso_mostar.html.twig', array( |
426 | 'ascenso' => $ascenso, | 428 | 'ascenso' => $ascenso, |
427 | 'servicio' => $servicio, | 429 | 'servicio' => $servicio, |
428 | 'escalas' => $escala, | 430 | 'escalas' => $escala, |
429 | 'pida' => $pida, | 431 | 'pida' => $pida, |
430 | - 'antiguedad' => $antiguedad | 432 | + 'antiguedad' => $antiguedad, |
433 | + 'form' => $form->createView(), | ||
431 | )); | 434 | )); |
432 | } | 435 | } |
433 | 436 |
src/AppBundle/Form/AddTutorType.php
@@ -0,0 +1,49 @@ | @@ -0,0 +1,49 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Created by Netbeans. | ||
4 | + * User: Wilmer Ramones | ||
5 | + * Date: 29/06/16 | ||
6 | + * Time: 09:07 AM | ||
7 | + * Modificado: 07/07/2016 | ||
8 | + */ | ||
9 | + | ||
10 | +namespace AppBundle\Form; | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | +use Symfony\Component\Form\AbstractType; | ||
15 | +use Symfony\Component\Form\FormBuilderInterface; | ||
16 | + | ||
17 | + | ||
18 | +use Symfony\Bridge\Doctrine\Form\Type\EntityType; | ||
19 | +use Doctrine\ORM\EntityRepository; | ||
20 | + | ||
21 | +class AddTutorType extends AbstractType | ||
22 | +{ | ||
23 | + public function buildForm(FormBuilderInterface $builder, array $options) | ||
24 | + { | ||
25 | + $builder | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + ->add('tutores_ascenso', EntityType::class, array( | ||
30 | + 'placeholder' => 'Añadir Posibles Jurados...', | ||
31 | + 'class' => 'AppBundle:TutoresAscenso', | ||
32 | + 'required' => false, | ||
33 | + 'label' => 'Asignar Jurados', | ||
34 | + 'multiple' => true, | ||
35 | + 'group_by' => 'institucion', | ||
36 | + )) | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + ; | ||
42 | + | ||
43 | + | ||
44 | + } | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | +} |