FabioFratini 1 سال پیش
والد
کامیت
5053b00641

+ 2 - 2
resources/views/components/verbale/allegati/index.blade.php

@@ -4,7 +4,7 @@
 @php
     $hasVisibleAllegati = false;
     foreach ($allegati as $allegato) {
-        if ($allegato->is_visible && $allegato->files) {
+        if ($allegato->is_visible && $allegato->files && $allegato->gallery_type == 1 && $allegato->is_visible == true) {
             $hasVisibleAllegati = true;
             break;
         }
@@ -21,7 +21,7 @@
     </table>
 
     @foreach($allegati as $allegato)
-        @if($allegato->is_visible && $allegato->files)
+        @if($allegato->is_visible && $allegato->files && $allegato->gallery_type == 1 && $allegato->is_visible == true)
             <x-verbale.allegati.file-display :files="explode('|', $allegato->files)" />
         @endif
     @endforeach

+ 1 - 1
resources/views/components/verbale/segnaletica/index.blade.php

@@ -17,7 +17,7 @@
     ];
 @endphp
 
-@if ($data['record']->segnaletica != '')
+@if ($data['record']->segnaletica != '' && $data['record']->segnaletica != null)
     <div class="page-break"></div>
 
     <table width="100%" class="table-title">

+ 86 - 65
resources/views/components/verbale/segnaletica/orizzontale.blade.php

@@ -14,85 +14,106 @@
         6 => 'DOPPIA',
         7 => 'TRATTEGGIATA IN CORRISPONDENZA DI'
     ];
-@endphp
 
-<table width="100%" class="table-title">
-    <tr>
-        <td align="center">
-            <h2>SEGNALETICA ORIZZONTALE</h2>
-        </td>
-    </tr>
-</table>
+    $hasData = false;
+    foreach ($orizzontaleAreas as $area) {
+        $viaKey = $area . '_via';
+        $direzioneKey = $area . '_direzione';
+        $lineMargineKey = $area . '_linea_margine';
+        $lineMezzeriaKey = $area . '_linea_mezzeria';
+        $altroKey = $area . '_altro';
+
+        if (isset($data['record']->{$viaKey}) && $data['record']->{$viaKey} != '' ||
+            isset($data['record']->{$direzioneKey}) && $data['record']->{$direzioneKey} != '' ||
+            isset($data['record']->{$lineMargineKey}) && $data['record']->{$lineMargineKey} != '' ||
+            isset($data['record']->{$lineMezzeriaKey}) && $data['record']->{$lineMezzeriaKey} != '' ||
+            isset($data['record']->{$altroKey}) && $data['record']->{$altroKey} != '' ||
+            (isset($data[$area]) && count($data[$area]) > 0)) {
+            $hasData = true;
+            break;
+        }
+    }
+@endphp
 
-<table class="table-content" width="100%">
-    @foreach ($orizzontaleAreas as $area)
-        @php
-            $viaKey = $area . '_via';
-            $direzioneKey = $area . '_direzione';
-            $lineMargineKey = $area . '_linea_margine';
-            $lineMezzeriaKey = $area . '_linea_mezzeria';
-            $altroKey = $area . '_altro';
-        @endphp
+@if ($hasData)
+    <table width="100%" class="table-title">
+        <tr>
+            <td align="center">
+                <h2>SEGNALETICA ORIZZONTALE</h2>
+            </td>
+        </tr>
+    </table>
 
-        @if ($data['record']->{$viaKey} != '')
-            <tr>
-                <td width="100%" align="center">
-                    <b>VIA DI RIFERIMENTO:</b>
-                    {{ optional($data['record']->{$viaKey . '_value'})->TOPONIMO }}
-                    {{ optional($data['record']->{$viaKey . '_value'})->DESCRIZIONE }}
-                </td>
-            </tr>
+    <table class="table-content" width="100%">
+        @foreach ($orizzontaleAreas as $area)
+            @php
+                $viaKey = $area . '_via';
+                $direzioneKey = $area . '_direzione';
+                $lineMargineKey = $area . '_linea_margine';
+                $lineMezzeriaKey = $area . '_linea_mezzeria';
+                $altroKey = $area . '_altro';
+            @endphp
 
-            @if ($data['record']->{$direzioneKey} != '')
+            @if (isset($data['record']->{$viaKey}) && $data['record']->{$viaKey} != '')
                 <tr>
                     <td width="100%" align="center">
