3 declare(strict_types=1);
30 $this->parent_gui = $parent_gui;
31 $this->rep_object = $ls_object;
34 $this->obj_user_tracking = $obj_user_tracking;
35 $this->privacy_settings = $privacy_settings;
37 $this->access = $access;
38 $this->rbac_review = $rbac_review;
41 $this->lng->loadLanguageModule(
'lso');
42 $this->lng->loadLanguageModule(
'trac');
43 $this->lng->loadLanguageModule(
'rbac');
44 $this->lng->loadLanguageModule(
'mmbr');
45 $this->lng->loadLanguageModule(
'user');
46 $this->lng->loadLanguageModule(
'ps');
53 parent::__construct($parent_gui,
'participants');
63 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"Modules/LearningSequence");
68 $this->
addColumn($this->lng->txt(
'name'),
'lastname',
'20%');
69 $this->
addColumn($this->lng->txt(
'login'),
'login');
73 $this->
addColumn($all_cols[$col][
'txt'], $col);
80 $this->
addColumn($this->lng->txt(
'first_access'),
"first_access");
81 $this->
addColumn($this->lng->txt(
'last_access'),
"last_access");
83 $this->
addColumn($this->lng->txt(
'completed_steps'),
"completed_steps");
84 $this->
addColumn($this->lng->txt(
'last_visited_step'),
"last_visited_step");
85 $this->
addColumn($this->lng->txt(
'lso_notification'),
'notification');
86 $this->
addColumn($this->lng->txt(
''),
'optional');
91 $this->
enable(
'select_all');
96 $this->
addMultiCommand(
'confirmDeleteParticipants', $this->lng->txt(
'remove'));
97 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->lng->txt(
'mmbr_btn_mail_selected_users'));
98 $this->
addMultiCommand(
'addToClipboard', $this->lng->txt(
'clipboard_add_btn'));
99 $this->
addCommandButton(
'updateParticipantsStatus', $this->lng->txt(
'save'));
104 $this->tpl->setVariable(
'VAL_ID', $set[
'usr_id']);
105 $this->tpl->setVariable(
'VAL_NAME', $set[
'lastname'] .
', ' . $set[
'firstname']);
106 $this->tpl->setVariable(
'VAL_LOGIN', $set[
'login']);
109 !$this->access->checkAccessOfUser($set[
'usr_id'],
'read',
'', $this->getRepositoryObject()->getRefId()) &&
110 is_array(
$info = $this->access->getInfo())
112 $this->tpl->setCurrentBlock(
'access_warning');
113 $this->tpl->setVariable(
'PARENT_ACCESS',
$info[0][
'text']);
114 $this->tpl->parseCurrentBlock();
118 $this->tpl->setCurrentBlock(
'access_warning');
119 $this->tpl->setVariable(
'PARENT_ACCESS', $this->lng->txt(
'usr_account_inactive'));
120 $this->tpl->parseCurrentBlock();
127 if (is_array($set[
'prtf'])) {
128 foreach ($set[
'prtf'] as $prtf_url => $prtf_txt) {
129 $tmp[] =
'<a href="' . $prtf_url .
'">' . $prtf_txt .
'</a>';
132 $this->tpl->setCurrentBlock(
'custom_fields');
133 $this->tpl->setVariable(
'VAL_CUST', (
string) implode(
'<br />', $tmp));
134 $this->tpl->parseCurrentBlock();
137 $this->tpl->setCurrentBlock(
'custom_fields');
138 $this->tpl->setVariable(
'VAL_CUST', (
string) $set[
'roles_label']);
139 $this->tpl->parseCurrentBlock();
142 $this->tpl->setCurrentBlock(
'custom_fields');
143 $this->tpl->setVariable(
'VAL_CUST', (
string) ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($set[
'usr_id']));
144 $this->tpl->parseCurrentBlock();
147 $this->tpl->setCurrentBlock(
'custom_fields');
148 $this->tpl->setVariable(
'VAL_CUST', isset($set[$field]) ? (
string) $set[$field] :
'');
149 $this->tpl->parseCurrentBlock();
154 $this->tpl->setVariable(
'VAL_POSTNAME',
'participants');
155 $this->tpl->setVariable(
'FIRST_ACCESS', $this->
getFirstAccess((
int) $set[
'usr_id']));
156 $this->tpl->setVariable(
'LAST_ACCESS', $this->
getLastAccess((
int) $set[
'usr_id']));
157 $this->tpl->setVariable(
'COMPLETED_STEPS', $this->
getCompletedSteps((
int) $set[
'usr_id']));
158 $this->tpl->setVariable(
'LAST_VISITED_STEP', $this->
getLastVisitedStep((
int) $set[
'usr_id']));
161 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $set[
'usr_id']);
162 $this->tpl->setVariable(
163 'VAL_NOTIFICATION_CHECKED',
164 $set[
'notification'] ?
'checked="checked"' :
'' 169 $this->tpl->setVariable(
'VAL_LOGIN', $set[
'login']);
179 if (
$data[$user_id] === -1) {
183 return $data[$user_id];
193 if (
$data[$user_id] === -1) {
197 return $data[$user_id];
203 $learner_items = array();
209 $completion_states = $this->rep_object->getLPCompletionStates();
211 foreach ($learner_items as $learner_item) {
212 if (in_array($learner_item->getLearningProgressStatus(), $completion_states)) {
217 return $passed .
" / " . count($learner_items);
232 if (
$data[$user_id] === -1) {
248 $ls_participants = $this->participants->getParticipants();
250 $ls_participants = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
257 if (!$ls_participants) {
262 $lso_user_data = $this->parent_gui->readMemberData(
268 unset($additional_fields[
'prtf']);
269 unset($additional_fields[
'roles']);
270 unset($additional_fields[
'org_units']);
272 $udf_ids = $usr_data_fields = $odf_ids = array();
273 foreach ($additional_fields as $field) {
274 if (substr($field, 0, 3) ==
'udf') {
275 $udf_ids[] = substr($field, 4);
279 if (substr($field, 0, 3) ==
'odf') {
280 $odf_ids[] = substr($field, 4);
284 $usr_data_fields[] = $field;
292 $this->current_filter[
'login'],
304 $user_data = array();
305 $filtered_user_ids = array();
306 $local_roles = $this->parent_gui->getLocalRoles();
308 foreach ($usr_data[
'set'] as $ud) {
309 $user_id = $ud[
'usr_id'];
311 if ($this->current_filter[
'roles']) {
312 if (!$this->rbac_review->isAssigned($user_id, $this->current_filter[
'roles'])) {
317 if ($this->current_filter[
'org_units']) {
318 $org_unit = $this->current_filter[
'org_units'];
320 $user_units = (string) ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
321 if (strpos($user_units,
$title) ===
false) {
326 $filtered_user_ids[] = $user_id;
327 $user_data[$user_id] = array_merge($ud, (array) $lso_user_data[$user_id]);
330 foreach ($local_roles as $role_id => $role_name) {
331 if ($this->rbac_review->isAssigned($user_id, $role_id)) {
332 $roles[] = $role_name;
336 $user_data[$user_id][
'name'] = $user_data[$user_id][
'lastname'] .
', ' . $user_data[$user_id][
'firstname'];
337 $user_data[$user_id][
'roles_label'] = implode(
'<br />', $roles);
338 $user_data[$user_id][
'roles'] = $this->participants->setRoleOrderPosition($user_id);
344 foreach (
$data as $usr_id => $fields) {
349 foreach ($fields as $field_id => $value) {
350 $user_data[$usr_id][
'udf_' . $field_id] = $value;
361 return $this->
setData($user_data);
368 $columns = $ef->getSelectableFieldsInfo(
372 if ($this->
settings->get(
'user_portfolios')) {
374 'txt' => $this->lng->txt(
'obj_prtf'),
382 'txt' => $this->lng->txt(
'objs_role'),
387 'org_units' => array(
388 'txt' => $this->lng->txt(
"org_units"),
showActionLinks($a_set)
show edit links
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
const EXTENDED_DATA_LAST_ACCESS
getLastAccess(int $user_id)
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getParticipants()
Get participants.
Class ilObjLearningSequence.
getCompletedSteps(int $user_id)
static _lookupTitle($a_id)
lookup object title
getOrderDirection()
Get order direction.
initSettings()
Init acceptance.
static lookupData($a_user_ids, $a_field_ids)
Lookup data.
initFilter()
Init table filter.
static _enabledLearningProgress()
check wether learing progress is enabled or not
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
static _getInstanceByType($a_type)
Get Singleton Instance.
Singleton class that stores all privacy settings.
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
enable($a_module_name)
enables particular modules of table
getSelectedColumns()
Get selected columns.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
__construct(ilLearningSequenceMembershipGUI $parent_gui, ilObjLearningSequence $ls_object, ilObjUserTracking $obj_user_tracking, ilPrivacySettings $privacy_settings, ilLanguage $lng, ilAccess $access, ilRbacReview $rbac_review, ilSetting $settings)
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
getFirstAccess(int $user_id)
setFormName($a_formname="")
Set Form name.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
checkAcceptance($a_usr_id)
Check acceptance.
static _lookupActive($a_usr_id)
Check user account active.
getLastVisitedStep(int $user_id)
Different to the concept we decide to use the title of the object instead of its actually number in t...
GUI class for learning sequence membership features.
static getUserListData( $a_order_field, $a_order_dir, $a_offset, $a_limit, $a_string_filter="", $a_activation_filter="", $a_last_login_filter=null, $a_limited_access_filter=false, $a_no_courses_filter=false, $a_course_group_filter=0, $a_role_filter=0, $a_user_folder_filter=null, $a_additional_fields='', $a_user_filter=null, $a_first_letter="", $a_authentication_filter=null)
Get data for user administration list.
class ilRbacReview Contains Review functions of core Rbac.