Fixed #4589 - Licence deployed to asset issue

This commit is contained in:
snipe 2017-12-12 05:43:06 -08:00
parent e4ab4024c5
commit aff93d8f2b
2 changed files with 19 additions and 9 deletions

View file

@ -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;
}

View file

@ -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>