mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Implemented Userfields for users (closes #1159)
This commit is contained in:
parent
8f1ce607f7
commit
2b13102299
@ -157,6 +157,7 @@
|
||||
- Dialogs are now used everywhere where appropriate instead of jumping between pages (for example when adding/editing shopping list items)
|
||||
- Added a "Clear filter"-button on all pages (with filters) to quickly reset applied filters
|
||||
- Users can now have a picture (will then be shown next to the current user name instead of the generic user icon)
|
||||
- Users can now also have Userfields
|
||||
- Prefilled number inputs now use sensible decimal places (max. the configured decimals while hiding trailing zeros where appropriate, means if you never use partial amounts for a product, you'll never see decimals for it)
|
||||
- Improved / more precise validation messages for number inputs
|
||||
- Ordering now happens case-insensitive
|
||||
|
@ -64,7 +64,9 @@ class UsersController extends BaseController
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_USERS_READ);
|
||||
return $this->renderPage($response, 'users', [
|
||||
'users' => $this->getDatabase()->users()->orderBy('username')
|
||||
'users' => $this->getDatabase()->users()->orderBy('username'),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('users'),
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('users')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -138,4 +138,5 @@ $("#delete-current-user-picture-button").on("click", function(e)
|
||||
$("#user-picture-label-none").removeClass("d-none");
|
||||
});
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
Grocy.FrontendHelpers.ValidateForm('user-form');
|
||||
|
@ -29,6 +29,10 @@
|
||||
href="{{ $U('/user/new') }}">
|
||||
{{ $__t('Add') }}
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary m-1 mt-md-0 mb-md-0 float-right"
|
||||
href="{{ $U('/userfields?entity=users') }}">
|
||||
{{ $__t('Configure userfields') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -76,6 +80,10 @@
|
||||
<th>{{ $__t('Username') }}</th>
|
||||
<th>{{ $__t('First name') }}</th>
|
||||
<th>{{ $__t('Last name') }}</th>
|
||||
|
||||
@include('components.userfields_thead', array(
|
||||
'userfields' => $userfields
|
||||
))
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="d-none">
|
||||
@ -112,6 +120,11 @@
|
||||
<td>
|
||||
{{ $user->last_name }}
|
||||
</td>
|
||||
|
||||
@include('components.userfields_tbody', array(
|
||||
'userfields' => $userfields,
|
||||
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $user->id)
|
||||
))
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
Loading…
x
Reference in New Issue
Block a user