19declare(strict_types=0);
46 bool $a_show_learning_progress =
false,
47 bool $a_show_timings =
false,
48 bool $a_show_lp_status_sync =
false,
53 $this->show_learning_progress = $a_show_learning_progress;
55 if (
null === $preloader) {
61 $this->preLoader = $preloader;
62 $this->show_timings = $a_show_timings;
63 $this->show_lp_status_sync = $a_show_lp_status_sync;
67 $this->show_lp_status_sync =
false;
70 $this->
access = $DIC->access();
72 $this->rbacReview =
$DIC->rbac()->review();
73 $this->
user = $DIC->user();
74 $this->
profile = $DIC[
'user']->getProfile();
79 $this->
lng->loadLanguageModule(
'crs');
80 $this->
lng->loadLanguageModule(
'trac');
81 $this->
lng->loadLanguageModule(
'rbac');
82 $this->
lng->loadLanguageModule(
'mmbr');
83 $this->
lng->loadLanguageModule(
'cert');
84 $this->
lng->loadLanguageModule(
'certificate');
91 $this->
addColumn($this->
lng->txt(
'name'),
'name',
'20%');
95 $this->
addColumn($all_cols[$col][
'txt'], $col);
98 if ($this->show_learning_progress) {
99 $this->
addColumn($this->
lng->txt(
'learning_progress'),
'progress');
102 if ($this->privacy->enabledCourseAccessTimes()) {
103 $this->
addColumn($this->
lng->txt(
'last_access'),
'access_ut',
'16em');
106 $this->
addColumn($this->
lng->txt(
'crs_member_passed'),
'passed');
107 if ($this->show_lp_status_sync) {
108 $this->
addColumn($this->
lng->txt(
'crs_member_passed_status_changed'),
'passed_timestamp');
112 $this->
addColumn($this->
lng->txt(
'crs_mem_contact'),
'contact');
113 $this->
addColumn($this->
lng->txt(
'crs_blocked'),
'blocked');
114 $this->
addColumn($this->
lng->txt(
'crs_notification_list_title'),
'notification');
116 $this->
addColumn($this->
lng->txt(
'actions'),
'optional',
'',
false,
'ilMembershipRowActionsHeader');
118 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"components/ILIAS/Course");
124 $this->
enable(
'select_all');
138 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->
lng->txt(
'mmbr_btn_mail_selected_users'));
139 $this->
lng->loadLanguageModule(
'user');
145 protected function fillRow(array $a_set): void
147 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
148 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
149 $this->tpl->setVariable(
'SELECT_PARTICIPANT', $this->
lng->txt(
"select") .
' ' . $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
152 !$this->
access->checkAccessOfUser($a_set[
'usr_id'],
'read',
'', $this->getRepositoryObject()->getRefId()) &&
155 $this->tpl->setCurrentBlock(
'access_warning');
156 $this->tpl->setVariable(
'PARENT_ACCESS',
$info[0][
'text']);
157 $this->tpl->parseCurrentBlock();
160 if (!$a_set[
'active']) {
161 $this->tpl->setCurrentBlock(
'access_warning');
162 $this->tpl->setVariable(
'PARENT_ACCESS', $this->
lng->txt(
'usr_account_inactive'));
163 $this->tpl->parseCurrentBlock();
169 $a_set[
'gender'] = ($a_set[
'gender'] ??
'') ? $this->
lng->txt(
'gender_' . $a_set[
'gender']) :
'';
170 $this->tpl->setCurrentBlock(
'custom_fields');
171 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
172 $this->tpl->parseCurrentBlock();
179 )) : $this->
lng->txt(
'no_date');
180 $this->tpl->setCurrentBlock(
'custom_fields');
181 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
182 $this->tpl->parseCurrentBlock();
185 case 'consultation_hour':
186 $this->tpl->setCurrentBlock(
'custom_fields');
188 foreach ((array) ($a_set[
'consultation_hours'] ?? []) as $ch) {
193 if ($ch[
'explanation']) {
194 $tmp .=
' ' . $ch[
'explanation'];
198 $dt_string = implode(
'<br />', $dts);
199 $this->tpl->setVariable(
'VAL_CUST', $dt_string);
200 $this->tpl->parseCurrentBlock();
205 if (is_array($a_set[
'prtf'])) {
206 foreach ($a_set[
'prtf'] as $prtf_url => $prtf_txt) {
207 $tmp[] =
'<a href="' . $prtf_url .
'">' . $prtf_txt .
'</a>';
210 $this->tpl->setCurrentBlock(
'custom_fields');
211 $this->tpl->setVariable(
'VAL_CUST', implode(
'<br />', $tmp));
212 $this->tpl->parseCurrentBlock();
215 case 'odf_last_update':
216 $this->tpl->setCurrentBlock(
'custom_fields');
217 $this->tpl->setVariable(
'VAL_CUST', (
string) ($a_set[
'odf_info_txt'] ??
''));
218 $this->tpl->parseCurrentBlock();
222 $this->tpl->setCurrentBlock(
'custom_fields');
223 $this->tpl->setVariable(
'VAL_CUST', (
string) ($a_set[
'roles_label'] ??
''));
224 $this->tpl->parseCurrentBlock();
228 $this->tpl->setCurrentBlock(
'custom_fields');
229 $this->tpl->setVariable(
231 ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((
int) $a_set[
'usr_id'])
233 $this->tpl->parseCurrentBlock();
237 $this->tpl->setCurrentBlock(
'custom_fields');
238 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
239 $this->tpl->parseCurrentBlock();
244 if ($this->privacy->enabledCourseAccessTimes()) {
245 $this->tpl->setVariable(
'VAL_ACCESS', $a_set[
'access_time']);
247 if ($this->show_learning_progress) {
248 $this->tpl->setCurrentBlock(
'lp');
250 $icon_rendered = $icons->renderIconForStatus($icons->lookupNumStatus($a_set[
'progress']));
252 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->
lng->txt($a_set[
'progress']));
253 $this->tpl->setVariable(
'LP_STATUS_ICON', $icon_rendered);
255 $this->tpl->parseCurrentBlock();
258 $this->tpl->setVariable(
'VAL_POSTNAME',
'participants');
260 if ($this->
access->checkAccess(
"grade",
"", $this->rep_object->getRefId())) {
261 $this->tpl->setCurrentBlock(
'grade');
262 $this->tpl->setVariable(
'VAL_PASSED_ID', $a_set[
'usr_id']);
263 $this->tpl->setVariable(
'VAL_PASSED_CHECKED', ($a_set[
'passed'] ?
'checked="checked"' :
''));
264 $this->tpl->setVariable(
'PASSED_TITLE', $this->
lng->txt(
'crs_member_passed'));
265 $this->tpl->parseCurrentBlock();
267 $this->tpl->setVariable(
'VAL_PASSED_TXT', ($a_set[
'passed']
268 ? $this->
lng->txt(
"yes")
269 : $this->lng->txt(
"no")));
277 $this->tpl->setCurrentBlock(
'with_contact');
278 $this->tpl->setVariable(
'VAL_CONTACT_ID', $a_set[
'usr_id']);
279 $this->tpl->setVariable(
'VAL_CONTACT_CHECKED', $a_set[
'contact'] ?
'checked="checked"' :
'');
280 $this->tpl->setVariable(
'CONTACT_TITLE', $this->
lng->txt(
'crs_mem_contact'));
281 $this->tpl->parseCurrentBlock();
284 $this->tpl->setCurrentBlock(
'with_notification');
285 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
286 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
287 $this->tpl->setVariable(
'NOTIFICATION_TITLE', $this->
lng->txt(
'crs_notification_list_title'));
288 $this->tpl->parseCurrentBlock();
296 $this->tpl->setCurrentBlock(
'with_blocked');
297 $this->tpl->setVariable(
'VAL_BLOCKED_ID', $a_set[
'usr_id']);
298 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED', ($a_set[
'blocked'] ?
'checked="checked"' :
''));
299 $this->tpl->setVariable(
'BLOCKED_TITLE', $this->
lng->txt(
'crs_blocked'));
300 $this->tpl->parseCurrentBlock();
303 if ($this->show_lp_status_sync) {
304 $this->tpl->setVariable(
'PASSED_INFO', $a_set[
"passed_info"]);
311 $this->tpl->setCurrentBlock(
'link');
312 $this->tpl->setVariable(
'LINK_NAME', $this->
ctrl->getLinkTarget($this->parent_obj,
'deliverCertificate'));
313 $this->tpl->setVariable(
'LINK_TXT', $this->
lng->txt(
'download_certificate'));
314 $this->tpl->parseCurrentBlock();
316 $this->
ctrl->clearParameters($this->parent_obj);
318 if ($this->show_timings) {
319 $this->
ctrl->setParameterByClass(
'ilcoursecontentgui',
'member_id', $a_set[
'usr_id']);
320 $this->tpl->setCurrentBlock(
'link');
321 $this->tpl->setVariable(
323 $this->
ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'showUserTimings')
325 $this->tpl->setVariable(
'LINK_TXT', $this->
lng->txt(
'timings_timings'));
326 $this->tpl->parseCurrentBlock();
335 unset($additional_fields[
"firstname"]);
336 unset($additional_fields[
"lastname"]);
337 unset($additional_fields[
"last_login"]);
338 unset($additional_fields[
"access_until"]);
339 unset($additional_fields[
'consultation_hour']);
340 unset($additional_fields[
'prtf']);
341 unset($additional_fields[
'roles']);
342 unset($additional_fields[
'org_units']);
344 $part = $this->participants->getParticipants();
346 $part = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
358 $udf_ids = $usr_data_fields = $odf_ids = array();
359 foreach ($additional_fields as $field) {
360 if (substr($field, 0, 3) ==
'udf') {
361 $udf_ids[] = substr($field, 4);
364 if (substr($field, 0, 3) ==
'odf') {
365 $odf_ids[] = substr($field, 4);
369 $usr_data_fields[] = $field;
377 $this->current_filter[
'login'],
391 foreach ((array) $usr_data[
'set'] as
$user) {
392 if ($this->current_filter[
'roles'] ??
false) {
393 if (!$this->rbacReview->isAssigned(
$user[
'usr_id'], $this->current_filter[
'roles'])) {
397 if ($this->current_filter[
'org_units'] ??
false) {
398 $org_unit = $this->current_filter[
'org_units'];
401 if (!in_array($org_unit, $assigned)) {
406 $usr_ids[] =
$user[
'usr_id'];
415 $a_user_data = array();
416 foreach ((array) $usr_data[
'set'] as $ud) {
419 if (!in_array(
$user_id, $usr_ids)) {
425 'active' => $ud[
'active'],
426 'firstname' => $ud[
'firstname'],
427 'lastname' => $ud[
'lastname'],
428 'login' => $ud[
'login']
435 foreach ($local_roles as $role_id => $role_name) {
437 if ($this->rbacReview->isAssigned(
$user_id, $role_id)) {
438 $roles[] = $role_name;
443 $a_user_data[
$user_id][
'roles_label'] = implode(
'<br />', $roles);
444 $a_user_data[
$user_id][
'roles'] = $this->participants->setRoleOrderPosition(
$user_id);
446 if ($this->show_lp_status_sync) {
449 $passed_timestamp =
'';
450 if ($a_user_data[
$user_id][
"passed_info"]) {
451 $pinfo = $a_user_data[
$user_id][
"passed_info"];
452 if ($pinfo[
"user_id"]) {
453 if ($pinfo[
"user_id"] < 0) {
454 $passed_info = $this->
lng->txt(
"crs_passed_status_system");
455 } elseif ($pinfo[
"user_id"] > 0) {
457 $passed_info = $this->
lng->txt(
"crs_passed_status_manual_by") .
": " . $name[
"login"];
460 if ($pinfo[
"timestamp"]) {
462 $passed_timestamp = $pinfo[
"timestamp"];
465 $a_user_data[
$user_id][
"passed_info"] = $passed_info;
466 $a_user_data[
$user_id][
"passed_timestamp"] = $passed_timestamp;
471 if ($udf_ids !== []) {
472 $a_user_data = array_reduce(
473 $this->
profile->getDataForMultiple($usr_ids),
474 function (array
$c, ProfileData $v): array {
479 foreach ($udf_ids as $field_id) {
480 $c[$v->getId()][
'udf_' . $field_id] = $v->getAdditionalFieldByIdentifier($field_id);
487 if ($odf_ids !== []) {
489 foreach (
$data as $usr_id => $fields) {
490 $usr_id = (
int) $usr_id;
492 if (!$this->
checkAcceptance($usr_id) || !in_array($usr_id, $usr_ids)) {
496 foreach ($fields as $field_id => $value) {
497 $a_user_data[$usr_id][
'odf_' . $field_id] = $value;
503 if (!isset($a_user_data[$usr_id])) {
507 if ($usr_id == $edit_info[
'update_user']) {
508 $a_user_data[$usr_id][
'odf_last_update'] =
'';
509 $a_user_data[$usr_id][
'odf_info_txt'] = $this->
lng->txt(
'cdf_edited_by_self');
511 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_' . $edit_info[
'editing_time']->get(
IL_CAL_UNIX));
515 $a_user_data[$usr_id][
'odf_last_update'] = $edit_info[
'update_user'];
516 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_' . $edit_info[
'editing_time']->get(
IL_CAL_UNIX));
519 $a_user_data[$usr_id][
'odf_info_txt'] = ($name[
'firstname'] .
' ' . $name[
'lastname'] .
', ' .
ilDatePresentation::formatDate($edit_info[
'editing_time']));
529 ) as $buser => $booking) {
530 if (isset($a_user_data[$buser])) {
531 $a_user_data[$buser][
'consultation_hour'] = $booking[0][
'dt'];
532 $a_user_data[$buser][
'consultation_hour_end'] = $booking[0][
'dtend'];
533 $a_user_data[$buser][
'consultation_hours'] = $booking;
552 if (isset($this->cached_user_names[
$user_id])) {
553 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.
bool $show_lp_status_sync
fillRow(array $a_set)
Standard Version of Fill Row.
ilPrivacySettings $privacy
__construct(object $a_parent_obj, ilObject $rep_object, bool $a_show_learning_progress=false, bool $a_show_timings=false, bool $a_show_lp_status_sync=false, ?ilCertificateUserForObjectPreloader $preloader=null)
ilCertificateUserForObjectPreloader $preLoader
lookupUserName(int $user_id)
bool $show_learning_progress
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
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
static _enabledLearningProgress()
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)
setEnableNumInfo(bool $a_val)
setExternalSegmentation(bool $a_val)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setEnableTitle(bool $a_enabletitle)
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
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)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setTopCommands(bool $a_val)
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