|
|
|
@ -86,10 +86,13 @@ function change_select(reset) { |
|
|
|
|
|
|
|
|
|
|
|
if (reset) { |
|
|
|
if (reset) { |
|
|
|
document.formulaire["first_letter_user"].value = ""; |
|
|
|
document.formulaire["first_letter_user"].value = ""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ('.(api_get_configuration_value('usergroup_add_user_show_all_student_by_default') ? 0 : 1).') { |
|
|
|
document.formulaire["form_sent"].value = "1"; |
|
|
|
document.formulaire["form_sent"].value = "1"; |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$.post("'.api_get_self().'", $(document.formulaire).serialize(), function(data) { |
|
|
|
$.post("'.api_get_self().'", $(document.formulaire).serialize(), function(data) { |
|
|
|
document.formulaire["form_sent"].value = "1"; |
|
|
|
document.formulaire["form_sent"].value = "1"; |
|
|
|
@ -173,6 +176,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'export') { |
|
|
|
|
|
|
|
|
|
|
|
// Filter by Extra Fields |
|
|
|
// Filter by Extra Fields |
|
|
|
$use_extra_fields = false; |
|
|
|
$use_extra_fields = false; |
|
|
|
|
|
|
|
$extra_field_result = []; |
|
|
|
if (is_array($extra_field_list)) { |
|
|
|
if (is_array($extra_field_list)) { |
|
|
|
if (is_array($new_field_list) && count($new_field_list) > 0) { |
|
|
|
if (is_array($new_field_list) && count($new_field_list) > 0) { |
|
|
|
foreach ($new_field_list as $new_field) { |
|
|
|
foreach ($new_field_list as $new_field) { |
|
|
|
@ -273,7 +277,7 @@ foreach ($list_in as $listedUserId) { |
|
|
|
$elements_in[$listedUserId] = $person_name; |
|
|
|
$elements_in[$listedUserId] = $person_name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$user_with_any_group = isset($_REQUEST['user_with_any_group']) && !empty($_REQUEST['user_with_any_group']); |
|
|
|
$user_with_any_group = !empty($_REQUEST['user_with_any_group']); |
|
|
|
$user_list = []; |
|
|
|
$user_list = []; |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($conditions)) { |
|
|
|
if (!empty($conditions)) { |
|
|
|
@ -317,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()) { |
|
|
|
if (ChamiloApi::isAjaxRequest()) { |
|
|
|
JsonResponse::create($elements_not_in)->send(); |
|
|
|
JsonResponse::create($elements_not_in)->send(); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
@ -341,7 +356,8 @@ echo '<div id="advanced_search_options" style="display:none">'; |
|
|
|
$searchForm->display(); |
|
|
|
$searchForm->display(); |
|
|
|
echo '</div>'; |
|
|
|
echo '</div>'; |
|
|
|
?> |
|
|
|
?> |
|
|
|
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) { |
|
|
|
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; |
|
|
|
|
|
|
|
if (!empty($_GET['add'])) { |
|
|
|
echo '&add=true'; |
|
|
|
echo '&add=true'; |
|
|
|
} ?>" style="margin:0px;"> |
|
|
|
} ?>" style="margin:0px;"> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
@ -383,15 +399,20 @@ echo Display::input('hidden', 'add_type', null); |
|
|
|
?> |
|
|
|
?> |
|
|
|
<select name="relation" id="relation" class="form-control"> |
|
|
|
<select name="relation" id="relation" class="form-control"> |
|
|
|
<option value=""><?php echo get_lang('SelectARelationType'); ?></option>
|
|
|
|
<option value=""><?php echo get_lang('SelectARelationType'); ?></option>
|
|
|
|
<option value="<?php echo GROUP_USER_PERMISSION_ADMIN; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_ADMIN) ? 'selected=selected' : ''; ?> >
|
|
|
|
<option |
|
|
|
|
|
|
|
value="<?php echo GROUP_USER_PERMISSION_ADMIN; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_ADMIN) ? 'selected=selected' : ''; ?> >
|
|
|
|
<?php echo get_lang('Admin'); ?></option>
|
|
|
|
<?php echo get_lang('Admin'); ?></option>
|
|
|
|
<option value="<?php echo GROUP_USER_PERMISSION_READER; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_READER) ? 'selected=selected' : ''; ?> >
|
|
|
|
<option |
|
|
|
|
|
|
|
value="<?php echo GROUP_USER_PERMISSION_READER; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_READER) ? 'selected=selected' : ''; ?> >
|
|
|
|
<?php echo get_lang('Reader'); ?></option>
|
|
|
|
<?php echo get_lang('Reader'); ?></option>
|
|
|
|
<option value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_PENDING_INVITATION) ? 'selected=selected' : ''; ?> >
|
|
|
|
<option |
|
|
|
|
|
|
|
value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_PENDING_INVITATION) ? 'selected=selected' : ''; ?> >
|
|
|
|
<?php echo get_lang('PendingInvitation'); ?></option>
|
|
|
|
<?php echo get_lang('PendingInvitation'); ?></option>
|
|
|
|
<option value="<?php echo GROUP_USER_PERMISSION_MODERATOR; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_MODERATOR) ? 'selected=selected' : ''; ?> >
|
|
|
|
<option |
|
|
|
|
|
|
|
value="<?php echo GROUP_USER_PERMISSION_MODERATOR; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_MODERATOR) ? 'selected=selected' : ''; ?> >
|
|
|
|
<?php echo get_lang('Moderator'); ?></option>
|
|
|
|
<?php echo get_lang('Moderator'); ?></option>
|
|
|
|
<option value="<?php echo GROUP_USER_PERMISSION_HRM; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_HRM) ? 'selected=selected' : ''; ?> >
|
|
|
|
<option |
|
|
|
|
|
|
|
value="<?php echo GROUP_USER_PERMISSION_HRM; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_HRM) ? 'selected=selected' : ''; ?> >
|
|
|
|
<?php echo get_lang('Drh'); ?></option>
|
|
|
|
<?php echo get_lang('Drh'); ?></option>
|
|
|
|
</select> |
|
|
|
</select> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
@ -438,11 +459,11 @@ echo Display::input('hidden', 'add_type', null); |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-md-2"> |
|
|
|
<div class="col-md-2"> |
|
|
|
<div style="padding-top:54px;width:auto;text-align: center;"> |
|
|
|
<div style="padding-top:54px;width:auto;text-align: center;"> |
|
|
|
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))"> |
|
|
|
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))"> |
|
|
|
<em class="fa fa-arrow-right"></em> |
|
|
|
<em class="fa fa-arrow-right"></em> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<br/><br/> |
|
|
|
<br/><br/> |
|
|
|
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_in'), document.getElementById('elements_not_in'))" onclick="moveItem(document.getElementById('elements_in'), document.getElementById('elements_not_in'))"> |
|
|
|
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_in'), document.getElementById('elements_not_in'))"> |
|
|
|
<em class="fa fa-arrow-left"></em> |
|
|
|
<em class="fa fa-arrow-left"></em> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -487,7 +508,7 @@ function moveItem(origin , destination) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function sortOptions(options) { |
|
|
|
function sortOptions(options) { |
|
|
|
newOptions = new Array(); |
|
|
|
newOptions = []; |
|
|
|
for (i = 0; i < options.length; i++) |
|
|
|
for (i = 0; i < options.length; i++) |
|
|
|
newOptions[i] = options[i]; |
|
|
|
newOptions[i] = options[i]; |
|
|
|
|
|
|
|
|
|
|
|
|