mirror of
https://github.com/grocy/grocy.git
synced 2025-04-30 18:12:44 +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)
|
- 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
|
- 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 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)
|
- 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
|
- Improved / more precise validation messages for number inputs
|
||||||
- Ordering now happens case-insensitive
|
- Ordering now happens case-insensitive
|
||||||
|
@ -64,7 +64,9 @@ class UsersController extends BaseController
|
|||||||
{
|
{
|
||||||
User::checkPermission($request, User::PERMISSION_USERS_READ);
|
User::checkPermission($request, User::PERMISSION_USERS_READ);
|
||||||
return $this->renderPage($response, 'users', [
|
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");
|
$("#user-picture-label-none").removeClass("d-none");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Grocy.Components.UserfieldsForm.Load();
|
||||||
Grocy.FrontendHelpers.ValidateForm('user-form');
|
Grocy.FrontendHelpers.ValidateForm('user-form');
|
||||||
|
@ -29,6 +29,10 @@
|
|||||||
href="{{ $U('/user/new') }}">
|
href="{{ $U('/user/new') }}">
|
||||||
{{ $__t('Add') }}
|
{{ $__t('Add') }}
|
||||||
</a>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -76,6 +80,10 @@
|
|||||||
<th>{{ $__t('Username') }}</th>
|
<th>{{ $__t('Username') }}</th>
|
||||||
<th>{{ $__t('First name') }}</th>
|
<th>{{ $__t('First name') }}</th>
|
||||||
<th>{{ $__t('Last name') }}</th>
|
<th>{{ $__t('Last name') }}</th>
|
||||||
|
|
||||||
|
@include('components.userfields_thead', array(
|
||||||
|
'userfields' => $userfields
|
||||||
|
))
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="d-none">
|
<tbody class="d-none">
|
||||||
@ -112,6 +120,11 @@
|
|||||||
<td>
|
<td>
|
||||||
{{ $user->last_name }}
|
{{ $user->last_name }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@include('components.userfields_tbody', array(
|
||||||
|
'userfields' => $userfields,
|
||||||
|
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $user->id)
|
||||||
|
))
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user