|
|
|
@ -403,6 +403,22 @@ if ($nbStudents > 0) { |
|
|
|
|
$select->addOptGroup($groupIdList, get_lang('Group')); |
|
|
|
|
$formClass->addButtonSearch(get_lang('Search')); |
|
|
|
|
|
|
|
|
|
// Filter by ex learners |
|
|
|
|
if (false !== api_get_configuration_value('user_edition_extra_field_to_check')) { |
|
|
|
|
$formExLearners = new FormValidator( |
|
|
|
|
'form_exlearners', |
|
|
|
|
'get', |
|
|
|
|
api_get_self().'?'.api_get_cidreq().'&'.$additionalParams |
|
|
|
|
); |
|
|
|
|
$group = []; |
|
|
|
|
$group[] = $formExLearners->createElement('radio', 'opt_exlearner', 'id="opt_exlearner1"', get_lang('Yes'), 1); |
|
|
|
|
$group[] = $formExLearners->createElement('radio', 'opt_exlearner', 'id="opt_exlearner0"', get_lang('No'), 0); |
|
|
|
|
$formExLearners->addGroup($group, 'exlearner', get_lang('ToHideExlearners')); |
|
|
|
|
$formExLearners->addHidden('cidReq', $courseCode); |
|
|
|
|
$formExLearners->addHidden('id_session', $sessionId); |
|
|
|
|
$formExLearners->addButtonSearch(get_lang('Search')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Groups |
|
|
|
|
/*$formGroup = new FormValidator( |
|
|
|
|
'groups', |
|
|
|
@ -485,6 +501,25 @@ if ($nbStudents > 0) { |
|
|
|
|
$conditions = ['where' => $whereCondition, 'inject_joins' => $joins]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (false !== api_get_configuration_value('user_edition_extra_field_to_check')) { |
|
|
|
|
if ($formExLearners->validate()) { |
|
|
|
|
$formValue = $formExLearners->getSubmitValue('exlearner'); |
|
|
|
|
if (isset($formValue['opt_exlearner']) && 1 == $formValue['opt_exlearner']) { |
|
|
|
|
$sessionId = api_get_session_id(); |
|
|
|
|
if (!empty($sessionId)) { |
|
|
|
|
$tableSessionCourseUser = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
|
|
|
$joins = " INNER JOIN $tableSessionCourseUser scu ON scu.user_id = user.id "; |
|
|
|
|
$whereCondition = " AND scu.status != ".COURSE_EXLEARNER." AND scu.c_id = '".api_get_course_int_id()."' AND scu.session_id = $sessionId"; |
|
|
|
|
$conditions = ['where' => $whereCondition, 'inject_joins' => $joins]; |
|
|
|
|
} else { |
|
|
|
|
$tableCourseUser = Database::get_main_table(TABLE_MAIN_COURSE_USER); |
|
|
|
|
$joins = " INNER JOIN $tableCourseUser cu ON cu.user_id = user.id "; |
|
|
|
|
$whereCondition = " AND cu.relation_type != ".COURSE_EXLEARNER." AND cu.c_id = '".api_get_course_int_id()."'"; |
|
|
|
|
$conditions = ['where' => $whereCondition, 'inject_joins' => $joins]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*if ($formGroup->validate()) { |
|
|
|
|
$groupId = (int) $formGroup->getSubmitValue('group_id'); |
|
|
|
@ -588,6 +623,9 @@ if ($nbStudents > 0) { |
|
|
|
|
$mainForm->addHtml('<div id="advanced_search_options" style="display:none;">'); |
|
|
|
|
$mainForm->addHtml($formClass->returnForm()); |
|
|
|
|
$mainForm->addHtml($formExtraField->returnForm()); |
|
|
|
|
if (false !== api_get_configuration_value('user_edition_extra_field_to_check')) { |
|
|
|
|
$mainForm->addHtml($formExLearners->returnForm()); |
|
|
|
|
} |
|
|
|
|
$mainForm->addHtml('</div>'); |
|
|
|
|
$html .= $mainForm->returnForm(); |
|
|
|
|
|
|
|
|
|