mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Fixed #15651 - admin user now displaying on maintenances page
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
8aa298f6b0
commit
b054017c9f
|
@ -66,7 +66,7 @@ class AssetMaintenancesTransformer
|
||||||
'completion_date' => Helper::getFormattedDateObject($assetmaintenance->completion_date, 'date'),
|
'completion_date' => Helper::getFormattedDateObject($assetmaintenance->completion_date, 'date'),
|
||||||
'user_id' => ($assetmaintenance->adminuser) ? [
|
'user_id' => ($assetmaintenance->adminuser) ? [
|
||||||
'id' => $assetmaintenance->adminuser->id,
|
'id' => $assetmaintenance->adminuser->id,
|
||||||
'name'=> e($assetmaintenance->admin->getFullNameAttribute())
|
'name'=> e($assetmaintenance->adminuser->present()->fullName())
|
||||||
] : null, // legacy to not change the shape of the API
|
] : null, // legacy to not change the shape of the API
|
||||||
'created_by' => ($assetmaintenance->adminuser) ? [
|
'created_by' => ($assetmaintenance->adminuser) ? [
|
||||||
'id' => (int) $assetmaintenance->adminuser->id,
|
'id' => (int) $assetmaintenance->adminuser->id,
|
||||||
|
|
|
@ -176,7 +176,7 @@ class AssetMaintenance extends Model implements ICompanyableChild
|
||||||
*/
|
*/
|
||||||
public function adminuser()
|
public function adminuser()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(\App\Models\User::class, 'user_id')
|
return $this->belongsTo(\App\Models\User::class, 'created_by')
|
||||||
->withTrashed();
|
->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,12 +116,6 @@ class AssetMaintenancesPresenter extends Presenter
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'title' => trans('admin/asset_maintenances/form.cost'),
|
'title' => trans('admin/asset_maintenances/form.cost'),
|
||||||
'class' => 'text-right',
|
'class' => 'text-right',
|
||||||
], [
|
|
||||||
'field' => 'user_id',
|
|
||||||
'searchable' => true,
|
|
||||||
'sortable' => true,
|
|
||||||
'title' => trans('general.admin'),
|
|
||||||
'formatter' => 'usersLinkObjFormatter',
|
|
||||||
], [
|
], [
|
||||||
'field' => 'created_by',
|
'field' => 'created_by',
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
|
|
Loading…
Reference in a new issue