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,
|
'id' => (int) $asset->company->id,
|
||||||
'name'=> e($asset->company->name)
|
'name'=> e($asset->company->name)
|
||||||
] : null,
|
] : null,
|
||||||
'location' => ($asset->assetloc) ? [
|
'location' => ($asset->assetLoc) ? [
|
||||||
'id' => (int) $asset->assetloc->id,
|
'id' => (int) $asset->assetLoc->id,
|
||||||
'name'=> e($asset->assetloc->name)
|
'name'=> e($asset->assetLoc->name)
|
||||||
] : null,
|
] : null,
|
||||||
'rtd_location' => ($asset->defaultLoc) ? [
|
'rtd_location' => ($asset->defaultLoc) ? [
|
||||||
'id' => (int) $asset->defaultLoc->id,
|
'id' => (int) $asset->defaultLoc->id,
|
||||||
|
|
|
@ -112,7 +112,7 @@ class AssetPresenter extends Presenter
|
||||||
"sortable" => true,
|
"sortable" => true,
|
||||||
"title" => trans('admin/hardware/table.location'),
|
"title" => trans('admin/hardware/table.location'),
|
||||||
"visible" => true,
|
"visible" => true,
|
||||||
"formatter" => "locationsLinkObjFormatter"
|
"formatter" => "deployedLocationFormatter"
|
||||||
], [
|
], [
|
||||||
"field" => "manufacturer",
|
"field" => "manufacturer",
|
||||||
"searchable" => true,
|
"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) {
|
function groupsAdminLinkFormatter(value, row) {
|
||||||
return '<a href="{{ url('/') }}/admin/groups/' + row.id + '"> ' + value + '</a>';
|
return '<a href="{{ url('/') }}/admin/groups/' + row.id + '"> ' + value + '</a>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue