mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Fixed #4589 - Licence deployed to asset issue
This commit is contained in:
parent
e4ab4024c5
commit
aff93d8f2b
|
@ -315,7 +315,7 @@ class LicensesController extends Controller
|
|||
$licenseSeat->asset_id = $request->input('asset_id');
|
||||
|
||||
// Override asset's assigned user if available
|
||||
if ($target->assigned_to!='') {
|
||||
if ($target->checkedOutToUser()) {
|
||||
$licenseSeat->assigned_to = $target->assigned_to;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,34 +56,44 @@
|
|||
<td>Seat {{ $count }} </td>
|
||||
<td>
|
||||
@if (($licensedto->user) && ($licensedto->deleted_at == NULL))
|
||||
|
||||
@can('users.view')
|
||||
<a href="{{ route('users.show', $licensedto->assigned_to) }}">
|
||||
<i class="fa fa-user"></i>
|
||||
{{ $licensedto->user->present()->fullName() }}
|
||||
</a>
|
||||
@else
|
||||
<i class="fa fa-user"></i>
|
||||
{{ $licensedto->user->present()->fullName() }}
|
||||
@endcan
|
||||
|
||||
@elseif (($licensedto->user) && ($licensedto->deleted_at != NULL))
|
||||
|
||||
<del>{{ $licensedto->user->present()->fullName() }}</del>
|
||||
@elseif ($licensedto->asset)
|
||||
@if ($licensedto->asset->assigned_to != 0)
|
||||
@can('users.view')
|
||||
{!! $licensedto->asset->assignedTo->present()->nameUrl() !!}
|
||||
@else
|
||||
{{ $licensedto->asset->assignedTo->present()->name() }}
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($licensedto->asset)
|
||||
|
||||
@can('view', $licensedto->asset)
|
||||
<a href="{{ route('hardware.show', $licensedto->asset_id) }}">
|
||||
<i class="fa fa-barcode"></i>
|
||||
{{ $licensedto->asset->name }} {{ $licensedto->asset->asset_tag }}
|
||||
</a>
|
||||
@else
|
||||
<i class="fa fa-barcode"></i>
|
||||
{{ $licensedto->asset->name }} {{ $licensedto->asset->asset_tag }}
|
||||
@endcan
|
||||
|
||||
@if ($licensedto->asset->location)
|
||||
@can('locations.view')
|
||||
({!! $licensedto->asset->location->present()->nameUrl() !!})
|
||||
@else
|
||||
({{ $licensedto->asset->location->present()->name() }})
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
|
|
Loading…
Reference in a new issue