width = '80%'; $table->data = array (); $table->colspan = array (); $table->size = array (); $table->size[0] = '35%'; $table->size[1] = '65%'; $table->style = array (); $table->style[0] = 'font-weight: bold; vertical-align: top'; $table->data[0][0] = __('User ID'); $table->data[0][1] = print_input_text_extended ('id_user', $id, '', '', 20, 60, !$new_user || $view_mode, '', '', true); $table->data[1][0] = __('Full (display) name'); $table->data[1][1] = print_input_text_extended ('fullname', $user_info['fullname'], '', '', 30, 255, $view_mode, '', '', true); $table->data[2][0] = __('Language'); $table->data[2][1] = print_select_from_sql ('SELECT id_language, name FROM tlanguage', 'language', $user_info["language"], '', '', '', true); /* $table->data[2][0] = __('First name'); $table->data[2][1] = print_input_text_extended ('firstname', $user_info['firstname'], '', '', 30, 255, $view_mode, '', '', true); $table->data[3][0] = __('Last name'); $table->data[3][1] = print_input_text_extended ('lastname', $user_info['lastname'], '', '', 30, 255, $view_mode, '', '', true); */ if ($config['user_can_update_password']) { $table->data[4][0] = __('Password'); $table->data[4][1] = print_input_text_extended ('password_new', '', '', '', 15, 255, $view_mode, '', '', true, true); $table->data[5][0] = __('Password confirmation'); $table->data[5][1] = print_input_text_extended ('password_confirm', '', '', '', 15, 255, $view_mode, '', '', true, true); } if ($config['admin_can_make_admin']) { $table->data[6][0] = __('Global Profile'); $table->data[6][1] = print_radio_button ('is_admin', 1, '', $user_info['is_admin'], true); $table->data[6][1] .= __('Administrator'); $table->data[6][1] .= print_help_tip (__("This user has permissions to manage all. This is admin user and overwrites all permissions given in profiles/groups"), true); $table->data[6][1] .= '
'; $table->data[6][1] .= print_radio_button ('is_admin', 0, '', $user_info['is_admin'], true); $table->data[6][1] .= __('Standard User'); $table->data[6][1] .= print_help_tip (__("This user has separated permissions to view data in his group agents, create incidents belong to his groups, add notes in another incidents, create personal assignments or reviews and other tasks, on different profiles"), true); } $table->data[7][0] = __('E-mail'); $table->data[7][1] = print_input_text_extended ("email", $user_info['email'], '', '', 20, 100, $view_mode, '', '', true); $table->data[8][0] = __('Phone number'); $table->data[8][1] = print_input_text_extended ("phone", $user_info['phone'], '', '', 10, 30, $view_mode, '', '', true); $table->data[9][0] = __('Comments'); $table->data[9][1] = print_textarea ("comments", 2, 65, $user_info['comments'], ($view_mode ? 'readonly="readonly"' : ''), true); // If we want to create a new user, skins displayed are the skins of the creator's group. If we want to update, skins displayed are the skins of the modified user. if ($new_user){ $usr_groups = (get_user_groups($config['id_user'])); $id_usr = $config['id_user']; }else{ $usr_groups = (get_user_groups($id)); $id_usr = $id; } // User only can change skins if has more than one group if (count($usr_groups) > 1){ $isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $table->data[10][0] = __('Skin'); $table->data[10][1] = print_select_skins($id_usr,'skin', $user_info['id_skin'], '', __('None'), 0, true); } } echo '
'; print_table ($table); echo '
'; if ($new_user) { if ($config['admin_can_add_user']){ print_input_hidden ('create_user', 1); print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"'); } } else { if ($config['user_can_update_info']) { print_input_hidden ('update_user', 1); print_submit_button (__('Update'), 'uptbutton', false, 'class="sub upd"'); } } echo '
'; echo '
'; echo '
'; /* Don't show anything else if we're creating an user */ if (empty ($id) || $new_user) return; echo '

'.__('Profiles/Groups assigned to this user').'

'; $table->width = '75%'; $table->data = array (); $table->head = array (); $table->align = array (); $table->style = array (); $table->style[0] = 'font-weight: bold'; $table->style[1] = 'font-weight: bold'; $table->head[0] = __('Profile name'); $table->head[1] = __('Group'); $table->head[2] = __('Action'); $table->align[2] = 'center'; $result = get_db_all_rows_field_filter ("tusuario_perfil", "id_usuario", $id); if ($result === false) { $result = array (); } foreach ($result as $profile) { $data = array (); $data[0] = ''.get_profile_name ($profile['id_perfil']).''; $data[1] = print_group_icon($profile["id_grupo"],true).' '.printTruncateText(get_group_name ($profile['id_grupo'], True), 35).''; $data[2] = '
'; $data[2] .= print_input_hidden ('delete_profile', 1, true); $data[2] .= print_input_hidden ('id_user_profile', $profile['id_up'], true); $data[2] .= print_input_hidden ('id_user', $id, true); $data[2] .= print_input_image ('del', 'images/cross.png', 1, '', true); $data[2] .= '
'; array_push ($table->data, $data); } $data = array (); $data[0] = '
'; $data[0] .= print_select (get_profiles (), 'assign_profile', 0, '', __('None'), 0, true, false, false); $data[1] = print_select_groups($config['id_user'], "UM", true, 'assign_group', -1, '', __('None'), -1, true, false, false); $data[2] = print_input_image ('add', 'images/add.png', 1, '', true); $data[2] .= print_input_hidden ('id', $id, true); $data[2] .= print_input_hidden ('add_profile', 1, true); $data[2] .= '
'; array_push ($table->data, $data); print_table ($table); echo ''; unset ($table); ?>