|
|
|
|
@ -206,6 +206,32 @@ if (isset($_GET['additional_profile_field'])) { |
|
|
|
|
Session::write('additional_user_profile_info', $userProfileInfo); |
|
|
|
|
Session::write('extra_field_info', $extra_info); |
|
|
|
|
|
|
|
|
|
$defaultExtraFields = []; |
|
|
|
|
$defaultExtraFieldsFromSettings = []; |
|
|
|
|
$defaultExtraFieldsFromSettings = api_get_configuration_value('course_log_default_extra_fields'); |
|
|
|
|
if (isset($defaultExtraFieldsFromSettings)) { |
|
|
|
|
$default_extra_fields = $defaultExtraFieldsFromSettings; |
|
|
|
|
$defaultExtraInfo = []; |
|
|
|
|
$defaultUserProfileInfo = []; |
|
|
|
|
|
|
|
|
|
$user_array = []; |
|
|
|
|
foreach ($studentList as $key => $item) { |
|
|
|
|
$user_array[] = $key; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach ($default_extra_fields as $fieldId) { |
|
|
|
|
// Fetching only the user that are loaded NOT ALL user in the portal. |
|
|
|
|
$defaultUserProfileInfo[$fieldId] = TrackingCourseLog::getAdditionalProfileInformationOfFieldByUser( |
|
|
|
|
$fieldId, |
|
|
|
|
$user_array |
|
|
|
|
); |
|
|
|
|
$defaultExtraInfo[$fieldId] = UserManager::get_extra_field_information($fieldId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Session::write('default_additional_user_profile_info', $defaultUserProfileInfo); |
|
|
|
|
Session::write('default_extra_field_info', $defaultExtraInfo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Display::display_header($nameTools, 'Tracking'); |
|
|
|
|
|
|
|
|
|
$actionsLeft = TrackingCourseLog::actionsLeft('users', $sessionId); |
|
|
|
|
@ -589,7 +615,7 @@ if ($nbStudents > 0) { |
|
|
|
|
Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_SMALL). |
|
|
|
|
get_lang('ExportAsCSV') |
|
|
|
|
.' </a>'); |
|
|
|
|
$extraFieldSelect = TrackingCourseLog::display_additional_profile_fields(); |
|
|
|
|
$extraFieldSelect = TrackingCourseLog::display_additional_profile_fields($default_extra_fields); |
|
|
|
|
if (!empty($extraFieldSelect)) { |
|
|
|
|
$html .= $extraFieldSelect; |
|
|
|
|
} |
|
|
|
|
@ -745,6 +771,13 @@ if ($nbStudents > 0) { |
|
|
|
|
$parameters['additional_profile_field'] = $fieldId; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (isset($default_extra_fields)) { |
|
|
|
|
foreach ($defaultExtraInfo as $field) { |
|
|
|
|
$table->set_header($counter, $field['display_text'], false); |
|
|
|
|
$headers[$field['variable']] = $field['display_text']; |
|
|
|
|
$counter++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$table->set_header($counter, get_lang('Details'), false); |
|
|
|
|
$headers['Details'] = get_lang('Details'); |
|
|
|
|
|
|
|
|
|
|