-                        DIREZIONE: {{ $data['record']->{$direzioneKey} }}
+                        <b>VIA DI RIFERIMENTO:</b>
+                        {{ optional($data['record']->{$viaKey . '_value'})->TOPONIMO }}
+                        {{ optional($data['record']->{$viaKey . '_value'})->DESCRIZIONE }}
                     </td>
                 </tr>
-            @endif
 
-            @if (count($data[$area]) > 0)
-                <tr class="tr-title">
-                    <td align="center">
-                        <b>DETTAGLIO SEGNALETICA ORIZZONTALE:</b>
-                    </td>
-                </tr>
-                @foreach ($data[$area] as $segnaletica_orizzontale)
+                @if (isset($data['record']->{$direzioneKey}) && $data['record']->{$direzioneKey} != '')
                     <tr>
+                        <td width="100%" align="center">
+                            DIREZIONE: {{ $data['record']->{$direzioneKey} }}
+                        </td>
+                    </tr>
+                @endif
+
+                @if (isset($data[$area]) && count($data[$area]) > 0)
+                    <tr class="tr-title">
                         <td align="center">
-                            {{ optional($segnaletica_orizzontale->segnaletica_orizzontale)->name }}
+                            <b>DETTAGLIO SEGNALETICA ORIZZONTALE:</b>
                         </td>
                     </tr>
-                @endforeach
-            @endif
+                    @foreach ($data[$area] as $segnaletica_orizzontale)
+                        <tr>
+                            <td align="center">
+                                {{ optional($segnaletica_orizzontale->segnaletica_orizzontale)->name }}
+                            </td>
+                        </tr>
+                    @endforeach
+                @endif
 
-            @if ($data['record']->{$lineMargineKey} != '')
-                <tr>
-                    <td width="100%" align="center">
-                        <b>LINEA MARGINE:</b>
-                        {{ $lineaTypes[$data['record']->{$lineMargineKey}] ?? '' }}
-                        {{ $data['record']->{$lineMargineKey . '_specifica'} ?? '' }}
-                    </td>
-                </tr>
-            @endif
+                @if (isset($data['record']->{$lineMargineKey}) && $data['record']->{$lineMargineKey} != '')
+                    <tr>
+                        <td width="100%" align="center">
+                            <b>LINEA MARGINE:</b>
+                            {{ $lineaTypes[$data['record']->{$lineMargineKey}] ?? '' }}
+                            {{ $data['record']->{$lineMargineKey . '_specifica'} ?? '' }}
+                        </td>
+                    </tr>
+                @endif
 
-            @if ($data['record']->{$lineMezzeriaKey} != '')
-            <tr>
-                <td width="100%" align="center">
-                    <b>LINEA DI MEZZERIA</b>
-                    {{ $lineaTypes[$data['record']->{$lineMezzeriaKey}] ?? '' }}
-                    {{ $data['record']->{$lineMezzeriaKey . '_specifica'} ?? '' }}
-                </td>
-            </tr>
-        @endif
+                @if (isset($data['record']->{$lineMezzeriaKey}) && $data['record']->{$lineMezzeriaKey} != '')
+                    <tr>
+                        <td width="100%" align="center">
+                            <b>LINEA DI MEZZERIA</b>
+                            {{ $lineaTypes[$data['record']->{$lineMezzeriaKey}] ?? '' }}
+                            {{ $data['record']->{$lineMezzeriaKey . '_specifica'} ?? '' }}
+                        </td>
+                    </tr>
+                @endif
 
-            @if ($data['record']->{$altroKey} != '')
-                <tr>
-                    <td width="100%" align="center">
-                        {{ $data['record']->{$altroKey} }}
-                    </td>
-                </tr>
+                @if (isset($data['record']->{$altroKey}) && $data['record']->{$altroKey} != '')
+                    <tr>
+                        <td width="100%" align="center">
+                            {{ $data['record']->{$altroKey} }}
+                        </td>
+                    </tr>
+                @endif
             @endif
-        @endif
-    @endforeach
-</table>
+        @endforeach
+    </table>
+@endif

+ 22 - 13
resources/views/components/verbale/segnaletica/verticale.blade.php

@@ -14,9 +14,16 @@
         $limiteVelocitaKey = $area . '_limite_velocita';
         $pannelloIntegrativoKey = $area . '_pannello_integrativo';
         $altroKey = $area . '_altro';
