Fixes bug when there any session field

skala
Julio Montoya 12 years ago
parent 4e97e203d9
commit 3e8613fc8c
  1. 2
      main/admin/configure_inscription.php
  2. 2
      main/admin/user_add.php
  3. 2
      main/admin/user_edit.php
  4. 2
      main/auth/inscription.php
  5. 2
      main/auth/profile.php
  6. 2
      main/inc/lib/session_field.lib.php
  7. 5
      main/inc/lib/usermanager.lib.php
  8. 2
      main/survey/fillsurvey.php

@ -277,7 +277,7 @@ if ($display_all_form) {
}
}
$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
UserManager::set_extra_fields_in_form($form, $extra_data, 'registration');
UserManager::set_extra_fields_in_form($form, $extra_data, 'registration', false, null, 'user');
}
// Terms and conditions

@ -207,7 +207,7 @@ $form->addElement('radio', 'active', '', get_lang('Inactive'), 0);
$extra_data = UserManager::get_extra_user_data(0, true);
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'user_add');
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'user_add', false, null, 'user');
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function

@ -266,7 +266,7 @@ if (!$user_data['platform_admin']) {
// EXTRA FIELDS
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'user_edit', true, $user_id);
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'user_edit', true, $user_id, 'user');
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function

@ -155,7 +155,7 @@ if ($user_already_registered_show_terms == false) {
}
// EXTRA FIELDS
$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
UserManager::set_extra_fields_in_form($form, $extra_data, 'registration');
UserManager::set_extra_fields_in_form($form, $extra_data, 'registration', false, null, 'user');
}
if (isset($_SESSION['user_language_choice']) && $_SESSION['user_language_choice'] != '') {

@ -280,7 +280,7 @@ if (is_platform_authentication() && is_profile_editable() && api_get_setting('pr
// EXTRA FIELDS
$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'profile', api_get_user_id());
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'profile', api_get_user_id(), 'user');
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function

@ -21,7 +21,7 @@ class SessionField extends Model {
}
}
$extra_fields = self::get_all();
UserManager::set_extra_fields_in_form($form, null, 'session_field', false, false, $extra_fields);
UserManager::set_extra_fields_in_form($form, null, 'session_field', false, false, 'session', $extra_fields);
}
public function get_count() {

@ -3528,16 +3528,17 @@ class UserManager {
return false;
}
static function set_extra_fields_in_form($form, $extra_data, $form_name, $admin_permissions = false, $user_id = null, $extra = null) {
static function set_extra_fields_in_form($form, $extra_data, $form_name, $admin_permissions = false, $user_id = null, $type = 'user', $extra = null) {
$user_id = intval($user_id);
// User extra fields
if (empty($extra)) {
if ($type == 'user') {
$extra = UserManager::get_extra_fields(0, 50, 5, 'ASC', true, null, true);
}
$jquery_ready_content = null;
if (!empty($extra))
foreach ($extra as $field_details) {
if (!$admin_permissions) {
if ($field_details['field_visible'] == 0) {

@ -389,7 +389,7 @@ if ($survey_data['form_fields']!='' && $survey_data['anonymous'] == 0 && is_arra
// EXTRA FIELDS
$extra_data = UserManager :: get_extra_user_data($user_id, true);
UserManager::set_extra_fields_in_form($form, $extra_data, 'profile');
UserManager::set_extra_fields_in_form($form, $extra_data, 'profile', false, null, 'user');
$form->addElement('style_submit_button', '', get_lang('Next'), array('class' => 'next'));
$user_data = array_merge($user_data, $extra_data);

Loading…
Cancel
Save