Added location to asset view
This commit is contained in:
@@ -8,9 +8,10 @@ return array(
|
||||
'serial' => 'Serial',
|
||||
'purchase_date' => 'Purchased',
|
||||
'purchase_cost' => 'Cost',
|
||||
'book_value' => 'Book Value',
|
||||
'book_value' => 'Value',
|
||||
'status' => 'Status',
|
||||
'checkoutto' => 'Checked Out',
|
||||
'change' => 'In/Out',
|
||||
'location' => 'Location',
|
||||
|
||||
);
|
||||
|
||||
@@ -49,4 +49,10 @@ class Asset extends Elegant {
|
||||
return $this->belongsTo('User', 'assigned_to');
|
||||
}
|
||||
|
||||
public function assetloc($locationId)
|
||||
{
|
||||
return Location::find($locationId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,9 +26,10 @@ Assets ::
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span2">@lang('admin/assets/table.asset_tag')</th>
|
||||
<th class="span4">@lang('admin/assets/table.title')</th>
|
||||
<th class="span2">@lang('admin/assets/table.title')</th>
|
||||
<th class="span2">@lang('admin/assets/table.serial')</th>
|
||||
<th class="span2">@lang('admin/assets/table.checkoutto')</th>
|
||||
<th class="span2">@lang('admin/assets/table.location')</th>
|
||||
<th class="span1">@lang('admin/assets/table.change')</th>
|
||||
<th class="span2">@lang('admin/assets/table.purchase_date')</th>
|
||||
<th class="span2">@lang('admin/assets/table.purchase_cost')</th>
|
||||
@@ -47,10 +48,16 @@ Assets ::
|
||||
@if ($asset->assigned_to != 0)
|
||||
<a href="{{ route('view/user', $asset->assigned_to) }}">
|
||||
{{ $asset->assigneduser->fullName() }}
|
||||
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($asset->assigneduser->location_id)
|
||||
{{ $asset->assetloc($asset->assigneduser->location_id)->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($asset->assigned_to != 0)
|
||||
<a href="{{ route('checkin/asset', $asset->id) }}" class="btn-flat info">Checkin</a>
|
||||
@else
|
||||
|
||||
Reference in New Issue
Block a user