Change
New function 'user'
Issue description
There is currently 5 functions allowing programmatic access to user related information: current_user, current_user_account, current_user_group, current_user_in_class, current_user_name. Deprecate those and replace them by a single function 'user' which provides all their functionalities.
Developer comments
It is a bit unfortunate that the function serves more than one responsibilty, but it is worth it. Here we go:
By default user returns an object with a minimal interface.
[% current_user_name(); %]
becomes
[% user()->name %]
Furthermore
[% current_user_account(); %]
becomes
[% user()->account %]
And
[% current_user(); %]
becomes
[% user()->person %]
If either the parameter %in% or %not_in% is present it returns a *boolean*. Therefore:
[% if (user(in: "id:abc")) { ... %]
[% if (user(not_in: "id:abc")) { ... %]
|
Work sessions2
Start |
2024-07-07T09:12:00
|
End |
2024-07-07T10:28:11
|
Participant |
Robert Cerny
|
Start |
2024-07-07T14:50:06
|
End |
2024-07-07T16:39:02
|
Participant |
Robert Cerny
|
|
We are sorry
This page cannot be displayed in your browser. Use Firefox, Opera, Safari, or Chrome instead.