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');
76 $this->lng->loadLanguageModule(
'rbac');
80 $this->type = $a_type;
83 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
87 $this->
setId(
'crs_' . $a_type .
'_' . $a_role_id.
'_'. $a_parent_obj->object->getId());
88 parent::__construct($a_parent_obj,
'members');
95 $this->
addColumn($this->lng->txt(
'name'),
'lastname',
'20%');
100 $this->
addColumn($all_cols[$col][
'txt'], $col);
103 if($this->show_learning_progress)
105 $this->
addColumn($this->lng->txt(
'learning_progress'),
'progress');
108 if($this->privacy->enabledCourseAccessTimes())
110 $this->
addColumn($this->lng->txt(
'last_access'),
'access_ut',
'16em');
113 $this->
addColumn($this->lng->txt(
'crs_member_passed'),
'passed');
114 if($this->show_lp_status_sync)
116 $this->
addColumn($this->lng->txt(
'crs_member_passed_status_changed'),
'passed_info');
119 if($this->type ==
'admin')
123 $this->
addColumn($this->lng->txt(
'crs_mem_contact'),
'contact');
125 $this->
addColumn($this->lng->txt(
'crs_notification_list_title'),
'notification');
128 elseif($this->type ==
'tutor')
132 $this->
addColumn($this->lng->txt(
'crs_mem_contact'),
'contact');
134 $this->
addColumn($this->lng->txt(
'crs_notification_list_title'),
'notification');
137 elseif($this->type ==
'member')
140 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
146 $this->
addColumn($this->lng->txt(
'crs_blocked'),
'blocked');
150 $this->
addColumn($this->lng->txt(
''),
'optional');
152 $this->
setRowTemplate(
"tpl.show_participants_row.html",
"Modules/Course");
160 $this->
enable(
'select_all');
182 include_once
"Services/Certificate/classes/class.ilCertificate.php";
184 if($this->enable_certificates)
188 if($this->enable_certificates)
190 $lng->loadLanguageModule(
'certificate');
199 $this->role_id = $a_role_id;
228 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
229 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
231 if(!$ilAccess->checkAccessOfUser($a_set[
'usr_id'],
'read',
'', $this->getParentObject()->object->getRefId()) and
232 is_array(
$info = $ilAccess->getInfo()))
234 $this->tpl->setCurrentBlock(
'access_warning');
235 $this->tpl->setVariable(
'PARENT_ACCESS',
$info[0][
'text']);
236 $this->tpl->parseCurrentBlock();
241 $this->tpl->setCurrentBlock(
'access_warning');
242 $this->tpl->setVariable(
'PARENT_ACCESS', $this->lng->txt(
'usr_account_inactive'));
243 $this->tpl->parseCurrentBlock();
252 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_' . $a_set[
'gender']) :
'';
253 $this->tpl->setCurrentBlock(
'custom_fields');
254 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
255 $this->tpl->parseCurrentBlock();
260 $this->tpl->setCurrentBlock(
'custom_fields');
261 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
262 $this->tpl->parseCurrentBlock();
265 case 'consultation_hour':
266 $this->tpl->setCurrentBlock(
'custom_fields');
268 foreach((array) $a_set[
'consultation_hours'] as $ch)
274 if($ch[
'explanation'])
276 $tmp .=
' ' . $ch[
'explanation'];
280 $dt_string = implode(
'<br />', $dts);
281 $this->tpl->setVariable(
'VAL_CUST',$dt_string);
282 $this->tpl->parseCurrentBlock();
287 if(is_array($a_set[
'prtf']))
289 foreach($a_set[
'prtf'] as $prtf_url => $prtf_txt)
291 $tmp[] =
'<a href="'.$prtf_url.
'">'.$prtf_txt.
'</a>';
294 $this->tpl->setVariable(
'VAL_CUST', implode(
'<br />', $tmp)) ;
298 case 'odf_last_update':
299 $this->tpl->setCurrentBlock(
'custom_fields');
300 $this->tpl->setVariable(
'VAL_CUST',(
string) $a_set[
'odf_info_txt']);
301 $this->tpl->parseCurrentBlock();
305 $this->tpl->setCurrentBlock(
'custom_fields');
306 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
307 $this->tpl->parseCurrentBlock();
312 if($this->privacy->enabledCourseAccessTimes())
314 $this->tpl->setVariable(
'VAL_ACCESS', $a_set[
'access_time']);
316 if($this->show_learning_progress)
318 $this->tpl->setCurrentBlock(
'lp');
319 switch($a_set[
'progress'])
322 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
327 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
332 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
337 $this->tpl->setVariable(
'LP_STATUS_ALT', $this->lng->txt($a_set[
'progress']));
341 $this->tpl->parseCurrentBlock();
343 if($this->type ==
'admin')
345 $this->tpl->setVariable(
'VAL_POSTNAME',
'admins');
347 $this->tpl->setVariable(
'VAL_CONTACT_ID',$a_set[
'usr_id']);
348 $this->tpl->setVariable(
'VAL_CONTACT_CHECKED',$a_set[
'contact'] ?
'checked="checked"' :
'');
350 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
351 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
353 elseif($this->type ==
'tutor')
355 $this->tpl->setVariable(
'VAL_POSTNAME',
'tutors');
357 $this->tpl->setVariable(
'VAL_CONTACT_ID',$a_set[
'usr_id']);
358 $this->tpl->setVariable(
'VAL_CONTACT_CHECKED',$a_set[
'contact'] ?
'checked="checked"' :
'');
360 $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $a_set[
'usr_id']);
361 $this->tpl->setVariable(
'VAL_NOTIFICATION_CHECKED', ($a_set[
'notification'] ?
'checked="checked"' :
''));
363 elseif($this->type ==
'member')
365 $this->tpl->setCurrentBlock(
'blocked');
366 $this->tpl->setVariable(
'VAL_POSTNAME',
'members');
367 $this->tpl->setVariable(
'VAL_BLOCKED_ID',$a_set[
'usr_id']);
368 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED',($a_set[
'blocked'] ?
'checked="checked"' :
''));
369 $this->tpl->parseCurrentBlock();
373 $this->tpl->setCurrentBlock(
'blocked');
374 $this->tpl->setVariable(
'VAL_BLOCKED_ID', $a_set[
'usr_id']);
375 $this->tpl->setVariable(
'VAL_BLOCKED_CHECKED', ($a_set[
'blocked'] ?
'checked="checked"' :
''));
376 $this->tpl->parseCurrentBlock();
378 $this->tpl->setVariable(
'VAL_POSTNAME',
'roles');
381 $this->tpl->setVariable(
'VAL_PASSED_ID',$a_set[
'usr_id']);
382 $this->tpl->setVariable(
'VAL_PASSED_CHECKED',($a_set[
'passed'] ?
'checked="checked"' :
''));
384 if($this->show_lp_status_sync)
386 $this->tpl->setVariable(
'PASSED_INFO', $a_set[
"passed_info"]);
391 if($a_set[
'passed'] && $this->enable_certificates)
393 $this->tpl->setCurrentBlock(
'link');
394 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj,
'deliverCertificate'));
395 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'download_certificate'));
396 $this->tpl->parseCurrentBlock();
398 $this->ctrl->clearParameters($this->parent_obj);
400 if($this->show_timings)
402 $this->ctrl->setParameterByClass(
'ilcoursecontentgui',
'member_id', $a_set[
'usr_id']);
403 $this->tpl->setCurrentBlock(
'link');
404 $this->tpl->setVariable(
'LINK_NAME', $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'showUserTimings'));
405 $this->tpl->setVariable(
'LINK_TXT', $this->lng->txt(
'timings_timings'));
406 $this->tpl->parseCurrentBlock();
422 include_once
'./Services/User/classes/class.ilUserQuery.php';
425 unset($additional_fields[
"firstname"]);
426 unset($additional_fields[
"lastname"]);
427 unset($additional_fields[
"last_login"]);
428 unset($additional_fields[
"access_until"]);
429 unset($additional_fields[
'consultation_hour']);
430 unset($additional_fields[
'prtf']);
432 $udf_ids = $usr_data_fields = $odf_ids = array();
433 foreach($additional_fields as $field)
435 if(substr($field, 0, 3) ==
'udf')
437 $udf_ids[] = substr($field, 4);
440 if(substr($field, 0, 3) ==
'odf')
442 $odf_ids[] = substr($field, 4);
446 $usr_data_fields[] = $field;
465 foreach((array) $usr_data[
'set'] as $user)
467 $usr_ids[] = $user[
'usr_id'];
472 $this->type ==
'admin',
474 $a_user_data = array();
475 foreach((array) $usr_data[
'set'] as $ud)
477 $user_id = $ud[
'usr_id'];
485 $a_user_data[$user_id] = array_merge($ud,$course_user_data[$user_id]);
487 if($this->show_lp_status_sync)
491 if($a_user_data[$user_id][
"passed_info"])
493 $pinfo = $a_user_data[$user_id][
"passed_info"];
494 if($pinfo[
"user_id"])
496 if($pinfo[
"user_id"] < 0)
498 $passed_info = $this->lng->txt(
"crs_passed_status_system");
500 else if($pinfo[
"user_id"] > 0)
503 $passed_info = $this->lng->txt(
"crs_passed_status_manual_by").
": ".$name[
"login"];
506 if($pinfo[
"timestamp"])
508 $passed_info .=
"<br />".ilDatePresentation::formatDate($pinfo[
"timestamp"]);
511 $a_user_data[$user_id][
"passed_info"] = $passed_info;
518 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
520 foreach(
$data as $usr_id => $fields)
527 foreach($fields as $field_id => $value)
529 $a_user_data[$usr_id][
'udf_' . $field_id] = $value;
536 include_once
'./Modules/Course/classes/Export/class.ilCourseUserData.php';
538 foreach(
$data as $usr_id => $fields)
546 foreach($fields as $field_id => $value)
548 $a_user_data[$usr_id][
'odf_' . $field_id] = $value;
554 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldHistory.php';
557 if(!isset($a_user_data[$usr_id]))
562 include_once
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
563 if($usr_id == $edit_info[
'update_user'])
565 $a_user_data[$usr_id][
'odf_last_update'] =
'';
566 $a_user_data[$usr_id][
'odf_info_txt'] =
$GLOBALS[
'lng']->txt(
'cdf_edited_by_self');
569 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_'.$edit_info[
'editing_time']->get(
IL_CAL_UNIX));
570 $a_user_data[$usr_id][
'odf_info_txt'] .= (
', '.ilDatePresentation::formatDate($edit_info[
'editing_time']));
575 $a_user_data[$usr_id][
'odf_last_update'] = $edit_info[
'update_user'];
576 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_'.$edit_info[
'editing_time']->get(
IL_CAL_UNIX));
579 $a_user_data[$usr_id][
'odf_info_txt'] = ($name[
'firstname'].
' '.$name[
'lastname'].
', '.
ilDatePresentation::formatDate($edit_info[
'editing_time']));
587 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
590 if(isset($a_user_data[$buser]))
592 $a_user_data[$buser][
'consultation_hour'] = $booking[0][
'dt'];
593 $a_user_data[$buser][
'consultation_hour_end'] = $booking[0][
'dtend'];
594 $a_user_data[$buser][
'consultation_hours'] = $booking;
598 $this->
setMaxCount($usr_data[
'cnt'] ? $usr_data[
'cnt'] : 0);
599 return $this->
setData($a_user_data);
showActionLinks($a_set)
show edit links
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static _lookupName($a_user_id)
lookup user name
setFormName($a_formname)
Set Form name.
static getUserListData($a_order_field, $a_order_dir, $a_offset, $a_limit, $a_string_filter="", $a_activation_filter="", $a_last_login_filter=null, $a_limited_access_filter=false, $a_no_courses_filter=false, $a_course_group_filter=0, $a_role_filter=0, $a_user_folder_filter=null, $a_additional_fields='', $a_user_filter=null, $a_first_letter="")
Get data for user administration list.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static lookupManagedBookingsForObject($a_obj_id, $a_usr_id)
Lookup bookings for own and managed consultation hours of an object.
setEnableNumInfo($a_val)
Set enable num info.
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
const LP_STATUS_NOT_ATTEMPTED
setExternalSegmentation($a_val)
Set external segmentation.
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
getOrderDirection()
Get order direction.
initSettings()
Init acceptance.
getParentObject()
Get parent object.
const LP_STATUS_IN_PROGRESS
static lookupData($a_user_ids, $a_field_ids)
Lookup data.
static _enabledLearningProgress()
check wether learing progress is enabled or not
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
setRoleId($a_role_id)
Set current role id.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
enable($a_module_name)
enables particular modules of table
static formatDate(ilDateTime $date)
Format a date public.
getSelectedColumns()
Get selected columns.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
__construct( $a_parent_obj, $a_type='admin', $show_content=true, $a_show_learning_progress=false, $a_show_timings=false, $a_show_edit_link=true, $a_role_id=0, $a_show_lp_status_sync=false)
Constructor.
getSelectableColumns()
Get selectable columns.
_lookupActive($a_usr_id)
Check user account active.
isColumnSelected($a_col)
Is given column selected?
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
static isObjectActive($a_obj_id)
disable($a_module_name)
diesables particular modules of table
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
checkAcceptance($a_usr_id)
Check acceptance.
static _getInstance()
Get instance of ilPrivacySettings.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setMaxCount($a_max_count)
set max.
setEnableTitle($a_enabletitle)
Set Enable Title.
const LP_STATUS_COMPLETED
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
static lookupEntriesByObjectId($a_obj_id)
Get entries by obj_id type $ilDB.
getRoleId()
Get current role id.