mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Fixes #3786 - checkin/checkout to components UI
This commit is contained in:
parent
b3293a7a5f
commit
5e47c18d68
|
@ -43,6 +43,7 @@ class ComponentsTransformer
|
|||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($component->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($component->updated_at, 'datetime'),
|
||||
'user_can_checkout' => ($component->numRemaining() > 0) ? 1 : 0,
|
||||
];
|
||||
|
||||
$permissions_array['available_actions'] = [
|
||||
|
|
|
@ -85,17 +85,29 @@ class ComponentPresenter extends Presenter
|
|||
"sortable" => true,
|
||||
"title" => trans('general.purchase_cost'),
|
||||
"visible" => true,
|
||||
], [
|
||||
"field" => "actions",
|
||||
"searchable" => false,
|
||||
"sortable" => false,
|
||||
"switchable" => false,
|
||||
"title" => trans('table.actions'),
|
||||
"visible" => true,
|
||||
"formatter" => "componentsActionsFormatter",
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
$layout[] = [
|
||||
"field" => "checkincheckout",
|
||||
"searchable" => false,
|
||||
"sortable" => false,
|
||||
"switchable" => true,
|
||||
"title" => 'Checkin/Checkout',
|
||||
"visible" => true,
|
||||
"formatter" => "componentsInOutFormatter",
|
||||
];
|
||||
|
||||
$layout[] = [
|
||||
"field" => "actions",
|
||||
"searchable" => false,
|
||||
"sortable" => false,
|
||||
"switchable" => false,
|
||||
"title" => trans('table.actions'),
|
||||
"formatter" => "componentsActionsFormatter",
|
||||
];
|
||||
|
||||
|
||||
return json_encode($layout);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue