src/templates/ReclutaProceso/showVacunacion.html.twig line 1

Open in your IDE?
  1. {% extends "ReclutaProceso/show.html.twig" %}
  2. {% block jquery %}
  3.     {{ parent() }}
  4.     <script type="text/javascript">
  5.         $(function()
  6.         {
  7.             $(".resultado").unbind('click');
  8.             $(".resultado").click(function(e){
  9.                 if ($('#certificadoIdoneo').prop('checked'))
  10.                 {
  11.                     $('#trObservaciones').addClass('hide');
  12.                     $('#trVolver').addClass('hide');
  13.                 }
  14.                 else
  15.                 {
  16.                     $('#trObservaciones').removeClass('hide');
  17.                     $('#trVolver').removeClass('hide');
  18.                 }
  19.             });        
  20.             $("#botonTerminar").unbind('click');
  21.             $("#botonTerminar").click(function(e){
  22.                 e.preventDefault();
  23.                 var ok=true;
  24.                 var msg='';
  25.                 if (!$('#certificadoIdoneo').prop('checked') && !$('#certificadoNoIdoneo').prop('checked'))
  26.                 {
  27.                     ok = false;
  28.                     msg = 'Debe indicar un resultado de la validación del certificado de vacunación.';
  29.                 }
  30.                 else
  31.                 {
  32.                     if ($('#certificadoNoIdoneo').prop('checked'))
  33.                     {
  34.                         if (!$('#observaciones').val())
  35.                         {
  36.                             ok=false;
  37.                             msg = 'Debe indicar las observaciones acerca del rechazo';
  38.                         }
  39.                         else
  40.                         {
  41.                             if (!($('#volverEste').prop('checked') || $('#volverProximo').prop('checked') || $('#volverNunca').prop('checked')))
  42.                             {
  43.                                 ok=false;
  44.                                 msg = 'Debe indicar cuando el aspirante puede volver a presentarse';
  45.                             }
  46.                         }
  47.                     }
  48.                 }
  49.                 if (ok)
  50.                 {
  51.                     $('#divResultado').mask('&nbsp;&nbsp;&nbsp;&nbsp;Actualizando información...');
  52.                     $('#form_resultado_vacunacion').ajaxSubmit({
  53.                         type: $('#form_resultado_vacunacion').attr('method'),
  54.                         url: $('#form_resultado_vacunacion').attr('action'),
  55.                         dataType: 'json',
  56.                         data: { _xml_http_request: true },
  57.                         success: function(data) {
  58.                             if (data.ok)
  59.                             {  
  60.                                 document.location.href='{{ path('crud_index', {'routeClassName': routeClassName}) }}';
  61.                             }
  62.                             else
  63.                             {
  64.                                 $('#divResultado').unmask();
  65.                                 showError(bootbox, data.msg);
  66.                             }
  67.                         }
  68.                     })
  69.                 }
  70.                 else
  71.                 {
  72.                     showError(bootbox, msg);
  73.                 }
  74.             }); 
  75.         
  76.         });
  77.         
  78.     </script>    
  79.     
  80. {% endblock %}
  81. {% block principal_heading %}
  82.     <div class="widget-header widget-header-flat">
  83.         <h4 class="widget-title lighter">
  84.             <i class="fas fa-search orange"></i>
  85.             Validación del Certificado de Vacunación
  86.         </h4>
  87.     </div>
  88. {% endblock %}
  89. {% block showdata %}
  90.     
  91.     {% block prev_acuartelamiento %}        
  92.     {% endblock prev_acuartelamiento %} 
  93.                         
  94.     {{ render(controller('App\\Crud\\Controller\\crudPlainController::showAction', {'rol': rol, 'routeClassName':'recluta', 'id':entity.recluta, 'parentRouteClassName':routeClassName})) }}
  95.     {% block more_seccion %}        
  96.         <div class="panel panel-default">
  97.             <div class="panel-heading">
  98.                 <h4 class="panel-title green">
  99.                     <a id="atab-1" aria-expanded="true" class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#datosPersonales">
  100.                         <i class="bigger-160 ace-icon fa fa-home " data-icon-hide="ace-icon fa fa-angle-down" data-icon-show="ace-icon fa fa-angle-right"></i>
  101.                         &nbsp;Certificado válido
  102.                     </a>
  103.                 </h4>
  104.             </div>
  105.             <div style="" aria-expanded="true" class="panel-collapse collapse in " id="datosPersonales">
  106.                 <div id="divResultado" class="panel-body" style="border-width: 1px; border-color: red">
  107.                     <div class="row">
  108.                         <div class="col-xs-12">
  109.                             {% if not entity.unidadMilitar %}
  110.                                 <form id='form_resultado_vacunacion' method='post' action='{{ path('aspirante_salvar_vacunacion') }}'>
  111.                                     <input type='hidden' name='resultado[reclutaProceso]' value='{{ entity.id }}'>
  112.                                     <table class="table table-striped table-bordered table-hover">
  113.                                         <tr>
  114.                                             <th style="width: {{ widthLabel }}">
  115.                                                 <label>
  116.                                                     Resultado:
  117.                                                 </label>
  118.                                             </th>
  119.                                             <td colspan='3'>
  120.                                                 <input type='radio' class='resultado' id='certificadoIdoneo' name='resultado[resultado]' value='valido' {% if entity.certificadoVacunacionOk %}checked="true"{% endif %}>&nbsp;&nbsp;Válido
  121.                                                 &nbsp;&nbsp;&nbsp;&nbsp;
  122.                                                 <input type='radio' class='resultado' id='certificadoNoIdoneo' name='resultado[resultado]' value='no_valido' {% if entity.certificadoVacunacionOk==false %}checked="true"{% endif %}>&nbsp;&nbsp;No válido
  123.                                             </td>
  124.                                         </tr>
  125.                                         <tr id='trObservaciones' {% if entity.certificadoVacunacionOk!=false %}class='hide'{% endif %}>
  126.                                             <th style="width: {{ widthLabel }}">
  127.                                                 <label>
  128.                                                     Observaciones:
  129.                                                 </label>
  130.                                             </th>
  131.                                             <td colspan='3'>
  132.                                                 <textarea id='observaciones' name='resultado[observaciones]' style='width: 100%'></textarea>
  133.                                             </td>
  134.                                         </tr>
  135.                                         {% if entity.volverPresentarse %}
  136.                                         <tr id='trVolver' {% if entity.certificadoVacunacionOk!=false %}class='hide'{% endif %}>
  137.                                             <th style="width: {{ widthLabel }}">
  138.                                                 <label>
  139.                                                     Volver a presentarse:
  140.                                                 </label>
  141.                                             </th>
  142.                                             <td>
  143.                                                 <input type='radio' id='volverEste' name='resultado[volver]' value='MISMO' {% if entity.volverPresentarse and entity.volverPresentarse.value=='MISMO' %}checked="true"{% endif %}>&nbsp;&nbsp;En este proceso
  144.                                             </td>
  145.                                             <td>
  146.                                                 <input type='radio' id='volverProximo' name='resultado[volver]' value='PROXIMO' {% if entity.volverPresentarse and entity.volverPresentarse.value=='PROXIMO' %}checked="true"{% endif %}>&nbsp;&nbsp;Próximo proceso
  147.                                             </td>
  148.                                             <td>
  149.                                                 <input type='radio' id='volverNunca' name='resultado[volver]' value='NUNCA' {% if entity.volverPresentarse and entity.volverPresentarse.value=='NUNCA' %}checked="true"{% endif %}>&nbsp;&nbsp;Nunca
  150.                                             </td>
  151.                                         </tr>
  152.                                         {% else%}
  153.                                              <tr id='trVolver' {% if entity.certificadoVacunacionOk!=false %}class='hide'{% endif %}>
  154.                                             <th style="width: {{ widthLabel }}">
  155.                                                 <label>
  156.                                                     Volver a presentarse:
  157.                                                 </label>
  158.                                             </th>
  159.                                             <td>
  160.                                                 <input type='radio' id='volverEste' name='resultado[volver]' value='MISMO' >&nbsp;&nbsp;En este proceso
  161.                                             </td>
  162.                                             <td>
  163.                                                 <input type='radio' id='volverProximo' name='resultado[volver]' value='PROXIMO' >&nbsp;&nbsp;Próximo proceso
  164.                                             </td>
  165.                                             <td>
  166.                                                 <input type='radio' id='volverNunca' name='resultado[volver]' value='NUNCA' >&nbsp;&nbsp;Nunca
  167.                                             </td>
  168.                                         </tr>
  169.                                         {% endif %}
  170.                                     </table>
  171.                                 </form>
  172.                             {% endif %}
  173.                         </div>
  174.                     </div>
  175.                 </div>
  176.             </div>
  177.         </div>
  178.     {% endblock more_seccion %}        
  179. {% endblock %} 
  180. {% block actions %}
  181.     <div class="row">
  182.         <div class="col-xs-4">
  183.             <center>
  184.                 {% block action_retorno %}
  185.                     {#<a class="btn btn-white btn-inverse btn-bold btn-round" href="{{ path('crud_index', {'routeClassName': routeClassName}) }}">#}
  186.                     <a class="btn btn-white btn-inverse btn-bold btn-round" href="{{ path('crud_plain_back_to_list', {'routeClassName': routeClassName, 'id': entity.id, 'from': 'show'}) }}">
  187.                         {% trans from 'crud' %}botones.regresar{% endtrans %}
  188.                     </a>
  189.                 {% endblock %} 
  190.             </center>
  191.         </div>   
  192.        {% if not entity.unidadMilitar  %} 
  193.             <div class="col-xs-4 forChanges">
  194.                 <center>
  195.                     <a id="botonTerminar" class="btn btn-white btn-inverse btn-bold btn-round" href="">Guardar validación</a>
  196.                 </center>
  197.             </div>    
  198.             {% if  entity.fechaResultado or entity.certificadoVacunacionOk  %}       
  199.                <div class="col-xs-4 forChanges">
  200.                     <center>
  201.                         <a id="botonImprimir"  target="_blank" class="btn btn-white btn-inverse btn-bold btn-round" href="{{ path('imprimirFichaProceso', {'idReclutaProceso': entity.id }) }}">Imprimir resultado</a>
  202.                     </center>
  203.                 </div>    
  204.             {% endif %}            
  205.         {% endif %}            
  206.     </div>
  207. {% endblock %}