315 lines
14 KiB
PHP
315 lines
14 KiB
PHP
<x-filament-panels::page>
|
|
<div class="flex flex-col gap-2">
|
|
<div class="flex items-center justify-between gap-3">
|
|
@php
|
|
$prevUrl = $this->getPrevUrl();
|
|
$nextUrl = $this->getNextUrl();
|
|
@endphp
|
|
|
|
@if($prevUrl)
|
|
<x-filament::button tag="a" href="{{ $prevUrl }}" color="gray">
|
|
←
|
|
</x-filament::button>
|
|
@else
|
|
<x-filament::button color="gray" disabled>
|
|
←
|
|
</x-filament::button>
|
|
@endif
|
|
|
|
<div class="flex items-center gap-3 text-sm text-gray-600">
|
|
<div>
|
|
Pagina {{ $this->navPage }} / {{ $this->navPages }}
|
|
</div>
|
|
|
|
<label class="flex items-center gap-2">
|
|
<span>Visualizzati</span>
|
|
<select class="rounded-md border-gray-300 text-sm" onchange="window.location.href=this.value">
|
|
@foreach([10,25,50,100] as $pp)
|
|
<option value="{{ $this->getPerPageUrl($pp) }}" @selected($this->navPerPage === $pp)>{{ $pp }}</option>
|
|
@endforeach
|
|
</select>
|
|
</label>
|
|
</div>
|
|
|
|
@if($nextUrl)
|
|
<x-filament::button tag="a" href="{{ $nextUrl }}" color="gray">
|
|
→
|
|
</x-filament::button>
|
|
@else
|
|
<x-filament::button color="gray" disabled>
|
|
→
|
|
</x-filament::button>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="flex items-center justify-center gap-2">
|
|
@php
|
|
$prevPageUrl = $this->getPrevPageUrl();
|
|
$nextPageUrl = $this->getNextPageUrl();
|
|
@endphp
|
|
|
|
@if($prevPageUrl)
|
|
<x-filament::button tag="a" href="{{ $prevPageUrl }}" color="gray" size="sm">
|
|
Pagina precedente
|
|
</x-filament::button>
|
|
@else
|
|
<x-filament::button color="gray" size="sm" disabled>
|
|
Pagina precedente
|
|
</x-filament::button>
|
|
@endif
|
|
|
|
@if($nextPageUrl)
|
|
<x-filament::button tag="a" href="{{ $nextPageUrl }}" color="gray" size="sm">
|
|
Pagina successiva
|
|
</x-filament::button>
|
|
@else
|
|
<x-filament::button color="gray" size="sm" disabled>
|
|
Pagina successiva
|
|
</x-filament::button>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 lg:grid-cols-3">
|
|
<x-filament::section class="lg:col-span-2">
|
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
|
|
<div>
|
|
<div class="text-sm text-gray-500">Nominativo</div>
|
|
<div class="text-lg font-semibold">{{ $rubrica->nome_completo ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Titolo</div>
|
|
<div class="text-lg font-semibold">
|
|
{{ $rubrica->titolo?->sigla ?? $rubrica->titolo?->nome ?? '—' }}
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Codice univoco</div>
|
|
<div class="font-mono">{{ $rubrica->codice_univoco ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Tipologia</div>
|
|
<div class="text-lg font-semibold">{{ $rubrica->tipo_contatto ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Categoria</div>
|
|
<div class="text-lg font-semibold">{{ $rubrica->categoria ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Codice fiscale</div>
|
|
<div class="font-mono">{{ $rubrica->codice_fiscale ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Partita IVA</div>
|
|
<div class="font-mono">{{ $rubrica->partita_iva ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Email</div>
|
|
<div>{{ $rubrica->email ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">PEC</div>
|
|
<div>{{ $rubrica->pec ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Telefono</div>
|
|
<div>{{ $rubrica->telefono_ufficio ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Cellulare</div>
|
|
<div>{{ $rubrica->telefono_cellulare ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Profilo chiamante</div>
|
|
<div>{{ $rubrica->tipo_utenza_call ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Riferimento stabile</div>
|
|
<div>{{ $rubrica->riferimento_stabile ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Riferimento unità</div>
|
|
<div>{{ $rubrica->riferimento_unita ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Telefono casa</div>
|
|
<div>{{ $rubrica->telefono_casa ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<div class="text-sm text-gray-500">Indirizzo</div>
|
|
<div>{{ $rubrica->indirizzo_completo ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<div class="text-sm text-gray-500">Note</div>
|
|
<div class="whitespace-pre-wrap">{{ $rubrica->note ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<div class="text-sm text-gray-500">Note segreteria</div>
|
|
<div class="whitespace-pre-wrap">{{ $rubrica->note_segreteria ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<div class="text-sm text-gray-500">Ruoli (attivi)</div>
|
|
@if(empty($ruoliAttivi))
|
|
<div class="text-sm text-gray-700">—</div>
|
|
@else
|
|
<div class="flex flex-wrap gap-2">
|
|
@foreach($ruoliAttivi as $r)
|
|
<span class="inline-flex items-center rounded-full border border-gray-200 bg-gray-50 px-2.5 py-1 text-xs font-semibold text-gray-800">
|
|
{{ $r['ruolo'] ?? '—' }}
|
|
@if(!empty($r['stabile_codice']))
|
|
<span class="ml-1 text-gray-500">· {{ $r['stabile_codice'] }}</span>
|
|
@endif
|
|
@if(!empty($r['unita_codice']))
|
|
<span class="ml-1 text-gray-500">· {{ $r['unita_codice'] }}</span>
|
|
@endif
|
|
@if(!empty($r['preferito']))
|
|
<span class="ml-1 text-gray-500">· preferito</span>
|
|
@endif
|
|
</span>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<div class="space-y-4">
|
|
<x-filament::section>
|
|
<x-slot name="heading">Collegamenti</x-slot>
|
|
|
|
<div class="space-y-4">
|
|
<div>
|
|
<div class="text-sm text-gray-500">Fornitori (ambiente attivo)</div>
|
|
@if(count($fornitori) > 0)
|
|
<ul class="mt-2 list-disc pl-5 text-sm">
|
|
@foreach($fornitori as $f)
|
|
<li>
|
|
<a class="text-primary-600 hover:underline" href="{{ \App\Filament\Pages\Gescon\FornitoreScheda::getUrl(['record' => $f['id']], panel: 'admin-filament') }}">
|
|
{{ $f['nome'] }}
|
|
</a>
|
|
<span class="text-xs text-gray-500">({{ $f['codice'] ?: '—' }})</span>
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
@else
|
|
<div class="mt-1 text-sm text-gray-500">—</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Stabili (ambiente attivo)</div>
|
|
@if(count($stabili) > 0)
|
|
<ul class="mt-2 list-disc pl-5 text-sm">
|
|
@foreach($stabili as $s)
|
|
<li>
|
|
<a class="text-primary-600 hover:underline" href="{{ \App\Filament\Pages\Gescon\StabileScheda::getUrl(['record' => $s['id']], panel: 'admin-filament') }}">
|
|
{{ $s['codice'] }} - {{ $s['nome'] }}
|
|
</a>
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
@else
|
|
<div class="mt-1 text-sm text-gray-500">—</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Azioni</x-slot>
|
|
|
|
<div class="flex flex-col gap-2">
|
|
<x-filament::button type="button" color="gray" wire:click="mountAction('contatti')">
|
|
Contatti aggiuntivi
|
|
</x-filament::button>
|
|
|
|
<x-filament::button type="button" color="gray" wire:click="mountAction('ruoli_legami')">
|
|
Ruoli / legami
|
|
</x-filament::button>
|
|
</div>
|
|
</x-filament::section>
|
|
</div>
|
|
</div>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Cronistoria ruoli / legami</x-slot>
|
|
<x-slot name="description">Storico collegamenti rubrica ↔ stabile/unità (con periodi).</x-slot>
|
|
|
|
@if(empty($cronistoriaRuoli))
|
|
<div class="text-sm text-gray-500">Nessun ruolo/legame registrato.</div>
|
|
@else
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b text-left text-gray-500">
|
|
<th class="py-2">Stabile</th>
|
|
<th class="py-2">Unità</th>
|
|
<th class="py-2">Ruolo</th>
|
|
<th class="py-2">Periodo</th>
|
|
<th class="py-2">Stato</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y">
|
|
@foreach($cronistoriaRuoli as $r)
|
|
@php
|
|
$unitaUrl = $this->getUrlUnita(($r['unita_id'] ?? 0) ?: null);
|
|
$periodo = trim(($r['data_inizio'] ?? '—') . ' → ' . (($r['data_fine'] ?? null) ?: 'in corso'));
|
|
@endphp
|
|
<tr>
|
|
<td class="py-2 text-gray-900">
|
|
{{ !empty($r['stabile_codice']) ? $r['stabile_codice'] : '—' }}
|
|
@if(!empty($r['stabile_nome']))
|
|
<div class="text-xs text-gray-500">{{ $r['stabile_nome'] }}</div>
|
|
@endif
|
|
</td>
|
|
<td class="py-2">
|
|
@if($unitaUrl)
|
|
<a href="{{ $unitaUrl }}" class="inline-flex items-center rounded-full border border-primary-200 bg-primary-50 px-2 py-0.5 text-xs font-semibold text-primary-700 hover:bg-primary-100">
|
|
{{ $r['unita_codice'] ?? 'Unità' }}
|
|
</a>
|
|
@else
|
|
<span class="text-gray-900">{{ $r['unita_codice'] ?? '—' }}</span>
|
|
@endif
|
|
@if(!empty($r['unita_nome']))
|
|
<div class="text-xs text-gray-500">{{ $r['unita_nome'] }}</div>
|
|
@endif
|
|
</td>
|
|
<td class="py-2 text-gray-900">{{ $r['ruolo'] ?? '—' }}</td>
|
|
<td class="py-2 text-gray-900">{{ $periodo }}</td>
|
|
<td class="py-2 text-gray-900">
|
|
@if(!empty($r['attivo']))
|
|
<span class="text-xs text-gray-500">attivo</span>
|
|
@else
|
|
<span class="text-xs text-gray-500">chiuso</span>
|
|
@endif
|
|
@if(!empty($r['preferito']))
|
|
<span class="text-xs text-gray-500">· preferito</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@endif
|
|
</x-filament::section>
|
|
</x-filament-panels::page>
|