Merge pull request #15431 from snipe/add_employee_num_to_asset_overview

Added employee number to asset view
This commit is contained in:
snipe 2024-08-31 13:47:25 +01:00 committed by GitHub
commit f8bbb7ad9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 11 deletions

View file

@ -64,14 +64,19 @@ class IconHelper
case 'kits': case 'kits':
return 'fas fa-object-group'; return 'fas fa-object-group';
case 'assets': case 'assets':
case 'asset':
return 'fas fa-barcode'; return 'fas fa-barcode';
case 'accessories': case 'accessories':
case 'accessory':
return 'far fa-keyboard'; return 'far fa-keyboard';
case 'components': case 'components':
case 'component':
return 'far fa-hdd'; return 'far fa-hdd';
case 'consumables': case 'consumables':
case 'consumable':
return 'fas fa-tint'; return 'fas fa-tint';
case 'licenses': case 'licenses':
case 'license':
return 'far fa-save'; return 'far fa-save';
case 'requestable': case 'requestable':
return 'fas fa-laptop'; return 'fas fa-laptop';
@ -141,6 +146,8 @@ class IconHelper
return 'fas fa-lock'; return 'fas fa-lock';
case 'locations': case 'locations':
return 'fas fa-map-marker-alt'; return 'fas fa-map-marker-alt';
case 'location':
return 'fas fa-map-marker-alt';
case 'superadmin': case 'superadmin':
return 'fas fa-crown'; return 'fas fa-crown';
case 'print': case 'print':
@ -173,6 +180,8 @@ class IconHelper
return 'fas fa-crosshairs'; return 'fas fa-crosshairs';
case 'oauth': case 'oauth':
return 'fas fa-user-secret'; return 'fas fa-user-secret';
case 'employee_num' :
return 'fa-regular fa-id-card';
} }
} }

View file

@ -277,26 +277,40 @@
<div class="col-md-12" style="text-align: left"> <div class="col-md-12" style="text-align: left">
<h2> <h2>
{{ trans('admin/hardware/form.checkedout_to') }} {{ trans('admin/hardware/form.checkedout_to') }}
<x-icon type="long-arrow-right" />
</h2> </h2>
<p>
<ul class="list-unstyled" style="line-height: 25px; font-size: 14px">
@if (($asset->checkedOutToUser()) && ($asset->assignedTo->present()->gravatar())) @if (($asset->checkedOutToUser()) && ($asset->assignedTo->present()->gravatar()))
<img src="{{ $asset->assignedTo->present()->gravatar() }}" class="user-image-inline hidden-print" alt="{{ $asset->assignedTo->present()->fullName() }}"> <li>
<img src="{{ $asset->assignedTo->present()->gravatar() }}" class="user-image-inline hidden-print" alt="{{ $asset->assignedTo->present()->fullName() }}">
{!! $asset->assignedTo->present()->nameUrl() !!}
</li>
@else
<li>
<x-icon type="{{ $asset->assignedType() }}" class="fa-fw" />
{!! $asset->assignedTo->present()->nameUrl() !!}
</li>
@endif @endif
</p>
{!! $asset->assignedTo->present()->glyph() . ' ' .$asset->assignedTo->present()->nameUrl() !!}
<ul class="list-unstyled" style="line-height: 25px;"> @if ((isset($asset->assignedTo->employee_num)) && ($asset->assignedTo->employee_num!=''))
<li>
<x-icon type="employee_num" class="fa-fw"/>
{{ $asset->assignedTo->employee_num }}
</li>
@endif
@if ((isset($asset->assignedTo->email)) && ($asset->assignedTo->email!='')) @if ((isset($asset->assignedTo->email)) && ($asset->assignedTo->email!=''))
<li> <li>
<x-icon type="email" /> <x-icon type="email" class="fa-fw" />
<a href="mailto:{{ $asset->assignedTo->email }}">{{ $asset->assignedTo->email }}</a> <a href="mailto:{{ $asset->assignedTo->email }}">{{ $asset->assignedTo->email }}</a>
</li> </li>
@endif @endif
@if ((isset($asset->assignedTo)) && ($asset->assignedTo->phone!='')) @if ((isset($asset->assignedTo)) && ($asset->assignedTo->phone!=''))
<li> <li>
<x-icon type="phone" /> <x-icon type="phone" class="fa-fw" />
<a href="tel:{{ $asset->assignedTo->phone }}">{{ $asset->assignedTo->phone }}</a> <a href="tel:{{ $asset->assignedTo->phone }}">{{ $asset->assignedTo->phone }}</a>
</li> </li>
@endif @endif
@ -307,7 +321,7 @@
@if (isset($asset->location)) @if (isset($asset->location))
<li> <li>
<x-icon type="locations" /> <x-icon type="locations" class="fa-fw" />
{{ $asset->location->name }}</li> {{ $asset->location->name }}</li>
<li>{{ $asset->location->address }} <li>{{ $asset->location->address }}
@if ($asset->location->address2!='') @if ($asset->location->address2!='')
@ -323,12 +337,12 @@
</li> </li>
@endif @endif
<li> <li>
<x-icon type="calendar" /> <x-icon type="calendar" class="fa-fw" />
{{ trans('admin/hardware/form.checkout_date') }}: {{ Helper::getFormattedDateObject($asset->last_checkout, 'date', false) }} {{ trans('admin/hardware/form.checkout_date') }}: {{ Helper::getFormattedDateObject($asset->last_checkout, 'date', false) }}
</li> </li>
@if (isset($asset->expected_checkin)) @if (isset($asset->expected_checkin))
<li> <li>
<x-icon type="calendar" /> <x-icon type="calendar" class="fa-fw" />
{{ trans('admin/hardware/form.expected_checkin') }}: {{ Helper::getFormattedDateObject($asset->expected_checkin, 'date', false) }} {{ trans('admin/hardware/form.expected_checkin') }}: {{ Helper::getFormattedDateObject($asset->expected_checkin, 'date', false) }}
</li> </li>
@endif @endif
@ -397,7 +411,7 @@
<x-icon type="long-arrow-right" /> <x-icon type="long-arrow-right" />
{!! $asset->assignedTo->present()->glyph() !!} <x-icon type="{{ $asset->assignedType() }}" class="fa-fw" />
{!! $asset->assignedTo->present()->nameUrl() !!} {!! $asset->assignedTo->present()->nameUrl() !!}
@else @else
@if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1')) @if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1'))