25 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
58 $a_show_learning_progress =
false,
59 $a_show_timings =
false,
60 $a_show_edit_link=
true,
62 $a_show_lp_status_sync =
false)
66 $this->show_learning_progress = $a_show_learning_progress;
67 $this->show_timings = $a_show_timings;
68 $this->show_edit_link = $a_show_edit_link;
69 $this->show_lp_status_sync = $a_show_lp_status_sync;
72 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
75 $this->show_lp_status_sync =
false;
79 $this->lng->loadLanguageModule(
'crs');
80 $this->lng->loadLanguageModule(
'trac');
83 $this->type = $a_type;
86 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
90 $this->
setId(
'crs_' . $a_type .
'_' . $a_role_id.
'_'. $a_parent_obj->object->getId());
98 $this->
addColumn($this->lng->txt(
'name'),
'lastname',
'20%');
103 $this->
addColumn($all_cols[$col][
'txt'], $col);
106 if($this->show_learning_progress)
108 $this->
addColumn($this->lng->txt(
'learning_progress'),
'progress');
111 if($this->privacy->enabledCourseAccessTimes())
113 $this->
addColumn($this->lng->txt(
'last_access'),
'access_ut',
'16em');
116 $this->
addColumn($this->lng->txt(
'crs_member_passed'),
'passed');
117 if($this->show_lp_status_sync)
119 $this->
addColumn($this->lng->txt(
'crs_member_passed_status_changed'),
'passed_info');
122 if($this->type ==
'admin')
125 $this->
addColumn($this->lng->txt(
'crs_notification_list_title'),
'notification');
128 elseif($this->type ==
'tutor')
131 $this->
addColumn($this->lng->txt(
'crs_notification_list_title'),
'notification');
134 elseif($this->type ==
'member')
137 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
143 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
147 $this->
addColumn($this->lng->txt(
''),
'optional');
149 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"Modules/Course");
157 $this->
enable(
'select_all');
177 include_once
"Services/Certificate/classes/class.ilCertificate.php";
179 if($this->enable_certificates)
183 if($this->enable_certificates)
185 $lng->loadLanguageModule(
'certificate');
194 $this->role_id = $a_role_id;
217 if(self::$all_columns)
222 include_once
'./Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
224 self::$all_columns = $ef->getSelectableFieldsInfo($this->
getParentObject()->object->getId());
239 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
240 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
242 if(!$ilAccess->checkAccessOfUser($a_set[
'usr_id'],
'read',
'', $this->getParentObject()->object->getRefId()) and
243 is_array($info = $ilAccess->getInfo()))
245 $this->tpl->setCurrentBlock(
'access_warning');
246 $this->tpl->setVariable(
'PARENT_ACCESS', $info[0][
'text']);
247 $this->tpl->parseCurrentBlock();
252 $this->tpl->setCurrentBlock(
'access_warning');
253 $this->tpl->setVariable(
'PARENT_ACCESS', $this->lng->txt(
'usr_account_inactive'));
254 $this->tpl->parseCurrentBlock();
263 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_' . $a_set[
'gender']) :
'';
264 $this->tpl->setCurrentBlock(
'custom_fields');
265 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
266 $this->tpl->parseCurrentBlock();
271 $this->tpl->setCurrentBlock(
'custom_fields');
272 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
273 $this->tpl->parseCurrentBlock();
277 $this->tpl->setCurrentBlock(
'custom_fields');
278 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
279 $this->tpl->parseCurrentBlock();
284 if($this->privacy->enabledCourseAccessTimes())
286 $this->tpl->setVariable(
'VAL_ACCESS', $a_set[
'access_time']);
288 if($this->show_learning_progress)
290 $this->tpl->setCurrentBlock(
'lp');
291 switch($a_set[
'progress'])
294 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
299 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
304 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
309 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
313 $this->tpl->parseCurrentBlock();
315 if($this->type ==
'admin')
317 $this->tpl->setVariable(
'VAL_POSTNAME',
'admins');
318 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
319 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
321 elseif($this->type ==
'tutor')
323 $this->tpl->setVariable(
'VAL_POSTNAME',
'tutors');
324 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
325 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
327 elseif($this->type ==
'member')
329 $this->tpl->setCurrentBlock(
'blocked');
330 $this->tpl->setVariable(
'VAL_POSTNAME',
'members');
331 $this->tpl->setVariable(
'VAL_BLOCKED_ID',$a_set[
'usr_id']);
332 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED',($a_set[
'blocked'] ?
'checked="checked"' :
''));
333 $this->tpl->parseCurrentBlock();
337 $this->tpl->setCurrentBlock(
'blocked');
338 $this->tpl->setVariable(
'VAL_BLOCKED_ID', $a_set[
'usr_id']);
339 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED', ($a_set[
'blocked'] ?
'checked="checked"' :
''));
340 $this->tpl->parseCurrentBlock();
342 $this->tpl->setVariable(
'VAL_POSTNAME',
'roles');
345 $this->tpl->setVariable(
'VAL_PASSED_ID',$a_set[
'usr_id']);
346 $this->tpl->setVariable(
'VAL_PASSED_CHECKED',($a_set[
'passed'] ?
'checked="checked"' :
''));
348 if($this->show_lp_status_sync)
350 $this->tpl->setVariable(
'PASSED_INFO', $a_set[
"passed_info"]);
353 $this->ctrl->setParameter($this->parent_obj,
'member_id', $a_set[
'usr_id']);
354 if($this->show_edit_link)
356 $this->tpl->setCurrentBlock(
'link');
357 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj,
'editMember'));
358 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'edit'));
359 $this->tpl->parseCurrentBlock();
361 if($a_set[
'passed'] && $this->enable_certificates)
363 $this->tpl->setCurrentBlock(
'link');
364 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj,
'deliverCertificate'));
365 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'download_certificate'));
366 $this->tpl->parseCurrentBlock();
368 $this->ctrl->clearParameters($this->parent_obj);
370 if($this->show_timings)
372 $this->ctrl->setParameterByClass(
'ilcoursecontentgui',
'member_id', $a_set[
'usr_id']);
373 $this->tpl->setCurrentBlock(
'link');
374 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'showUserTimings'));
375 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'timings_timings'));
376 $this->tpl->parseCurrentBlock();
392 include_once
'./Services/User/classes/class.ilUserQuery.php';
395 unset($additional_fields[
"firstname"]);
396 unset($additional_fields[
"lastname"]);
397 unset($additional_fields[
"last_login"]);
398 unset($additional_fields[
"access_until"]);
400 $udf_ids = $usr_data_fields = $odf_ids = array();
401 foreach($additional_fields as $field)
403 if(substr($field, 0, 3) ==
'udf')
405 $udf_ids[] = substr($field, 4);
408 if(substr($field, 0, 3) ==
'odf')
410 $odf_ids[] = substr($field, 4);
414 $usr_data_fields[] = $field;
433 foreach((array) $usr_data[
'set'] as $user)
435 $usr_ids[] = $user[
'usr_id'];
439 $course_user_data = $this->
getParentObject()->readMemberData($usr_ids,$this->type ==
'admin');
440 $a_user_data = array();
441 foreach((array) $usr_data[
'set'] as $ud)
443 $a_user_data[$ud[
'usr_id']] = array_merge($ud,$course_user_data[$ud[
'usr_id']]);
445 if($this->show_lp_status_sync)
449 if($a_user_data[$ud[
'usr_id']][
"passed_info"])
451 $pinfo = $a_user_data[$ud[
'usr_id']][
"passed_info"];
452 if($pinfo[
"user_id"])
454 if($pinfo[
"user_id"] < 0)
456 $passed_info = $this->lng->txt(
"crs_passed_status_system");
458 else if($pinfo[
"user_id"] > 0)
461 $passed_info = $this->lng->txt(
"crs_passed_status_manual_by").
": ".$name[
"login"];
464 if($pinfo[
"timestamp"])
466 $passed_info .=
"<br />".ilDatePresentation::formatDate($pinfo[
"timestamp"]);
469 $a_user_data[$ud[
'usr_id']][
"passed_info"] = $passed_info;
476 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
485 foreach($fields as $field_id => $value)
487 $a_user_data[
$usr_id][
'udf_' . $field_id] = $value;
494 include_once
'./Modules/Course/classes/Export/class.ilCourseUserData.php';
504 foreach($fields as $field_id => $value)
506 $a_user_data[
$usr_id][
'odf_' . $field_id] = $value;
511 foreach($usr_data[
'set'] as $user)
519 foreach($usr_data_fields as $field)
521 $a_user_data[$user[
'usr_id']][$field] = $user[$field] ? $user[$field] :
'';
524 $this->
setMaxCount($usr_data[
'cnt'] ? $usr_data[
'cnt'] : 0);
525 return $this->
setData($a_user_data);
530 if(!self::$confirmation_required)
534 if(!self::$export_allowed)
538 return in_array($a_usr_id, self::$accepted_ids);
547 if(self::$accepted_ids !== NULL)
555 include_once
'Services/Membership/classes/class.ilMemberAgreement.php';