mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Updated asset transformers/presenters to display requestable status
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
1ce9df7998
commit
7c3d8b896b
|
@ -111,6 +111,7 @@ class AssetsController extends Controller
|
|||
'requests_counter',
|
||||
'byod',
|
||||
'asset_eol_date',
|
||||
'requestable',
|
||||
];
|
||||
|
||||
$filter = [];
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue