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');
179 include_once
"Services/Certificate/classes/class.ilCertificate.php";
181 if($this->enable_certificates)
185 if($this->enable_certificates)
187 $lng->loadLanguageModule(
'certificate');
196 $this->role_id = $a_role_id;
221 if(self::$all_columns)
223 #return self::$all_columns;
226 include_once
'./Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
228 self::$all_columns = $ef->getSelectableFieldsInfo($this->
getParentObject()->object->getId());
230 if ($this->type ==
'member' &&
231 $ilSetting->get(
'user_portfolios'))
233 self::$all_columns[
'prtf'] = array(
234 'txt' => $this->lng->txt(
'obj_prtf'),
253 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
254 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
256 if(!$ilAccess->checkAccessOfUser($a_set[
'usr_id'],
'read',
'', $this->getParentObject()->object->getRefId()) and
257 is_array($info = $ilAccess->getInfo()))
259 $this->tpl->setCurrentBlock(
'access_warning');
260 $this->tpl->setVariable(
'PARENT_ACCESS', $info[0][
'text']);
261 $this->tpl->parseCurrentBlock();
266 $this->tpl->setCurrentBlock(
'access_warning');
267 $this->tpl->setVariable(
'PARENT_ACCESS', $this->lng->txt(
'usr_account_inactive'));
268 $this->tpl->parseCurrentBlock();
277 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_' . $a_set[
'gender']) :
'';
278 $this->tpl->setCurrentBlock(
'custom_fields');
279 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
280 $this->tpl->parseCurrentBlock();
285 $this->tpl->setCurrentBlock(
'custom_fields');
286 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
287 $this->tpl->parseCurrentBlock();
290 case 'consultation_hour':
291 $this->tpl->setCurrentBlock(
'custom_fields');
293 foreach((array) $a_set[
'consultation_hours'] as $ch)
299 if($ch[
'explanation'])
301 $tmp .=
' ' . $ch[
'explanation'];
305 $dt_string = implode(
'<br />', $dts);
306 $this->tpl->setVariable(
'VAL_CUST',$dt_string);
307 $this->tpl->parseCurrentBlock();
312 if(is_array($a_set[
'prtf']))
314 foreach($a_set[
'prtf'] as $prtf_url => $prtf_txt)
316 $tmp[] =
'<a href="'.$prtf_url.
'">'.$prtf_txt.
'</a>';
319 $this->tpl->setVariable(
'VAL_CUST', implode(
'<br />', $tmp)) ;
323 $this->tpl->setCurrentBlock(
'custom_fields');
324 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
325 $this->tpl->parseCurrentBlock();
330 if($this->privacy->enabledCourseAccessTimes())
332 $this->tpl->setVariable(
'VAL_ACCESS', $a_set[
'access_time']);
334 if($this->show_learning_progress)
336 $this->tpl->setCurrentBlock(
'lp');
337 switch($a_set[
'progress'])
340 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
345 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
350 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
355 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
359 $this->tpl->parseCurrentBlock();
361 if($this->type ==
'admin')
363 $this->tpl->setVariable(
'VAL_POSTNAME',
'admins');
364 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
365 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
367 elseif($this->type ==
'tutor')
369 $this->tpl->setVariable(
'VAL_POSTNAME',
'tutors');
370 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
371 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
373 elseif($this->type ==
'member')
375 $this->tpl->setCurrentBlock(
'blocked');
376 $this->tpl->setVariable(
'VAL_POSTNAME',
'members');
377 $this->tpl->setVariable(
'VAL_BLOCKED_ID',$a_set[
'usr_id']);
378 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED',($a_set[
'blocked'] ?
'checked="checked"' :
''));
379 $this->tpl->parseCurrentBlock();
383 $this->tpl->setCurrentBlock(
'blocked');
384 $this->tpl->setVariable(
'VAL_BLOCKED_ID', $a_set[
'usr_id']);
385 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED', ($a_set[
'blocked'] ?
'checked="checked"' :
''));
386 $this->tpl->parseCurrentBlock();
388 $this->tpl->setVariable(
'VAL_POSTNAME',
'roles');
391 $this->tpl->setVariable(
'VAL_PASSED_ID',$a_set[
'usr_id']);
392 $this->tpl->setVariable(
'VAL_PASSED_CHECKED',($a_set[
'passed'] ?
'checked="checked"' :
''));
394 if($this->show_lp_status_sync)
396 $this->tpl->setVariable(
'PASSED_INFO', $a_set[
"passed_info"]);
399 $this->ctrl->setParameter($this->parent_obj,
'member_id', $a_set[
'usr_id']);
400 if($this->show_edit_link)
402 $this->tpl->setCurrentBlock(
'link');
403 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj,
'editMember'));
404 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'edit'));
405 $this->tpl->parseCurrentBlock();
407 if($a_set[
'passed'] && $this->enable_certificates)
409 $this->tpl->setCurrentBlock(
'link');
410 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj,
'deliverCertificate'));
411 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'download_certificate'));
412 $this->tpl->parseCurrentBlock();
414 $this->ctrl->clearParameters($this->parent_obj);
416 if($this->show_timings)
418 $this->ctrl->setParameterByClass(
'ilcoursecontentgui',
'member_id', $a_set[
'usr_id']);
419 $this->tpl->setCurrentBlock(
'link');
420 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'showUserTimings'));
421 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'timings_timings'));
422 $this->tpl->parseCurrentBlock();
438 include_once
'./Services/User/classes/class.ilUserQuery.php';
441 unset($additional_fields[
"firstname"]);
442 unset($additional_fields[
"lastname"]);
443 unset($additional_fields[
"last_login"]);
444 unset($additional_fields[
"access_until"]);
445 unset($additional_fields[
'consultation_hour']);
446 unset($additional_fields[
'prtf']);
448 $udf_ids = $usr_data_fields = $odf_ids = array();
449 foreach($additional_fields as $field)
451 if(substr($field, 0, 3) ==
'udf')
453 $udf_ids[] = substr($field, 4);
456 if(substr($field, 0, 3) ==
'odf')
458 $odf_ids[] = substr($field, 4);
462 $usr_data_fields[] = $field;
481 foreach((array) $usr_data[
'set'] as $user)
483 $usr_ids[] = $user[
'usr_id'];
488 $this->type ==
'admin',
490 $a_user_data = array();
491 foreach((array) $usr_data[
'set'] as $ud)
493 $a_user_data[$ud[
'usr_id']] = array_merge($ud,$course_user_data[$ud[
'usr_id']]);
495 if($this->show_lp_status_sync)
499 if($a_user_data[$ud[
'usr_id']][
"passed_info"])
501 $pinfo = $a_user_data[$ud[
'usr_id']][
"passed_info"];
502 if($pinfo[
"user_id"])
504 if($pinfo[
"user_id"] < 0)
506 $passed_info = $this->lng->txt(
"crs_passed_status_system");
508 else if($pinfo[
"user_id"] > 0)
511 $passed_info = $this->lng->txt(
"crs_passed_status_manual_by").
": ".$name[
"login"];
514 if($pinfo[
"timestamp"])
516 $passed_info .=
"<br />".ilDatePresentation::formatDate($pinfo[
"timestamp"]);
519 $a_user_data[$ud[
'usr_id']][
"passed_info"] = $passed_info;
526 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
535 foreach($fields as $field_id => $value)
537 $a_user_data[
$usr_id][
'udf_' . $field_id] = $value;
544 include_once
'./Modules/Course/classes/Export/class.ilCourseUserData.php';
554 foreach($fields as $field_id => $value)
556 $a_user_data[
$usr_id][
'odf_' . $field_id] = $value;
561 foreach($usr_data[
'set'] as $user)
569 foreach($usr_data_fields as $field)
571 $a_user_data[$user[
'usr_id']][$field] = $user[$field] ? $user[$field] :
'';
577 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
580 if(isset($a_user_data[$buser]))
582 $a_user_data[$buser][
'consultation_hour'] = $booking[0][
'dt'];
583 $a_user_data[$buser][
'consultation_hour_end'] = $booking[0][
'dtend'];
584 $a_user_data[$buser][
'consultation_hours'] = $booking;
588 $this->
setMaxCount($usr_data[
'cnt'] ? $usr_data[
'cnt'] : 0);
589 return $this->
setData($a_user_data);
594 if(!self::$confirmation_required)
598 if(!self::$export_allowed)
602 return in_array($a_usr_id, self::$accepted_ids);
611 if(self::$accepted_ids !== NULL)
619 include_once
'Services/Membership/classes/class.ilMemberAgreement.php';