121 lines
5.1 KiB
PHP
121 lines
5.1 KiB
PHP
@php
|
|
$user = \Illuminate\Support\Facades\Auth::user();
|
|
|
|
$urgenti = 0;
|
|
$avvisi = 0;
|
|
|
|
if ($user instanceof \App\Models\User) {
|
|
$stabileId = \App\Support\StabileContext::resolveActiveStabileId($user);
|
|
if ($stabileId) {
|
|
$base = \App\Models\Ticket::query()
|
|
->where('stabile_id', $stabileId)
|
|
->where('stato', 'Aperto');
|
|
|
|
$urgenti = (clone $base)->where('priorita', 'Urgente')->count();
|
|
$avvisi = (clone $base)->where('priorita', '!=', 'Urgente')->count();
|
|
}
|
|
}
|
|
|
|
$totNotifiche = $urgenti + $avvisi;
|
|
@endphp
|
|
|
|
<div class="flex items-center gap-2">
|
|
<div class="hidden items-center gap-1 md:flex">
|
|
@if(\App\Filament\Pages\Supporto\TicketMobile::canAccess())
|
|
<a href="{{ \App\Filament\Pages\Supporto\TicketMobile::getUrl(panel: 'admin-filament') }}" class="rounded-md border border-gray-200 px-2 py-1 text-xs font-medium text-gray-700 hover:bg-gray-50" title="Inserimento Ticket">Ticket +</a>
|
|
@endif
|
|
|
|
@if(\App\Filament\Pages\Supporto\TicketGestione::canAccess())
|
|
<a href="{{ \App\Filament\Pages\Supporto\TicketGestione::getUrl(panel: 'admin-filament') }}" class="rounded-md border border-gray-200 px-2 py-1 text-xs font-medium text-gray-700 hover:bg-gray-50" title="Gestione Ticket">Ticket Gestione</a>
|
|
@endif
|
|
|
|
@if(\App\Filament\Pages\Strumenti\PostIt::canAccess())
|
|
<a href="{{ \App\Filament\Pages\Strumenti\PostIt::getUrl(panel: 'admin-filament') }}" class="rounded-md border border-gray-200 px-2 py-1 text-xs font-medium text-gray-700 hover:bg-gray-50" title="Inserimento Post-it">Post-it +</a>
|
|
@endif
|
|
|
|
@if(\App\Filament\Pages\Strumenti\PostItGestione::canAccess())
|
|
<a href="{{ \App\Filament\Pages\Strumenti\PostItGestione::getUrl(panel: 'admin-filament') }}" class="rounded-md border border-gray-200 px-2 py-1 text-xs font-medium text-gray-700 hover:bg-gray-50" title="Gestione Post-it">Post-it Gestione</a>
|
|
@endif
|
|
</div>
|
|
|
|
@if(\App\Filament\Pages\Strumenti\Calendario::canAccess())
|
|
<a
|
|
href="{{ \App\Filament\Pages\Strumenti\Calendario::getUrl(panel: 'admin-filament') }}"
|
|
class="fi-icon-btn fi-color-gray"
|
|
title="Calendario"
|
|
>
|
|
<x-filament::icon icon="heroicon-o-calendar-days" class="h-5 w-5" />
|
|
</a>
|
|
@endif
|
|
|
|
@if(\App\Filament\Pages\Strumenti\Comunicazioni::canAccess())
|
|
<a
|
|
href="{{ \App\Filament\Pages\Strumenti\Comunicazioni::getUrl(panel: 'admin-filament') }}"
|
|
class="fi-icon-btn fi-color-gray"
|
|
title="Comunicazioni"
|
|
>
|
|
<x-filament::icon icon="heroicon-o-chat-bubble-left-right" class="h-5 w-5" />
|
|
</a>
|
|
@endif
|
|
|
|
@if(\App\Filament\Pages\Strumenti\PostIt::canAccess())
|
|
<a
|
|
href="{{ \App\Filament\Pages\Strumenti\PostIt::getUrl(panel: 'admin-filament') }}"
|
|
class="fi-icon-btn fi-color-gray"
|
|
title="Post-it"
|
|
>
|
|
<x-filament::icon icon="heroicon-o-document-text" class="h-5 w-5" />
|
|
</a>
|
|
@endif
|
|
|
|
<x-filament::dropdown placement="bottom-end">
|
|
<x-slot name="trigger">
|
|
<button type="button" class="relative fi-icon-btn fi-color-gray" title="Avvisi">
|
|
<x-filament::icon icon="heroicon-o-bell" class="h-5 w-5" />
|
|
|
|
@if($totNotifiche > 0)
|
|
<span class="absolute -top-1 -right-1 inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-danger-600 px-1 text-[11px] font-semibold text-white">
|
|
{{ $totNotifiche }}
|
|
</span>
|
|
@endif
|
|
</button>
|
|
</x-slot>
|
|
|
|
<div class="w-72 p-2">
|
|
<a
|
|
href="{{ \App\Filament\Pages\Supporto\Urgenze::getUrl(panel: 'admin-filament') }}"
|
|
class="flex items-center justify-between rounded-md px-3 py-2 hover:bg-gray-50"
|
|
>
|
|
<span class="text-sm">Urgenze</span>
|
|
@if($urgenti > 0)
|
|
<span class="text-xs font-semibold text-danger-700">{{ $urgenti }}</span>
|
|
@endif
|
|
</a>
|
|
|
|
<a
|
|
href="{{ \App\Filament\Pages\Supporto\Avvisi::getUrl(panel: 'admin-filament') }}"
|
|
class="flex items-center justify-between rounded-md px-3 py-2 hover:bg-gray-50"
|
|
>
|
|
<span class="text-sm">Avvisi</span>
|
|
@if($avvisi > 0)
|
|
<span class="text-xs font-semibold text-gray-700">{{ $avvisi }}</span>
|
|
@endif
|
|
</a>
|
|
|
|
<div class="my-2 h-px bg-gray-100"></div>
|
|
|
|
<a
|
|
href="{{ \App\Filament\Pages\Supporto\RichiestaHelp::getUrl(panel: 'admin-filament') }}"
|
|
class="flex items-center justify-between rounded-md px-3 py-2 hover:bg-gray-50"
|
|
>
|
|
<span class="text-sm">Richiedi help</span>
|
|
<x-filament::icon icon="heroicon-o-lifebuoy" class="h-4 w-4 text-gray-500" />
|
|
</a>
|
|
</div>
|
|
</x-filament::dropdown>
|
|
|
|
<div class="px-1">
|
|
<x-filament-panels::theme-switcher />
|
|
</div>
|
|
</div>
|