|
@@ -7,11 +7,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</header>
|
|
</header>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<section id="subheader" class="">
|
|
<section id="subheader" class="">
|
|
|
<div class="row g-3">
|
|
<div class="row g-3">
|
|
|
- <div class="col-md-2">
|
|
|
|
|
|
|
+ <div class="col-md-3">
|
|
|
Utente
|
|
Utente
|
|
|
<select name="search_member_id" class="form-select filterMember" wire:model="filterMember">
|
|
<select name="search_member_id" class="form-select filterMember" wire:model="filterMember">
|
|
|
<option value="">--Seleziona--
|
|
<option value="">--Seleziona--
|
|
@@ -28,13 +26,16 @@
|
|
|
@endforeach
|
|
@endforeach
|
|
|
</select>
|
|
</select>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="col-md-2">
|
|
|
|
|
- <span class="date_span">Dal</span>
|
|
|
|
|
- <input type="date" wire:model.defer="fromDate" class="form-control" @if($isFiltering) disabled @endif>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-md-2">
|
|
|
|
|
- <span class="date_span ms-2">al</span>
|
|
|
|
|
- <input type="date" wire:model.defer="toDate" class="form-control" @if($isFiltering) disabled @endif>
|
|
|
|
|
|
|
+ <div class="col-md-3">
|
|
|
|
|
+ Periodo
|
|
|
|
|
+ <select wire:model="selectedPeriod" class="form-select" @if($isFiltering) disabled @endif style="height: 38px;">
|
|
|
|
|
+ <option value="OGGI">Oggi</option>
|
|
|
|
|
+ <option value="IERI">Ieri</option>
|
|
|
|
|
+ <option value="MESE CORRENTE">Mese Corrente</option>
|
|
|
|
|
+ <option value="MESE PRECEDENTE">Mese Precedente</option>
|
|
|
|
|
+ <option value="ULTIMO TRIMESTRE">Ultimo Trimestre</option>
|
|
|
|
|
+ <option value="ULTIMO QUADRIMESTRE">Ultimo Quadrimestre</option>
|
|
|
|
|
+ </select>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="col-md-2">
|
|
<div class="col-md-2">
|
|
|
<div class="prima--nota_buttons ms-auto" style="float:right; margin-top:25px;">
|
|
<div class="prima--nota_buttons ms-auto" style="float:right; margin-top:25px;">
|
|
@@ -45,7 +46,7 @@
|
|
|
FILTRA
|
|
FILTRA
|
|
|
@endif
|
|
@endif
|
|
|
</button>
|
|
</button>
|
|
|
- <button class="btn--ui lightGrey reset reset" style="margin-left:5px;color:#10172A;" onclick="reset()" @if($isFiltering) disabled @endif>RESET</button>
|
|
|
|
|
|
|
+ <button class="btn--ui lightGrey reset reset" style="margin-left:5px;color:#10172A;" wire:click="resetFilters" @if($isFiltering) disabled @endif>RESET</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -65,103 +66,101 @@
|
|
|
|
|
|
|
|
<section id="resume-table" class="scrollTable records-table" style="position: relative;">
|
|
<section id="resume-table" class="scrollTable records-table" style="position: relative;">
|
|
|
|
|
|
|
|
- @if($isFiltering)
|
|
|
|
|
- <div class="loading-overlay">
|
|
|
|
|
- <div class="loading-content">
|
|
|
|
|
- <i class="fas fa-spinner fa-spin fa-3x"></i>
|
|
|
|
|
- <p>Caricamento dati in corso...</p>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ @if($isFiltering)
|
|
|
|
|
+ <div class="loading-overlay">
|
|
|
|
|
+ <div class="loading-content">
|
|
|
|
|
+ <i class="fas fa-spinner fa-spin fa-3x"></i>
|
|
|
|
|
+ <p>Caricamento dati in corso...</p>
|
|
|
</div>
|
|
</div>
|
|
|
- @endif
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @endif
|
|
|
|
|
|
|
|
- <!-- Your existing table -->
|
|
|
|
|
- <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="col">Data</th>
|
|
|
|
|
- <th scope="col" style="border-left:3px solid white;">Causale</th>
|
|
|
|
|
- <th scope="col" style="border-left:3px solid white;">Dettaglio Causale</th>
|
|
|
|
|
- <th scope="col" style="border-left:3px solid white;">Stato</th>
|
|
|
|
|
- <th scope="col" style="border-left:3px solid white;">Nominativo</th>
|
|
|
|
|
- @foreach($payments as $p)
|
|
|
|
|
- <th colspan="2" scope="col" style="text-align:center; border-left:3px solid white;">{{$p->name}}</th>
|
|
|
|
|
- @endforeach
|
|
|
|
|
- </tr>
|
|
|
|
|
|
|
+ <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="col">Data</th>
|
|
|
|
|
+ <th scope="col" style="border-left:3px solid white;">Tipo</th>
|
|
|
|
|
+ <th scope="col" style="border-left:3px solid white;">Causale</th>
|
|
|
|
|
+ <th scope="col" style="border-left:3px solid white;">Stato</th>
|
|
|
|
|
+ <th scope="col" style="border-left:3px solid white;">Nominativo</th>
|
|
|
|
|
+ @foreach($payments as $p)
|
|
|
|
|
+ <th colspan="2" scope="col" style="text-align:center; border-left:3px solid white;">{{$p->name}}</th>
|
|
|
|
|
+ @endforeach
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="col"></th>
|
|
|
|
|
+ <th scope="col" style="border-left:3px solid white;"></th>
|
|
|
|
|
+ <th scope="col" style="border-left:3px solid white;"></th>
|
|
|
|
|
+ <th scope="col" style="border-left:3px solid white;"></th>
|
|
|
|
|
+ <th scope="col" style="border-left:3px solid white;"></th>
|
|
|
|
|
+ @foreach($payments as $p)
|
|
|
|
|
+ @if($p->type == 'ALL')
|
|
|
|
|
+ <th scope="col" style="text-align:center; border-left:3px solid white;">Entrate</th>
|
|
|
|
|
+ <th scope="col" style="text-align:center">Uscite</th>
|
|
|
|
|
+ @elseif($p->type == 'IN')
|
|
|
|
|
+ <th scope="col" style="text-align:center; border-left:3px solid white;">Entrate</th>
|
|
|
|
|
+ <th scope="col" style="text-align:center;"></th>
|
|
|
|
|
+ @elseif($p->type == 'OUT')
|
|
|
|
|
+ <th style="border-left:3px solid white;"></th>
|
|
|
|
|
+ <th scope="col" style="text-align:center;">Uscite</th>
|
|
|
|
|
+ @endif
|
|
|
|
|
+ @endforeach
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody id="checkall-target">
|
|
|
|
|
+ @php $count = 0; @endphp
|
|
|
|
|
+ @foreach($records as $causal => $record)
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th scope="col"></th>
|
|
|
|
|
- <th scope="col" style="border-left:3px solid white;"></th>
|
|
|
|
|
- <th scope="col" style="border-left:3px solid white;"></th>
|
|
|
|
|
- <th scope="col" style="border-left:3px solid white;"></th>
|
|
|
|
|
- <th scope="col" style="border-left:3px solid white;"></th>
|
|
|
|
|
|
|
+ @php
|
|
|
|
|
+ $parts = explode("§", $causal);
|
|
|
|
|
+ $d = $parts[0] ?? '';
|
|
|
|
|
+ $c = $parts[1] ?? '';
|
|
|
|
|
+ $n = $parts[2] ?? '';
|
|
|
|
|
+ $det = $parts[3] ?? '';
|
|
|
|
|
+ $del = $parts[4] ?? '';
|
|
|
|
|
+
|
|
|
|
|
+ $detailParts = explode('|', $det);
|
|
|
|
|
+ $isMultiple = count($detailParts) > 1;
|
|
|
|
|
+ $displayDetail = $isMultiple ? 'Varie' : $det;
|
|
|
|
|
+ @endphp
|
|
|
|
|
+ <td style="background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{date("d/m/Y", strtotime($d))}}</td>
|
|
|
|
|
+ <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$c}}</td>
|
|
|
|
|
+ <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
|
|
|
|
|
+ @if($isMultiple)
|
|
|
|
|
+ <span class="varie-link" data-causals="{{implode('|', array_slice($detailParts, 1))}}" style="color: #0C6197; cursor: pointer; text-decoration: underline;">
|
|
|
|
|
+ {{$displayDetail}}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ @else
|
|
|
|
|
+ {{$displayDetail}}
|
|
|
|
|
+ @endif
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
|
|
|
|
|
+ @if($del == 'DELETED')
|
|
|
|
|
+ <span style='color:red'>Annullata</span>
|
|
|
|
|
+ @endif
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$n}}</td>
|
|
|
@foreach($payments as $p)
|
|
@foreach($payments as $p)
|
|
|
- @if($p->type == 'ALL')
|
|
|
|
|
- <th scope="col" style="text-align:center; border-left:3px solid white;">Entrate</th>
|
|
|
|
|
- <th scope="col" style="text-align:center">Uscite</th>
|
|
|
|
|
- @elseif($p->type == 'IN')
|
|
|
|
|
- <th scope="col" style="text-align:center; border-left:3px solid white;">Entrate</th>
|
|
|
|
|
- <th scope="col" style="text-align:center;"></th>
|
|
|
|
|
- @elseif($p->type == 'OUT')
|
|
|
|
|
- <th style="border-left:3px solid white;"></th>
|
|
|
|
|
- <th scope="col" style="text-align:center;">Uscite</th>
|
|
|
|
|
|
|
+ @if(isset($record[$p->name]))
|
|
|
|
|
+ <td style="text-align:right; border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
|
|
|
|
|
+ @if(isset($record[$p->name]["IN"]))
|
|
|
|
|
+ <span class="tablesaw-cell-content " style="color:green">{{formatPrice($record[$p->name]["IN"])}}</span>
|
|
|
|
|
+ @endif
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td style="text-align:right;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
|
|
|
|
|
+ @if(isset($record[$p->name]["OUT"]))
|
|
|
|
|
+ <span class="tablesaw-cell-content " style="color:red">{{formatPrice($record[$p->name]["OUT"])}}</span>
|
|
|
|
|
+ @endif
|
|
|
|
|
+ </td>
|
|
|
|
|
+ @else
|
|
|
|
|
+ <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}"></td>
|
|
|
|
|
+ <td style="background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}"></td>
|
|
|
@endif
|
|
@endif
|
|
|
@endforeach
|
|
@endforeach
|
|
|
</tr>
|
|
</tr>
|
|
|
- </thead>
|
|
|
|
|
- <tbody id="checkall-target">
|
|
|
|
|
- @php $count = 0; @endphp
|
|
|
|
|
- @foreach($records as $causal => $record)
|
|
|
|
|
- <tr>
|
|
|
|
|
- @php
|
|
|
|
|
- $parts = explode("§", $causal);
|
|
|
|
|
- $d = $parts[0] ?? '';
|
|
|
|
|
- $c = $parts[1] ?? '';
|
|
|
|
|
- $n = $parts[2] ?? ''; // Nominativo
|
|
|
|
|
- $det = $parts[3] ?? '';
|
|
|
|
|
- $del = $parts[4] ?? '';
|
|
|
|
|
-
|
|
|
|
|
- // Check if detail contains multiple causals (separated by |)
|
|
|
|
|
- $detailParts = explode('|', $det);
|
|
|
|
|
- $isMultiple = count($detailParts) > 1;
|
|
|
|
|
- $displayDetail = $isMultiple ? 'Varie' : $det;
|
|
|
|
|
- @endphp
|
|
|
|
|
- <td style="background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{date("d/m/Y", strtotime($d))}}</td>
|
|
|
|
|
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$c}}</td>
|
|
|
|
|
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
|
|
|
|
|
- @if($isMultiple)
|
|
|
|
|
- <span class="varie-link" data-causals="{{implode('|', array_slice($detailParts, 1))}}" style="color: #0C6197; cursor: pointer; text-decoration: underline;">
|
|
|
|
|
- {{$displayDetail}}
|
|
|
|
|
- </span>
|
|
|
|
|
- @else
|
|
|
|
|
- {{$displayDetail}}
|
|
|
|
|
- @endif
|
|
|
|
|
- </td>
|
|
|
|
|
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
|
|
|
|
|
- @if($del == 'DELETED')
|
|
|
|
|
- <span style='color:red'>Annullata</span>
|
|
|
|
|
- @endif
|
|
|
|
|
- </td>
|
|
|
|
|
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$n}}</td>
|
|
|
|
|
- @foreach($payments as $p)
|
|
|
|
|
- @if(isset($record[$p->name]))
|
|
|
|
|
- <td style="text-align:right; border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
|
|
|
|
|
- @if(isset($record[$p->name]["IN"]))
|
|
|
|
|
- <span class="tablesaw-cell-content " style="color:green">{{formatPrice($record[$p->name]["IN"])}}</span>
|
|
|
|
|
- @endif
|
|
|
|
|
- </td>
|
|
|
|
|
- <td style="text-align:right;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
|
|
|
|
|
- @if(isset($record[$p->name]["OUT"]))
|
|
|
|
|
- <span class="tablesaw-cell-content " style="color:red">{{formatPrice($record[$p->name]["OUT"])}}</span>
|
|
|
|
|
- @endif
|
|
|
|
|
- </td>
|
|
|
|
|
- @else
|
|
|
|
|
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}"></td>
|
|
|
|
|
- <td style="background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}"></td>
|
|
|
|
|
- @endif
|
|
|
|
|
- @endforeach
|
|
|
|
|
- </tr>
|
|
|
|
|
- @php $count++; @endphp
|
|
|
|
|
- @endforeach
|
|
|
|
|
- </tbody>
|
|
|
|
|
|
|
+ @php $count++; @endphp
|
|
|
|
|
+ @endforeach
|
|
|
|
|
+ </tbody>
|
|
|
<tfoot>
|
|
<tfoot>
|
|
|
<tr>
|
|
<tr>
|
|
|
<td></td>
|
|
<td></td>
|
|
@@ -223,45 +222,108 @@
|
|
|
<button type="button" class="btn btn-floating btn-lg" id="btn-back-to-bottom"><i class="fas fa-arrow-down"></i></button>
|
|
<button type="button" class="btn btn-floating btn-lg" id="btn-back-to-bottom"><i class="fas fa-arrow-down"></i></button>
|
|
|
<button type="button" class="btn btn-floating btn-lg" id="btn-back-to-top"><i class="fas fa-arrow-up"></i></button>
|
|
<button type="button" class="btn btn-floating btn-lg" id="btn-back-to-top"><i class="fas fa-arrow-up"></i></button>
|
|
|
</section>
|
|
</section>
|
|
|
|
|
+
|
|
|
<div class="modal fade" id="causalsModal" tabindex="-1" aria-labelledby="causalsModalLabel" aria-hidden="true">
|
|
<div class="modal fade" id="causalsModal" tabindex="-1" aria-labelledby="causalsModalLabel" aria-hidden="true">
|
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-dialog modal-lg">
|
|
|
<div class="modal-content">
|
|
<div class="modal-content">
|
|
|
- <div class="modal-header" style="background-color: #0C6197!important;">
|
|
|
|
|
- <h5 class="modal-title" id="causalsModalLabel" >Dettaglio Causali</h5>
|
|
|
|
|
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="CHIUDI"></button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="modal-body">
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-12">
|
|
|
|
|
- <h6>Causali incluse:</h6>
|
|
|
|
|
- <ul id="causalsList" class="list-group list-group-flush">
|
|
|
|
|
- <!-- Causals will be populated here by JavaScript -->
|
|
|
|
|
- </ul>
|
|
|
|
|
|
|
+ <div class="modal-header" style="background-color: #0C6197!important;">
|
|
|
|
|
+ <h5 class="modal-title" id="causalsModalLabel">Dettaglio Causali</h5>
|
|
|
|
|
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="CHIUDI"></button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-12">
|
|
|
|
|
+ <h6>Causali incluse:</h6>
|
|
|
|
|
+ <ul id="causalsList" class="list-group list-group-flush">
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-footer" style="background-color: #FFF!important;">
|
|
|
|
|
+ <button type="button" class="btn--ui lightGrey me-2" data-bs-dismiss="modal">CHIUDI</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="modal-footer" style="background-color: #FFF!important;">
|
|
|
|
|
- <button type="button" class="btn--ui lightGrey me-2" data-bs-dismiss="modal">CHIUDI</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@push('scripts')
|
|
@push('scripts')
|
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
|
@endpush
|
|
@endpush
|
|
|
|
|
+
|
|
|
@push('scripts')
|
|
@push('scripts')
|
|
|
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
|
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
|
|
<style>
|
|
<style>
|
|
|
|
|
+ .loading-overlay {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ background-color: rgba(255, 255, 255, 0.9);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ z-index: 1000;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .loading-content {
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ color: #0C6197;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .loading-content i {
|
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
|
+ color: #0C6197;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .loading-content p {
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ color: #10172A;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal {
|
|
|
|
|
+ z-index: 9999 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-backdrop {
|
|
|
|
|
+ z-index: 9998 !important;
|
|
|
|
|
+ background-color: rgba(0, 0, 0, 0.6) !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-content {
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
|
|
|
|
|
+ z-index: 10000 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-header {
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ border-bottom: none;
|
|
|
|
|
+ border-radius: 8px 8px 0 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-header .btn-close {
|
|
|
|
|
+ filter: invert(1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-title {
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .varie-link:hover {
|
|
|
|
|
+ color: #084c6b !important;
|
|
|
|
|
+ text-decoration: underline !important;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
#btn-back-to-top {
|
|
#btn-back-to-top {
|
|
|
background-color: #0C6197;
|
|
background-color: #0C6197;
|
|
|
color: white;
|
|
color: white;
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
- /* bottom: 20px; */
|
|
|
|
|
- /* right: 20px; */
|
|
|
|
|
display: none;
|
|
display: none;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -269,17 +331,23 @@
|
|
|
background-color: #0C6197;
|
|
background-color: #0C6197;
|
|
|
color: white;
|
|
color: white;
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
- /* top: 120px; */
|
|
|
|
|
- /* right: 20px; */
|
|
|
|
|
z-index: 9999;
|
|
z-index: 9999;
|
|
|
display: none;
|
|
display: none;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ button[disabled] {
|
|
|
|
|
+ opacity: 0.7;
|
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .btn--ui .fa-spinner {
|
|
|
|
|
+ margin-right: 5px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.scrollTable {
|
|
.scrollTable {
|
|
|
- margin-left: 0px ;
|
|
|
|
|
- margin-right: 0px ;
|
|
|
|
|
|
|
+ margin-left: 0px;
|
|
|
|
|
+ margin-right: 0px;
|
|
|
padding: 15px;
|
|
padding: 15px;
|
|
|
- /*max-width: 800px !important;*/
|
|
|
|
|
overflow-x: auto;
|
|
overflow-x: auto;
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
@@ -292,47 +360,44 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
table thead {
|
|
table thead {
|
|
|
- /* Important */
|
|
|
|
|
position: sticky;
|
|
position: sticky;
|
|
|
z-index: 100;
|
|
z-index: 100;
|
|
|
top: 0;
|
|
top: 0;
|
|
|
}
|
|
}
|
|
|
- .select2-container--default .select2-selection--single{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .select2-container--default .select2-selection--single {
|
|
|
background-color: #E9F0F5;
|
|
background-color: #E9F0F5;
|
|
|
border: 0.0625rem solid #DFE5EB;
|
|
border: 0.0625rem solid #DFE5EB;
|
|
|
font-size: 0.75rem;
|
|
font-size: 0.75rem;
|
|
|
- }
|
|
|
|
|
- .select2-selection
|
|
|
|
|
- {
|
|
|
|
|
height: 38px !important;
|
|
height: 38px !important;
|
|
|
}
|
|
}
|
|
|
- .select2-selection__rendered
|
|
|
|
|
- {
|
|
|
|
|
- padding-top:3px;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .select2-selection__rendered {
|
|
|
|
|
+ padding-top: 3px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.select2 {
|
|
.select2 {
|
|
|
- width:100% !important;
|
|
|
|
|
- }
|
|
|
|
|
- .i{
|
|
|
|
|
- font-size:16px;
|
|
|
|
|
- font-weight:bold;
|
|
|
|
|
- }
|
|
|
|
|
- .cellBorder
|
|
|
|
|
- {
|
|
|
|
|
- border-left: 1px solid grey;
|
|
|
|
|
|
|
+ width: 100% !important;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .select2-selection--multiple{
|
|
|
|
|
|
|
+ .select2-selection--multiple {
|
|
|
overflow: hidden !important;
|
|
overflow: hidden !important;
|
|
|
height: auto !important;
|
|
height: auto !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.select2-container {
|
|
.select2-container {
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
display: inline-block;
|
|
display: inline-block;
|
|
|
margin: 0;
|
|
margin: 0;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
vertical-align: middle;
|
|
vertical-align: middle;
|
|
|
|
|
+ z-index: 999 !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .select2-dropdown {
|
|
|
|
|
+ z-index: 999 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.select2-container .select2-selection--single {
|
|
.select2-container .select2-selection--single {
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
@@ -341,6 +406,7 @@
|
|
|
user-select: none;
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
-webkit-user-select: none;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.select2-container .select2-selection--single .select2-selection__rendered {
|
|
.select2-container .select2-selection--single .select2-selection__rendered {
|
|
|
display: block;
|
|
display: block;
|
|
|
padding-left: 8px;
|
|
padding-left: 8px;
|
|
@@ -349,9 +415,11 @@
|
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
button#exportDropdown.btn--ui_outline.light {
|
|
button#exportDropdown.btn--ui_outline.light {
|
|
|
font-weight: normal !important;
|
|
font-weight: normal !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.btn--ui_outline.light.dropdown-toggle:active,
|
|
.btn--ui_outline.light.dropdown-toggle:active,
|
|
|
.btn--ui_outline.light.dropdown-toggle:focus,
|
|
.btn--ui_outline.light.dropdown-toggle:focus,
|
|
|
.btn--ui_outline.light.dropdown-toggle.show {
|
|
.btn--ui_outline.light.dropdown-toggle.show {
|
|
@@ -365,6 +433,45 @@
|
|
|
color: #10172A !important;
|
|
color: #10172A !important;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .form-select {
|
|
|
|
|
+ height: 38px !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ body.modal-open {
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-dialog {
|
|
|
|
|
+ z-index: 10001 !important;
|
|
|
|
|
+ margin: 1.75rem auto;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .list-group-item {
|
|
|
|
|
+ border-left: none;
|
|
|
|
|
+ border-right: none;
|
|
|
|
|
+ border-top: 1px solid #dee2e6;
|
|
|
|
|
+ padding: 12px 15px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .list-group-item:first-child {
|
|
|
|
|
+ border-top: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .list-group-item:last-child {
|
|
|
|
|
+ border-bottom: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @media (max-width: 768px) {
|
|
|
|
|
+ .col-md-2, .col-md-3, .col-md-4 {
|
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .prima--nota_buttons {
|
|
|
|
|
+ float: none !important;
|
|
|
|
|
+ margin-top: 10px !important;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|
|
|
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
|
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
|
|
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
|
@@ -373,18 +480,22 @@
|
|
|
|
|
|
|
|
@push('scripts')
|
|
@push('scripts')
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ function closeSelect2Dropdowns() {
|
|
|
|
|
+ $('.filterCausals').each(function() {
|
|
|
|
|
+ if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
|
|
+ $(this).select2('close');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ $('.filterMember').each(function() {
|
|
|
|
|
+ if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
|
|
+ $(this).select2('close');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- Livewire.on('load-table', () => {
|
|
|
|
|
- load();
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- function load()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ function load() {
|
|
|
$(document).ready(function(){
|
|
$(document).ready(function(){
|
|
|
-
|
|
|
|
|
$(document).on("keypress", $('.filterCausals'), function (e) {
|
|
$(document).on("keypress", $('.filterCausals'), function (e) {
|
|
|
-
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
$(".select2-results__option").each(function(){
|
|
$(".select2-results__option").each(function(){
|
|
|
var txt = $(this).html();
|
|
var txt = $(this).html();
|
|
@@ -394,13 +505,24 @@
|
|
|
}, 100);
|
|
}, 100);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $('.filterCausals').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
|
|
- $('.filterCausals').on('change', function (e) {
|
|
|
|
|
|
|
+ if (!$('.filterCausals').hasClass('select2-hidden-accessible')) {
|
|
|
|
|
+ $('.filterCausals').select2({
|
|
|
|
|
+ "language": {"noResults": function(){return "Nessun risultato";}},
|
|
|
|
|
+ "dropdownParent": $('body'),
|
|
|
|
|
+ "width": "100%"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $('.filterCausals').off('change.customHandler').on('change.customHandler', function (e) {
|
|
|
var data = $('.filterCausals').select2("val");
|
|
var data = $('.filterCausals').select2("val");
|
|
|
@this.set('filterCausals', data);
|
|
@this.set('filterCausals', data);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $('.filterCausals').on('select2:open', function (e) {
|
|
|
|
|
|
|
+ $('.filterCausals').off('select2:open.customHandler').on('select2:open.customHandler', function (e) {
|
|
|
|
|
+ if ($('#causalsModal').hasClass('show')) {
|
|
|
|
|
+ $('#causalsModal').modal('hide');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
$(".select2-results__option").each(function(){
|
|
$(".select2-results__option").each(function(){
|
|
|
var txt = $(this).html();
|
|
var txt = $(this).html();
|
|
@@ -410,45 +532,30 @@
|
|
|
}, 100);
|
|
}, 100);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $('.filterMember').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
|
|
- $('.filterMember').on('change', function (e) {
|
|
|
|
|
|
|
+ if (!$('.filterMember').hasClass('select2-hidden-accessible')) {
|
|
|
|
|
+ $('.filterMember').select2({
|
|
|
|
|
+ "language": {"noResults": function(){return "Nessun risultato";}},
|
|
|
|
|
+ "dropdownParent": $('body'),
|
|
|
|
|
+ "width": "100%"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $('.filterMember').off('change.customHandler').on('change.customHandler', function (e) {
|
|
|
var data = $('.filterMember').select2("val");
|
|
var data = $('.filterMember').select2("val");
|
|
|
@this.set('filterMember', data);
|
|
@this.set('filterMember', data);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ $('.filterMember').off('select2:open.customHandler').on('select2:open.customHandler', function (e) {
|
|
|
|
|
+ if ($('#causalsModal').hasClass('show')) {
|
|
|
|
|
+ $('#causalsModal').modal('hide');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Livewire.on('load-select', () => {
|
|
|
|
|
- $('.filterCausals').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
|
|
- $('.filterCausals').on('change', function (e) {
|
|
|
|
|
- var data = $('.filterCausals').select2("val");
|
|
|
|
|
- @this.set('filterCausals', data);
|
|
|
|
|
- });
|
|
|
|
|
- $('.filterMember').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
|
|
- $('.filterMember').on('change', function (e) {
|
|
|
|
|
- var data = $('.filterMember').select2("val");
|
|
|
|
|
- @this.set('filterMember', data);
|
|
|
|
|
- });
|
|
|
|
|
- setMaxWidth();
|
|
|
|
|
- setMaxHeight();
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- load();
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- </script>
|
|
|
|
|
-
|
|
|
|
|
-@endpush
|
|
|
|
|
-
|
|
|
|
|
-@push('scripts')
|
|
|
|
|
- <script>
|
|
|
|
|
-
|
|
|
|
|
- function printData()
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- var divToPrint=document.getElementById("tablesaw-350");
|
|
|
|
|
- newWin= window.open("");
|
|
|
|
|
|
|
+ function printData() {
|
|
|
|
|
+ var divToPrint = document.getElementById("tablesaw-350");
|
|
|
|
|
+ newWin = window.open("");
|
|
|
var htmlToPrint = '' +
|
|
var htmlToPrint = '' +
|
|
|
'<style type="text/css">' +
|
|
'<style type="text/css">' +
|
|
|
'table th, table td {' +
|
|
'table th, table td {' +
|
|
@@ -463,135 +570,56 @@
|
|
|
newWin.close();
|
|
newWin.close();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- document.querySelector("#print").addEventListener("click", function(){
|
|
|
|
|
- printData();
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- $( document ).ready( function(){
|
|
|
|
|
-
|
|
|
|
|
- setMaxWidth();
|
|
|
|
|
- setMaxHeight();
|
|
|
|
|
- $( window ).bind( "resize", setMaxWidth );
|
|
|
|
|
- $( window ).bind( "resize", setMaxHeight );
|
|
|
|
|
-
|
|
|
|
|
- $(".open-filter").click(function(){
|
|
|
|
|
- setMaxWidth();
|
|
|
|
|
- setMaxHeight();
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- function setMaxWidth() {
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function setMaxHeight() {
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- let mybuttonBottom = document.getElementById("btn-back-to-bottom");
|
|
|
|
|
- let mybutton = document.getElementById("btn-back-to-top");
|
|
|
|
|
-
|
|
|
|
|
- window.onscroll = function () {
|
|
|
|
|
- scrollFunction();
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
|
|
+ function scrollFunction() {
|
|
|
const element = document.getElementById('resume-table');
|
|
const element = document.getElementById('resume-table');
|
|
|
- element.onscroll = (e)=>{
|
|
|
|
|
- scrollFunction();
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- function scrollFunction() {
|
|
|
|
|
- if (
|
|
|
|
|
- element.scrollTop > 20
|
|
|
|
|
- ) {
|
|
|
|
|
- mybutton.style.display = "block";
|
|
|
|
|
- mybuttonBottom.style.display = "block";
|
|
|
|
|
- } else {
|
|
|
|
|
- mybutton.style.display = "none";
|
|
|
|
|
- mybuttonBottom.style.display = "none";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const mybuttonBottom = document.getElementById("btn-back-to-bottom");
|
|
|
|
|
+ const mybutton = document.getElementById("btn-back-to-top");
|
|
|
|
|
|
|
|
- function scrollFunctionOld() {
|
|
|
|
|
- if (
|
|
|
|
|
- document.body.scrollTop > 20 ||
|
|
|
|
|
- document.documentElement.scrollTop > 20
|
|
|
|
|
- ) {
|
|
|
|
|
|
|
+ if (element.scrollTop > 20) {
|
|
|
mybutton.style.display = "block";
|
|
mybutton.style.display = "block";
|
|
|
mybuttonBottom.style.display = "block";
|
|
mybuttonBottom.style.display = "block";
|
|
|
} else {
|
|
} else {
|
|
|
mybutton.style.display = "none";
|
|
mybutton.style.display = "none";
|
|
|
mybuttonBottom.style.display = "none";
|
|
mybuttonBottom.style.display = "none";
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- // When the user clicks on the button, scroll to the top of the document
|
|
|
|
|
- mybutton.addEventListener("click", backToTop);
|
|
|
|
|
- mybuttonBottom.addEventListener("click", backToBottom);
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- function backToTop() {
|
|
|
|
|
- $('#resume-table').scrollTop(0);
|
|
|
|
|
- /*document.body.scrollTop = 0;
|
|
|
|
|
- document.documentElement.scrollTop = 0;*/
|
|
|
|
|
- }
|
|
|
|
|
- function backToBottom() {
|
|
|
|
|
- $('#resume-table').scrollTop($('#resume-table')[0].scrollHeight);
|
|
|
|
|
- //window.scrollTo(0, document.body.scrollHeight);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ function backToTop() {
|
|
|
|
|
+ $('#resume-table').scrollTop(0);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- function reset()
|
|
|
|
|
- {
|
|
|
|
|
- $('.filterMember').val('');
|
|
|
|
|
- $('.filterMember').trigger('change');
|
|
|
|
|
- $('.filterCausals').val('');
|
|
|
|
|
- $('.filterCausals').trigger('change');
|
|
|
|
|
- var today = new Date().toISOString().split('T')[0];
|
|
|
|
|
|
|
+ function backToBottom() {
|
|
|
|
|
+ $('#resume-table').scrollTop($('#resume-table')[0].scrollHeight);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // Update the form inputs
|
|
|
|
|
- window.livewire.find(document.querySelector('[wire\\:id]').getAttribute('wire:id')).set('fromDate', today);
|
|
|
|
|
- window.livewire.find(document.querySelector('[wire\\:id]').getAttribute('wire:id')).set('toDate', today);
|
|
|
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
|
+ load();
|
|
|
|
|
+ document.querySelector("#print").addEventListener("click", function(){
|
|
|
|
|
+ printData();
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- // Reset the applied dates and trigger filter
|
|
|
|
|
- window.livewire.find(document.querySelector('[wire\\:id]').getAttribute('wire:id')).set('appliedFromDate', today);
|
|
|
|
|
- window.livewire.find(document.querySelector('[wire\\:id]').getAttribute('wire:id')).set('appliedToDate', today);
|
|
|
|
|
|
|
+ const element = document.getElementById('resume-table');
|
|
|
|
|
+ element.onscroll = scrollFunction;
|
|
|
|
|
|
|
|
- // Trigger re-render
|
|
|
|
|
- window.livewire.find(document.querySelector('[wire\\:id]').getAttribute('wire:id')).call('$refresh');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const mybuttonBottom = document.getElementById("btn-back-to-bottom");
|
|
|
|
|
+ const mybutton = document.getElementById("btn-back-to-top");
|
|
|
|
|
|
|
|
- $(document).ready(function() {
|
|
|
|
|
- // Safe function to close select2 dropdowns
|
|
|
|
|
- function closeSelect2Dropdowns() {
|
|
|
|
|
- // Only close select2 on elements that actually have select2 initialized
|
|
|
|
|
- $('.filterCausals').each(function() {
|
|
|
|
|
- if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
|
|
- $(this).select2('close');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- $('.filterMember').each(function() {
|
|
|
|
|
- if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
|
|
- $(this).select2('close');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ mybutton.addEventListener("click", backToTop);
|
|
|
|
|
+ mybuttonBottom.addEventListener("click", backToBottom);
|
|
|
|
|
|
|
|
- // Handle click on "Varie" links
|
|
|
|
|
$(document).on('click', '.varie-link', function(e) {
|
|
$(document).on('click', '.varie-link', function(e) {
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
- // Close any open select2 dropdowns safely
|
|
|
|
|
closeSelect2Dropdowns();
|
|
closeSelect2Dropdowns();
|
|
|
|
|
|
|
|
- // Get the causals data from the data attribute
|
|
|
|
|
const causalsData = $(this).data('causals');
|
|
const causalsData = $(this).data('causals');
|
|
|
|
|
|
|
|
if (causalsData) {
|
|
if (causalsData) {
|
|
|
- // Split the causals by | separator
|
|
|
|
|
const causals = causalsData.split('|');
|
|
const causals = causalsData.split('|');
|
|
|
|
|
|
|
|
- // Clear the previous list
|
|
|
|
|
$('#causalsList').empty();
|
|
$('#causalsList').empty();
|
|
|
|
|
|
|
|
- // Populate the modal with causals
|
|
|
|
|
causals.forEach(function(causal) {
|
|
causals.forEach(function(causal) {
|
|
|
if (causal.trim()) {
|
|
if (causal.trim()) {
|
|
|
$('#causalsList').append(
|
|
$('#causalsList').append(
|
|
@@ -603,132 +631,36 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // Show the modal with proper focus management
|
|
|
|
|
$('#causalsModal').modal('show');
|
|
$('#causalsModal').modal('show');
|
|
|
|
|
|
|
|
- // Ensure modal gets focus
|
|
|
|
|
$('#causalsModal').on('shown.bs.modal', function () {
|
|
$('#causalsModal').on('shown.bs.modal', function () {
|
|
|
$(this).find('.btn-close').focus();
|
|
$(this).find('.btn-close').focus();
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // Close select2 dropdowns when modal is opening
|
|
|
|
|
$('#causalsModal').on('show.bs.modal', function () {
|
|
$('#causalsModal').on('show.bs.modal', function () {
|
|
|
closeSelect2Dropdowns();
|
|
closeSelect2Dropdowns();
|
|
|
$('body').addClass('modal-open');
|
|
$('body').addClass('modal-open');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // Clean up when modal is closed
|
|
|
|
|
$('#causalsModal').on('hidden.bs.modal', function () {
|
|
$('#causalsModal').on('hidden.bs.modal', function () {
|
|
|
$('body').removeClass('modal-open');
|
|
$('body').removeClass('modal-open');
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // Update the existing load function to include the new event handlers
|
|
|
|
|
- function load()
|
|
|
|
|
- {
|
|
|
|
|
- $(document).ready(function(){
|
|
|
|
|
-
|
|
|
|
|
- $(document).on("keypress", $('.filterCausals'), function (e) {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- $(".select2-results__option").each(function(){
|
|
|
|
|
- var txt = $(this).html();
|
|
|
|
|
- var count = (txt.match(/-/g) || []).length;
|
|
|
|
|
- $(this).addClass('paddingLeftSelect' + count);
|
|
|
|
|
- });
|
|
|
|
|
- }, 100);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // Initialize select2 only if not already initialized
|
|
|
|
|
- if (!$('.filterCausals').hasClass('select2-hidden-accessible')) {
|
|
|
|
|
- $('.filterCausals').select2({
|
|
|
|
|
- "language": {"noResults": function(){return "Nessun risultato";}},
|
|
|
|
|
- "dropdownParent": $('body'),
|
|
|
|
|
- "width": "100%"
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $('.filterCausals').off('change.customHandler').on('change.customHandler', function (e) {
|
|
|
|
|
- var data = $('.filterCausals').select2("val");
|
|
|
|
|
- @this.set('filterCausals', data);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- $('.filterCausals').off('select2:open.customHandler').on('select2:open.customHandler', function (e) {
|
|
|
|
|
- // Close modal if open when select2 opens
|
|
|
|
|
- if ($('#causalsModal').hasClass('show')) {
|
|
|
|
|
- $('#causalsModal').modal('hide');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- $(".select2-results__option").each(function(){
|
|
|
|
|
- var txt = $(this).html();
|
|
|
|
|
- var count = (txt.match(/-/g) || []).length;
|
|
|
|
|
- $(this).addClass('paddingLeftSelect' + count);
|
|
|
|
|
- });
|
|
|
|
|
- }, 100);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // Initialize select2 only if not already initialized
|
|
|
|
|
- if (!$('.filterMember').hasClass('select2-hidden-accessible')) {
|
|
|
|
|
- $('.filterMember').select2({
|
|
|
|
|
- "language": {"noResults": function(){return "Nessun risultato";}},
|
|
|
|
|
- "dropdownParent": $('body'),
|
|
|
|
|
- "width": "100%"
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $('.filterMember').off('change.customHandler').on('change.customHandler', function (e) {
|
|
|
|
|
- var data = $('.filterMember').select2("val");
|
|
|
|
|
- @this.set('filterMember', data);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- $('.filterMember').off('select2:open.customHandler').on('select2:open.customHandler', function (e) {
|
|
|
|
|
- // Close modal if open when select2 opens
|
|
|
|
|
- if ($('#causalsModal').hasClass('show')) {
|
|
|
|
|
- $('#causalsModal').modal('hide');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // Re-attach event handlers for "Varie" links after Livewire updates
|
|
|
|
|
- $(document).off('click', '.varie-link').on('click', '.varie-link', function(e) {
|
|
|
|
|
- e.preventDefault();
|
|
|
|
|
- e.stopPropagation();
|
|
|
|
|
-
|
|
|
|
|
- // Close any open select2 dropdowns safely
|
|
|
|
|
- $('.filterCausals').each(function() {
|
|
|
|
|
- if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
|
|
- $(this).select2('close');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- $('.filterMember').each(function() {
|
|
|
|
|
- if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
|
|
- $(this).select2('close');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- const causalsData = $(this).data('causals');
|
|
|
|
|
-
|
|
|
|
|
- if (causalsData) {
|
|
|
|
|
- const causals = causalsData.split('|');
|
|
|
|
|
-
|
|
|
|
|
- $('#causalsList').empty();
|
|
|
|
|
|
|
+ Livewire.on('load-table', () => {
|
|
|
|
|
+ load();
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- causals.forEach(function(causal) {
|
|
|
|
|
- if (causal.trim()) {
|
|
|
|
|
- $('#causalsList').append(
|
|
|
|
|
- '<li class="list-group-item">' +
|
|
|
|
|
- '<i class="fas fa-tags me-2" style="color: #0C6197;"></i>' +
|
|
|
|
|
- causal.trim() +
|
|
|
|
|
- '</li>'
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ Livewire.on('load-select', () => {
|
|
|
|
|
+ load();
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- $('#causalsModal').modal('show');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ Livewire.on('filters-reset', () => {
|
|
|
|
|
+ $('.filterMember').val('').trigger('change');
|
|
|
|
|
+ $('.filterCausals').val('').trigger('change');
|
|
|
|
|
+ load();
|
|
|
|
|
+ });
|
|
|
</script>
|
|
</script>
|
|
|
@endpush
|
|
@endpush
|