templates/movimientos/orden_reparacion/index.html.twig line 1

Open in your IDE?
  1. {% extends 'navbar.html.twig' %}
  2. {% block title %}Orden Reparacion Interna{% endblock %}
  3. {% block content_user %}
  4.     <h5>Orden Reparacion Interna</h5>
  5.     <hr>
  6.     <table id="example" class="table table-striped table-bordered table-hover">
  7.         <thead>
  8.             <tr>
  9.                 <th>Numero</th>
  10.                 <th>Fecha</th>
  11.                 <th>Ingresada</th>
  12.                 <th>Responsable</th>
  13.                 <th>Equipos</th>
  14.                 <th>Observaciones</th>
  15.                 <th>actions</th>
  16.             </tr>
  17.         </thead>
  18.         <tbody>
  19.         {% for orden_reparacion in orden_reparacions %}
  20.             <tr>
  21.                 <td>{{ "%06d"|format(orden_reparacion.numero) }}</td>
  22.                 <td>{{ orden_reparacion.fecha ? orden_reparacion.fecha|date('d/m/Y') : '' }}</td>
  23.                 <td>{{ orden_reparacion.yaProcesada ? 'Si' : 'No' }}</td>
  24.                 <td>{{ orden_reparacion.responsable }}</td>
  25.                 <td>
  26.                     {{ orden_reparacion.detailEquipos }}
  27.                 </td>
  28.                 <td>{{ orden_reparacion.observaciones }}</td>
  29.                 <td>
  30.                     <a href="{{ path('app_movimientos_item_movimiento_new', {'id': orden_reparacion.id}) }}" class="btn btn-success btn-sm">
  31.                             {{ orden_reparacion.yaProcesada ? 'Ver' : 'Editar' }}
  32.                     </a>
  33.                     {% if not orden_reparacion.finalizoCircuito %}
  34.                         {% if orden_reparacion.yaProcesada  %}
  35.                             <a href="{{ path('app_movimientos_item_movimiento_ingresar', {'id': orden_reparacion.id}) }}" 
  36.                                class="btn btn-danger btn-sm">Devolucion</a>
  37.                         {% endif %}
  38.                     {% endif %}
  39.                 </td>
  40.             </tr>
  41.         {% else %}
  42.             <tr>
  43.                 <td colspan="7">no records found</td>
  44.             </tr>
  45.         {% endfor %}
  46.         </tbody>
  47.     </table>
  48.     <a href="{{ path('app_movimientos_orden_reparacion_new') }}" class="btn btn-primary">Nueva Orden Reparacion</a>
  49. {% endblock %}
  50. {% block javascripts_footer %}
  51.     
  52.     {{ parent() }}
  53.     <script type="text/javascript">
  54.         $('.btn-confirm').click(function(event){
  55.                                                 event.preventDefault();
  56.                                                 let a = $(this);
  57.                                                 bootbox.confirm({
  58.                                                                     message: 'Seguro confirmar el prestamo # ' + a.data('loop') + '?',
  59.                                                                     buttons: {
  60.                                                                             confirm: {
  61.                                                                                     label: 'Si, confirmar',
  62.                                                                                     className: 'btn-success'
  63.                                                                             },
  64.                                                                             cancel: {
  65.                                                                                     label: 'No, cancelar',
  66.                                                                                     className: 'btn-danger'
  67.                                                                             }
  68.                                                                     },
  69.                                                                     callback: function (result) {
  70.                                                                                                   if (result)
  71.                                                                                                   {
  72.                                                                                                         $.post(a.attr('href'),
  73.                                                                                                                function (data){
  74.                                                                                                                                 if (data.ok)
  75.                                                                                                                                 {
  76.                                                                                                                                     window.location.href = window.location.href;
  77.                                                                                                                                 }
  78.                                                                                                                                 else
  79.                                                                                                                                 {
  80.                                                                                                                                     bootbox.alert(data.msg);
  81.                                                                                                                                 }
  82.                                                                                                                });
  83.                                                                                                   }
  84.                                                                                                 }
  85.                                                                 });
  86.         });
  87.         $('#example').DataTable({
  88.                                     fixedHeader: true,
  89.                                     paging: true,
  90.                                     responsive: true,
  91.                                     order: [[ 0, 'desc' ]],
  92.                                     language: {
  93.                                         url: '{{ asset('i18n/spanish.json') }}'
  94.                                     }
  95.                                 });
  96.     </script>
  97. {% endblock %}