Make user view columns dynamic by config

This commit is contained in:
Johannes Rudolph 2022-12-23 04:46:32 +01:00 committed by GitHub
parent 92e0b8be65
commit b1b08afd23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -285,6 +285,9 @@ return [
// Number of shifts to freeload until angel is locked for shift signup. // Number of shifts to freeload until angel is locked for shift signup.
'max_freeloadable_shifts' => env('MAX_FREELOADABLE_SHIFTS', 2), 'max_freeloadable_shifts' => env('MAX_FREELOADABLE_SHIFTS', 2),
// Hide columns in backend user view. Possible values are any sortable parameters of the table.
'disabled_user_view_columns' => [],
// Local timezone // Local timezone
'timezone' => env('TIMEZONE', 'Europe/Berlin'), 'timezone' => env('TIMEZONE', 'Europe/Berlin'),

View File

@ -158,6 +158,10 @@ function Users_view(
$user_table_headers['last_login_at'] = Users_table_header_link('last_login_at', __('Last login'), $order_by); $user_table_headers['last_login_at'] = Users_table_header_link('last_login_at', __('Last login'), $order_by);
$user_table_headers['actions'] = ''; $user_table_headers['actions'] = '';
foreach (config('disabled_user_view_columns') ?? [] as $key) {
unset($user_table_headers[$key]);
}
return page_with_title(__('All users'), [ return page_with_title(__('All users'), [
msg(), msg(),
buttons([ buttons([