Few more dashboard fixes

This commit is contained in:
snipe 2016-08-02 05:06:17 -07:00
parent cbc42f3e59
commit 0e5209e80f
2 changed files with 13 additions and 7 deletions

View file

@ -85,6 +85,13 @@ class Actionlog extends Model implements ICompanyableChild
->withTrashed();
}
public function userasassetlog()
{
return $this->belongsTo('\App\Models\User', 'asset_id')
->withTrashed();
}
public function childlogs()
{

View file

@ -140,7 +140,7 @@
{{ strtolower(trans('general.'.str_replace(' ','_',$activity->action_type))) }}
</td>
<td>
@if (($activity->assetlog) && ($activity->asset_type=="hardware"))
@if (($activity->assetlog) && ($activity->asset_type=="hardware"))
<a href="{{ route('view/hardware', $activity->asset_id) }}">{{ $activity->assetlog->showAssetName() }}</a>
@elseif (($activity->licenselog) && ($activity->asset_type=="software"))
<a href="{{ route('view/license', $activity->asset_id) }}">{{ $activity->licenselog->name }}</a>
@ -150,18 +150,17 @@
<a href="{{ route('view/accessory', $activity->accessory_id) }}">{{ $activity->accessorylog->name }}</a>
@elseif (($activity->componentlog) && ($activity->asset_type=="component"))
<a href="{{ route('view/component', $activity->component_id) }}">{{ $activity->componentlog->name }}</a>
@elseif (($activity->assetlog) && ($activity->action_type=="uploaded"))
@elseif (($activity->assetlog) && ($activity->action_type=="uploaded") && ($activity->asset_type=="hardware"))
<a href="{{ route('view/hardware', $activity->asset_id) }}">{{ $activity->assetlog->showAssetName() }}</a>
@elseif (($activity->userlog) && ($activity->action_type=="uploaded"))
<a href="{{ route('view/user', $activity->asset_id) }}">{{ $activity->userlog->fullName() }}</a>
@else
{{ trans('general.bad_data') }}
@endif
</td>
<td>
@if (($activity->componentlog) && ($activity->asset_type=="component"))
@if (($activity->userasassetlog) && ($activity->action_type=="uploaded") && ($activity->asset_type=="user"))
<a href="{{ route('view/user', $activity->asset_id) }}">{{ $activity->userasassetlog->fullName() }}</a>
@elseif (($activity->componentlog) && ($activity->asset_type=="component"))
<a href="{{ route('view/hardware', $activity->asset_id) }}">{{ $activity->assetlog->showAssetName() }}</a>
@elseif($activity->action_type=='requested')
@if ($activity->adminlog)