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,
65 $this->show_learning_progress = $a_show_learning_progress;
66 $this->show_timings = $a_show_timings;
67 $this->show_edit_link = $a_show_edit_link;
70 $this->lng->loadLanguageModule(
'crs');
71 $this->lng->loadLanguageModule(
'trac');
74 $this->type = $a_type;
77 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
81 $this->
setId(
'crs_' . $a_type .
'_' . $a_role_id.
'_'. $a_parent_obj->object->getId());
89 $this->
addColumn($this->lng->txt(
'name'),
'lastname',
'20%');
94 $this->
addColumn($all_cols[$col][
'txt'], $col);
97 if($this->show_learning_progress)
99 $this->
addColumn($this->lng->txt(
'learning_progress'),
'progress');
102 if($this->privacy->enabledCourseAccessTimes())
104 $this->
addColumn($this->lng->txt(
'last_access'),
'access_ut',
'16em');
106 $this->
addColumn($this->lng->txt(
'crs_member_passed'),
'passed');
107 if($this->type ==
'admin')
110 $this->
addColumn($this->lng->txt(
'crs_notification'),
'notification');
113 elseif($this->type ==
'tutor')
116 $this->
addColumn($this->lng->txt(
'crs_notification'),
'notification');
119 elseif($this->type ==
'member')
122 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
128 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
132 $this->
addColumn($this->lng->txt(
''),
'optional');
134 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"Modules/Course");
142 $this->
enable(
'select_all');
168 $this->role_id = $a_role_id;
191 if(self::$all_columns)
196 include_once
'./Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
198 self::$all_columns = $ef->getSelectableFieldsInfo($this->
getParentObject()->object->getId());
211 global $ilUser, $ilAccess;
213 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
214 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
216 if(!$ilAccess->checkAccessOfUser($a_set[
'usr_id'],
'read',
'', $this->getParentObject()->object->getRefId()) and
217 is_array($info = $ilAccess->getInfo()))
219 $this->tpl->setCurrentBlock(
'access_warning');
220 $this->tpl->setVariable(
'PARENT_ACCESS', $info[0][
'text']);
221 $this->tpl->parseCurrentBlock();
226 $this->tpl->setCurrentBlock(
'access_warning');
227 $this->tpl->setVariable(
'PARENT_ACCESS', $this->lng->txt(
'usr_account_inactive'));
228 $this->tpl->parseCurrentBlock();
237 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_' . $a_set[
'gender']) :
'';
238 $this->tpl->setCurrentBlock(
'custom_fields');
239 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
240 $this->tpl->parseCurrentBlock();
245 $this->tpl->setCurrentBlock(
'custom_fields');
246 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
247 $this->tpl->parseCurrentBlock();
251 $this->tpl->setCurrentBlock(
'custom_fields');
252 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
253 $this->tpl->parseCurrentBlock();
258 if($this->privacy->enabledCourseAccessTimes())
260 $this->tpl->setVariable(
'VAL_ACCESS', $a_set[
'access_time']);
262 if($this->show_learning_progress)
264 $this->tpl->setCurrentBlock(
'lp');
265 switch($a_set[
'progress'])
268 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
273 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
278 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
283 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
287 $this->tpl->parseCurrentBlock();
290 if($this->type ==
'admin')
292 $this->tpl->setVariable(
'VAL_POSTNAME',
'admins');
293 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
294 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
296 elseif($this->type ==
'tutor')
298 $this->tpl->setVariable(
'VAL_POSTNAME',
'tutors');
299 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
300 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
302 elseif($this->type ==
'member')
304 $this->tpl->setCurrentBlock(
'blocked');
305 $this->tpl->setVariable(
'VAL_POSTNAME',
'members');
306 $this->tpl->setVariable(
'VAL_BLOCKED_ID',$a_set[
'usr_id']);
307 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED',($a_set[
'blocked'] ?
'checked="checked"' :
''));
308 $this->tpl->parseCurrentBlock();
312 $this->tpl->setCurrentBlock(
'blocked');
313 $this->tpl->setVariable(
'VAL_BLOCKED_ID', $a_set[
'usr_id']);
314 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED', ($a_set[
'blocked'] ?
'checked="checked"' :
''));
315 $this->tpl->parseCurrentBlock();
317 $this->tpl->setVariable(
'VAL_POSTNAME',
'roles');
320 $this->tpl->setVariable(
'VAL_PASSED_ID',$a_set[
'usr_id']);
321 $this->tpl->setVariable(
'VAL_PASSED_CHECKED',($a_set[
'passed'] ?
'checked="checked"' :
''));
323 $this->ctrl->setParameter($this->parent_obj,
'member_id', $a_set[
'usr_id']);
324 if($this->show_edit_link)
326 $this->tpl->setCurrentBlock(
'link');
327 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj,
'editMember'));
328 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'edit'));
329 $this->tpl->parseCurrentBlock();
331 $this->ctrl->clearParameters($this->parent_obj);
333 if($this->show_timings)
335 $this->ctrl->setParameterByClass(
'ilcoursecontentgui',
'member_id', $a_set[
'usr_id']);
336 $this->tpl->setCurrentBlock(
'link');
337 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'showUserTimings'));
338 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'timings_timings'));
339 $this->tpl->parseCurrentBlock();
355 include_once
'./Services/User/classes/class.ilUserQuery.php';
358 unset($additional_fields[
"firstname"]);
359 unset($additional_fields[
"lastname"]);
360 unset($additional_fields[
"last_login"]);
361 unset($additional_fields[
"access_until"]);
363 $udf_ids = $usr_data_fields = $odf_ids = array();
364 foreach($additional_fields as $field)
366 if(substr($field, 0, 3) ==
'udf')
368 $udf_ids[] = substr($field, 4);
371 if(substr($field, 0, 3) ==
'odf')
373 $odf_ids[] = substr($field, 4);
377 $usr_data_fields[] = $field;
396 foreach((array) $usr_data[
'set'] as $user)
398 $usr_ids[] = $user[
'usr_id'];
402 $course_user_data = $this->
getParentObject()->readMemberData($usr_ids,$this->type ==
'admin');
403 $a_user_data = array();
404 foreach((array) $usr_data[
'set'] as $ud)
406 $a_user_data[$ud[
'usr_id']] = array_merge($ud,$course_user_data[$ud[
'usr_id']]);
412 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
421 foreach($fields as $field_id => $value)
423 $a_user_data[
$usr_id][
'udf_' . $field_id] = $value;
430 include_once
'./Modules/Course/classes/Export/class.ilCourseUserData.php';
440 foreach($fields as $field_id => $value)
442 $a_user_data[
$usr_id][
'odf_' . $field_id] = $value;
447 foreach($usr_data[
'set'] as $user)
455 foreach($usr_data_fields as $field)
457 $a_user_data[$user[
'usr_id']][$field] = $user[$field] ? $user[$field] :
'';
460 $this->
setMaxCount($usr_data[
'cnt'] ? $usr_data[
'cnt'] : 0);
461 return $this->
setData($a_user_data);
466 if(!self::$confirmation_required)
470 if(!self::$export_allowed)
474 return in_array($a_usr_id, self::$accepted_ids);
483 if(self::$accepted_ids !== NULL)
491 include_once
'Services/Membership/classes/class.ilMemberAgreement.php';