56 : void
57 {
58 $participants = $this->objParticipants->getParticipants();
59 if ($this->type === 'crs' || $this->type === 'grp') {
60 $participants = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
61 'read',
62 'manage_members',
63 $this->ref_id,
64 $participants
65 );
66 }
67
68 $preloadedRoleIds = [];
69 foreach ($participants as
$user_id) {
72 continue;
73 }
74
75 if (!$user->getActive()) {
76 continue;
77 }
78
79 $login = $user->getLogin();
80
81 $publicName = '';
82 if (in_array($user->getPref('public_profile'), ['g', 'y'])) {
83 $publicName = $user->getLastname() . ', ' . $user->getFirstname();
84 }
85
87 $this->data[
$user_id][
'login'] = $login;
88 $this->data[
$user_id][
'name'] = $publicName;
89
90 $assignedRoles = $this->objParticipants->getAssignedRoles(
$user_id);
91 $rolesToPreload = array_diff($assignedRoles, $preloadedRoleIds);
92 $this->dataCache->preloadObjectCache($rolesToPreload);
93
94 $roleTitles = [];
95 foreach ($assignedRoles as $roleId) {
96 $preloadedRoleIds[$roleId] = $roleId;
97 $title = $this->dataCache->lookupTitle((int) $roleId);
98 $roleTitles[] = $title;
99 }
100
101 $roleTitles = $this->
sortRoles($roleTitles);
102
103 $roleTitles = array_map(
104 fn(
string $roleTitle):
string => $this->
buildRoleTitle($roleTitle),
105 $roleTitles
106 );
107
108 $this->data[
$user_id][
'role'] = implode(
', ', $roleTitles);
109 }
110 }
buildRoleTitle(string $role)
sortRoles(array $roleTitles)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id