A free open source IT asset/license management system
Users Detail: Added maintenances tab
snipeee5c8d993012
diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.phpindex 91d365cd6a..4660889002 100755--- a/resources/views/users/view.blade.php+++ b/resources/views/users/view.blade.php@@ -33,6 +33,7 @@<x-tabs.license-tab count="{{ $user->licenses()->count() }}"/><x-tabs.accessory-tab count="{{ $user->accessories()->count() }}"/><x-tabs.consumable-tab count="{{ $user->consumables()->count() }}"/>+ <x-tabs.maintenance-tab count="{{ $user->assignedMaintenances()->count() }}"/><x-tabs.files-tab :item="$user" count="{{ $user->uploads()->count() }}"/><x-tabs.eula-tab count="{{ $user->eulas()->count() }}"/><x-tabs.location-tab count="{{ $user->managedLocations()->count() }}"/>@@ -182,7 +183,6 @@</x-data-row>@endif-</x-page-data><!-- ./ definition list column -->@@ -194,7 +194,7 @@<x-page-column class="col-md-4 col-sm-12">- @if($user->getUserTotalCost()->total_user_cost > 0)+ @if ($user->getUserTotalCost()->total_user_cost > 0)<x-well class="well-sm"><div class="well-display">@@ -211,6 +211,15 @@{{ Helper::formatCurrencyOutput($user->getUserTotalCost()->accessory_cost)}}</x-data-row>+ {{-- Sum across complete + active maintenances tied+ to this user — used to surface "which users+ cost the most maintenance over time" as a glance.+ The current-active count lives on the tab badge+ above so we don't duplicate it here. --}}+ <x-data-row icon_type="maintenances" :label="trans('general.maintenance_cost')" align="right">+ {{ Helper::formatCurrencyOutput($user->getUserTotalCost()->maintenance_cost) }}+ </x-data-row>+<x-data-row icon_type="cost" label=" {{ trans('admin/users/table.total_assets_cost') }}" align="right">{{ Helper::formatCurrencyOutput($user->getUserTotalCost()->total_user_cost) }}</x-data-row>@@ -496,6 +505,17 @@</x-tabs.pane>+ {{-- Maintenances tab: every maintenance whose underlying+ asset was checked out to this user. Shows open and+ closed; the tab badge only counts the open ones+ (see assignedMaintenances()->active() above). --}}+ <x-tabs.pane name="maintenances" :count="$user->assignedMaintenances()->count()">+ <x-table.maintenances+ :route="route('api.maintenances.index', ['checked_out_to_id' => $user->id, 'checked_out_to_type' => \App\Models\User::class])"+ export_filename="export-maintenances-{{ str_slug($user->username) }}-{{ date('Y-m-d') }}"+ />+ </x-tabs.pane>+<x-tabs.pane name="managed-users" :count="$user->managesUsers()->count()">@include('partials.users-bulk-actions')