diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 08040f839c..c2089ab298 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -33,8 +33,6 @@ check_login(); require_once $config['homedir'].'/vendor/autoload.php'; -use PandoraFMS\Dashboard\Manager; - require_once $config['homedir'].'/include/functions_profile.php'; require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_groups.php'; @@ -1376,72 +1374,6 @@ if (is_metaconsole() === true) { ); } -$values = [ - -1 => __('Use global conf'), - 1 => __('Yes'), - 0 => __('No'), -]; - -$home_screen = '

'.__('Home screen').ui_print_help_tip( - __('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'), - true -).'

'; - -$dashboards = Manager::getDashboards( - -1, - -1, - false, - false, - $id_usr -); - -$dashboards_aux = []; -if ($dashboards === false) { - $dashboards = ['None' => 'None']; -} else { - foreach ($dashboards as $key => $dashboard) { - $dashboards_aux[$dashboard['id']] = $dashboard['name']; - } -} - -$home_screen .= ''; - -$layouts = visual_map_get_user_layouts($config['id_user'], true); -$layouts_aux = []; -if ($layouts === false) { - $layouts_aux = ['None' => 'None']; -} else { - foreach ($layouts as $layout) { - $layouts_aux[$layout] = $layout; - } -} - -$home_screen .= ''; - -$home_screen .= html_print_input_text( - 'data_section', - $user_info['data_section'], - '', - 60, - 255, - true, - false -); - -$home_screen = ''; - $size_pagination = '

'.__('Block size for pagination').'

'; $size_pagination .= html_print_input_text( 'block_size', @@ -2078,17 +2010,20 @@ if (is_metaconsole() === false) { } function show_data_section() { - var $section = $("#section").val(); - var $allElements = $('div[id^="custom_home_screen_"]'); - var $elementSelected = $('div[id="custom_home_screen_' + $section + '"]'); + var section = $("#section").val(); + if(section === 'other'){ + section = 'external_link'; + } + var allElements = $('div[id^="custom_home_screen_"]'); + var elementSelected = $('div[id="custom_home_screen_' + section + '"]'); // Hide all elements. - $allElements.each(function() { + allElements.each(function() { $(this).addClass('invisible'); $(this).children().addClass('invisible'); }) // Show only the selected. - $elementSelected.removeClass('invisible'); - $elementSelected.children().removeClass('invisible'); + elementSelected.removeClass('invisible'); + elementSelected.children().removeClass('invisible'); } function switch_ehorus_conf() { diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index 6d5f9bf18b..95def919c2 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -48,13 +48,44 @@ $homeScreenValues = [ // Custom Home Screen controls. $customHomeScreenAddition = []; // Home screen. Dashboard. -$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%'); +$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select( + $dashboards_aux, + 'dashboard', + $user_info['data_section'], + '', + '', + '', + true, + false, + true, + 'w100p', + false, + 'width: 100%' +); // Home screen. Visual consoles. -$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%'); +$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select( + $layouts_aux, + 'visual_console', + $user_info['data_section'], + '', + '', + '', + true, + false, + true, + 'w100p', + false, + 'width: 100%' +); // Home screen. External link and Other. -$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true); -$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true); - +$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text( + 'data_section', + $user_info['data_section'], + '', + 60, + 255, + true +); $customHomeScreenDataField = ''; foreach ($customHomeScreenAddition as $key => $customField) { $customHomeScreenDataField .= html_print_div( @@ -576,7 +607,7 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh true ); -// eHorus conf +// EHorus conf. if (isset($config['ehorus_user_level_conf']) === true && (bool) $config['ehorus_user_level_conf'] === true) { $userManagementTable->data['captions_ehorus_user_level_enabled'][1] = __('Pandora RC user access enabled'); $userManagementTable->data['fields_ehorus_user_level_enabled'][1] = html_print_checkbox_switch( @@ -791,7 +822,7 @@ $userManagementTable->data['fields_addSettings'][0] = html_print_textarea( 5, 65, $user_info['comments'], - ($view_mode ? 'readonly="readonly"' : ''), + ($view_mode) ? 'readonly="readonly"' : '', true, '' ); @@ -945,15 +976,7 @@ $(document).ready(function () { $('#advanced-line1_looknfeel-1 > a').css('display', 'block'); }) - var ehorus_user_level_enabled = - - ; + var ehorus_user_level_enabled = ''; var chk_ehorus_user_level_enabled = ehorus_user_level_enabled; if (ehorus_user_level_enabled == 0) {