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

Open in your IDE?
  1. {% extends "@crud\\crud\\index_inner.html.twig" %}
  2. {% block javascripts %}
  3.     {{ parent() }}
  4.     
  5.     <script src="{{ asset('ace/js/jquery.table2excel.js') }}"></script>
  6. {% endblock javascripts %}
  7. {% block jquery %}
  8.     {{ parent() }}
  9.     <script type="text/javascript">
  10.         $(function()
  11.         {
  12.             {% include 'ProcesoReclutamiento\\filtros_jquery.html.twig' with {'routeClassName': routeClassName, 'ctrl_proceso':'procesoReclutamiento', 'ctrl_base':'reclutaBase', 'ctrl_centro':'centroMovilizacion', 'ctrl_unidad':'unidadMilitar'}  %}
  13.             $("#form_reclutaCentroInstruccion").change(function(e){
  14.                 $("#form_centroMovilizacion").parent().parent().parent().mask("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  15.                 var selected;
  16.                 if ($(this).val())
  17.                 {
  18.                     selected = $(this).val();
  19.                 }
  20.                 else
  21.                 {
  22.                     selected = -1;
  23.                 }
  24.                 var url = '{{ path('crudNested', {'bundleName': 'App', 'className': 'CentroMovilizacion', 'fieldName': 'centrosInstruccion', 'value': '__VALUE__',  'sel':'__SEL__' }) }}';
  25.                 url= url.replace('__VALUE__',selected);
  26.                 if ($("#form_centroMovilizacion").val())
  27.                 {
  28.                     centro = $("#form_centroMovilizacion").val();
  29.                     url= url.replace('__SEL__',$("#form_centroMovilizacion").val());
  30.                 }
  31.                 else
  32.                 {
  33.                     url= url.replace('__SEL__','-1');
  34.                 }
  35.                 $("#form_centroMovilizacion").load(url,function(){
  36.                     $("#form_centroMovilizacion").trigger('chosen:updated');
  37.                     $("#form_centroMovilizacion").parent().parent().parent().unmask();
  38.                 });
  39.             });
  40.             $('#form_procesoReclutamiento').change();
  41.             {% if filterData is defined and filterData['reclutaBase'] is defined and filterData['reclutaBase'] != 'not null' %}
  42.                 if ($("#form_reclutaBase").length>0 && $("#form_reclutaBase").val() && $("#form_reclutaBase").val() != {{ filterData['reclutaBase'] }})
  43.                 {
  44.                     $("#form_reclutaBase").val({{ filterData['reclutaBase'] }});
  45.                     $("#form_reclutaBase").change();
  46.                 }
  47.             {% endif %}
  48.             {% if filterData is defined and filterData['reclutaCentroInstruccion'] is defined and filterData['reclutaCentroInstruccion'] != 'not null' %}
  49.                 if ($("#form_reclutaCentroInstruccion").length>0 && $("#form_reclutaCentroInstruccion").val() && $("#form_reclutaCentroInstruccion").val() != {{ filterData['reclutaCentroInstruccion'] }})
  50.                 {
  51.                     $("#form_reclutaCentroInstruccion").val({{ filterData['reclutaCentroInstruccion'] }});
  52.                     $("#form_reclutaCentroInstruccion").change();
  53.                 }
  54.             {% endif %}
  55.             {% if filterData is defined and filterData['centroMovilizacion'] is defined and filterData['centroMovilizacion'] != 'not null' %}
  56.                 if ($("#form_centroMovilizacion").length>0 && $("#form_centroMovilizacion").val() && $("#form_centroMovilizacion").val() != {{ filterData['centroMovilizacion'] }})
  57.                 {
  58.                     $("#form_centroMovilizacion").val({{ filterData['centroMovilizacion'] }});
  59.                     $("#form_centroMovilizacion").change();
  60.                 }
  61.             {% endif %}
  62.             {% if filterData is defined and filterData['unidadMilitar'] is defined and filterData['unidadMilitar'] != 'not null' %}
  63.                 if ($("#form_unidadMilitar").length>0 && $("#form_unidadMilitar").val() && $("#form_unidadMilitar").val() != {{ filterData['unidadMilitar'] }})
  64.                 {
  65.                     $("#form_unidadMilitar").val({{ filterData['unidadMilitar'] }});
  66.                     $("#form_unidadMilitar").trigger('chosen:updated');
  67.                 }
  68.             {% endif %}
  69.         
  70.         });
  71.         
  72.     </script>    
  73.     
  74. {% endblock jquery %}
  75. {% block table_index_jquery %}
  76.     {{ parent() }} 
  77.     
  78.     var table = $('#{{ routeClassName }}').DataTable();
  79.     
  80.     $('#btnExportarExcel').on('click', function(){
  81.         $('<table>').append($(table.table().header()).clone())
  82.             .append(table.$('tr').clone()).table2excel({
  83.             exclude: "" ,             
  84.             filename: "{{ routeClassName }}.xls",
  85.             ignoreColumn: [0],
  86.             exclude: "#noExl",
  87.             exclude_img: true,
  88.             exclude_links: true,
  89.             exclude_inputs: true
  90.         });  });
  91.     
  92. {% endblock table_index_jquery %}
  93. {% block button_new %}
  94.     {% if entities|length>0 %}
  95.         $('#{{ routeClassName }}').on('draw.dt', 
  96.             function(){
  97.                 $("#{{ routeClassName }}_length").addClass("hide");
  98.                 if (!$("#{{ routeClassName }}_wrapper").hasClass("boton_nuevo"))
  99.                 {
  100.                     $("#{{ routeClassName }}_wrapper").addClass("boton_nuevo")
  101.                     $("#{{ routeClassName }}_wrapper").
  102.                         children("div.row").
  103.                         children("div:first")
  104.                         {#% block button_new_elements %}
  105.                             {% set texto = routeClassName~'.singular' %}     
  106.                             .append("<div id='{{routeClassName}}_botonNuevoDiv' class='forChanges'><a href='{{ path('crud_excel', {'routeClassName': routeClassName}) }}'><button id='btnExportarExcel' class='btn btn-white btn-inverse btn-bold btn-round' title='{{ 'reporterecluta.botones.exportarExcel'   |trans({},'crud' )}}'><img src='{{ asset('images/icon/icono_excel.png') }}'><span class='hidden-xs'>{{ 'reporterecluta.botones.exportarExcel'   |trans({},'crud' )}}</span></button></a></div>")
  107.                         {% endblock button_new_elements %#}
  108.                         ;    
  109.                 }
  110.         });
  111.     {% endif %}  
  112. {% endblock button_new %}  
  113. {% block main_column_info %}
  114.     <div id="otros_botones" class="menu_int clearfix" >
  115.     {% if entities is not empty %}
  116.         {% if routeClassName == "listaasignacionunidad" or routeClassName == "listaasignacionbase"  or routeClassName == "nominaunidadinicio" %}
  117.         <a id="btnExportarCrudExcel" class='btn btn-white btn-inverse btn-bold btn-round' href="{{ path('crud_excel', {'routeClassName': routeClassName}) }}" title='Exportar a excel'>
  118.             <img src='{{ asset('images/icon/icono_excel.png') }}'>
  119.                 <span class='hidden-xs'>{{ 'reporteresultados.botones.exportarExcel'   |trans({},'crud' )}}</span>
  120.         </a>    
  121.         <a class="btn btn-white btn-inverse btn-bold btn-round" title='Exportar a PDF' target="_blank" href="{{ path('exportar_reporte_PDF', {'routeClassName': routeClassName }) }}">
  122.            <img src='{{ asset('images/icon/icono_pdf.png') }}'>
  123.                 <span class='hidden-xs'>{{ 'listaasignacionunidad.botones.exportarPDF' |trans({},'crud' )}}</span>
  124.         </a>
  125.         {% else %}
  126.         <a id='exportar_excel' href='#'>
  127.             <button id="btnExportarExcel" class='btn btn-white btn-inverse btn-bold btn-round' title='Exportar a excel'><img src='{{ asset('images/icon/icono_excel.png') }}'>
  128.                 <span class='hidden-xs'>{{ 'reporteresultados.botones.exportarExcel'   |trans({},'crud' )}}</span>
  129.             </button>
  130.         </a>
  131.         {% endif %}
  132.     {% endif %}
  133.     </div>
  134.                 
  135. {% endblock main_column_info %}
  136. {% block show_no_results %}
  137.     {% if filtrosOk is not defined %}
  138.         {{ parent() }}
  139.     {% else %}
  140.         <div class="alert alert-info">
  141.             <strong>
  142.                 <i class="fas fa-info-circle bigger-150"></i>
  143.                 {{ filtrosOk }}    
  144.             </strong>
  145.             <br>
  146.         </div>
  147.     {% endif %}
  148. {% endblock show_no_results %}
  149. {% block sortableColumns %} 
  150.     {% if routeClassName == "listaasignacionunidad" %}
  151.         {"bSortable": false}
  152.         {% for field in indexFields %}
  153.             , null
  154.         {% endfor %}
  155.     {% else %}
  156.     {{ parent() }}
  157.     {% endif %}
  158. {% endblock sortableColumns %} 
  159. {% block index_th %}
  160.     {% if routeClassName == "listaasignacionunidad" %}
  161.         <th>Orden</th>
  162.     {% endif %}
  163.     {{ parent() }}
  164. {% endblock %}
  165. {% block index_data %}
  166.     {% if routeClassName == "listaasignacionunidad" %}
  167.         <td>{{ loop.index }}</td>
  168.     {% endif %}
  169.     {{ parent() }}
  170. {% endblock index_data %}
  171. {% block results %}
  172.     {{ parent() }}
  173.     {% if (routeClassName == "listaasignacionunidad" or routeClassName == "nominaunidadinicio") and totales is defined %}
  174.     <table id="totales" class="table table-striped table-bordered table-hover" width="100%">
  175.     <tr>
  176.         <th>Total Hombres: </th>
  177.         <td colspan="6">{{ totales['Hombres'] }}</td>
  178.         <td style="display: none;"></td>
  179.         <td style="display: none;"></td>
  180.         <td style="display: none;"></td>
  181.         <td style="display: none;"></td>
  182.         <td style="display: none;"></td>
  183.     </tr>
  184.     <tr>
  185.         <th>Total Mujeres: </th>
  186.         <td colspan="6">{{ totales['Mujeres'] }}</td>
  187.         <td style="display: none;"></td>
  188.         <td style="display: none;"></td>
  189.         <td style="display: none;"></td>
  190.         <td style="display: none;"></td>
  191.         <td style="display: none;"></td>
  192.     </tr>
  193.     <tr>
  194.         <th>Total: </th>
  195.         <td colspan="6">{{ totales['Hombres'] + totales['Mujeres'] }}</td>
  196.         <td style="display: none;"></td>
  197.         <td style="display: none;"></td>
  198.         <td style="display: none;"></td>
  199.         <td style="display: none;"></td>
  200.         <td style="display: none;"></td>
  201.     </tr>
  202.    </table> 
  203.     {% endif %}
  204. {% endblock %}