25 include_once
'./Services/Membership/classes/class.ilParticipantsTableGUI.php';
53 $a_show_learning_progress =
false,
54 $a_show_timings =
false,
55 $a_show_edit_link=
true,
57 $a_show_lp_status_sync =
false)
61 $this->show_learning_progress = $a_show_learning_progress;
62 $this->show_timings = $a_show_timings;
63 $this->show_edit_link = $a_show_edit_link;
64 $this->show_lp_status_sync = $a_show_lp_status_sync;
67 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
70 $this->show_lp_status_sync =
false;
74 $this->lng->loadLanguageModule(
'crs');
75 $this->lng->loadLanguageModule(
'trac');
78 $this->type = $a_type;
81 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
85 $this->
setId(
'crs_' . $a_type .
'_' . $a_role_id.
'_'. $a_parent_obj->object->getId());
93 $this->
addColumn($this->lng->txt(
'name'),
'lastname',
'20%');
98 $this->
addColumn($all_cols[$col][
'txt'], $col);
101 if($this->show_learning_progress)
103 $this->
addColumn($this->lng->txt(
'learning_progress'),
'progress');
106 if($this->privacy->enabledCourseAccessTimes())
108 $this->
addColumn($this->lng->txt(
'last_access'),
'access_ut',
'16em');
111 $this->
addColumn($this->lng->txt(
'crs_member_passed'),
'passed');
112 if($this->show_lp_status_sync)
114 $this->
addColumn($this->lng->txt(
'crs_member_passed_status_changed'),
'passed_info');
117 if($this->type ==
'admin')
120 $this->
addColumn($this->lng->txt(
'crs_notification_list_title'),
'notification');
123 elseif($this->type ==
'tutor')
126 $this->
addColumn($this->lng->txt(
'crs_notification_list_title'),
'notification');
129 elseif($this->type ==
'member')
132 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
138 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
142 $this->
addColumn($this->lng->txt(
''),
'optional');
144 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"Modules/Course");
152 $this->
enable(
'select_all');
174 include_once
"Services/Certificate/classes/class.ilCertificate.php";
176 if($this->enable_certificates)
180 if($this->enable_certificates)
182 $lng->loadLanguageModule(
'certificate');
191 $this->role_id = $a_role_id;
220 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
221 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
223 if(!$ilAccess->checkAccessOfUser($a_set[
'usr_id'],
'read',
'', $this->getParentObject()->object->getRefId()) and
224 is_array($info = $ilAccess->getInfo()))
226 $this->tpl->setCurrentBlock(
'access_warning');
227 $this->tpl->setVariable(
'PARENT_ACCESS', $info[0][
'text']);
228 $this->tpl->parseCurrentBlock();
233 $this->tpl->setCurrentBlock(
'access_warning');
234 $this->tpl->setVariable(
'PARENT_ACCESS', $this->lng->txt(
'usr_account_inactive'));
235 $this->tpl->parseCurrentBlock();
244 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_' . $a_set[
'gender']) :
'';
245 $this->tpl->setCurrentBlock(
'custom_fields');
246 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
247 $this->tpl->parseCurrentBlock();
252 $this->tpl->setCurrentBlock(
'custom_fields');
253 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
254 $this->tpl->parseCurrentBlock();
257 case 'consultation_hour':
258 $this->tpl->setCurrentBlock(
'custom_fields');
260 foreach((array) $a_set[
'consultation_hours'] as $ch)
266 if($ch[
'explanation'])
268 $tmp .=
' ' . $ch[
'explanation'];
272 $dt_string = implode(
'<br />', $dts);
273 $this->tpl->setVariable(
'VAL_CUST',$dt_string);
274 $this->tpl->parseCurrentBlock();
279 if(is_array($a_set[
'prtf']))
281 foreach($a_set[
'prtf'] as $prtf_url => $prtf_txt)
283 $tmp[] =
'<a href="'.$prtf_url.
'">'.$prtf_txt.
'</a>';
286 $this->tpl->setVariable(
'VAL_CUST', implode(
'<br />', $tmp)) ;
290 case 'odf_last_update':
291 $this->tpl->setCurrentBlock(
'custom_fields');
292 $this->tpl->setVariable(
'VAL_CUST',(
string) $a_set[
'odf_info_txt']);
293 $this->tpl->parseCurrentBlock();
297 $this->tpl->setCurrentBlock(
'custom_fields');
298 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
299 $this->tpl->parseCurrentBlock();
304 if($this->privacy->enabledCourseAccessTimes())
306 $this->tpl->setVariable(
'VAL_ACCESS', $a_set[
'access_time']);
308 if($this->show_learning_progress)
310 $this->tpl->setCurrentBlock(
'lp');
311 switch($a_set[
'progress'])
314 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
319 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
324 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
329 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
333 $this->tpl->parseCurrentBlock();
335 if($this->type ==
'admin')
337 $this->tpl->setVariable(
'VAL_POSTNAME',
'admins');
338 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
339 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
341 elseif($this->type ==
'tutor')
343 $this->tpl->setVariable(
'VAL_POSTNAME',
'tutors');
344 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
345 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
347 elseif($this->type ==
'member')
349 $this->tpl->setCurrentBlock(
'blocked');
350 $this->tpl->setVariable(
'VAL_POSTNAME',
'members');
351 $this->tpl->setVariable(
'VAL_BLOCKED_ID',$a_set[
'usr_id']);
352 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED',($a_set[
'blocked'] ?
'checked="checked"' :
''));
353 $this->tpl->parseCurrentBlock();
357 $this->tpl->setCurrentBlock(
'blocked');
358 $this->tpl->setVariable(
'VAL_BLOCKED_ID', $a_set[
'usr_id']);
359 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED', ($a_set[
'blocked'] ?
'checked="checked"' :
''));
360 $this->tpl->parseCurrentBlock();
362 $this->tpl->setVariable(
'VAL_POSTNAME',
'roles');
365 $this->tpl->setVariable(
'VAL_PASSED_ID',$a_set[
'usr_id']);
366 $this->tpl->setVariable(
'VAL_PASSED_CHECKED',($a_set[
'passed'] ?
'checked="checked"' :
''));
368 if($this->show_lp_status_sync)
370 $this->tpl->setVariable(
'PASSED_INFO', $a_set[
"passed_info"]);
375 if($a_set[
'passed'] && $this->enable_certificates)
377 $this->tpl->setCurrentBlock(
'link');
378 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj,
'deliverCertificate'));
379 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'download_certificate'));
380 $this->tpl->parseCurrentBlock();
382 $this->ctrl->clearParameters($this->parent_obj);
384 if($this->show_timings)
386 $this->ctrl->setParameterByClass(
'ilcoursecontentgui',
'member_id', $a_set[
'usr_id']);
387 $this->tpl->setCurrentBlock(
'link');
388 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'showUserTimings'));
389 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'timings_timings'));
390 $this->tpl->parseCurrentBlock();
406 include_once
'./Services/User/classes/class.ilUserQuery.php';
409 unset($additional_fields[
"firstname"]);
410 unset($additional_fields[
"lastname"]);
411 unset($additional_fields[
"last_login"]);
412 unset($additional_fields[
"access_until"]);
413 unset($additional_fields[
'consultation_hour']);
414 unset($additional_fields[
'prtf']);
416 $udf_ids = $usr_data_fields = $odf_ids = array();
417 foreach($additional_fields as $field)
419 if(substr($field, 0, 3) ==
'udf')
421 $udf_ids[] = substr($field, 4);
424 if(substr($field, 0, 3) ==
'odf')
426 $odf_ids[] = substr($field, 4);
430 $usr_data_fields[] = $field;
449 foreach((array) $usr_data[
'set'] as $user)
451 $usr_ids[] = $user[
'usr_id'];
456 $this->type ==
'admin',
458 $a_user_data = array();
459 foreach((array) $usr_data[
'set'] as $ud)
461 $a_user_data[$ud[
'usr_id']] = array_merge($ud,$course_user_data[$ud[
'usr_id']]);
463 if($this->show_lp_status_sync)
467 if($a_user_data[$ud[
'usr_id']][
"passed_info"])
469 $pinfo = $a_user_data[$ud[
'usr_id']][
"passed_info"];
470 if($pinfo[
"user_id"])
472 if($pinfo[
"user_id"] < 0)
474 $passed_info = $this->lng->txt(
"crs_passed_status_system");
476 else if($pinfo[
"user_id"] > 0)
479 $passed_info = $this->lng->txt(
"crs_passed_status_manual_by").
": ".$name[
"login"];
482 if($pinfo[
"timestamp"])
484 $passed_info .=
"<br />".ilDatePresentation::formatDate($pinfo[
"timestamp"]);
487 $a_user_data[$ud[
'usr_id']][
"passed_info"] = $passed_info;
494 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
496 foreach(
$data as $usr_id => $fields)
503 foreach($fields as $field_id => $value)
505 $a_user_data[$usr_id][
'udf_' . $field_id] = $value;
512 include_once
'./Modules/Course/classes/Export/class.ilCourseUserData.php';
514 foreach(
$data as $usr_id => $fields)
522 foreach($fields as $field_id => $value)
524 $a_user_data[$usr_id][
'odf_' . $field_id] = $value;
530 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldHistory.php';
533 if(!isset($a_user_data[$usr_id]))
538 include_once
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
539 if($usr_id == $edit_info[
'update_user'])
541 $a_user_data[$usr_id][
'odf_last_update'] =
'';
542 $a_user_data[$usr_id][
'odf_info_txt'] =
$GLOBALS[
'lng']->txt(
'cdf_edited_by_self');
545 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_'.$edit_info[
'editing_time']->get(
IL_CAL_UNIX));
546 $a_user_data[$usr_id][
'odf_info_txt'] .= (
', '.ilDatePresentation::formatDate($edit_info[
'editing_time']));
551 $a_user_data[$usr_id][
'odf_last_update'] = $edit_info[
'update_user'];
552 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_'.$edit_info[
'editing_time']->get(
IL_CAL_UNIX));
555 $a_user_data[$usr_id][
'odf_info_txt'] = ($name[
'firstname'].
' '.$name[
'lastname'].
', '.
ilDatePresentation::formatDate($edit_info[
'editing_time']));
560 foreach($usr_data[
'set'] as $user)
568 foreach($usr_data_fields as $field)
570 $a_user_data[$user[
'usr_id']][$field] = $user[$field] ? $user[$field] :
'';
576 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
579 if(isset($a_user_data[$buser]))
581 $a_user_data[$buser][
'consultation_hour'] = $booking[0][
'dt'];
582 $a_user_data[$buser][
'consultation_hour_end'] = $booking[0][
'dtend'];
583 $a_user_data[$buser][
'consultation_hours'] = $booking;
587 $this->
setMaxCount($usr_data[
'cnt'] ? $usr_data[
'cnt'] : 0);
588 return $this->
setData($a_user_data);