19declare(strict_types=1);
57 $this->
lng->loadLanguageModule(
'lso');
58 $this->
lng->loadLanguageModule(
'trac');
59 $this->
lng->loadLanguageModule(
'rbac');
60 $this->
lng->loadLanguageModule(
'mmbr');
61 $this->
lng->loadLanguageModule(
'user');
62 $this->
lng->loadLanguageModule(
'ps');
79 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"components/ILIAS/LearningSequence");
84 $this->
addColumn($this->
lng->txt(
'name'),
'lastname',
'20%');
89 $this->
addColumn($all_cols[$col][
'txt'], $col);
97 $this->
addColumn($this->
lng->txt(
'first_access'),
"first_access");
98 $this->
addColumn($this->
lng->txt(
'last_access'),
"last_access");
100 $this->
addColumn($this->
lng->txt(
'completed_steps'),
"completed_steps");
101 $this->
addColumn($this->
lng->txt(
'last_visited_step'),
"last_visited_step");
102 $this->
addColumn($this->
lng->txt(
'lso_notification'),
'notification');
108 $this->
enable(
'select_all');
114 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->
lng->txt(
'mmbr_btn_mail_selected_users'));
119 protected function fillRow(array $a_set): void
121 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
122 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
123 $this->tpl->setVariable(
'VAL_LOGIN', $a_set[
'login']);
126 !$this->
access->checkAccessOfUser((
int) $a_set[
'usr_id'],
'read',
'', $this->getRepositoryObject()->getRefId()) &&
129 $this->tpl->setCurrentBlock(
'access_warning');
130 $this->tpl->setVariable(
'PARENT_ACCESS',
$info[0][
'text']);
131 $this->tpl->parseCurrentBlock();
135 $this->tpl->setCurrentBlock(
'access_warning');
136 $this->tpl->setVariable(
'PARENT_ACCESS', $this->
lng->txt(
'usr_account_inactive'));
137 $this->tpl->parseCurrentBlock();
144 if (array_key_exists(
'prtf', $a_set) && is_array($a_set[
'prtf'])) {
145 foreach ($a_set[
'prtf'] as $prtf_url => $prtf_txt) {
146 $tmp[] =
'<a href="' . $prtf_url .
'">' . $prtf_txt .
'</a>';
149 $this->tpl->setCurrentBlock(
'custom_fields');
150 $this->tpl->setVariable(
'VAL_CUST', implode(
'<br />', $tmp));
151 $this->tpl->parseCurrentBlock();
154 $this->tpl->setCurrentBlock(
'custom_fields');
155 $this->tpl->setVariable(
'VAL_CUST', (
string) $a_set[
'roles_label']);
156 $this->tpl->parseCurrentBlock();
159 $this->tpl->setCurrentBlock(
'custom_fields');
160 $this->tpl->setVariable(
'VAL_CUST', ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((
int) $a_set[
'usr_id']));
161 $this->tpl->parseCurrentBlock();
164 $this->tpl->setCurrentBlock(
'custom_fields');
165 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
166 $this->tpl->parseCurrentBlock();
171 $this->tpl->setVariable(
'VAL_POSTNAME',
'participants');
178 $this->tpl->setVariable(
'FIRST_ACCESS', $this->
getFirstAccess((
int) $a_set[
'usr_id']));
179 $this->tpl->setVariable(
'LAST_ACCESS', $this->
getLastAccess((
int) $a_set[
'usr_id']));
182 $this->tpl->setVariable(
'COMPLETED_STEPS', $this->
getCompletedSteps((
int) $a_set[
'usr_id']));
183 $this->tpl->setVariable(
'LAST_VISITED_STEP', $this->
getLastVisitedStep((
int) $a_set[
'usr_id']));
186 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', (
int) $a_set[
'usr_id']);
187 $this->tpl->setVariable(
188 'VAL_NOTIFICATION_CHECKED',
189 $a_set[
'notification'] ?
'checked="checked"' :
''
194 $this->tpl->setVariable(
'VAL_LOGIN', $a_set[
'login']);
233 $completion_states = $this->rep_object->getLPCompletionStates();
235 foreach ($learner_items as $learner_item) {
236 if (in_array($learner_item->getLearningProgressStatus(), $completion_states)) {
241 return $passed .
" / " . count($learner_items);
272 $ls_participants = $this->participants->getParticipants();
274 $ls_participants = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
281 if (!$ls_participants) {
286 $lso_user_data = $this->parent_gui->readMemberData(
292 unset($additional_fields[
'prtf']);
293 unset($additional_fields[
'roles']);
294 unset($additional_fields[
'org_units']);
296 $udf_ids = $usr_data_fields = $odf_ids = array();
297 foreach ($additional_fields as $field) {
298 if (substr($field, 0, 3) ==
'udf') {
299 $udf_ids[] = substr($field, 4);
303 if (substr($field, 0, 3) ==
'odf') {
304 $odf_ids[] = substr($field, 4);
308 $usr_data_fields[] = $field;
316 $this->current_filter[
'login'],
328 $user_data = array();
329 $filtered_user_ids = array();
330 $local_roles = $this->parent_gui->getLocalRoles();
332 foreach ($usr_data[
'set'] as $ud) {
335 if ($this->current_filter[
'roles']) {
336 if (!$this->rbac_review->isAssigned(
$user_id, $this->current_filter[
'roles'])) {
341 if (array_key_exists(
'org_units', $this->current_filter)
342 && $this->current_filter[
'org_units'] !==
''
344 $org_unit = $this->current_filter[
'org_units'];
346 $user_units = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((
int)
$user_id);
347 if (strpos($user_units,
$title) ===
false) {
356 foreach ($local_roles as $role_id => $role_name) {
357 if ($this->rbac_review->isAssigned((
int)
$user_id, $role_id)) {
358 $roles[] = $role_name;
363 $user_data[
$user_id][
'roles_label'] = implode(
'<br />', $roles);
364 $user_data[
$user_id][
'roles'] = $this->participants->setRoleOrderPosition((
int)
$user_id);
368 if ($udf_ids !== []) {
369 $user_data = array_reduce(
370 $this->
profile->getDataForMultiple($filtered_user_ids),
371 function (array
$c, ProfileData $v) use ($udf_ids): array {
376 foreach ($udf_ids as $field_id) {
377 $c[$v->getId()][
'udf_' . $field_id] = $v->getAdditionalFieldByIdentifier($field_id);
396 $columns = $ef->getSelectableFieldsInfo(
400 if ($this->
settings->get(
'user_portfolios')) {
401 $columns[
'prtf'] = array(
402 'txt' => $this->
lng->txt(
'obj_prtf'),
410 'txt' => $this->
lng->txt(
'objs_role'),
416 'txt' => $this->lng->txt(
"org_units"),
Class ilAccessHandler Checks access for ILIAS objects.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _getInstanceByType(string $a_type)
Get Singleton Instance.
GUI class for learning sequence membership features.
getLastAccess(int $user_id)
ilLearningSequenceMembershipGUI $parent_gui
ilRbacReview $rbac_review
ilPrivacySettings $privacy_settings
__construct(ilLearningSequenceMembershipGUI $parent_gui, ilObjLearningSequence $ls_object, ilObjUserTracking $obj_user_tracking, ilPrivacySettings $privacy_settings, ilLanguage $lng, ilAccess $access, ilRbacReview $rbac_review, ilSetting $settings, Profile $profile)
fillRow(array $a_set)
Standard Version of Fill Row.
getFirstAccess(int $user_id)
ilObjUserTracking $obj_user_tracking
getSelectableColumns()
Get selectable columns.
getLastVisitedStep(int $user_id)
Different to the concept we decide to use the title of the object instead of its actually number in t...
ilObjLearningSequence $ls_object
getCompletedSteps(int $user_id)
static _enabledLearningProgress()
const EXTENDED_DATA_LAST_ACCESS
static _lookupActive(int $a_usr_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
checkAcceptance(int $a_usr_id)
initFilter()
Init table filter.
Singleton class that stores all privacy settings.
class ilRbacReview Contains Review functions of core Rbac.
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc