Fixes #3790 - parent display on locations index

This commit is contained in:
snipe 2017-08-22 15:02:31 -07:00
parent 63bc2ec09f
commit 1d7e243d0a
2 changed files with 5 additions and 2 deletions

View file

@ -44,7 +44,10 @@ class LocationsTransformer
'assets' => $assets_arr,
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($location->updated_at, 'datetime'),
'parent_id' => ($location->parent_id) ? (int) $location->parent_id : null,
'parent' => ($location->parent) ? [
'id' => (int) $location->parent->id,
'name'=> e($location->parent->name)
] : null,
'children' => $children_arr,
];

View file

@ -29,7 +29,7 @@
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="true" data-formatter="locationsLinkFormatter" data-field="name" data-searchable="true">{{ trans('admin/locations/table.name') }}</th>
<th data-sortable="true" data-field="parent">{{ trans('admin/locations/table.parent') }}</th>
<th data-sortable="true" data-field="parent" data-formatter="locationsLinkObjFormatter">{{ trans('admin/locations/table.parent') }}</th>
<th data-searchable="false" data-sortable="false" data-field="assets_default">{{ trans('admin/locations/table.assets_rtd') }}</th>
<th data-searchable="false" data-sortable="false" data-field="assets_checkedout">{{ trans('admin/locations/table.assets_checkedout') }}</th>
<th data-searchable="true" data-sortable="true" data-field="currency">{{ App\Models\Setting::first()->default_currency }}</th>