18 declare(strict_types=1);
50 $this->
lng->loadLanguageModule(
'lso');
51 $this->
lng->loadLanguageModule(
'trac');
52 $this->
lng->loadLanguageModule(
'rbac');
53 $this->
lng->loadLanguageModule(
'mmbr');
54 $this->
lng->loadLanguageModule(
'user');
55 $this->
lng->loadLanguageModule(
'ps');
72 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"Modules/LearningSequence");
77 $this->
addColumn($this->
lng->txt(
'name'),
'lastname',
'20%');
82 $this->
addColumn($all_cols[$col][
'txt'], $col);
90 $this->
addColumn($this->
lng->txt(
'first_access'),
"first_access");
91 $this->
addColumn($this->
lng->txt(
'last_access'),
"last_access");
93 $this->
addColumn($this->
lng->txt(
'completed_steps'),
"completed_steps");
94 $this->
addColumn($this->
lng->txt(
'last_visited_step'),
"last_visited_step");
95 $this->
addColumn($this->
lng->txt(
'lso_notification'),
'notification');
101 $this->
enable(
'select_all');
107 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->
lng->txt(
'mmbr_btn_mail_selected_users'));
112 protected function fillRow(array $a_set): void
114 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
115 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
116 $this->tpl->setVariable(
'VAL_LOGIN', $a_set[
'login']);
119 !$this->
access->checkAccessOfUser((
int) $a_set[
'usr_id'],
'read',
'', $this->getRepositoryObject()->getRefId()) &&
120 is_array($info = $this->
access->getInfo())
122 $this->tpl->setCurrentBlock(
'access_warning');
123 $this->tpl->setVariable(
'PARENT_ACCESS', $info[0][
'text']);
124 $this->tpl->parseCurrentBlock();
128 $this->tpl->setCurrentBlock(
'access_warning');
129 $this->tpl->setVariable(
'PARENT_ACCESS', $this->
lng->txt(
'usr_account_inactive'));
130 $this->tpl->parseCurrentBlock();
137 if (array_key_exists(
'prtf', $a_set) && is_array($a_set[
'prtf'])) {
138 foreach ($a_set[
'prtf'] as $prtf_url => $prtf_txt) {
139 $tmp[] =
'<a href="' . $prtf_url .
'">' . $prtf_txt .
'</a>';
142 $this->tpl->setCurrentBlock(
'custom_fields');
143 $this->tpl->setVariable(
'VAL_CUST', implode(
'<br />', $tmp));
144 $this->tpl->parseCurrentBlock();
147 $this->tpl->setCurrentBlock(
'custom_fields');
148 $this->tpl->setVariable(
'VAL_CUST', (
string) $a_set[
'roles_label']);
149 $this->tpl->parseCurrentBlock();
152 $this->tpl->setCurrentBlock(
'custom_fields');
153 $this->tpl->setVariable(
'VAL_CUST', ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((
int) $a_set[
'usr_id']));
154 $this->tpl->parseCurrentBlock();
157 $this->tpl->setCurrentBlock(
'custom_fields');
158 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
159 $this->tpl->parseCurrentBlock();
164 $this->tpl->setVariable(
'VAL_POSTNAME',
'participants');
171 $this->tpl->setVariable(
'FIRST_ACCESS', $this->
getFirstAccess((
int) $a_set[
'usr_id']));
172 $this->tpl->setVariable(
'LAST_ACCESS', $this->
getLastAccess((
int) $a_set[
'usr_id']));
175 $this->tpl->setVariable(
'COMPLETED_STEPS', $this->
getCompletedSteps((
int) $a_set[
'usr_id']));
176 $this->tpl->setVariable(
'LAST_VISITED_STEP', $this->
getLastVisitedStep((
int) $a_set[
'usr_id']));
179 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', (
int) $a_set[
'usr_id']);
180 $this->tpl->setVariable(
181 'VAL_NOTIFICATION_CHECKED',
182 $a_set[
'notification'] ?
'checked="checked"' :
'' 187 $this->tpl->setVariable(
'VAL_LOGIN', $a_set[
'login']);
197 if (
$data[$user_id] ===
'-1') {
201 return $data[$user_id];
211 if (
$data[$user_id] ===
'-1') {
215 return $data[$user_id];
226 $completion_states = $this->rep_object->getLPCompletionStates();
228 foreach ($learner_items as $learner_item) {
229 if (in_array($learner_item->getLearningProgressStatus(), $completion_states)) {
234 return $passed .
" / " . count($learner_items);
249 if (
$data[$user_id] === -1) {
265 $ls_participants = $this->participants->getParticipants();
267 $ls_participants = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
274 if (!$ls_participants) {
279 $lso_user_data = $this->parent_gui->readMemberData(
285 unset($additional_fields[
'prtf']);
286 unset($additional_fields[
'roles']);
287 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);
296 if (substr($field, 0, 3) ==
'odf') {
297 $odf_ids[] = substr($field, 4);
301 $usr_data_fields[] = $field;
309 $this->current_filter[
'login'],
321 $user_data = array();
322 $filtered_user_ids = array();
323 $local_roles = $this->parent_gui->getLocalRoles();
325 foreach ($usr_data[
'set'] as $ud) {
326 $user_id = $ud[
'usr_id'];
328 if ($this->current_filter[
'roles']) {
329 if (!$this->rbac_review->isAssigned($user_id, $this->current_filter[
'roles'])) {
334 if (array_key_exists(
'org_units', $this->current_filter)
335 && $this->current_filter[
'org_units'] !==
'' 337 $org_unit = $this->current_filter[
'org_units'];
339 $user_units = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((
int) $user_id);
340 if (strpos($user_units,
$title) ===
false) {
345 $filtered_user_ids[] = $user_id;
346 $user_data[$user_id] = array_merge($ud, $lso_user_data[$user_id]);
349 foreach ($local_roles as $role_id => $role_name) {
350 if ($this->rbac_review->isAssigned((
int) $user_id, $role_id)) {
351 $roles[] = $role_name;
355 $user_data[$user_id][
'name'] = $user_data[$user_id][
'lastname'] .
', ' . $user_data[$user_id][
'firstname'];
356 $user_data[$user_id][
'roles_label'] = implode(
'<br />', $roles);
357 $user_data[$user_id][
'roles'] = $this->participants->setRoleOrderPosition((
int) $user_id);
361 if ($udf_ids !== []) {
363 foreach (
$data as $usr_id => $fields) {
368 foreach ($fields as $field_id => $value) {
369 $user_data[$usr_id][
'udf_' . $field_id] = $value;
386 $columns = $ef->getSelectableFieldsInfo(
390 if ($this->
settings->get(
'user_portfolios')) {
391 $columns[
'prtf'] = array(
392 'txt' => $this->
lng->txt(
'obj_prtf'),
400 'txt' => $this->
lng->txt(
'objs_role'),
406 'txt' => $this->
lng->txt(
"org_units"),
static lookupData(array $a_user_ids, array $a_field_ids)
Lookup data.
ilPrivacySettings $privacy_settings
const EXTENDED_DATA_LAST_ACCESS
getLastAccess(int $user_id)
enable(string $a_module_name)
ilObjUserTracking $obj_user_tracking
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
getCompletedSteps(int $user_id)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
checkAcceptance(int $a_usr_id)
setFormName(string $a_name="")
ilRbacReview $rbac_review
static _lookupObjId(int $ref_id)
initFilter()
Init table filter.
static _enabledLearningProgress()
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
static _lookupTitle(int $obj_id)
setDefaultOrderField(string $a_defaultorderfield)
Singleton class that stores all privacy settings.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
__construct(ilLearningSequenceMembershipGUI $parent_gui, ilObjLearningSequence $ls_object, ilObjUserTracking $obj_user_tracking, ilPrivacySettings $privacy_settings, ilLanguage $lng, ilAccess $access, ilRbacReview $rbac_review, ilSetting $settings)
getFirstAccess(int $user_id)
static _getInstanceByType(string $a_type)
Get Singleton Instance.
__construct(Container $dic, ilPlugin $plugin)
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)
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.
ilLearningSequenceMembershipGUI $parent_gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getLastVisitedStep(int $user_id)
Different to the concept we decide to use the title of the object instead of its actually number in t...
addMultiCommand(string $a_cmd, string $a_text)
determineOffsetAndOrder(bool $a_omit_offset=false)
GUI class for learning sequence membership features.
static _lookupActive(int $a_usr_id)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
ilObjLearningSequence $ls_object
setPrefix(string $a_prefix)