370 lines
24 KiB
PHP
370 lines
24 KiB
PHP
<x-filament-panels::page>
|
|
<div class="space-y-4" wire:key="amministratori-superadmin-5tabs-shell">
|
|
|
|
{{-- STICKY HEADER BANNER - IMPERSONIFICAZIONE CONTESTUALE ATTIVA --}}
|
|
@if(session('impersonator_id'))
|
|
<div class="sticky top-0 z-50 rounded-xl border border-amber-400 bg-amber-500 p-3 text-white shadow-lg flex flex-wrap items-center justify-between gap-3">
|
|
<div class="flex items-center gap-2 text-xs font-bold">
|
|
<span class="text-base">⚠️</span>
|
|
<span>MODALITÀ IMPERSONIFICAZIONE ATTIVA: Stai operando nel contesto dello studio amministrato.</span>
|
|
</div>
|
|
<a
|
|
href="{{ route('impersonate.leave') }}"
|
|
class="inline-flex items-center gap-1.5 rounded-lg bg-slate-900 px-3 py-1.5 text-xs font-bold text-white shadow hover:bg-slate-800 transition"
|
|
>
|
|
↩️ TORNA A SUPER ADMIN
|
|
</a>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- BARRA PULSANTINI ICONICI COMPATTI (SENZA SCROLL ORIZZONTALE) --}}
|
|
<div class="rounded-xl border bg-white p-2.5 shadow-sm">
|
|
<div class="flex flex-wrap items-center gap-1.5">
|
|
<button
|
|
type="button"
|
|
wire:click="apriTab('elenco')"
|
|
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-bold transition {{ $activeTab === 'elenco' ? 'bg-slate-900 text-white shadow' : 'bg-slate-100 text-slate-700 hover:bg-slate-200' }}"
|
|
>
|
|
🏢 Elenco
|
|
</button>
|
|
<button
|
|
type="button"
|
|
wire:click="apriTab('scheda')"
|
|
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-bold transition {{ $activeTab === 'scheda' ? 'bg-slate-900 text-white shadow' : 'bg-slate-100 text-slate-700 hover:bg-slate-200' }}"
|
|
>
|
|
✏️ Modifica {{ $selectedAmministratoreId ? "(#{$selectedAmministratoreId})" : '' }}
|
|
</button>
|
|
<button
|
|
type="button"
|
|
wire:click="apriTab('stabili')"
|
|
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-bold transition {{ $activeTab === 'stabili' ? 'bg-slate-900 text-white shadow' : 'bg-slate-100 text-slate-700 hover:bg-slate-200' }}"
|
|
>
|
|
📊 Stabili & Fornitori
|
|
</button>
|
|
<button
|
|
type="button"
|
|
wire:click="apriTab('moduli')"
|
|
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-bold transition {{ $activeTab === 'moduli' ? 'bg-emerald-700 text-white shadow' : 'bg-emerald-50 text-emerald-800 hover:bg-emerald-100' }}"
|
|
>
|
|
🛡️ Moduli & Scadenze
|
|
</button>
|
|
<button
|
|
type="button"
|
|
wire:click="apriTab('acl')"
|
|
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-bold transition {{ $activeTab === 'acl' ? 'bg-sky-700 text-white shadow' : 'bg-sky-50 text-sky-800 hover:bg-sky-100' }}"
|
|
>
|
|
🔑 Matrice ACL
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- TAB 1: 🏢 ELENCO AMMINISTRATORI --}}
|
|
@if($activeTab === 'elenco')
|
|
<div class="rounded-xl border bg-white p-4 shadow-sm">
|
|
<div class="mb-3 flex items-center justify-between">
|
|
<div>
|
|
<h2 class="text-base font-bold text-slate-900">Amministratori Stabili Censiti</h2>
|
|
<p class="text-xs text-slate-500">Cliccando su ✏️ Modifica su qualunque riga, il sistema seleziona l'amministratore e passa automagicamente al TAB 2.</p>
|
|
</div>
|
|
</div>
|
|
{{ $this->table }}
|
|
</div>
|
|
@endif
|
|
|
|
{{-- TAB 2: ✏️ SCHEDA DETTAGLIO & EDITING INLINE --}}
|
|
@if($activeTab === 'scheda')
|
|
@if($selectedAmministratoreId && !empty($editForm))
|
|
<div class="rounded-xl border border-slate-300 bg-white p-5 shadow-md">
|
|
<div class="mb-4 flex flex-wrap items-center justify-between gap-3 border-b pb-3">
|
|
<div class="flex items-center gap-3">
|
|
<div class="flex h-10 w-10 items-center justify-center rounded-lg bg-slate-900 text-white font-bold text-lg">
|
|
#{{ $editForm['id'] ?? '' }}
|
|
</div>
|
|
<div>
|
|
<h3 class="text-lg font-bold text-slate-900">
|
|
SCHEDA DETTAGLIO: {{ strtoupper($editForm['cognome'] ?? '') }} {{ strtoupper($editForm['nome'] ?? '') }}
|
|
</h3>
|
|
<div class="flex items-center gap-2 text-xs text-slate-600">
|
|
<span>Codice Univoco: <strong class="font-mono text-slate-900">{{ $editForm['codice_univoco'] ?? '-' }}</strong></span>
|
|
<span>•</span>
|
|
<span>Studio: <strong>{{ $editForm['denominazione_studio'] ?? '-' }}</strong></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex flex-wrap gap-2">
|
|
<button
|
|
type="button"
|
|
wire:click="impersonaSelected"
|
|
class="inline-flex items-center gap-1.5 rounded-lg bg-amber-500 px-3 py-1.5 text-xs font-bold text-white hover:bg-amber-600 shadow"
|
|
>
|
|
⚡ IMPERSONA SENZA PASSWORD
|
|
</button>
|
|
<button
|
|
type="button"
|
|
wire:click="inviaCredenzialiSelected"
|
|
class="inline-flex items-center gap-1.5 rounded-lg bg-sky-600 px-3 py-1.5 text-xs font-bold text-white hover:bg-sky-500 shadow"
|
|
>
|
|
📧 INVIA CREDIENZIALI
|
|
</button>
|
|
<button
|
|
type="button"
|
|
wire:click="resetPasswordSelected"
|
|
class="inline-flex items-center gap-1.5 rounded-lg bg-slate-700 px-3 py-1.5 text-xs font-bold text-white hover:bg-slate-600 shadow"
|
|
>
|
|
🔑 RESET PASSWORD
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- FORM INPUTS IN-PLACE --}}
|
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-3 text-xs">
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Nome</label>
|
|
<input type="text" wire:model="editForm.nome" class="mt-1 w-full rounded-md border-slate-300 text-sm focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Cognome</label>
|
|
<input type="text" wire:model="editForm.cognome" class="mt-1 w-full rounded-md border-slate-300 text-sm focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Denominazione Studio</label>
|
|
<input type="text" wire:model="editForm.denominazione_studio" class="mt-1 w-full rounded-md border-slate-300 text-sm focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Codice Fiscale Studio</label>
|
|
<input type="text" wire:model="editForm.codice_fiscale_studio" class="mt-1 w-full rounded-md border-slate-300 text-sm font-mono focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Partita IVA Studio</label>
|
|
<input type="text" wire:model="editForm.partita_iva" class="mt-1 w-full rounded-md border-slate-300 text-sm font-mono focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Email Login Studio</label>
|
|
<input type="email" wire:model="editForm.user_email" class="mt-1 w-full rounded-md border-slate-300 text-sm focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<label class="block font-semibold text-slate-700">Indirizzo Studio</label>
|
|
<input type="text" wire:model="editForm.indirizzo_studio" class="mt-1 w-full rounded-md border-slate-300 text-sm focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Città / CAP / PR</label>
|
|
<div class="mt-1 flex gap-2">
|
|
<input type="text" wire:model="editForm.citta_studio" placeholder="Città" class="w-1/2 rounded-md border-slate-300 text-sm">
|
|
<input type="text" wire:model="editForm.cap_studio" placeholder="CAP" class="w-1/4 rounded-md border-slate-300 text-sm">
|
|
<input type="text" wire:model="editForm.provincia_studio" placeholder="PR" class="w-1/4 rounded-md border-slate-300 text-sm">
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Telefono Studio</label>
|
|
<input type="text" wire:model="editForm.telefono_studio" class="mt-1 w-full rounded-md border-slate-300 text-sm focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">PEC Studio</label>
|
|
<input type="email" wire:model="editForm.pec_studio" class="mt-1 w-full rounded-md border-slate-300 text-sm focus:border-slate-800 focus:ring-slate-800">
|
|
</div>
|
|
<div>
|
|
<label class="block font-semibold text-slate-700">Stato Studio</label>
|
|
<div class="mt-2 flex items-center gap-2">
|
|
<input type="checkbox" wire:model="editForm.attivo" id="chk-attivo" class="rounded border-slate-300 text-slate-800 focus:ring-slate-800">
|
|
<label for="chk-attivo" class="text-xs text-slate-700">Studio Attivo & Abilitato ad Import Stabili</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- PERCORSI ARCHIVIO TENANT CANONICI --}}
|
|
<div class="mt-5 rounded-lg border border-slate-200 bg-slate-900 p-3 text-xs text-slate-200">
|
|
<div class="font-bold text-amber-400 mb-1">PERCORSI ARCHIVIO TENANT & BACKUP DEDICATO:</div>
|
|
<div class="font-mono space-y-1">
|
|
<div>• Cartella Stabile: <span class="text-emerald-400">storage/app/private/amministratori/{{ $editForm['codice_univoco'] ?? '00000001' }}/</span></div>
|
|
<div>• Documenti: <span class="text-emerald-400">storage/app/private/amministratori/{{ $editForm['codice_univoco'] ?? '00000001' }}/documenti/</span></div>
|
|
<div>• Backups SQLite: <span class="text-emerald-400">storage/app/private/amministratori/{{ $editForm['codice_univoco'] ?? '00000001' }}/database/backups/</span></div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- PULSANTI DI AZIONE --}}
|
|
<div class="mt-5 flex flex-wrap items-center justify-between gap-3 border-t pt-4">
|
|
<button
|
|
type="button"
|
|
wire:click="salvaSchedaInPlace"
|
|
class="inline-flex items-center rounded-lg bg-emerald-700 px-4 py-2 text-xs font-bold text-white hover:bg-emerald-600 shadow"
|
|
>
|
|
✓ SALVA SCHEDA AMMINISTRATORE
|
|
</button>
|
|
<button
|
|
type="button"
|
|
wire:click="impersonaSelected"
|
|
class="inline-flex items-center gap-1 rounded-lg bg-amber-500 px-4 py-2 text-xs font-bold text-white hover:bg-amber-600 shadow"
|
|
>
|
|
⚡ IMPERSONA STUDIO {{ strtoupper($editForm['cognome'] ?? '') }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
@else
|
|
<div class="rounded-xl border bg-white p-8 text-center text-slate-500 text-sm">
|
|
Nessun amministratore selezionato. Seleziona una riga nel TAB 1 per aprire la scheda qui.
|
|
</div>
|
|
@endif
|
|
@endif
|
|
|
|
{{-- TAB 3: 📊 STABILI & FORNITORI ASSEGNATI --}}
|
|
@if($activeTab === 'stabili')
|
|
<div class="rounded-xl border bg-white p-5 shadow-sm space-y-4">
|
|
<h3 class="text-base font-bold text-slate-900">Stabili & Fornitori dello Studio (#{{ $selectedAmministratoreId }})</h3>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs">
|
|
<div class="rounded-lg border bg-slate-50 p-4">
|
|
<h4 class="font-bold text-slate-800 mb-2">🏢 Stabili Condominiali Gestiti:</h4>
|
|
<ul class="space-y-1 font-mono text-slate-700">
|
|
<li>• Stabile 0010 - CATONE 34 / GERMANICO 85</li>
|
|
<li>• Stabile 0013 - OTTAVIANO 105 / GIULIO CESARE</li>
|
|
<li>• Stabile 0016 - GERMANICO 96</li>
|
|
<li>• Stabile 0018 - GRACCHI 6</li>
|
|
</ul>
|
|
</div>
|
|
<div class="rounded-lg border bg-slate-50 p-4">
|
|
<h4 class="font-bold text-slate-800 mb-2">🛠️ Fornitori Accreditati per lo Studio:</h4>
|
|
<div class="text-slate-700">
|
|
Totale <strong>370 fornitori</strong> censiti ed isolati in via esclusiva per lo studio di Cecilia Tordini (#13).
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- TAB 4: 🛡️ MODULI AVANZATI, LICENZE & DATE SCADENZA STUDIO --}}
|
|
@if($activeTab === 'moduli')
|
|
<div class="rounded-xl border border-emerald-300 bg-white p-5 shadow-sm space-y-4">
|
|
<div class="flex items-center justify-between border-b pb-3">
|
|
<div>
|
|
<h3 class="text-base font-bold text-emerald-900">Moduli Applicativi, Licenze & Date Scadenza Studio (#{{ $selectedAmministratoreId }})</h3>
|
|
<p class="text-xs text-slate-500">Attiva o disabilita le funzionalità avanzate per lo studio e configura la data di scadenza della licenza.</p>
|
|
</div>
|
|
<span class="rounded-full bg-emerald-100 px-3 py-1 text-xs font-bold text-emerald-800">
|
|
SuperAdmin Control Center
|
|
</span>
|
|
</div>
|
|
|
|
<div class="space-y-3 text-xs">
|
|
<div class="rounded-lg border p-3 flex flex-wrap items-center justify-between gap-2 bg-slate-50">
|
|
<div>
|
|
<span class="font-bold text-slate-800">📩 Scarico FE Cassetto Fiscale & XML SDI</span>
|
|
<div class="text-slate-500">Abilita lo scarico diretto delle fatture elettroniche dal cassetto fiscale dello stabile.</div>
|
|
</div>
|
|
<div class="flex items-center gap-3">
|
|
<span class="font-mono font-bold text-slate-700">Scadenza: 31/12/2027</span>
|
|
<button type="button" class="rounded-md bg-emerald-700 px-2.5 py-1 text-white font-bold">Attivo</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="rounded-lg border p-3 flex flex-wrap items-center justify-between gap-2 bg-slate-50">
|
|
<div>
|
|
<span class="font-bold text-slate-800">🏦 Integrazione Multi-Banca & Import CBI</span>
|
|
<div class="text-slate-500">Importazione ed abbinamento automatico flussi bancari CBI ed estratti conto.</div>
|
|
</div>
|
|
<div class="flex items-center gap-3">
|
|
<span class="font-mono font-bold text-slate-700">Scadenza: 31/12/2027</span>
|
|
<button type="button" class="rounded-md bg-emerald-700 px-2.5 py-1 text-white font-bold">Attivo</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="rounded-lg border p-3 flex flex-wrap items-center justify-between gap-2 bg-slate-50">
|
|
<div>
|
|
<span class="font-bold text-slate-800">Visure Catastali Sister & Planimetrie</span>
|
|
<div class="text-slate-500">Consultazione ed allineamento automatico dei dati catastali consolidati.</div>
|
|
</div>
|
|
<div class="flex items-center gap-3">
|
|
<span class="font-mono font-bold text-slate-700">Scadenza: 30/06/2027</span>
|
|
<button type="button" class="rounded-md bg-emerald-700 px-2.5 py-1 text-white font-bold">Attivo</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="rounded-lg border p-3 flex flex-wrap items-center justify-between gap-2 bg-slate-50">
|
|
<div>
|
|
<span class="font-bold text-slate-800">🔄 Modulo Importazione Legacy MDB Gescon (import-gescon)</span>
|
|
<div class="text-slate-500">Pipeline di importazione Stabili.mdb e Fornitori.mdb per la migrazione.</div>
|
|
</div>
|
|
<div class="flex items-center gap-3">
|
|
<span class="font-mono font-bold text-slate-700">Scadenza: 31/12/2026</span>
|
|
<button type="button" class="rounded-md bg-emerald-700 px-2.5 py-1 text-white font-bold">Attivo</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pt-3 border-t">
|
|
<button type="button" class="rounded-lg bg-emerald-800 px-4 py-2 text-white text-xs font-bold shadow">
|
|
✓ SALVA CONFIGURAZIONE LICENZE & SCADENZE
|
|
</button>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- TAB 5: 🔑 MATRICE PERMESSI ACL & VISIBILITÀ MENÙ --}}
|
|
@if($activeTab === 'acl')
|
|
<div class="rounded-xl border border-sky-300 bg-white p-5 shadow-sm space-y-4">
|
|
<div class="flex items-center justify-between border-b pb-3">
|
|
<div>
|
|
<h3 class="text-base font-bold text-sky-900">Matrice Permessi ACL & Visibilità Menù (PostgreSQL / Laravel Spatie)</h3>
|
|
<p class="text-xs text-slate-500">Gestisci i permessi granulari ed i ruoli assegnati all'utente ed ai collaboratori dello studio.</p>
|
|
</div>
|
|
<span class="rounded-full bg-sky-100 px-3 py-1 text-xs font-bold text-sky-800">
|
|
ACL PostgreSQL Powered
|
|
</span>
|
|
</div>
|
|
|
|
<div class="rounded-lg border overflow-hidden">
|
|
<table class="w-full text-left text-xs">
|
|
<thead class="bg-slate-100 font-bold text-slate-800 border-b">
|
|
<tr>
|
|
<th class="p-3">MENÙ / SEZIONE DI SISTEMA</th>
|
|
<th class="p-3">LETTURA</th>
|
|
<th class="p-3">MODIFICA</th>
|
|
<th class="p-3">CANCELLAZIONE</th>
|
|
<th class="p-3">PERMESSO SPATIE</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y font-mono">
|
|
<tr class="hover:bg-slate-50">
|
|
<td class="p-3 font-sans font-bold text-slate-900">🏢 Anagrafica Stabili & Unità Immobiliare</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 text-slate-400">[ ] Disabilitato</td>
|
|
<td class="p-3 font-mono text-slate-600">manage-stabili</td>
|
|
</tr>
|
|
<tr class="hover:bg-slate-50">
|
|
<td class="p-3 font-sans font-bold text-slate-900">👥 Condomini, Inquilini & Comproprietà</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 text-slate-400">[ ] Disabilitato</td>
|
|
<td class="p-3 font-mono text-slate-600">manage-condomini</td>
|
|
</tr>
|
|
<tr class="hover:bg-slate-50">
|
|
<td class="p-3 font-sans font-bold text-slate-900">🛠️ Anagrafica Fornitori Accreditati</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 font-mono text-slate-600">manage-fornitori</td>
|
|
</tr>
|
|
<tr class="hover:bg-slate-50">
|
|
<td class="p-3 font-sans font-bold text-slate-900">🔄 Modulo Importazione Legacy MDB Gescon</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 text-emerald-600 font-bold">[X] Abilitato</td>
|
|
<td class="p-3 text-slate-400">[ ] Disabilitato</td>
|
|
<td class="p-3 font-mono text-slate-600">import-gescon</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="pt-3 border-t">
|
|
<button type="button" class="rounded-lg bg-sky-800 px-4 py-2 text-white text-xs font-bold shadow">
|
|
✓ SALVA MATRICE PERMESSI ACL
|
|
</button>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
</div>
|
|
</x-filament-panels::page>
|