Updated asset transformers/presenters to display requestable status

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-02-28 14:59:55 +00:00
parent 1ce9df7998
commit 7c3d8b896b
3 changed files with 10 additions and 0 deletions

View file

@ -111,6 +111,7 @@ class AssetsController extends Controller
'requests_counter',
'byod',
'asset_eol_date',
'requestable',
];
$filter = [];

View file

@ -37,6 +37,7 @@ class AssetsTransformer
'name'=> e($asset->model->name),
] : null,
'byod' => ($asset->byod ? true : false),
'requestable' => ($asset->requestable ? true : false),
'model_number' => (($asset->model) && ($asset->model->model_number)) ? e($asset->model->model_number) : null,
'eol' => (($asset->asset_eol_date != '') && ($asset->purchase_date != '')) ? Carbon::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date).' months' : null,

View file

@ -195,6 +195,14 @@ class AssetPresenter extends Presenter
'visible' => false,
'title' => trans('admin/hardware/form.warranty_expires'),
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'requestable',
'searchable' => false,
'sortable' => true,
'visible' => false,
'title' => trans('admin/hardware/general.requestable'),
'formatter' => 'trueFalseFormatter',
], [
'field' => 'notes',
'searchable' => true,