acta_defensa_mostar.html.twig 23.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488
{% extends 'base_app.html.twig' %}
{% block stylesheets %}
    {{ parent() }}
    <link href="{{ asset('assets/vendor/lightbox2/dist/css/lightbox.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="{{ asset('assets/vendor/chosen/chosen.min.css') }}">
    <style>
        .full {
            width: 100%;
        }
        .wrapper {
            width: 6.9rem;
            height: 2rem;
            position: relative;
            margin: 0rem auto;
            border-radius: 2rem;
            background: gray;
        }

        .wrapper .toggle {
            width: 1.8rem;
            height: 1.8rem;
            position: absolute;
            left: 2.5rem;
            top: 0.1rem;
            border-radius: 50%;
            box-sizing: border-box;
            border: 0.1rem solid #ff6c00;
            background: #ff8933;
            box-shadow: 0 0 0.2rem 0.1rem #ff6c00 inset, 0 0 0.2rem 0.1rem #ff6c00;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .wrapper label {
            cursor: pointer;
            width: 2rem;
            height: 2rem;
            position: absolute;
            margin: 0;
            padding: 0;
            z-index: 1;
            display: inline-block;
            text-align: center;
            line-height: 2rem;
            text-transform: uppercase;
            font-family: FontAwesome;
            font-style: normal;
            font-weight: normal;
            color: white;

        }

        .wrapper input {
            position: absolute;
            left: 0;
            margin: 0;
            padding: 0;
            opacity: 0;
        }

        .yes_radio:checked ~ .toggle {
            border: 0.1rem solid #008000;
            background: #00b300;
            box-shadow: 0 0 0.2rem 0.1rem #008000 inset, 0 0 0.2rem 0.1rem #008000;
            left: 0.1rem;
        }

        .no_radio:checked {
            background: red;
        }

        .no_radio:checked ~ .toggle {
            border: 0.1rem solid #ff0000;
            background: #ff3333;
            box-shadow: 0 0 0.2rem 0.1rem #ff0000 inset, 0 0 0.2rem 0.1rem #ff0000;
            left: 4.97rem;
        }

        .maybe_radio, .maybe-lbl {
            left: 33.33333%;
        }

        .no_radio, .no-lbl {
            left: 66.66667%;
        }

        .maybe-lbl {
            -webkit-animation-delay: 2s;
            -o-animation-delay: 2s;
            -moz-animation-delay: 2s;
            animation-delay: 2s;
        }

        .no-lbl {
            -webkit-animation-delay: 4s;
            -o-animation-delay: 4s;
            -moz-animation-delay: 4s;
            animation-delay: 4s;
        }


    </style>
{% endblock %}

