19declare(strict_types=1);
43 ?
object $a_parent_obj,
56 $this->
access = $DIC->access();
57 $this->rbacreview =
$DIC->rbac()->review();
58 $this->
user = $DIC->user();
59 $this->
user = $DIC[
'user']->getProfile();
65 $this->
lng->loadLanguageModule(
'grp');
66 $this->
lng->loadLanguageModule(
'trac');
67 $this->
lng->loadLanguageModule(
'rbac');
68 $this->
lng->loadLanguageModule(
'mmbr');
74 $this->
addColumn($this->
lng->txt(
'name'),
'lastname',
'20%');
78 $this->
addColumn($all_cols[$col][
'txt'], $col);
81 if ($this->show_learning_progress) {
82 $this->
addColumn($this->
lng->txt(
'learning_progress'),
'progress');
85 if ($this->privacy->enabledGroupAccessTimes()) {
86 $this->
addColumn($this->
lng->txt(
'last_access'),
'access_time_unix');
88 $this->
addColumn($this->
lng->txt(
'grp_mem_contacts'),
'contact');
89 $this->
addColumn($this->
lng->txt(
'grp_notification'),
'notification');
91 $this->
addColumn($this->
lng->txt(
'actions'),
'optional',
'',
false,
'ilMembershipRowActionsHeader');
94 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"components/ILIAS/Group");
101 $this->
enable(
'select_all');
107 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->
lng->txt(
'mmbr_btn_mail_selected_users'));
108 $this->
lng->loadLanguageModule(
'user');
118 protected function fillRow(array $a_set): void
122 $ilAccess =
$DIC->access();
124 $a_set[
'usr_id'] = (
int) $a_set[
'usr_id'];
125 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
126 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
127 if (!$ilAccess->checkAccessOfUser($a_set[
'usr_id'],
'read',
'', $this->getRepositoryObject()->getRefId()) and
128 is_array(
$info = $ilAccess->getInfo())) {
129 $this->tpl->setCurrentBlock(
'access_warning');
130 $this->tpl->setVariable(
'PARENT_ACCESS',
$info[0][
'text']);
131 $this->tpl->parseCurrentBlock();
134 if (!$a_set[
'active']) {
135 $this->tpl->setCurrentBlock(
'access_warning');
136 $this->tpl->setVariable(
'PARENT_ACCESS', $this->
lng->txt(
'usr_account_inactive'));
137 $this->tpl->parseCurrentBlock();
144 $a_set[
'gender'] = $a_set[
'gender'] ? $this->
lng->txt(
'gender_' . $a_set[
'gender']) :
'';
145 $this->tpl->setCurrentBlock(
'custom_fields');
146 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
147 $this->tpl->parseCurrentBlock();
152 $this->tpl->setCurrentBlock(
'custom_fields');
153 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
154 $this->tpl->parseCurrentBlock();
157 case 'consultation_hour':
158 $this->tpl->setCurrentBlock(
'custom_fields');
160 foreach ((array) $a_set[
'consultation_hours'] as $ch) {
165 if ($ch[
'explanation']) {
166 $tmp .=
' ' . $ch[
'explanation'];
170 $dt_string = implode(
'<br />', $dts);
171 $this->tpl->setVariable(
'VAL_CUST', $dt_string) ;
172 $this->tpl->parseCurrentBlock();
177 if (is_array($a_set[
'prtf'])) {
178 foreach ($a_set[
'prtf'] as $prtf_url => $prtf_txt) {
179 $tmp[] =
'<a href="' . $prtf_url .
'">' . $prtf_txt .
'</a>';
182 $this->tpl->setCurrentBlock(
'custom_fields');
183 $this->tpl->setVariable(
'VAL_CUST', implode(
'<br />', $tmp)) ;
184 $this->tpl->parseCurrentBlock();
187 case 'odf_last_update':
188 $this->tpl->setCurrentBlock(
'custom_fields');
189 $this->tpl->setVariable(
'VAL_CUST', $a_set[
'odf_info_txt'] ??
'');
190 $this->tpl->parseCurrentBlock();
194 $this->tpl->setCurrentBlock(
'custom_fields');
195 $this->tpl->setVariable(
'VAL_CUST', (
string) $a_set[
'roles_label']);
196 $this->tpl->parseCurrentBlock();
200 $this->tpl->setCurrentBlock(
'custom_fields');
201 $this->tpl->setVariable(
203 ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_set[
'usr_id'])
205 $this->tpl->parseCurrentBlock();
209 $this->tpl->setCurrentBlock(
'custom_fields');
210 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
211 $this->tpl->parseCurrentBlock();
216 if ($this->privacy->enabledGroupAccessTimes()) {
217 $this->tpl->setVariable(
'VAL_ACCESS', $a_set[
'access_time']);
220 if ($this->show_learning_progress) {
221 $this->tpl->setCurrentBlock(
'lp');
223 $icon_rendered = $icons->renderIconForStatus($icons->lookupNumStatus($a_set[
'progress']));
225 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->
lng->txt($a_set[
'progress']));
226 $this->tpl->setVariable(
'LP_STATUS_ICON', $icon_rendered);
228 $this->tpl->parseCurrentBlock();
231 $this->tpl->setVariable(
'VAL_POSTNAME',
'participants');
234 $this->tpl->setVariable(
'VAL_CONTACT_ID', $a_set[
'usr_id']);
235 $this->tpl->setVariable(
236 'VAL_CONTACT_CHECKED',
237 $a_set[
'contact'] ?
'checked="checked"' :
''
244 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
245 $this->tpl->setVariable(
246 'VAL_NOTIFICATION_CHECKED',
247 $a_set[
'notification'] ?
'checked="checked"' :
''
251 $this->tpl->setVariable(
'VAL_LOGIN', $a_set[
'login']);
258 $part = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
278 unset($additional_fields[
"firstname"]);
279 unset($additional_fields[
"lastname"]);
280 unset($additional_fields[
"last_login"]);
281 unset($additional_fields[
"access_until"]);
282 unset($additional_fields[
'consultation_hour']);
283 unset($additional_fields[
'prtf']);
284 unset($additional_fields[
'roles']);
285 unset($additional_fields[
'org_units']);
289 $udf_ids = $usr_data_fields = $odf_ids = array();
290 foreach ($additional_fields as $field) {
291 if (substr($field, 0, 3) ==
'udf') {
292 $udf_ids[] = substr($field, 4);
295 if (substr($field, 0, 3) ==
'odf') {
296 $odf_ids[] = substr($field, 4);
300 $usr_data_fields[] = $field;
308 (
string) $this->current_filter[
'login'],
320 $a_user_data = array();
321 $filtered_user_ids = array();
323 foreach ((array) $usr_data[
'set'] as $ud) {
325 if ($this->current_filter[
'roles']) {
326 if (!$this->rbacreview->isAssigned(
$user_id, $this->current_filter[
'roles'])) {
330 if (array_key_exists(
'org_units', $this->current_filter) && $this->current_filter[
'org_units']) {
331 $org_unit = $this->current_filter[
'org_units'];
333 if (!in_array($org_unit, $assigned)) {
339 $a_user_data[
$user_id] = array_merge($ud, (array) $group_user_data[
$user_id]);
342 foreach ($local_roles as $role_id => $role_name) {
344 if ($this->rbacreview->isAssigned(
$user_id, $role_id)) {
345 $roles[] = $role_name;
349 $a_user_data[
$user_id][
'roles_label'] = implode(
'<br />', $roles);
350 $a_user_data[
$user_id][
'roles'] = $this->participants->setRoleOrderPosition(
$user_id);
355 $a_user_data = array_reduce(
356 $this->
profile->getDataForMultiple($filtered_user_ids),
357 function (array
$c, ProfileData $v) use ($udf_ids): array {
362 foreach ($udf_ids as $field_id) {
363 $c[$v->getId()][
'udf_' . $field_id] = $v->getAdditionalFieldByIdentifier($field_id);
372 foreach (
$data as $usr_id => $fields) {
373 $usr_id = (
int) $usr_id;
377 foreach ($fields as $field_id => $value) {
378 if ($a_user_data[$usr_id] ??
false) {
379 $a_user_data[$usr_id][
'odf_' . $field_id] = $value;
385 if (!isset($a_user_data[$usr_id])) {
389 if ($usr_id == $edit_info[
'update_user']) {
390 $a_user_data[$usr_id][
'odf_last_update'] =
'';
391 $a_user_data[$usr_id][
'odf_info_txt'] = $this->
lng->txt(
'cdf_edited_by_self');
393 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_' . $edit_info[
'editing_time']->get(
IL_CAL_UNIX));
397 $a_user_data[$usr_id][
'odf_last_update'] = $edit_info[
'update_user'];
398 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_' . $edit_info[
'editing_time']->get(
IL_CAL_UNIX));
401 $a_user_data[$usr_id][
'odf_info_txt'] = ($name[
'firstname'] .
' ' . $name[
'lastname'] .
', ' .
ilDatePresentation::formatDate($edit_info[
'editing_time']));
409 if (isset($a_user_data[$buser])) {
410 $a_user_data[$buser][
'consultation_hour'] = $booking[0][
'dt'];
411 $a_user_data[$buser][
'consultation_hour_end'] = $booking[0][
'dtend'];
412 $a_user_data[$buser][
'consultation_hours'] = $booking;
430 if (isset($this->cached_user_names[
$user_id])) {
431 return $this->cached_user_names[
$user_id];
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static lookupManagedBookingsForObject(int $a_obj_id, int $a_usr_id)
Lookup bookings for own and managed consultation hours of an object.
static _getValuesByObjId(int $a_obj_id)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
@classDescription Date and time handling
bool $show_learning_progress
ilPrivacySettings $privacy
__construct(?object $a_parent_obj, ilObject $rep_object, bool $show_learning_progress=false)
lookupUserName(int $user_id)
fillRow(array $a_set)
@inheritDoc
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
static _lookupName(int $a_user_id)
static lookupEntriesByObjectId(int $a_obj_id)
Class ilObject Basic functions for all objects.
getSelectableColumns()
Get selectable columns.
checkAcceptance(int $a_usr_id)
initFilter()
Init table filter.
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
Singleton class that stores all privacy settings.
class ilRbacReview Contains Review functions of core Rbac.
isColumnSelected(string $col)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
determineOffsetAndOrder(bool $a_omit_offset=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
enable(string $a_module_name)
static getUserListData(string $a_order_field, string $a_order_dir, int $a_offset, int $a_limit, string $a_string_filter="", string $a_activation_filter="", ?ilDateTime $a_last_login_filter=null, bool $a_limited_access_filter=false, bool $a_no_courses_filter=false, int $a_course_group_filter=0, int $a_role_filter=0, ?array $a_user_folder_filter=null, ?array $a_additional_fields=null, ?array $a_user_filter=null, string $a_first_letter="", string $a_authentication_filter="")
Get data for user administration list.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc