24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
54 public function __construct($a_parent_obj,$a_type =
'admin',$show_content =
true,$a_show_learning_progress =
false,$a_show_timings =
false, $a_show_edit_link=
true)
58 $this->show_learning_progress = $a_show_learning_progress;
59 $this->show_timings = $a_show_timings;
60 $this->show_edit_link = $a_show_edit_link;
63 $this->lng->loadLanguageModule(
'crs');
64 $this->lng->loadLanguageModule(
'trac');
67 $this->type = $a_type;
69 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
73 $this->
setId(
'crs_'.$a_type.
'_'.$a_parent_obj->object->getId());
81 $this->
addColumn($this->lng->txt(
'name'),
'lastname',
'20%');
86 $this->
addColumn($all_cols[$col][
'txt'],$col);
89 if($this->show_learning_progress)
91 $this->
addColumn($this->lng->txt(
'learning_progress'),
'progress');
94 if($this->privacy->enabledCourseAccessTimes())
96 $this->
addColumn($this->lng->txt(
'last_access'),
'access_ut',
'16em');
98 $this->
addColumn($this->lng->txt(
'crs_member_passed'),
'passed');
99 if($this->type ==
'admin')
103 $this->
addColumn($this->lng->txt(
'crs_notification'),
'notification');
106 elseif($this->type ==
'tutor')
110 $this->
addColumn($this->lng->txt(
'crs_notification'),
'notification');
117 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
120 $this->
addColumn($this->lng->txt(
''),
'optional');
122 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"Modules/Course");
130 $this->
enable(
'select_all');
160 if(self::$all_columns)
165 include_once
'./Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
167 self::$all_columns = $ef->getSelectableFieldsInfo($this->
getParentObject()->object->getId());
180 global $ilUser,$ilAccess;
182 $this->tpl->setVariable(
'VAL_ID',$a_set[
'usr_id']);
183 $this->tpl->setVariable(
'VAL_NAME',$a_set[
'lastname'].
', '.$a_set[
'firstname']);
185 if(!$ilAccess->checkAccessOfUser($a_set[
'usr_id'],
'read',
'',$this->getParentObject()->object->getRefId()) and
186 is_array($info = $ilAccess->getInfo()))
188 $this->tpl->setCurrentBlock(
'access_warning');
189 $this->tpl->setVariable(
'PARENT_ACCESS',$info[0][
'text']);
190 $this->tpl->parseCurrentBlock();
195 $this->tpl->setCurrentBlock(
'access_warning');
196 $this->tpl->setVariable(
'PARENT_ACCESS',$this->lng->txt(
'usr_account_inactive'));
197 $this->tpl->parseCurrentBlock();
206 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_'.$a_set[
'gender']) :
'';
207 $this->tpl->setCurrentBlock(
'custom_fields');
208 $this->tpl->setVariable(
'VAL_CUST',$a_set[$field]);
209 $this->tpl->parseCurrentBlock();
214 $this->tpl->setCurrentBlock(
'custom_fields');
215 $this->tpl->setVariable(
'VAL_CUST',$a_set[$field]);
216 $this->tpl->parseCurrentBlock();
220 $this->tpl->setCurrentBlock(
'custom_fields');
221 $this->tpl->setVariable(
'VAL_CUST',$a_set[$field] ? $a_set[$field] :
'');
222 $this->tpl->parseCurrentBlock();
227 if($this->privacy->enabledCourseAccessTimes())
229 $this->tpl->setVariable(
'VAL_ACCESS',$a_set[
'access_time']);
231 if($this->show_learning_progress)
233 $this->tpl->setCurrentBlock(
'lp');
234 switch($a_set[
'progress'])
237 $this->tpl->setVariable(
'LP_STATUS_ALT',$this->lng->txt($a_set[
'progress']));
242 $this->tpl->setVariable(
'LP_STATUS_ALT',$this->lng->txt($a_set[
'progress']));
247 $this->tpl->setVariable(
'LP_STATUS_ALT',$this->lng->txt($a_set[
'progress']));
252 $this->tpl->setVariable(
'LP_STATUS_ALT',$this->lng->txt($a_set[
'progress']));
257 $this->tpl->parseCurrentBlock();
260 if($this->type ==
'admin')
262 $this->tpl->setVariable(
'VAL_POSTNAME',
'admins');
263 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID',$a_set[
'usr_id']);
264 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED',($a_set[
'notification'] ?
'checked="checked"' :
''));
266 elseif($this->type ==
'tutor')
268 $this->tpl->setVariable(
'VAL_POSTNAME',
'tutors');
269 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID',$a_set[
'usr_id']);
270 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED',($a_set[
'notification'] ?
'checked="checked"' :
''));
274 $this->tpl->setCurrentBlock(
'blocked');
275 $this->tpl->setVariable(
'VAL_BLOCKED_ID',$a_set[
'usr_id']);
276 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED',($a_set[
'blocked'] ?
'checked="checked"' :
''));
277 $this->tpl->parseCurrentBlock();
279 $this->tpl->setVariable(
'VAL_POSTNAME',
'members');
282 $this->tpl->setVariable(
'VAL_PASSED_ID',$a_set[
'usr_id']);
283 $this->tpl->setVariable(
'VAL_PASSED_CHECKED',($a_set[
'passed'] ?
'checked="checked"' :
''));
286 $this->ctrl->setParameter($this->parent_obj,
'member_id',$a_set[
'usr_id']);
287 if ($this->show_edit_link)
289 $this->tpl->setCurrentBlock(
'link');
290 $this->tpl->setVariable(
'LINK_NAME',$this->ctrl->getLinkTarget($this->parent_obj,
'editMember'));
291 $this->tpl->setVariable(
'LINK_TXT',$this->lng->txt(
'edit'));
292 $this->tpl->parseCurrentBlock();
294 $this->ctrl->clearParameters($this->parent_obj);
297 if($this->show_timings)
299 $this->ctrl->setParameterByClass(
'ilcoursecontentgui',
'member_id',$a_set[
'usr_id']);
300 $this->tpl->setCurrentBlock(
'link');
301 $this->tpl->setVariable(
'LINK_NAME',$this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'showUserTimings'));
302 $this->tpl->setVariable(
'LINK_TXT',$this->lng->txt(
'timings_timings'));
303 $this->tpl->parseCurrentBlock();
313 include_once
'./Services/User/classes/class.ilUserQuery.php';
316 unset($additional_fields[
"firstname"]);
317 unset($additional_fields[
"lastname"]);
318 unset($additional_fields[
"last_login"]);
319 unset($additional_fields[
"access_until"]);
334 $udf_ids = $usr_data_fields = $odf_ids = array();
335 foreach($additional_fields as $field)
337 if(substr($field,0,3) ==
'udf')
339 $udf_ids[] = substr($field,4);
342 if(substr($field,0,3) ==
'odf')
344 $odf_ids[] = substr($field,4);
348 $usr_data_fields[] = $field;
370 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
379 foreach($fields as $field_id => $value)
381 $a_user_data[
$usr_id][
'udf_'.$field_id] = $value;
388 include_once
'./Modules/Course/classes/Export/class.ilCourseUserData.php';
398 foreach($fields as $field_id => $value)
400 $a_user_data[
$usr_id][
'odf_'.$field_id] = $value;
406 foreach($usr_data[
'set'] as
$user)
414 foreach($usr_data_fields as $field)
416 $a_user_data[$user[
'usr_id']][$field] = $user[$field] ? $user[$field] :
'';
419 return $this->
setData($a_user_data);
424 if(!self::$confirmation_required)
428 if(!self::$export_allowed)
432 return in_array($a_usr_id,self::$accepted_ids);
441 if(self::$accepted_ids !== NULL)
449 include_once
'Services/Membership/classes/class.ilMemberAgreement.php';