-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
3.2.2, 3.3
-
None
-
MOODLE_32_STABLE, MOODLE_33_STABLE
We have a method for retrieving user identity fields that current user can see in the given context:
get_extra_user_fields()
|
However we do not have a method that returns what user name fields current user can see in the given context. In some places in code we use something like this:
order_in_string(get_all_user_name_fields(), $nameformat);
|
// $nameformat is calculated from $CFG->fullnamedisplay and $CFG->alternativefullnameformat
|
// based on capability to view full names in the current context
|
Where we need this new method:
- Displaying the header with possible sort fields in the tables listing users (this is part of tablelib)
- Exporting reports where we need one line per user - we do not want to put fullname() in one cell of the export table, we want to have firstname, lastname, etc. as separate columns
To mention that there are some interesting methods in user_picture class but not quite what we need here
- Discovered while testing
-
MDL-58172 mod_choice responses export does not respect user identity fields setting or viewuseridentity capability
- Closed