Group: add usergroup_add_user_show_all_student_by_default conf setting - refs BT#20712

Show all users in selector as initial list when subscribing users to group
pull/4698/head
Angel Fernando Quiroz Campos 2 years ago
parent e4163ec38f
commit 1fdbec244a
  1. 18
      main/admin/add_users_to_usergroup.php
  2. 3
      main/install/configuration.dist.php

@ -86,9 +86,12 @@ function change_select(reset) {
if (reset) {
document.formulaire["first_letter_user"].value = "";
document.formulaire["form_sent"].value = "1";
return;
if ('.(api_get_configuration_value('usergroup_add_user_show_all_student_by_default') ? 0 : 1).') {
document.formulaire["form_sent"].value = "1";
return;
}
}
$.post("'.api_get_self().'", $(document.formulaire).serialize(), function(data) {
@ -318,6 +321,17 @@ if (!empty($user_list)) {
}
}
if (api_get_configuration_value('usergroup_add_user_show_all_student_by_default')
&& empty($elements_not_in)
&& empty($first_letter_user)
) {
$initialUserList = UserManager::getUserListLike([], $order, true, 'OR');
$elements_not_in = array_combine(
array_column($initialUserList, 'id'),
array_column($initialUserList, 'complete_name_with_username')
);
}
if (ChamiloApi::isAjaxRequest()) {
JsonResponse::create($elements_not_in)->send();
exit;

@ -1239,6 +1239,9 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
// Do not unsubscribe users from session when sessions are unsubscribe to class
// $_configuration['usergroup_do_not_unsubscribe_users_from_session_on_session_unsubscribe'] = false;
// Show all users in selector as initial list when subscribing users to class
//$_configuration['usergroup_add_user_show_all_student_by_default'] = false;
// Validate user login via a webservice, Chamilo will send a "login" and "password" parameters
// to the "myWebServiceFunctionToLogin" function, the result should be "1" if the user have access.
/*$_configuration['webservice_validation'] = [

Loading…
Cancel
Save