{%block body %} 
    {% set cantidadJurado = 6 %}
     <div class="content-wrapper">
        <div class="container">
            {% for message in app.session.flashBag.get('notice') %}
                <h4 class="alert alert-success">{{ message }}</h4>    
            {%endfor %}
            <div class="row">
                <div class="col-md-9">
                    <h4 class="page-head-line">Solicitud de Ascenso número <code>{{ascenso.id}}</code>: 
                        {{ docente }}
                    </h4>                       
                </div>
                <div class="col-md-3">
                    {% if servicio.idEstatus.id == 1 %}
                        <h4 class="alert alert-success">Estatus <strong>{{servicio.idEstatus}}</strong></h4>
                    {% elseif servicio.idEstatus.id == 3 %}
                        <h4 class="alert alert-danger">Estatus <strong>{{servicio.idEstatus}}</strong> </h4>
                    {% else %}
                        <h4 class="alert alert-warning">Estatus <strong>{{servicio.idEstatus}}</strong></h4>
                    {% endif %}

                </div>
            </div>
            <div class="row">
                
                <div class="col-md-6">

                    <div class="col-md-4">
                        <img src="{{ asset('bundles/framework/images/portal/logo_ubv.png') }}" />
                    </div>

                    <div class="col-md-8">      
                        
                    
                        
                        
                        {% if escalas is not null %}
                        <div class="form-group">
                            <label for="Escalafones">{{ cantidadJurado }}Escalafones Obtenidos:</label>
                             <table class="table table-striped table-bordered">
                                    <th>Escalafón</th>
                                    <th>Fecha</th>
                                    <th>Tipo</th>
                            {% for escala in escalas %}
                               
                                    <tr>
                                        <td>{{escala.idEscala }}</td>
                                        <td>{{escala.fechaEscala | date('d-m-Y') }}</td>
                                        <td>{{escala.idTipoEscala }}</td>
                                    </tr>                                                                                                    
                            {%endfor %}
                            </table>   
                            
                            <p><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p>                                
                                  {% set anadirJurado = false  %}
                                {% if (ascenso.tesisUbv or ascenso.tipoTrabajoInvestigacion == 'investigacion') %}
                                    <h4>Jurados propuestos por el Docente</h4>
                                    {% set anadirJurado = true  %}
                                    {% set cantidadJurado = 6 %}
                                     <div id="seccion_jurados" class="well">
                                         <ul>
                                    {% for tutor in ascenso.tutores %}
                                        {% if loop.length == 6 %} 
                                            {% set anadirJurado = false %}
                                        {% else %}
                                            {% set cantidadJurado = cantidadJurado - 1 %}
                                        {% endif %}
                                       
                                    <li id="well_{{tutor.id}}">
                                        
                                        <strong>{{ tutor.idTutor.nombres }}  {{ tutor.idTutor.apellidos }}:</strong>
                                        {{ tutor.idTutor.institucion }} -> {{ tutor.idTutor.idEscala.nombre }}
                                        <input type="button" class="btn btn-warning btn-xs" value="act" id="actualizar_tutor">
                                        <input type="button" class="btn btn-danger btn-xs eliminar_jurado" value="X" id="{{ tutor.id }}">
                                    </li>
                                    
                                {% endfor %}
                                </ul>
                                </div>
                                {% endif %}
                                {% if anadirJurado and ascenso.idEstatus.id == 2 %}
                                    <p id="falta" class="label label-danger" data-faltaid = '{{cantidadJurado}}'>
                                        El docente no tiene o le faltó completar posibles jurados
                                    </p>
                                    {% form_theme form 'bootstrap_3_layout.html.twig' %}        
                                    {{ form_start(form) }}
                                    {{ form_widget(form) }}
                                    {{ form_end(form) }}
                                    <button class="btn btn-primary btn-sm" data-loading-text="<i class='fa fa-circle-o-notch fa-spin'></i> Añadiendo..." id="anadirJurados">Añadir Jurados</button>
                                {% else %}
                                    <p id="falta" class="label label-success" data-faltaid = '0'>
                                        El docente completó los 6 Jurados Propuestos
                                    </p>
                                    {% form_theme form 'bootstrap_3_layout.html.twig' %}
                                    {{ form_start(form) }}
                                    {{ form_widget(form) }}
                                    {{ form_end(form) }}
                                    <button class="btn btn-primary btn-sm" data-loading-text="<i class='fa fa-circle-o-notch fa-spin'></i> Añadiendo..." id="anadirJurados">Añadir Jurados</button>
                                {% endif %}
                            
                            
                        </div>
                        {% endif %}

                        {% if antiguedad is not null %}
                            {% if antiguedad.idEstatus.id != 4 %}
                                <button class="alert alert-info"> El docente tiene una solicitud de antiguedad en estatus {{ antiguedad.idEstatus.nombre }} que no ha formalizado Todavía</button>
                            {% else %}
                                El Docente ya ha formalizado su Antiguedad ante la UBV
                            {% endif %}
                        {% endif %}
   
                         {% if ascenso.tituloTrabajo is not null %}
                        <div class="form-group">
                             <label for="titulo">Título del Trabajo:</label>
                             <input type="text" class="form-control" value="{{ascenso.tituloTrabajo}}" />
                             <p><strong>Tipo de Trabajo de Ascneso:</strong> {{ ascenso.tipoTrabajoInvestigacion }} </p> 
                             {% if ascenso.tipoTrabajoInvestigacion == 'tesis' %}
                                {% if ascenso.tesisUbv %}
                                    <p>Debe tener informe de pertinencia debido a que
                                    es una tesis fuera de UBV</p>
                                    {% else %}
                                    <p>La Tesis fue hecha dentro de UBV</p>
                                    
                                    {% endif %}
                             {% endif %}
                        </div>
                        {% endif %} 

                        </div>
                </div>
                <form action="{{ path('cea_ascenso_actualizar', { 'id': ascenso.id }) }}" method="POST">
                <div class="col-md-5">    
                     <h3>Documentos Consignados</h3>    
                     <div class="widget-content">
                                             
                         
                         {% for documento in docente.documentosVerificados %}
                             {% if documento.idServicio.id == servicio.id %}
                                 {% set extension = documento.ubicacion | split('.') | last %}
                         <div {% if extension != "pdf" %}class="col-xs-6"{% else %}class="col-xs-12"{% endif %}>
                            <div class="thumbnail">

                                {% if extension != "pdf" %}
                                <a href="{{asset('uploads/ascenso/'~ documento.ubicacion)}}" data-lightbox="trabajo">
                                    <img src="{{ asset('uploads/ascenso/thumb/'~ documento.ubicacion) }}" />
                                </a>
                                {% else %}
                                    <object type="application/pdf" data="{{asset('uploads/ascenso/'~ documento.ubicacion)}}" width="100%" height="300px"></object>
                                {% endif %}
                              <div class="caption">                                
                                <p>{{ documento.idTipoDocumentos.nombre }}</p>
                                  {% if documento.idEstatus.id == 2 or documento.idEstatus.id == 3 %}
                                  <div class="wrapper">
                                      <label for="yes_radio{{ loop.index }}" class="yes-lbl"><i class="fa fa-check"></i>
                                      </label>
                                      <input type="radio" value="1" name="{{ documento.idTipoDocumentos.identificador }}" class="yes_radio" id="yes_radio{{ loop.index }}" {% if documento.idEstatus.id == 1 %} checked="checked" {% endif %}>
                                      <label for="maybe_radio{{ loop.index }}" class="maybe-lbl">
                                          <i class="fa fa-question"></i>
                                      </label>
                                      <input type="radio" value="" name="{{ documento.idTipoDocumentos.identificador }}" class="maybe_radio" id="maybe_radio{{ loop.index }}" {% if documento.idEstatus.id == 2 %} checked="checked" {% endif %} disabled>
                                      <label for="no_radio{{ loop.index }}" class="no-lbl"><i
                                                  class="fa fa-close"></i></label><input type="radio" value="3"
                                                                                         name="{{ documento.idTipoDocumentos.identificador }}"
                                                                                         class="no_radio"
                                                                                         id="no_radio{{ loop.index }}" {% if documento.idEstatus.id == 3 %} checked="checked" {% endif %}>

                                      <div class="toggle"></div>
                                  </div>
                                  {% endif %}
                              </div>
                          </div>
                        </div>
                               {% endif %}
                          {% endfor %}

                    </div>
                </div>
                    <!-- MOSTRAR ACTIVIDAD PIDA DEL DOCENTE  -->
                    {% if not docente.pida %}
                        <p class="alert alert-warning">El Docente no ha registrado todavía su actividad PIDA</p>
                    {% else %}
                        <div class="col-md-12">
                            <div class="account-container full register">
                                <div class="content clearfix">
                                    <h2>PIDA <span class="small" style="float: right;"> Estatus: {{ servicioPida.idEstatus }}</span></h2>
                                    <table class="table table-bordered">
                                        <th>Objetivo Histórico</th>
                                        <th>Actividad Docente</th>
                                        <th>Tarea Específica</th>
                                        <th>Plazo</th>
                                        <th>Estatus</th>
                                        {% for pid in docente.pida | sort %}
                                            {#solo  muestre la vigente #}
                                            {% if pid.idDocenteServicio.id == servicioPida.id %}
                                                <tr>
                                                <td rowspan="{{ pid.pidaTareaEspecifico | length }}">
                                                    {{ pid.idPlanHistoricoNacionalEstrategico.nombre }}
                                                </td>
                                                <td rowspan="{{ pid.pidaTareaEspecifico | length }}">
                                                    {{ pid.idActividadDocente.nombre }}
                                                </td>

                                                {% for tarea in pid.pidaTareaEspecifico | sort %}
                                                    <td>{{ tarea.pidaTareaEspecifico }}
                                                    </td>
                                                    <td>{{ tarea.idPidaPlazo }}</td>
                                                    <td>
                                                        {{ tarea.idPidaEstatus }}
                                                    </td>

                                                    </tr>
                                                {% endfor %}

                                                </tr>
                                            {% endif %}
                                        {% endfor %}
                                    </table>
                                </div>
                            </div>
                        </div>
                    {% endif %}



                    <!-- Modal -->

            </div>

                    <div class="modal fade" id="motivo_rechazo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel">Rechazo de Solicitud</h4>
                                </div>

                                <div class="modal-body">


                                    <div class="form-group">
                                        <label for="message-text" class="control-label">Mensaje:</label>
                                        <textarea class="form-control" id="message-text" name="message-text"></textarea>
                                    </div>

                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                    <button type="submit" name="rechazar" id="rechazar" class="btn btn-primary">Enviar Rechazo</button>
                                </div>
                            </div>

                        </div>
                    </div>
                    {% if servicio.idEstatus.id == 3 %}
                        <button class="btn btn-success btn-sm" type="submit" name="aprobado" id="aprobado" ><span class="fa fa-check" ></span>&nbsp;Aprobar</button>
                    {% elseif servicio.idEstatus.id == 2 %}
                        <button class="btn btn-success btn-sm" type="submit" name="aprobado" id="aprobado" ><span class="fa fa-check" ></span>&nbsp;Aprobar</button>
                        <a id="modal_rechazo" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#motivo_rechazo"  ><span class="fa fa-close"></span>&nbsp;Rechazar</a>
                    {% endif %}
                </form>
            </div>

        
    </div>
{% endblock %}


{% block javascripts %}
    {{ parent() }}
    <script type="text/javascript" src="{{ asset('assets/vendor/chosen/chosen.jquery.min.js') }}"></script>
    <script type="text/javascript" src="{{ asset('assets/vendor/lightbox2/dist/js/lightbox.min.js') }}"></script>
    
    <script>
        var cantidad = $("#falta").data('faltaid');        
        $("#seccion_jurados").on("click", ".eliminar_jurado", function(){ 
            var eliminado = $(this).attr('id');
             $.ajax({
               method: "POST",
               url: "{{ url('ajax_eliminar_tutor') }}",
               async: true,
               cache: false,    
               data: ({ eliminar: eliminado, ascensoId: {{ ascenso.id }} }),
               success: function (data) {
                        alert(cantidad);                        
                        console.log("esto es id: " + eliminado);
                        $("#well_" + eliminado).remove();
                        cantidad = cantidad + 1;
                        $("#add_tutor_tutores_ascenso").chosen('destroy').chosen({ max_selected_options: cantidad });

                },
               error: function (XMLHttpRequest, textStatus, errorThrown) { 
                     console.log(errorThrown);                 

               }

           });
        });
        
        $("#aadd_tutor_tutores_ascenso").on("chosen:ready", function() {
            $("#add_tutor_tutores_ascenso").chosen('destroy').chosen({ max_selected_options: 2 });
        });
        
        
        $("#add_tutor_tutores_ascenso").chosen({
            no_results_text: "<a data-toggle='modal' data-target='#buscarTutores' href='#'>Tutor no registrado, click aquí para registrar!</a>",
            max_selected_options: cantidad
            
        });
        
        
        
        $( "#anadirJurados" ).click(function() {
            $.ajax({
               method: "POST",
               url: "{{ url('ajax_adicionar_tutor') }}",
               async: true,
               cache: false,    
               data: ({ jurados: $("#add_tutor_tutores_ascenso").val(), ascensoId: {{ ascenso.id }} }),
               success: function (data) {
                        console.log(data);
                        for (var i = 0; i < data.adicionar_nombres.length; i ++){
                            $("#seccion_jurados").append( "<li id='well_" + data.jurados[i] +  "'><strong>" +  data.adicionar_nombres[i] + ":</strong>" +  data.adicionar_institucion[i]  + "<input type='button' class='btn btn-danger btn-xs' value='X' id='" + data.adicionar_id[i] + "'/></li>"  );
                            $("#" + data.jurados[i] ).addClass("eliminar_jurado");
                            cantidad = cantidad - 1;
                        }
                        $("#add_tutor_tutores_ascenso").val("");
                        $( "#anadirJurados" ).button('reset');

                },
               error: function (XMLHttpRequest, textStatus, errorThrown) { 
                     console.log(errorThrown);                 

               }

           });
       });

        var buttonpressed;
        $('#aprobado').click(function() {
            //alert("click"); return false;
            buttonpressed = $(this).attr('name')
        });

        $('#rechazar').click(function() {
            buttonpressed = $(this).attr('name')
        });


        $('form').submit(function() {
            console.log($(':radio:checked', this).length);
            for (var i = 0; i < $(':radio:checked', this).length; i ++){
                console.log($(':radio:checked', this)[i]);
                if ( ($(':radio:checked', this)[i].value == "")) {
                    alert('Debes revisar todos los documentos para poder enviar la solicitud!');
                    $("#aprobado").button('reset');
                    return false;
                }

            }

            if (buttonpressed == "aprobado") {
                for (var i = 0; i < $(':radio:checked', this).length; i++) {
                    console.log($(':radio:checked', this)[i]);
                    if (($(':radio:checked', this)[i].value == "3")) {
                        alert('No puedes aprobar una solicitud con documentos en estatus de rechazado');
                        $("#aprobado").button('reset');
                        return false;
                    }

                }
            }


        });

        $('#motivo_rechazo').on('hidden.bs.modal', function (e) {
            $("#modal_rechazo").button('reset');
        })
           
        
    </script>
    
    {% endblock %}