mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Fixes #4249 - display deployed location in listing
This commit is contained in:
parent
b90933bb8b
commit
c5893b4445
|
@ -54,9 +54,9 @@ class AssetsTransformer
|
|||
'id' => (int) $asset->company->id,
|
||||
'name'=> e($asset->company->name)
|
||||
] : null,
|
||||
'location' => ($asset->assetloc) ? [
|
||||
'id' => (int) $asset->assetloc->id,
|
||||
'name'=> e($asset->assetloc->name)
|
||||
'location' => ($asset->assetLoc) ? [
|
||||
'id' => (int) $asset->assetLoc->id,
|
||||
'name'=> e($asset->assetLoc->name)
|
||||
] : null,
|
||||
'rtd_location' => ($asset->defaultLoc) ? [
|
||||
'id' => (int) $asset->defaultLoc->id,
|
||||
|
|
|
@ -112,7 +112,7 @@ class AssetPresenter extends Presenter
|
|||
"sortable" => true,
|
||||
"title" => trans('admin/hardware/table.location'),
|
||||
"visible" => true,
|
||||
"formatter" => "locationsLinkObjFormatter"
|
||||
"formatter" => "deployedLocationFormatter"
|
||||
], [
|
||||
"field" => "manufacturer",
|
||||
"searchable" => true,
|
||||
|
|
|
@ -346,6 +346,15 @@ $('.snipe-table').bootstrapTable({
|
|||
}
|
||||
}
|
||||
|
||||
function deployedLocationFormatter(row, value) {
|
||||
if ((row) && (row!=undefined)) {
|
||||
return '<a href="{{ url('/') }}/locations/' + row.id + '"> ' + row.name + '</a>';
|
||||
} else if (value.rtd_location) {
|
||||
return '<a href="{{ url('/') }}/locations/' + value.rtd_location.id + '" data-tooltip="true" title="Default Location"> ' + value.rtd_location.name + '</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function groupsAdminLinkFormatter(value, row) {
|
||||
return '<a href="{{ url('/') }}/admin/groups/' + row.id + '"> ' + value + '</a>';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue