|
|
|
@ -1,9 +1,7 @@ |
|
|
|
|
<?php |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
/** |
|
|
|
|
============================================================================== |
|
|
|
|
* @package chamilo.admin |
|
|
|
|
============================================================================== |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
// Language files that should be included |
|
|
|
@ -195,6 +193,7 @@ $form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active |
|
|
|
|
$form->addElement('radio', 'active', '', get_lang('Inactive'), 0); |
|
|
|
|
|
|
|
|
|
// EXTRA FIELDS |
|
|
|
|
//@todo MOVE this code in a useful class, this code is repete MANY times in Chamilo: user_edit.php, main/auth/inscription.php, etc, etc |
|
|
|
|
$extra = UserManager::get_extra_fields(0, 50, 5, 'ASC'); |
|
|
|
|
$extra_data = UserManager::get_extra_user_data(0, true); |
|
|
|
|
|
|
|
|
@ -221,11 +220,21 @@ foreach($extra as $id => $field_details) { |
|
|
|
|
$form->addGroup($group, 'extra_'.$field_details[1], $field_details[3], ''); |
|
|
|
|
break; |
|
|
|
|
case USER_FIELD_TYPE_SELECT: |
|
|
|
|
$get_lang_variables = false; |
|
|
|
|
if (in_array($field_details[1], array('mail_notify_message','mail_notify_invitation', 'mail_notify_group_message'))) { |
|
|
|
|
$get_lang_variables = true; |
|
|
|
|
} |
|
|
|
|
$options = array(); |
|
|
|
|
foreach($field_details[9] as $option_id => $option_details) { |
|
|
|
|
if ($get_lang_variables) { |
|
|
|
|
$option_details[2] = get_lang($option_details[2]); |
|
|
|
|
} |
|
|
|
|
$options[$option_details[1]] = $option_details[2]; |
|
|
|
|
} |
|
|
|
|
$form->addElement('select','extra_'.$field_details[1],$field_details[3],$options,''); |
|
|
|
|
if ($get_lang_variables) { |
|
|
|
|
$field_details[3] = get_lang($field_details[3]); |
|
|
|
|
} |
|
|
|
|
$form->addElement('select','extra_'.$field_details[1],$field_details[3], $options,''); |
|
|
|
|
break; |
|
|
|
|
case USER_FIELD_TYPE_SELECT_MULTIPLE: |
|
|
|
|
$options = array(); |
|
|
|
@ -270,6 +279,7 @@ foreach($extra as $id => $field_details) { |
|
|
|
|
$extra_data['extra_'.$field_details[1]] = array(); |
|
|
|
|
|
|
|
|
|
// looping through the selected values and assigning the selected values to either the first or second select form |
|
|
|
|
|
|
|
|
|
foreach ($selected_values as $key => $selected_value) { |
|
|
|
|
if (key_exists($selected_value, $values[0])) { |
|
|
|
|
$extra_data['extra_'.$field_details[1]]['extra_'.$field_details[1]] = $selected_value; |
|
|
|
|