Added users, locations to presenter, transformer

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-05-07 12:07:41 +01:00
parent 410b547f3c
commit 482965197d
2 changed files with 20 additions and 0 deletions

View file

@ -64,6 +64,8 @@ class UsersTransformer
'licenses_count' => (int) $user->licenses_count,
'accessories_count' => (int) $user->accessories_count,
'consumables_count' => (int) $user->consumables_count,
'manages_users_count' => (int) $user->manages_users_count,
'manages_locations_count' => (int) $user->manages_locations_count,
'company' => ($user->company) ? ['id' => (int) $user->company->id, 'name'=> e($user->company->name)] : null,
'created_by' => ($user->createdBy) ? [
'id' => (int) $user->createdBy->id,

View file

@ -251,6 +251,24 @@ class UserPresenter extends Presenter
'title' => 'Accessories',
'visible' => true,
],
[
'field' => 'manages_users_count',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'class' => 'css-users',
'title' => 'Managed Users',
'visible' => true,
],
[
'field' => 'manages_locations_count',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'class' => 'css-location',
'title' => 'Managed Locations',
'visible' => true,
],
[
'field' => 'notes',
'searchable' => true,