+
+        $hasData = isset($data['record']->{$viaKey}) && $data['record']->{$viaKey} != '' ||
+            isset($data['record']->{$direzioneKey}) && $data['record']->{$direzioneKey} != '' ||
+            isset($data['record']->{$limiteVelocitaKey}) && $data['record']->{$limiteVelocitaKey} != '' ||
+            isset($data['record']->{$pannelloIntegrativoKey}) && $data['record']->{$pannelloIntegrativoKey} != '' ||
+            isset($data['record']->{$altroKey}) && $data['record']->{$altroKey} != '' ||
+            (isset($data[$area]) && count($data[$area]) > 0);
     @endphp
 
-    @if ($data['record']->{$viaKey} != '')
+    @if ($hasData)
         <table width="100%" class="table-title">
             <tr>
                 <td align="center">
@@ -25,15 +32,17 @@
             </tr>
         </table>
         <table class="table-content" width="100%">
-            <tr>
-                <td width="100%" align="center">
-                    <b>VIA DI RIFERIMENTO:</b>
-                    {{ optional($data['record']->{$viaKey . '_value'})->TOPONIMO }}
-                    {{ optional($data['record']->{$viaKey . '_value'})->DESCRIZIONE }}
-                </td>
-            </tr>
+            @if (isset($data['record']->{$viaKey}) && $data['record']->{$viaKey} != '')
+                <tr>
+                    <td width="100%" align="center">
+                        <b>VIA DI RIFERIMENTO:</b>
+                        {{ optional($data['record']->{$viaKey . '_value'})->TOPONIMO }}
+                        {{ optional($data['record']->{$viaKey . '_value'})->DESCRIZIONE }}
+                    </td>
+                </tr>
+            @endif
 
-            @if ($data['record']->{$direzioneKey} != '')
+            @if (isset($data['record']->{$direzioneKey}) && $data['record']->{$direzioneKey} != '')
                 <tr>
                     <td width="100%" align="center">
                         DIREZIONE: {{ $data['record']->{$direzioneKey} }}
@@ -41,7 +50,7 @@
                 </tr>
             @endif
 
-            @if (count($data[$area]) > 0)
+            @if (isset($data[$area]) && count($data[$area]) > 0)
                 <tr class="tr-title">
                     <td align="center">
                         <b>DETTAGLIO SEGNALETICA VERTICALE:</b>
@@ -56,7 +65,7 @@
                 @endforeach
             @endif
 
-            @if ($data['record']->{$limiteVelocitaKey} != '')
+            @if (isset($data['record']->{$limiteVelocitaKey}) && $data['record']->{$limiteVelocitaKey} != '')
                 <tr>
                     <td width="100%" align="center">
                         LIMITE DI VELOCITÀ: {{ $data['record']->{$limiteVelocitaKey} }}
@@ -64,7 +73,7 @@
                 </tr>
             @endif
 
-            @if ($data['record']->{$pannelloIntegrativoKey} != '')
+            @if (isset($data['record']->{$pannelloIntegrativoKey}) && $data['record']->{$pannelloIntegrativoKey} != '')
                 <tr>
                     <td width="100%" align="center">
                         PANNELLO INTEGRATIVO: {{ $data['record']->{$pannelloIntegrativoKey} }}
@@ -72,7 +81,7 @@
                 </tr>
             @endif
 
-            @if ($data['record']->{$altroKey} != '')
+            @if (isset($data['record']->{$altroKey}) && $data['record']->{$altroKey} != '')
                 <tr>
                     <td width="100%" align="center">
                         {{ $data['record']->{$altroKey} }}

+ 3 - 3
resources/views/livewire/report.blade.php

@@ -2274,7 +2274,7 @@
                                 <tr>
                                     <th>Nome</th>
                                     <th>Tipologia</th>
-                                    <th>Visibile</th>
+                                    <th>Visibile in stampa</th>
                                     <th style="width:100px">&nbsp;</th>
                                     <th style="width:100px">&nbsp;</th>
                                 </tr>
@@ -2327,7 +2327,7 @@
                                 <tr>
                                     <th>Nome</th>
                                     <th>Tipologia</th>
-                                    <th>Visibile</th>
+                                    <th>Visibile in stampa</th>
                                     <th style="width:100px">&nbsp;</th>
                                     <th style="width:100px">&nbsp;</th>
                                 </tr>
@@ -4813,7 +4813,7 @@
 
                 <div class="row mt-3">
                     <div class="col-md-4">
-                        <label for="" class="form-label">Visibile</label>
+                        <label for="" class="form-label">Visibile in stampa</label>
                     </div>
                     <div class="col-md-8">
                         <div class="custom-control custom-switch custom-switch-md">