From ac41e9255fd9adc46524138e6354c88e359bdbc1 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 24 Apr 2019 13:53:18 +0200 Subject: [PATCH] helpers Former-commit-id: 56c67397cb17ca0ebc28e2903c378fcda10a6536 --- pandora_console/extensions/agents_alerts.php | 11 +- pandora_console/extensions/agents_modules.php | 13 +- pandora_console/extensions/module_groups.php | 9 +- .../extensions/realtime_graphs.php | 9 +- .../godmode/agentes/agent_manager.php | 10 +- .../godmode/agentes/configurar_agente.php | 3 +- .../agentes/planned_downtime.editor.php | 426 +++++-- .../godmode/agentes/planned_downtime.list.php | 58 +- .../godmode/alerts/alert_list.builder.php | 9 +- .../godmode/alerts/alert_list.list.php | 31 +- .../godmode/gis_maps/configure_gis_map.php | 2 +- .../godmode/massive/massive_edit_agents.php | 4 +- .../godmode/reporting/graph_builder.php | 25 +- .../godmode/reporting/map_builder.php | 4 +- .../godmode/reporting/reporting_builder.php | 34 +- .../reporting/visual_console_favorite.php | 2 +- .../snmpconsole/snmp_trap_generator.php | 76 +- .../include/ajax/alert_list.ajax.php | 102 +- pandora_console/include/functions.php | 1089 +++++++++++++++++ pandora_console/include/functions_ui.php | 6 +- .../help/clippy/modules_not_learning_mode.php | 42 +- pandora_console/include/javascript/pandora.js | 4 +- .../operation/agentes/group_view.php | 11 +- .../operation/agentes/networkmap.dinamic.php | 2 +- .../agentes/pandora_networkmap.editor.php | 2 +- .../operation/agentes/pandora_networkmap.php | 2 +- .../agentes/pandora_networkmap.view.php | 4 +- .../operation/agentes/status_monitor.php | 2 +- .../operation/agentes/tactical.php | 13 +- .../operation/agentes/ver_agente.php | 16 +- .../operation/snmpconsole/snmp_browser.php | 2 +- pandora_console/operation/tree.php | 2 +- .../operation/users/user_edit_header.php | 69 +- .../users/user_edit_notifications.php | 27 +- 34 files changed, 1845 insertions(+), 276 deletions(-) diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 72b90eeafa..18a6fdd0bf 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -138,8 +138,15 @@ function mainAgentsAlerts() $onheader['combo_refr'] = $comborefr; } - // Header - ui_print_page_header(__('Agents/Alerts'), 'images/op_alerts.png', false, '', false, $updated_time); + // Header. + ui_print_page_header( + __('Agents/Alerts'), + 'images/op_alerts.png', + false, + 'agents_alerts_view', + false, + $updated_time + ); // Old style table, we need a lot of special formatting,don't use table function // Prepare old-style table diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 8c0eaa7dae..b5860068d8 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -181,8 +181,15 @@ function mainAgentsModules() // Old style table, we need a lot of special formatting,don't use table function // Prepare old-style table if ($config['pure'] == 0) { - // Header - ui_print_page_header(__('Agents/Modules'), 'images/module_mc.png', false, '', false, $updated_time); + // Header. + ui_print_page_header( + __('Agents/Modules'), + 'images/module_mc.png', + false, + 'agents_module_view', + false, + $updated_time + ); echo ''; echo ''; echo "'; @@ -826,4 +833,4 @@ $ignored_params['refresh'] = ''; } } - \ No newline at end of file + diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 1a505538ed..9e750be932 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -192,7 +192,14 @@ function mainModuleGroups() $array_data[$value['id_grupo']][$value['id_mg']] = $value; } - ui_print_page_header(__('Combined table of agent group and module group'), 'images/module_group.png', false, '', false, ''); + ui_print_page_header( + __('Combined table of agent group and module group'), + 'images/module_group.png', + false, + 'module_groups_view', + false, + '' + ); echo "
".$fullscreen['text'].'
"; diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index 09d66abf0c..cea09fe4d5 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -29,7 +29,14 @@ function pandora_realtime_graphs() $hide_header = get_parameter('hide_header', 0); if (!$hide_header) { - ui_print_page_header(__('Realtime graphs'), 'images/extensions.png', false, '', false, $onheader); + ui_print_page_header( + __('Realtime graphs'), + 'images/extensions.png', + false, + 'real_time_view', + false, + $onheader + ); } $chart[time()]['graph'] = '0'; diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index a7fc1f156a..4e4453d680 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -334,9 +334,9 @@ $table->data[7][1] = html_print_select( __('None'), 0, true -).' '.ui_print_help_icon('agent_server', true); +); -// Description +// Description. $table->data[8][0] = __('Description'); $table->data[8][1] = html_print_input_text( 'comentarios', @@ -362,7 +362,7 @@ $table->data = []; if (enterprise_installed()) { $secondary_groups_selected = enterprise_hook('agents_get_secondary_groups', [$id_agente]); - $table->data['secondary_groups'][0] = __('Secondary groups').ui_print_help_icon('secondary_groups', true); + $table->data['secondary_groups'][0] = __('Secondary groups'); $table->data['secondary_groups'][1] = html_print_select_groups( false, // Use the current user to select the groups @@ -535,12 +535,12 @@ $params['cascade_protection'] = true; $table->data[1][1] = ui_print_agent_autocomplete_input($params); if (enterprise_installed()) { - $table->data[1][1] .= html_print_checkbox('cascade_protection', 1, $cascade_protection, true).__('Cascade protection').' '.ui_print_help_icon('cascade_protection', true); + $table->data[1][1] .= html_print_checkbox('cascade_protection', 1, $cascade_protection, true).__('Cascade protection'); } $table->data[1][1] .= '  '.__('Module').' '.html_print_select($modules_values, 'cascade_protection_module', $cascade_protection_module, '', '', 0, true); // Learn mode / Normal mode -$table->data[3][0] = __('Module definition').ui_print_help_icon('module_definition', true); +$table->data[3][0] = __('Module definition'); $table->data[3][1] = __('Learning mode').' '.html_print_radio_button_extended( 'modo', 1, diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index dd7fad8fe8..06fcbed2c7 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -574,10 +574,11 @@ if ($id_agente) { } $help_header = ''; - // This add information to the header + // This add information to the header. switch ($tab) { case 'main': $tab_description = '- '.__('Setup'); + $help_header = 'main_tab'; break; case 'collection': diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index bc5ac2a09c..4dc9151039 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -1,16 +1,32 @@ "".html_print_image('images/list.png', true, ['title' => __('List')]).'', + 'text' => "".html_print_image( + 'images/list.png', + true, + ['title' => __('List')] + ).'', ]; -// Header +// Header. ui_print_page_header( __('Planned Downtime'), 'images/gm_monitoring.png', false, - 'planned_downtime', + 'planned_downtime_editor', true, $buttons ); -// recursion group filter +// Recursion group filter. $recursion = get_parameter('recursion', $_POST['recursion']); -// Initialize data -$id_group = (int) get_parameter('id_group'); -$name = (string) get_parameter('name'); -$description = (string) get_parameter('description'); +// Initialize data. +$id_group = (int) get_parameter('id_group'); +$name = (string) get_parameter('name'); +$description = (string) get_parameter('description'); -$type_downtime = (string) get_parameter('type_downtime', 'quiet'); -$type_execution = (string) get_parameter('type_execution', 'once'); -$type_periodicity = (string) get_parameter('type_periodicity', 'weekly'); +$type_downtime = (string) get_parameter('type_downtime', 'quiet'); +$type_execution = (string) get_parameter('type_execution', 'once'); +$type_periodicity = (string) get_parameter('type_periodicity', 'weekly'); $utimestamp = get_system_time(); -// Fake utimestamp to retrieve the string date of the system +// Fake utimestamp to retrieve the string date of the system. $system_time = ($utimestamp - get_fixed_offset()); -$once_date_from = (string) get_parameter('once_date_from', date(DATE_FORMAT, $utimestamp)); -$once_time_from = (string) get_parameter('once_time_from', date(TIME_FORMAT, $utimestamp)); -$once_date_to = (string) get_parameter('once_date_to', date(DATE_FORMAT, $utimestamp)); -$once_time_to = (string) get_parameter('once_time_to', date(TIME_FORMAT, ($utimestamp + SECONDS_1HOUR))); +$once_date_from = (string) get_parameter( + 'once_date_from', + date(DATE_FORMAT, $utimestamp) +); +$once_time_from = (string) get_parameter( + 'once_time_from', + date(TIME_FORMAT, $utimestamp) +); +$once_date_to = (string) get_parameter( + 'once_date_to', + date(DATE_FORMAT, $utimestamp) +); +$once_time_to = (string) get_parameter( + 'once_time_to', + date(TIME_FORMAT, ($utimestamp + SECONDS_1HOUR)) +); -$periodically_day_from = (int) get_parameter('periodically_day_from', 1); -$periodically_day_to = (int) get_parameter('periodically_day_to', 31); -$periodically_time_from = (string) get_parameter('periodically_time_from', date(TIME_FORMAT, $system_time)); -$periodically_time_to = (string) get_parameter('periodically_time_to', date(TIME_FORMAT, ($system_time + SECONDS_1HOUR))); +$periodically_day_from = (int) get_parameter( + 'periodically_day_from', + 1 +); +$periodically_day_to = (int) get_parameter( + 'periodically_day_to', + 31 +); +$periodically_time_from = (string) get_parameter( + 'periodically_time_from', + date(TIME_FORMAT, $system_time) +); +$periodically_time_to = (string) get_parameter( + 'periodically_time_to', + date(TIME_FORMAT, ($system_time + SECONDS_1HOUR)) +); -$monday = (bool) get_parameter('monday'); -$tuesday = (bool) get_parameter('tuesday'); -$wednesday = (bool) get_parameter('wednesday'); -$thursday = (bool) get_parameter('thursday'); -$friday = (bool) get_parameter('friday'); -$saturday = (bool) get_parameter('saturday'); -$sunday = (bool) get_parameter('sunday'); +$monday = (bool) get_parameter('monday'); +$tuesday = (bool) get_parameter('tuesday'); +$wednesday = (bool) get_parameter('wednesday'); +$thursday = (bool) get_parameter('thursday'); +$friday = (bool) get_parameter('friday'); +$saturday = (bool) get_parameter('saturday'); +$sunday = (bool) get_parameter('sunday'); -$first_create = (int) get_parameter('first_create'); -$create_downtime = (int) get_parameter('create_downtime'); -$update_downtime = (int) get_parameter('update_downtime'); -$edit_downtime = (int) get_parameter('edit_downtime'); -$id_downtime = (int) get_parameter('id_downtime'); +$first_create = (int) get_parameter('first_create'); +$create_downtime = (int) get_parameter('create_downtime'); +$update_downtime = (int) get_parameter('update_downtime'); +$edit_downtime = (int) get_parameter('edit_downtime'); +$id_downtime = (int) get_parameter('id_downtime'); -$id_agent = (int) get_parameter('id_agent'); -$insert_downtime_agent = (int) get_parameter('insert_downtime_agent'); -$delete_downtime_agent = (int) get_parameter('delete_downtime_agent'); +$id_agent = (int) get_parameter('id_agent'); +$insert_downtime_agent = (int) get_parameter('insert_downtime_agent'); +$delete_downtime_agent = (int) get_parameter('delete_downtime_agent'); $modules_selection_mode = (string) get_parameter('modules_selection_mode'); -// User groups with AD or AW permission for ACL checks -$user_groups_ad = array_keys(users_get_groups($config['id_user'], $access)); +// User groups with AD or AW permission for ACL checks. +$user_groups_ad = array_keys( + users_get_groups($config['id_user'], $access) +); -// INSERT A NEW DOWNTIME_AGENT ASSOCIATION +// INSERT A NEW DOWNTIME_AGENT ASSOCIATION. if ($insert_downtime_agent === 1) { - // Check AD permission on downtime - $downtime_group = db_get_value('id_group', 'tplanned_downtime', 'id', $id_downtime); + // Check AD permission on downtime. + $downtime_group = db_get_value( + 'id_group', + 'tplanned_downtime', + 'id', + $id_downtime + ); - if ($downtime_group === false || !in_array($downtime_group, $user_groups_ad)) { + if ($downtime_group === false + || !in_array($downtime_group, $user_groups_ad) + ) { db_pandora_audit( 'ACL Violation', 'Trying to access downtime scheduler' @@ -116,17 +169,27 @@ if ($insert_downtime_agent === 1) { $all_modules = (empty($module_names) || ($module_names[0] === '0')); - // 'Is running' check - $is_running = (bool) db_get_value('executed', 'tplanned_downtime', 'id', $id_downtime); + // 'Is running' check. + $is_running = (bool) db_get_value( + 'executed', + 'tplanned_downtime', + 'id', + $id_downtime + ); if ($is_running) { - ui_print_error_message(__('This elements cannot be modified while the downtime is being executed')); + ui_print_error_message( + __('This elements cannot be modified while the downtime is being executed') + ); } else { foreach ($agents as $agent_id) { - // check module belongs to the agent + // Check module belongs to the agent. if ($modules_selection_mode == 'all') { $check = false; foreach ($module_names as $module_name) { - $check_module = modules_get_agentmodule_id($module_name, $agent_id); + $check_module = modules_get_agentmodule_id( + $module_name, + $agent_id + ); if (!empty($check_module)) { $check = true; } @@ -137,10 +200,17 @@ if ($insert_downtime_agent === 1) { } } - // Check AD permission on agent - $agent_group = db_get_value('id_grupo', 'tagente', 'id_agente', $agent_id); + // Check AD permission on agent. + $agent_group = db_get_value( + 'id_grupo', + 'tagente', + 'id_agente', + $agent_id + ); - if ($agent_group === false || !in_array($agent_group, $user_groups_ad)) { + if ($agent_group === false + || !in_array($agent_group, $user_groups_ad) + ) { continue; } @@ -149,11 +219,17 @@ if ($insert_downtime_agent === 1) { 'id_agent' => $agent_id, 'all_modules' => $all_modules, ]; - $result = db_process_sql_insert('tplanned_downtime_agents', $values); + $result = db_process_sql_insert( + 'tplanned_downtime_agents', + $values + ); if ($result && !$all_modules) { foreach ($module_names as $module_name) { - $module = modules_get_agentmodule_id($module_name, $agent_id); + $module = modules_get_agentmodule_id( + $module_name, + $agent_id + ); if (empty($module)) { continue; @@ -164,7 +240,10 @@ if ($insert_downtime_agent === 1) { 'id_agent' => $agent_id, 'id_agent_module' => $module['id_agente_modulo'], ]; - $result = db_process_sql_insert('tplanned_downtime_modules', $values); + $result = db_process_sql_insert( + 'tplanned_downtime_modules', + $values + ); if ($result) { $values = ['id_user' => $config['id_user']]; @@ -180,14 +259,21 @@ if ($insert_downtime_agent === 1) { } } -// DELETE A DOWNTIME_AGENT ASSOCIATION +// DELETE A DOWNTIME_AGENT ASSOCIATION. if ($delete_downtime_agent === 1) { $id_da = (int) get_parameter('id_downtime_agent'); - // Check AD permission on downtime - $downtime_group = db_get_value('id_group', 'tplanned_downtime', 'id', $id_downtime); + // Check AD permission on downtime. + $downtime_group = db_get_value( + 'id_group', + 'tplanned_downtime', + 'id', + $id_downtime + ); - if ($downtime_group === false || !in_array($downtime_group, $user_groups_ad)) { + if ($downtime_group === false + || !in_array($downtime_group, $user_groups_ad) + ) { db_pandora_audit( 'ACL Violation', 'Trying to access downtime scheduler' @@ -196,10 +282,17 @@ if ($delete_downtime_agent === 1) { return; } - // Check AD permission on agent - $agent_group = db_get_value('id_grupo', 'tagente', 'id_agente', $id_agent); + // Check AD permission on agent. + $agent_group = db_get_value( + 'id_grupo', + 'tagente', + 'id_agente', + $id_agent + ); - if ($agent_group === false || !in_array($agent_group, $user_groups_ad)) { + if ($agent_group === false + || !in_array($agent_group, $user_groups_ad) + ) { db_pandora_audit( 'ACL Violation', 'Trying to access downtime scheduler' @@ -208,17 +301,27 @@ if ($delete_downtime_agent === 1) { return; } - // 'Is running' check - $is_running = (bool) db_get_value('executed', 'tplanned_downtime', 'id', $id_downtime); + // 'Is running' check. + $is_running = (bool) db_get_value( + 'executed', + 'tplanned_downtime', + 'id', + $id_downtime + ); if ($is_running) { - ui_print_error_message(__('This elements cannot be modified while the downtime is being executed')); + ui_print_error_message( + __('This elements cannot be modified while the downtime is being executed') + ); } else { $row_to_delete = db_get_row('tplanned_downtime_agents', 'id', $id_da); - $result = db_process_sql_delete('tplanned_downtime_agents', ['id' => $id_da]); + $result = db_process_sql_delete( + 'tplanned_downtime_agents', + ['id' => $id_da] + ); if ($result) { - // Delete modules in downtime + // Delete modules in downtime. db_process_sql_delete( 'tplanned_downtime_modules', [ @@ -230,7 +333,7 @@ if ($delete_downtime_agent === 1) { } } -// UPDATE OR CREATE A DOWNTIME (MAIN DATA, NOT AGENT ASSOCIATION) +// UPDATE OR CREATE A DOWNTIME (MAIN DATA, NOT AGENT ASSOCIATION). if ($create_downtime || $update_downtime) { $check = (bool) db_get_value('name', 'tplanned_downtime', 'name', $name); @@ -239,22 +342,32 @@ if ($create_downtime || $update_downtime) { $now = time(); if ($type_execution == 'once' && !$config['past_planned_downtimes'] && $datetime_from < $now) { - ui_print_error_message(__('Not created. Error inserting data. Start time must be higher than the current time')); + ui_print_error_message( + __('Not created. Error inserting data. Start time must be higher than the current time') + ); } else if ($type_execution == 'once' && $datetime_from >= $datetime_to) { - ui_print_error_message(__('Not created. Error inserting data').'. '.__('The end date must be higher than the start date')); + ui_print_error_message( + __('Not created. Error inserting data').'. '.__('The end date must be higher than the start date') + ); } else if ($type_execution == 'once' && $datetime_to <= $now && !$config['past_planned_downtimes']) { - ui_print_error_message(__('Not created. Error inserting data').'. '.__('The end date must be higher than the current time')); + ui_print_error_message( + __('Not created. Error inserting data').'. '.__('The end date must be higher than the current time') + ); } else if ($type_execution == 'periodically' && (($type_periodicity == 'weekly' && $periodically_time_from >= $periodically_time_to) || ($type_periodicity == 'monthly' && $periodically_day_from == $periodically_day_to && $periodically_time_from >= $periodically_time_to)) ) { - ui_print_error_message(__('Not created. Error inserting data').'. '.__('The end time must be higher than the start time')); + ui_print_error_message( + __('Not created. Error inserting data').'. '.__('The end time must be higher than the start time') + ); } else if ($type_execution == 'periodically' && $type_periodicity == 'monthly' && $periodically_day_from > $periodically_day_to) { - ui_print_error_message(__('Not created. Error inserting data').'. '.__('The end day must be higher than the start day')); + ui_print_error_message( + __('Not created. Error inserting data').'. '.__('The end day must be higher than the start day') + ); } else { $sql = ''; if ($create_downtime) { - // Check AD permission on new downtime + // Check AD permission on new downtime. if (!in_array($id_group, $user_groups_ad)) { db_pandora_audit( 'ACL Violation', @@ -295,7 +408,10 @@ if ($create_downtime || $update_downtime) { $values['periodically_time_to'] = '1970/01/01 '.$values['periodically_time_to']; } - $result = db_process_sql_insert('tplanned_downtime', $values); + $result = db_process_sql_insert( + 'tplanned_downtime', + $values + ); } else { ui_print_error_message( __('Each planned downtime must have a different name') @@ -309,7 +425,7 @@ if ($create_downtime || $update_downtime) { } else if ($update_downtime) { $old_downtime = db_get_row('tplanned_downtime', 'id', $id_downtime); - // Check AD permission on OLD downtime + // Check AD permission on OLD downtime. if (empty($old_downtime) || !in_array($old_downtime['id_group'], $user_groups_ad)) { db_pandora_audit( 'ACL Violation', @@ -319,7 +435,7 @@ if ($create_downtime || $update_downtime) { return; } - // Check AD permission on NEW downtime group + // Check AD permission on NEW downtime group. if (!in_array($id_group, $user_groups_ad)) { db_pandora_audit( 'ACL Violation', @@ -329,14 +445,17 @@ if ($create_downtime || $update_downtime) { return; } - // 'Is running' check + // 'Is running' check. $is_running = (bool) $old_downtime['executed']; $values = []; if (trim(io_safe_output($name)) == '') { - ui_print_error_message(__('Planned downtime must have a name')); + ui_print_error_message( + __('Planned downtime must have a name') + ); } - // When running only certain items can be modified for the 'once' type + + // When running only certain items can be modified for the 'once' type. else if ($is_running && $type_execution == 'once') { $values = [ 'description' => $description, @@ -344,7 +463,9 @@ if ($create_downtime || $update_downtime) { 'id_user' => $config['id_user'], ]; } else if ($is_running) { - ui_print_error_message(__('Cannot be modified while the downtime is being executed')); + ui_print_error_message( + __('Cannot be modified while the downtime is being executed') + ); } else { $values = [ 'name' => $name, @@ -376,7 +497,11 @@ if ($create_downtime || $update_downtime) { } if (!empty($values)) { - $result = db_process_sql_update('tplanned_downtime', $values, ['id' => $id_downtime]); + $result = db_process_sql_update( + 'tplanned_downtime', + $values, + ['id' => $id_downtime] + ); } } @@ -399,7 +524,7 @@ if ($create_downtime || $update_downtime) { // Have any data to show ? if ($id_downtime > 0) { - // Columns of the table tplanned_downtime + // Columns of the table tplanned_downtime. $columns = [ 'id', 'name', @@ -436,7 +561,8 @@ if ($id_downtime > 0) { break; case 'oracle': - // Oracle doesn't have TIME type, so we should transform the DATE value + // Oracle doesn't have TIME type, + // so we should transform the DATE value. $new_time_from = "TO_CHAR(periodically_time_from, 'HH24:MI:SS') AS periodically_time_from"; $new_time_to = "TO_CHAR(periodically_time_to, 'HH24:MI:SS') AS periodically_time_to"; @@ -500,7 +626,8 @@ if ($id_downtime > 0) { $running = (bool) $result['executed']; } -// when the planned downtime is in execution, only action to postpone on once type is enabled and the other are disabled. +// When the planned downtime is in execution, +// only action to postpone on once type is enabled and the other are disabled. $disabled_in_execution = (int) $running; $table = new StdClass(); @@ -508,11 +635,40 @@ $table->class = 'databox filters'; $table->width = '100%'; $table->data = []; $table->data[0][0] = __('Name'); -$table->data[0][1] = html_print_input_text('name', $name, '', 25, 40, true, $disabled_in_execution); +$table->data[0][1] = html_print_input_text( + 'name', + $name, + '', + 25, + 40, + true, + $disabled_in_execution +); $table->data[1][0] = __('Group'); -$table->data[1][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', 0, true, false, true, '', $disabled_in_execution); +$table->data[1][1] = html_print_select_groups( + false, + $access, + true, + 'id_group', + $id_group, + '', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution +); $table->data[2][0] = __('Description'); -$table->data[2][1] = html_print_textarea('description', 3, 35, $description, '', true); +$table->data[2][1] = html_print_textarea( + 'description', + 3, + 35, + $description, + '', + true +); $table->data[3][0] = __('Type').ui_print_help_tip( __('Quiet: Modules will not generate events or fire alerts.').'
'.__('Disable Agents: Disables the selected agents.').'
'.__('Disable Alerts: Disable alerts for the selected agents.'), @@ -554,7 +710,7 @@ $table->data[4][1] = html_print_select( ); $days = array_combine(range(1, 31), range(1, 31)); -$table->data[5][0] = __('Configure the time').' '.ui_print_help_icon('planned_downtime_time', true); +$table->data[5][0] = __('Configure the time').' '; ; $table->data[5][1] = "
"; } -// Editor form +// Editor form. html_print_table($table); html_print_input_hidden('id_agent', $id_agent); @@ -686,10 +842,20 @@ echo '
'; if ($id_downtime > 0) { html_print_input_hidden('update_downtime', 1); html_print_input_hidden('id_downtime', $id_downtime); - html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"'); + html_print_submit_button( + __('Update'), + 'updbutton', + false, + 'class="sub upd"' + ); } else { html_print_input_hidden('create_downtime', 1); - html_print_submit_button(__('Add'), 'crtbutton', false, 'class="sub wand"'); + html_print_submit_button( + __('Add'), + 'crtbutton', + false, + 'class="sub wand"' + ); } echo '
'; @@ -700,11 +866,11 @@ if ($id_downtime > 0) { $filter_group = (int) get_parameter('filter_group', 0); - // User AD groups to str for the filter + // User AD groups to str for the filter. $id_groups_str = implode(',', $user_groups_ad); if (empty($id_groups_str)) { - // Restrictive filter on error. This will filter all the downtimes + // Restrictive filter on error. This will filter all the downtimes. $id_groups_str = '-1'; } @@ -752,7 +918,7 @@ if ($id_downtime > 0) { $agent_ids = extract_column($agents, 'id_agente'); $agent_names = extract_column($agents, 'alias'); - // item[] = ; + $agents = array_combine($agent_ids, $agent_names); if ($agents === false) { $agents = []; @@ -763,7 +929,6 @@ if ($id_downtime > 0) { $disabled_add_button = true; } - echo "
"; html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;margin-right:15px;'); @@ -803,7 +968,10 @@ if ($id_downtime > 0) { ); echo ''; - echo '

'.__('Available modules:').ui_print_help_tip(__('Only for type Quiet for downtimes.'), true).'

'; + echo '

'.__('Available modules:').ui_print_help_tip( + __('Only for type Quiet for downtimes.'), + true + ).'

'; if ($type_downtime != 'quiet') { echo '
'; - // Start Overview of existing planned downtime + // Start Overview of existing planned downtime. echo '

'.__('Agents planned for this downtime').':

'; - // User the $id_groups_str built before + // User the $id_groups_str built before. $sql = sprintf( 'SELECT ta.nombre, tpda.id, ta.id_os, ta.id_agente, ta.id_grupo, @@ -860,13 +1047,18 @@ if ($id_downtime > 0) { foreach ($downtimes_agents as $downtime_agent) { $data = []; - $alias = db_get_value('alias', 'tagente', 'id_agente', $downtime_agent['id_agente']); + $alias = db_get_value( + 'alias', + 'tagente', + 'id_agente', + $downtime_agent['id_agente'] + ); $data[0] = $alias; $data[1] = db_get_sql( 'SELECT nombre - FROM tgrupo - WHERE id_grupo = '.$downtime_agent['id_grupo'] + FROM tgrupo + WHERE id_grupo = '.$downtime_agent['id_grupo'] ); $data[2] = ui_print_os_icon($downtime_agent['id_os'], true, true); @@ -887,7 +1079,9 @@ if ($id_downtime > 0) { if (!$running) { $data[5] = ''; - if ($type_downtime != 'disable_agents_alerts' && $type_downtime != 'disable_agents') { + if ($type_downtime != 'disable_agents_alerts' + && $type_downtime != 'disable_agents' + ) { $data[5] = ''.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete')]).''; } diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index a9529248b0..961ea1f7d0 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -50,7 +50,7 @@ if ($migrate_malformed) { } } -// Header +// Header. ui_print_page_header( __('Planned Downtime'), 'images/gm_monitoring.png', @@ -115,7 +115,7 @@ if ($delete_downtime) { } } -// Filter parameters +// Filter parameters. $offset = (int) get_parameter('offset'); $filter_params = []; @@ -131,7 +131,7 @@ $module_name = $filter_params['module_name'] = (string) (!empty($module_ $filter_params_str = http_build_query($filter_params); -// Table filter +// Table filter. $table_form = new StdClass(); $table_form->class = 'databox filters'; $table_form->width = '100%'; @@ -143,9 +143,9 @@ $table_form->data = []; $row = []; -// Search text +// Search text. $row[] = __('Search').' '.html_print_input_text('search_text', $search_text, '', 50, 250, true); -// Dates +// Dates. $date_inputs = __('From').' '.html_print_input_text('date_from', $date_from, '', 10, 10, true); $date_inputs .= '  '; $date_inputs .= __('To').' '.html_print_input_text('date_to', $date_to, '', 10, 10, true); @@ -155,20 +155,20 @@ $table_form->data[] = $row; $row = []; -// Execution type +// Execution type. $execution_type_fields = [ 'once' => __('Once'), 'periodically' => __('Periodically'), ]; $row[] = __('Execution type').' '.html_print_select($execution_type_fields, 'execution_type', $execution_type, '', __('Any'), '', true, false, false); -// Show past downtimes +// Show past downtimes. $row[] = __('Show past downtimes').' '.html_print_checkbox('archived', 1, $show_archived, true); $table_form->data[] = $row; $row = []; -// Agent +// Agent. $params = []; $params['show_helptip'] = true; $params['input_name'] = 'agent_name'; @@ -180,14 +180,14 @@ $params['hidden_input_idagent_value'] = $agent_id; $agent_input = __('Agent').' '.ui_print_agent_autocomplete_input($params); $row[] = $agent_input; -// Module +// Module. $row[] = __('Module').' '.html_print_autocomplete_modules('module_name', $module_name, false, true, '', [], true); $row[] = html_print_submit_button(__('Search'), 'search', false, 'class="sub search"', true); $table_form->data[] = $row; -// End of table filter -// Useful to know if the user has done a form filtering +// End of table filter. +// Useful to know if the user has done a form filtering. $filter_performed = false; $groups = users_get_groups(false, $access); @@ -197,7 +197,7 @@ if (!empty($groups)) { $groups_string = implode(',', array_keys($groups)); $where_values .= " AND id_group IN ($groups_string)"; - // WARNING: add $filter_performed = true; to any future filter + // WARNING: add $filter_performed = true; to any future filter. if (!empty($search_text)) { $filter_performed = true; @@ -272,7 +272,7 @@ if (!empty($groups)) { AND tpda.all_modules = 1))"; } - // Columns of the table tplanned_downtime + // Columns of the table tplanned_downtime. $columns = [ 'id', 'name', @@ -353,23 +353,23 @@ if (!empty($groups)) { $downtimes = []; } -// No downtimes cause the user has not anyone +// No downtimes cause the user has not anyone. if (!$downtimes && !$filter_performed) { include_once $config['homedir'].'/general/firts_task/planned_downtime.php'; } -// No downtimes cause the user performed a search +// No downtimes cause the user performed a search. else if (!$downtimes) { - // Filter form + // Filter form. echo "
"; html_print_table($table_form); echo '
'; - // Info message + // Info message. echo '
'.__('No planned downtime').'
'; echo '
'; - // Create button + // Create button. if ($write_permisson) { echo ' '; echo '
'; @@ -379,7 +379,7 @@ else if (!$downtimes) { echo '
'; } -// Has downtimes +// Has downtimes. else { echo ""; html_print_table($table_form); @@ -387,11 +387,11 @@ else { ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset); - // User groups with AR, AD or AW permission + // User groups with AR, AD or AW permission. $groupsAD = users_get_groups($config['id_user'], $access); $groupsAD = array_keys($groupsAD); - // View available downtimes present in database (if any of them) + // View available downtimes present in database (if any of them). $table = new StdClass(); $table->class = 'info_table'; $table->width = '100%'; @@ -475,7 +475,7 @@ else { ); } - // If user have writting permissions + // If user have writting permissions. if (in_array($downtime['id_group'], $groupsAD)) { // Stop button if ($downtime['type_execution'] == 'once' && $downtime['executed'] == 1) { @@ -484,16 +484,16 @@ else { $data['stop'] = ''; } - // Edit & delete buttons + // Edit & delete buttons. if ($downtime['executed'] == 0) { - // Edit + // Edit. $data['edit'] = ''.html_print_image('images/config.png', true, ['title' => __('Update')]).''; - // Delete + // Delete. $data['delete'] = ''.html_print_image('images/cross.png', true, ['title' => __('Delete')]); } else if ($downtime['executed'] == 1 && $downtime['type_execution'] == 'once') { - // Edit + // Edit. $data['edit'] = ''.html_print_image('images/config.png', true, ['title' => __('Update')]).''; - // Delete + // Delete. $data['delete'] = __('N/A'); } else { $data['edit'] = ''; @@ -521,7 +521,7 @@ else { ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom'); echo '
'; - // CSV export button + // CSV export button. echo '
'; html_print_button( __('Export to CSV'), @@ -532,7 +532,7 @@ else { ); echo '
'; - // Create button + // Create button. if ($write_permisson) { echo ' '; echo ''; diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 97d4c951bc..ca3a099bf3 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -124,11 +124,7 @@ $table->data[1][1] .= __('Number of alerts match from').' '; $table->data[1][1] .= html_print_input_text('fires_min', '', '', 4, 10, true); $table->data[1][1] .= ' '.__('to').' '; $table->data[1][1] .= html_print_input_text('fires_max', '', '', 4, 10, true); -$table->data[1][1] .= ui_print_help_icon( - 'alert-matches', - true, - ui_get_full_url(false, false, false, false) -); + $table->data[1][1] .= ''; if (check_acl($config['id_user'], 0, 'LM')) { $table->data[1][1] .= ''; @@ -172,8 +168,7 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { $table->data[3][0] = __('Threshold'); $table->data[3][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true); - $table->data[3][1] .= ' '.__('seconds').ui_print_help_icon('action_threshold', true); - + $table->data[3][1] .= ' '.__('seconds'); if (!isset($step)) { echo ''; diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index e7a013d971..4b3a3395cf 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -700,20 +700,41 @@ foreach ($simple_alerts as $alert) { $data[2] .= ''; $data[2] .= ''; $data[2] .= ''; - $data[2] .= __('Number of alerts match from').' '.ui_print_help_icon('alert-matches', true, ui_get_full_url(false, false, false, false)); + $data[2] .= __('Number of alerts match from'); $data[2] .= ''; $data[2] .= ''; - $data[2] .= html_print_input_text('fires_min', 0, '', 4, 10, true); + $data[2] .= html_print_input_text( + 'fires_min', + 0, + '', + 4, + 10, + true + ); $data[2] .= ' '.__('to').' '; - $data[2] .= html_print_input_text('fires_max', 0, '', 4, 10, true); + $data[2] .= html_print_input_text( + 'fires_max', + 0, + '', + 4, + 10, + true + ); $data[2] .= ''; $data[2] .= ''; $data[2] .= ''; $data[2] .= ''; - $data[2] .= __('Threshold').' '.ui_print_help_icon('action_threshold', true, ui_get_full_url(false, false, false, false)); + $data[2] .= __('Threshold'); $data[2] .= ''; $data[2] .= ''; - $data[2] .= html_print_input_text('module_action_threshold', '', '', 4, 10, true); + $data[2] .= html_print_input_text( + 'module_action_threshold', + '', + '', + 4, + 10, + true + ); $data[2] .= ''; $data[2] .= ''; $data[2] .= ''; diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index 9e52ddeae9..b39222f049 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -277,7 +277,7 @@ ui_print_page_header( __('GIS Maps builder'), 'images/gm_gis.png', false, - 'configure_gis_map', + 'configure_gis_map_edit', true, $buttons ); diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 74d05c10d0..da1a0887b5 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -489,7 +489,7 @@ $params['selectbox_id'] = 'cascade_protection_module'; $params['javascript_is_function_select'] = true; $table->data[0][1] = ui_print_agent_autocomplete_input($params); -$table->data[0][1] .= ''.__('Cascade protection').' '.ui_print_help_icon('cascade_protection', true).html_print_select( +$table->data[0][1] .= ''.__('Cascade protection').''.html_print_select( [ 1 => __('Yes'), 0 => __('No'), @@ -587,7 +587,7 @@ $table->data[0][0] = __('Custom ID'); $table->data[0][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255, true); // Learn mode / Normal mode -$table->data[1][0] = __('Module definition').ui_print_help_icon('module_definition', true); +$table->data[1][0] = __('Module definition'); $table->data[1][1] = __('No change').' '.html_print_radio_button_extended('mode', -1, '', $mode, false, '', 'style="margin-right: 40px;"', true); $table->data[1][1] .= __('Learning mode').' '.html_print_radio_button_extended('mode', 1, '', $mode, false, '', 'style="margin-right: 40px;"', true); $table->data[1][1] .= __('Normal mode').' '.html_print_radio_button_extended('mode', 0, '', $mode, false, '', 'style="margin-right: 40px;"', true); diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 28bae38d3d..7a83697824 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -276,19 +276,30 @@ if (isset($name)) { $head .= ' - '.$name; } -// Header +// Header. $tab = get_parameter('tab', ''); switch ($tab) { + default: case 'main': - ui_print_page_header($head, 'images/chart.png', false, 'graph_builder', false, $buttons); + ui_print_page_header( + $head, + 'images/chart.png', + false, + 'graph_builder', + false, + $buttons + ); break; case 'graph_editor': - ui_print_page_header($head, 'images/chart.png', false, 'graph_editor', false, $buttons); - break; - - default: - ui_print_page_header($head, 'images/chart.png', false, 'graph_builder', false, $buttons); + ui_print_page_header( + $head, + 'images/chart.png', + false, + 'graph_editor', + false, + $buttons + ); break; } diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 9b83a15600..8ce970262d 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -15,7 +15,7 @@ global $config; require_once $config['homedir'].'/include/functions_visual_map.php'; -// ACL for the general permission +// ACL for the general permission. $vconsoles_read = check_acl($config['id_user'], 0, 'VR'); $vconsoles_write = check_acl($config['id_user'], 0, 'VW'); $vconsoles_manage = check_acl($config['id_user'], 0, 'VM'); @@ -84,7 +84,7 @@ if (!$is_metaconsole) { __('Reporting').' » '.__('Visual Console'), 'images/op_reporting.png', false, - 'map_builder', + 'map_builder_intro', false, $buttons ); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 03179dd4d4..edcb968016 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -457,6 +457,7 @@ switch ($action) { } $subsection = ''; + $helpers = ''; switch ($activeTab) { case 'main': $buttons['list_reports']['active'] = true; @@ -464,7 +465,14 @@ switch ($action) { break; default: - $subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons); + $data_tab = reporting_enterprise_add_subsection_main( + $activeTab, + $buttons + ); + + $subsection = $data_tab['subsection']; + $buttons = $data_tab['buttons']; + $helpers = $data_tab['helpers']; break; } @@ -2401,6 +2409,7 @@ switch ($action) { $buttons = reporting_enterprise_add_main_Tabs($buttons); $subsection = ''; + $helpers = ''; switch ($activeTab) { case 'main': $buttons['list_reports']['active'] = true; @@ -2408,7 +2417,14 @@ switch ($action) { break; default: - $subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons); + $data_tab = reporting_enterprise_add_subsection_main( + $activeTab, + $buttons + ); + + $subsection = $data_tab['subsection']; + $buttons = $data_tab['buttons']; + $helpers = $data_tab['helper']; break; } @@ -2429,7 +2445,7 @@ switch ($action) { } // Page header for normal console. else { - ui_print_page_header($subsection, 'images/op_reporting.png', false, '', false, $buttons, false, '', 60); + ui_print_page_header($subsection, 'images/op_reporting.png', false, $helpers, false, $buttons, false, '', 60); } @@ -2505,11 +2521,21 @@ if ($enterpriseEnable and defined('METACONSOLE')) { // Print header. ui_meta_print_header(__('Reporting').$textReportName, '', $buttons); } else { + switch ($activeTab) { + case 'main': + $helpers = ''; + break; + + default: + $helpers = 'reporting_'.$activeTab.'_tab'; + break; + } + ui_print_page_header( $textReportName, 'images/op_reporting.png', false, - 'reporting_'.$activeTab.'_tab', + $helpers, false, $buttons, false, diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index df13291539..d1cd7ce2ef 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -78,7 +78,7 @@ if (!$is_metaconsole) { __('Reporting').' » '.__('Visual Favourite Console'), 'images/op_reporting.png', false, - 'map_builder', + 'map_builder_favorite', false, $buttons ); diff --git a/pandora_console/godmode/snmpconsole/snmp_trap_generator.php b/pandora_console/godmode/snmpconsole/snmp_trap_generator.php index ec8ed20930..43ed63abec 100755 --- a/pandora_console/godmode/snmpconsole/snmp_trap_generator.php +++ b/pandora_console/godmode/snmpconsole/snmp_trap_generator.php @@ -33,7 +33,13 @@ $snmp_type = (int) get_parameter('snmp_type', 0); $snmp_value = (string) get_parameter('snmp_value', ''); $generate_trap = (bool) get_parameter('generate_trap', 0); -ui_print_page_header(__('SNMP Trap generator'), 'images/op_snmp.png', false, '', false); +ui_print_page_header( + __('SNMP Trap generator'), + 'images/op_snmp.png', + false, + 'snmp_trap_generator_view', + false +); if ($generate_trap) { $result = true; @@ -64,22 +70,64 @@ $table->size = []; $table->data = []; $table->data[0][0] = __('Host address'); -$table->data[0][1] = html_print_input_text('snmp_host_address', $snmp_host_address, '', 50, 255, true); +$table->data[0][1] = html_print_input_text( + 'snmp_host_address', + $snmp_host_address, + '', + 50, + 255, + true +); $table->data[0][2] = __('Community'); -$table->data[0][3] = html_print_input_text('snmp_community', $snmp_community, '', 50, 255, true); +$table->data[0][3] = html_print_input_text( + 'snmp_community', + $snmp_community, + '', + 50, + 255, + true +); $table->data[2][0] = __('Enterprise String'); -$table->data[2][1] = html_print_input_text('snmp_oid', $snmp_oid, '', 50, 255, true); +$table->data[2][1] = html_print_input_text( + 'snmp_oid', + $snmp_oid, + '', + 50, + 255, + true +); $table->data[2][2] = __('Value'); -$table->data[2][3] = html_print_input_text('snmp_value', $snmp_value, '', 50, 255, true); +$table->data[2][3] = html_print_input_text( + 'snmp_value', + $snmp_value, + '', + 50, + 255, + true +); $table->data[3][0] = __('SNMP Agent'); -$table->data[3][1] = html_print_input_text('snmp_agent', $snmp_agent, '', 50, 255, true); +$table->data[3][1] = html_print_input_text( + 'snmp_agent', + $snmp_agent, + '', + 50, + 255, + true +); -$table->data[3][2] = __('SNMP Type').' '.ui_print_help_icon('snmp_trap_types', true); -$table->data[3][3] = html_print_input_text('snmp_type', $snmp_type, '', 50, 255, true); +$table->data[3][2] = __('SNMP Type'); +$table->data[3][3] = html_print_input_text( + 'snmp_type', + $snmp_type, + '', + 50, + 255, + true +); $types = [ 0 => 'Cold start (0)', @@ -90,7 +138,17 @@ $types = [ 5 => 'EGP neighbor loss (5)', 6 => 'Enterprise (6)', ]; -$table->data[3][3] = html_print_select($types, 'snmp_type', $snmp_type, '', __('Select'), -1, true, false, false); +$table->data[3][3] = html_print_select( + $types, + 'snmp_type', + $snmp_type, + '', + __('Select'), + -1, + true, + false, + false +); $traps_generator .= html_print_table($table, true); diff --git a/pandora_console/include/ajax/alert_list.ajax.php b/pandora_console/include/ajax/alert_list.ajax.php index fef3f3c97c..b8c3705046 100644 --- a/pandora_console/include/ajax/alert_list.ajax.php +++ b/pandora_console/include/ajax/alert_list.ajax.php @@ -153,24 +153,48 @@ if ($show_update_action_menu) { $id_alert = (int) get_parameter('id_alert'); $module_name = modules_get_agentmodule_name($id_agent_module); - $agent_alias = modules_get_agentmodule_agent_alias($id_agent); + + $agent_alias = modules_get_agentmodule_agent_alias($id_agent_module); $id_action = (int) get_parameter('id_action'); $actions = alerts_get_alert_agent_module_actions($id_alert); - $action_opction = db_get_row('talert_template_module_actions', 'id_alert_template_module', $id_alert); + $action_opction = db_get_row( + 'talert_template_module_actions', + 'id_alert_template_module', + $id_alert + ); $data .= ''; $data .= ''; - $data .= html_print_input_hidden('update_action', 1, true); - $data .= html_print_input_hidden('id_module_action_ajax', $id_module_action, true); + $data .= html_print_input_hidden( + 'update_action', + 1, + true + ); + $data .= html_print_input_hidden( + 'id_module_action_ajax', + $id_module_action, + true + ); if (! $id_agente) { $data .= ''; $data .= ''; $data .= ''; $data .= ''; } @@ -180,7 +204,14 @@ if ($show_update_action_menu) { $data .= __('Module'); $data .= ''; $data .= ''; $data .= ''; $data .= ''; @@ -188,29 +219,72 @@ if ($show_update_action_menu) { $data .= __('Action'); $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= '
'; - $data .= __('Agent'); + $data .= __('Agent').' '.ui_print_help_icon( + 'alert_scalate', + true, + ui_get_full_url(false, false, false, false) + ); $data .= ''; - $data .= ui_print_truncate_text($agent_alias, 'agent_small', false, true, true, '[…]'); + $data .= ui_print_truncate_text( + $agent_alias, + 'agent_small', + false, + true, + true, + '[…]' + ); $data .= '
'; - $data .= ui_print_truncate_text($module_name, 'module_small', false, true, true, '[…]'); + $data .= ui_print_truncate_text( + $module_name, + 'module_small', + false, + true, + true, + '[…]' + ); $data .= '
'; - $data .= html_print_select($actions, 'action_select_ajax', $id_action, '', __('None'), 0, true, false, true, '', false, 'width:150px'); + $data .= html_print_select( + $actions, + 'action_select_ajax', + $id_action, + '', + __('None'), + 0, + true, + false, + true, + '', + false, + 'width:150px' + ); $data .= '
'; - $data .= __('Number of alerts match from').' '.ui_print_help_icon('alert-matches', true, ui_get_full_url(false, false, false, false)); + $data .= __('Number of alerts match from'); $data .= ''; - $data .= html_print_input_text('fires_min_ajax', $action_opction['fires_min'], '', 4, 10, true); + $data .= html_print_input_text( + 'fires_min_ajax', + $action_opction['fires_min'], + '', + 4, + 10, + true + ); $data .= ' '.__('to').' '; - $data .= html_print_input_text('fires_max_ajax', $action_opction['fires_max'], '', 4, 10, true); + $data .= html_print_input_text( + 'fires_max_ajax', + $action_opction['fires_max'], + '', + 4, + 10, + true + ); $data .= '
'; - $data .= __('Threshold').' '.ui_print_help_icon('action_threshold', true, ui_get_full_url(false, false, false, false)); + $data .= __('Threshold'); $data .= ''; - $data .= html_print_input_text('module_action_threshold_ajax', $action_opction['module_action_threshold'], '', 4, 10, true); + $data .= html_print_input_text( + 'module_action_threshold_ajax', + $action_opction['module_action_threshold'], + '', + 4, + 10, + true + ); $data .= '
'; - $data .= html_print_submit_button(__('Update'), 'updbutton', false, ['class' => 'sub next', 'style' => 'float:right'], true); + $data .= html_print_submit_button( + __('Update'), + 'updbutton', + false, + [ + 'class' => 'sub next', + 'style' => 'float:right', + ], + true + ); $data .= ''; echo $data; return; diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 0b9f71221b..73dcfaedb6 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3940,3 +3940,1092 @@ function mask2cidr($mask) $base = ip2long('255.255.255.255'); return (32 - log((($long ^ $base) + 1), 2)); } + + +function get_help_info($section_name) +{ + global $config; + hd($section_name); + + $user_language = get_user_language($id_user); + + $es = false; + $result = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:'; + if ($user_language == 'es') { + $es = true; + $result = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:'; + } + + switch ($section_name) { + case 'action_threshold': + if ($es) { + $result .= ''; + } else { + $result .= ''; + } + break; + + case 'tactical_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Vista_t.C3.A1ctica'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Tactical_view'; + } + break; + + case 'group_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Vista_de_Grupos'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Group_view'; + } + break; + + case 'tree_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Vista_de_.C3.A1rbol'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#The_Tree_View'; + } + break; + + case 'monitor_detail_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Detalles_Monitores'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Monitor_Details'; + } + break; + + case 'tag_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Vista_de_etiquetas'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Tag_view'; + } + break; + + case 'alert_validation': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Detalles_de_Alertas'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Alert_Details'; + } + break; + + case 'agents_alerts_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Vista_de_agente_.2F_alerta'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Agent.2F_Alert_View'; + } + break; + + case 'agents_module_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Vista_de_agente_.2F_modulo'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Agents_.2F_Modules_View'; + } + break; + + case 'module_groups_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Vista_de_grupos_de_m.C3.B3dulos'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Module_Groups_View'; + } + break; + + case 'snmp_browser_view': + if ($es) { + $result .= 'Monitorizacion_remota&printable=yes#Navegador_SNMP_de_Pandora_FMS'; + } else { + $result .= 'Remote_Monitoring&printable=yes#Pandora_FMS_SNMP_MIB_Browser'; + } + break; + + case 'snmp_trap_generator_view': + if ($es) { + $result .= 'Monitorizacion_traps_SNMP&printable=yes#Generador_de_Traps'; + } else { + $result .= 'SNMP_traps_Monitoring&printable=yes#Trap_Generator'; + } + break; + + case 'real_time_view': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Gr.C3.A1ficas_Real-time'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Real-time_Graphs'; + } + break; + + case 'ad_advanced_permision': + + break; + + case 'agent_access': + + break; + + case 'agent_status': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Detalles_del_agente'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Agent_Details'; + } + break; + + case 'agent_main_tab': + if ($es) { + $result .= 'Intro_Monitorizacion&printable=yes#Visualizaci.C3.B3n_del_agente'; + } else { + $result .= 'Intro_Monitoring&printable=yes#Agent_configuration_in_the_console_2'; + } + break; + + case 'agent_module_tab': + if ($es) { + $result = 3866; + $result['section'][] = 'Par.C3.A1metros_comunes'; + $result['section'][] = 'Monitorizaci.C3.B3n_de_estados'; + } else { + $result = 3867; + $result['section'][] = 'Common_Parameters'; + $result['section'][] = 'Status_Monitoring'; + } + break; + + case 'agent_wux_console': + // XXX + if ($es) { + $result = ''; + $result['section'][] = ''; + } else { + $result = ''; + $result['section'][] = ''; + } + break; + + case 'aggregate_by': + + break; + + case 'alert_action': + + break; + + case 'alert_command': + + break; + + case 'alert_config': + + break; + + case 'alert_fields_description': + + break; + + case 'alert_fields_values': + + break; + + case 'alert_macros': + + break; + + case 'alert-matches': + // XXX + break; + + case 'alert_recovery': + + break; + + case 'alerts_config': + + break; + + case 'alert_special_days': + + break; + + case 'alerts': + + break; + + case 'alert_template': + + break; + + case 'alert_type': + + break; + + case 'autocreate_blacklist': + + break; + + case 'categories': + + break; + + case 'collections': + + break; + + case 'collection_tab': + + break; + + case 'column_macros': + // XXX + break; + + case 'component_groups': + + break; + + case 'conf_alert_template': + + break; + + case 'configure_gis_map': + if ($es) { + $result .= 'Pandora_GIS&printable=yes#Introducci.C3.B3n'; + } else { + $result .= 'GIS&printable=yes#Introduction'; + } + break; + + case 'configure_gis_map_edit': + if ($es) { + $result .= 'Pandora_GIS&printable=yes#GIS_Maps'; + } else { + $result .= 'GIS&printable=yes#GIS_Maps'; + } + break; + + case 'context_module_unknow': + + break; + + case 'context_pandora_server_email': + // XXX Aparece al principio de la pagina + break; + + case 'create_agent': + + break; + + case 'custom_logo_collapsed': + + break; + + case 'custom_logo': + + break; + + case 'date_format': + + break; + + case 'duplicateconfig': + + break; + + case 'event_alert': + + break; + + case 'events_history': + + break; + + case 'events_replication': + + break; + + case 'eventview': + if ($es) { + $result .= 'Eventos&printable=yes#Introducci.C3.B3n'; + } else { + $result .= 'Events&printable=yes#Introduction'; + } + break; + + case 'export_server': + + break; + + case 'external_alert': + + break; + + case 'field_match_snmp': + + break; + + case 'gis_map_builder': + + break; + + case 'gis_setup_map_connection': + + break; + + case 'gis_tab': + if ($es) { + $result = 3031; + $result['section'][] = 'Configuraci.C3.B3n_del_Agent_GIS'; + } else { + $result = 2876; + $result['section'][] = 'The_Agent.27s_GIS_Setup'; + } + break; + + case 'graph_builder': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Crear_Gr.C3.A1ficas_combinadas'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Creating_combined_graphs'; + } + break; + + case 'graph_editor': + if ($es) { + $result .= 'Presentacion_datos/visualizacion&printable=yes#Agregar_elementos_a_gr.C3.A1ficas_combinadas'; + } else { + $result .= 'Data_Presentation/Visualization&printable=yes#Adding_elements_to_combined_graphs'; + } + break; + + case 'dashboards_tab': + if ($es) { + $result .= 'Dashboard&printable=yes#Introducci.C3.B3n'; + } else { + $result .= 'Dashboard&printable=yes#Introduction'; + } + break; + + case 'graphs': + + break; + + case 'graph_view': + + break; + + case 'history_database': + + break; + + case 'integria_url': + + break; + + case 'inventory_tab': + if ($es) { + $result .= 'Inventario&printable=yes#M.C3.B3dulos_de_inventario'; + } else { + $result .= 'Inventory&printable=yes#Inventory_Modules'; + } + break; + + case 'info_agent': + if ($es) { + $result = 3866; + $result['section'][] = 'Visualizaci.C3.B3n_del_agente'; + } else { + $result = 3867; + $result['section'][] = 'Agent_configuration_in_the_console_2'; + } + break; + + case 'ipam_create_tab': + case 'ipam_list_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Introducci.C3.B3n'; + } else { + $result .= 'IPAM&printable=yes#Introduction'; + } + break; + + case 'ipam_calculator_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Calculadora_de_subredes'; + } else { + $result .= 'IPAM&printable=yes#Subnetwork_calculator'; + } + break; + + case 'ipam_vlan_config_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Vlan_IPAM'; + } else { + $result .= 'IPAM&printable=yes#VLAN_IPAM'; + } + break; + + case 'ipam_vlan_statistics_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Estad.C3.ADsticas_IPAM_Vlan'; + } else { + $result .= 'IPAM&printable=yes#IPAM_VLAN_Stats'; + } + break; + + case 'ipam_vlan_wizard_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Wizard_IPAM_Vlan'; + } else { + $result .= 'IPAM&printable=yes#IPAM_VLAN_Wizard:'; + } + break; + + case 'ipam_supernet_config_tab': + if ($es) { + $result .= 'IPAM&printable=yes#IPAM_Supernet'; + } else { + $result .= 'IPAM&printable=yes#IPAM_Supernet'; + } + break; + + case 'ipam_supernet_map_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Mapa_Superred_IPAM'; + } else { + $result .= 'IPAM&printable=yes#IPAM_Supernet_Map'; + } + break; + + case 'ipam_supernet_statistics_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Estad.C3.ADsticas_IPAM_Superred'; + } else { + $result .= 'IPAM&printable=yes#IPAM_Supernet_Stats'; + } + break; + + case 'ipam_new_tab': + case 'ipam_edit_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Vista_de_edici.C3.B3n'; + } else { + $result .= 'IPAM&printable=yes#Edit_view'; + } + break; + + case 'ipam_massive_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Vista_Operaciones_masivas'; + } else { + $result .= 'IPAM&printable=yes#Massive_operations_view'; + } + break; + + case 'ipam_network_tab': + case 'ipam_force_tab': + if ($es) { + $result .= 'IPAM&printable=yes#Vista_de_iconos'; + } else { + $result .= 'IPAM&printable=yes#Icon_view'; + } + break; + + case 'ip_api_list': + + break; + + case 'linked_map_weight': + + break; + + case 'local_component': + + break; + + case 'log_viewer': + + break; + + case 'macros': + + break; + + case 'macros_visual_maps': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Macros_en_las_consolas_visuales'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Macros_in_Visual_Consoles'; + } + break; + + case 'linked_map_status_calc': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Mapa_asociado'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Associated_Map'; + } + break; + + case 'main_help': + + break; + + case 'main_tab': + if ($es) { + $result .= 'Intro_Monitorizacion&printable=yes#Configuraci.C3.B3n_del_agente_en_consola'; + } else { + $result .= 'Intro_Monitoring&printable=yes#Agent_configuration_in_the_console'; + } + break; + + case 'manage_alert_list': + if ($es) { + $result .= 'Alertas&printable=yes#Gestionar_alertas_desde_el_agente'; + } else { + $result .= 'Alerts&printable=yes#Managing_Alerts_from_within_the_Agent'; + } + break; + + case 'alert_scalate': + if ($es) { + $result .= 'Alertas&printable=yes#Escalado_de_alertas'; + } else { + $result .= 'Alerts&printable=yes#Scaling_Alerts'; + } + break; + + case 'manage_alerts': + + break; + + case 'manageconfig': + + break; + + case 'map_builder_intro': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Introducci.C3.B3n'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Introduction'; + } + break; + + case 'map_builder_favorite': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Consolas_visuales_favoritas'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Favorite_visual_consoles'; + } + break; + + case 'map_builder_template': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Plantillas_de_consolas_visuales'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Visual_Console_Templates'; + } + break; + + case 'map_builder_wizard': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Asistente_de_consola_visuales'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Wizard_Visual_Console'; + } + break; + + case 'meta_access': + + break; + + case 'metaconsole_agent_cache': + + break; + + case 'module_linking': + + break; + + case 'module_tokens': + + break; + + case 'module_type': + if ($es) { + $result = 2042; + $result['section'][] = 'Tipos_de_m.C3.B3dulos'; + } else { + $result = 2681; + $result['section'][] = 'Types_of_Modules'; + } + break; + + case 'network_component': + + break; + + case 'network_map_enterprise_edit': + if ($es) { + $result .= 'Presentacion_datos/Mapas_de_red&printable=yes#Mapa_de_red_no_vac.C3.ADo'; + } else { + $result .= 'Data_Presentation/Network_Maps&printable=yes#Non_empty_network_map'; + } + break; + + case 'network_map_enterprise_list': + if ($es) { + $result .= 'Presentacion_datos/Mapas_de_red&printable=yes#Introducci.C3.B3n'; + } else { + $result .= 'Data_Presentation/Network_Maps&printable=yes#Introduction'; + } + break; + + case 'network_map_enterprise_empty': + if ($es) { + $result .= 'Presentacion_datos/Mapas_de_red&printable=yes#Mapa_de_red_vac.C3.ADo'; + } else { + $result .= 'Data_Presentation/Network_Maps&printable=yes#Empty_network_map'; + } + break; + + case 'network_map_enterprise_view': + if ($es) { + $result .= 'Presentacion_datos/Mapas_de_red&printable=yes#Vista_de_un_mapa_de_red'; + } else { + $result .= 'Data_Presentation/Network_Maps&printable=yes#Network_map_view'; + } + break; + + case 'transactional_view': + if ($es) { + $result .= 'Monitorizacion_transaccional&printable=yes#Introducci.C3.B3n'; + } else { + $result .= 'Transactional_Monitoring&printable=yes#Introduction'; + } + break; + + case 'no_hierarchy': + + break; + + case 'operation_visual_console': + + break; + + case 'pcap_filter': + + break; + + case 'performance': + + break; + + case 'planned_downtime': + if ($es) { + $result .= 'Gestion_y_Administracion&printable=yes#Creaci.C3.B3n_parada_planificada'; + } else { + $result .= 'Managing_and_Administration&printable=yes#Create_a_scheduled_downtime'; + } + break; + + case 'planned_downtime_editor': + if ($es) { + $result .= 'Gestion_y_Administracion&printable=yes#Creaci.C3.B3n_parada_planificada'; + } else { + $result .= 'Managing_and_Administration&printable=yes#Create_a_scheduled_downtime'; + } + break; + + case 'plugin_definition': + + break; + + case 'plugin_macros': + + break; + + case 'plugin_parameters': + + break; + + case 'plugin_policy': + + break; + + case 'policy_agent': + + break; + + case 'policy_queue': + + break; + + case 'prediction_date': + + break; + + case 'prediction_source_module': + + break; + + case 'profile': + + break; + + case 'projection_graph': + + break; + + case 'propagate_acl': + + break; + + case 'reconscript_definition': + + break; + + case 'recontask': + + break; + + case 'template_reporting_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Introducci.C3.B3n'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#Introduction'; + } + break; + + case 'reporting_template_list_item_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Pesta.C3.B1a_List_Items'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_.27List_Items.27_Tab'; + } + break; + + case 'reporting_template_item_editor_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Pesta.C3.B1a_Item_editor'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_.27Item_Editor.27_Tab'; + } + break; + + case 'reporting_template_advanced_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Opciones_avanzadas_de_informe'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_Advanced_Options_Tab'; + } + break; + + case 'reporting_advanced_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Opciones_avanzadas_de_informe'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_Advanced_Options_Tab'; + } + break; + + case 'reporting_global_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Global'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_Global_Tab'; + } + break; + + case 'reporting_item_editor_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Pesta.C3.B1a_Item_editor'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_.27Item_Editor.27_Tab'; + } + break; + + case 'reporting_list_items_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Pesta.C3.B1a_List_Items'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_.27List_Items.27_Tab'; + } + break; + + case 'reporting_preview_tab': + // XXX + break; + + case 'reporting_time_lapse': + // XXX + break; + + case 'reporting_wizard_sla_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Wizard_SLA'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_SLA_Wizard_Tab'; + } + break; + + case 'reporting_wizard_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Wizard_general'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#The_Wizard_Tab'; + } + break; + + case 'reports_label_field': + // XXX + break; + + case 'response_macros': + + break; + + case 'response_parameters': + + break; + + case 'serverlag': + + break; + + case 'servers': + + break; + + case 'service_elements_management': + + break; + + case 'service_management_edit': + + break; + + case 'services_management': + + break; + + case 'setup_gis_index': + + break; + + case 'snmp_alert_configuration': + + break; + + case 'snmp_alert_custom': + + break; + + case 'snmp_alert_field1': + + break; + + case 'snmp_alert_filters': + + break; + + case 'snmp_alert': + + break; + + case 'snmp_alert_position': + + break; + + case 'snmpcommunity': + + break; + + case 'snmp_explorer': + + break; + + case 'snmp_explorer_tab': + if ($es) { + $result = 3840; + $result['section'][] = 'Wizard_SNMP'; + } else { + $result = 3841; + $result['section'][] = 'SNMP_Wizard'; + } + break; + + case 'snmp_interfaces_explorer_tab': + if ($es) { + $result = 3840; + $result['section'][] = 'SNMP_Interfaces_wizard'; + } else { + $result = 3841; + $result['section'][] = 'SNMP_Interface_Wizard'; + } + break; + + case 'snmp_interfaces_explorer_tab': + if ($es) { + $result = 3840; + $result['section'][] = 'SNMP_Interfaces_wizard'; + } else { + $result = 3841; + $result['section'][] = 'SNMP_Interface_Wizard'; + } + break; + + case 'wmi_explorer_tab': + if ($es) { + $result = 3840; + $result['section'][] = 'Wizard_WMI'; + } else { + $result = 3841; + $result['section'][] = 'WMI_Wizard'; + } + break; + + case 'snmpoid': + + break; + + case 'snmp_trap_types': + + break; + + case 'snmpwalk': + + break; + + case 'tags_config': + + break; + + case 'tcp_send': + + break; + + case 'timesource': + + break; + + case 'time_st-comparation': + + break; + + case 'transactional_map_phases': + if ($es) { + $result .= 'Monitorizacion_transaccional&printable=yes#Creaci.C3.B3n_del_.C3.A1rbol_de_fases'; + } else { + $result .= 'Transactional_Monitoring&printable=yes#Creating_the_phase_tree'; + } + break; + + case 'transactional_map_phases_data': + if ($es) { + $result .= 'Monitorizacion_transaccional&printable=yes#Configuraci.C3.B3n_de_los_scripts_de_control'; + } else { + $result .= 'Transactional_Monitoring&printable=yes#Control_scripts_configuration'; + } + break; + + case 'wizard_reporting_tab': + if ($es) { + $result .= 'Presentacion_datos/Informes&printable=yes#Asistente_de_plantillas'; + } else { + $result .= 'Data_Presentation/Reports&printable=yes#Template_Wizard'; + } + break; + + case 'user_edit_notifications': + if ($es) { + $result .= 'Gestion_y_Administracion&printable=yes#Configuraci.C3.B3n_de_notificaciones'; + } else { + $result .= 'Managing_and_Administration&printable=yes#Notification_configuration'; + } + break; + + case 'view_services_detail': + + break; + + case 'view_services': + + break; + + case 'visual_console_editor_data_tab': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Creaci.C3.B3n_-_Datos_generales'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Creation_-_General_data'; + } + break; + + case 'visual_console_editor_editor_tab': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Creaci.C3.B3n_y_edici.C3.B3n_de_consolas_visuales'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Creation_and_edition_of_Visual_Consoles'; + } + break; + + case 'visual_console_editor_list_elements_tab': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Creaci.C3.B3n_-_lista_de_elementos'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Creation_-_List_of_Elements'; + } + break; + + case 'visual_console_editor_wizard_tab': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Creaci.C3.B3n_-_Wizard'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Creation_-_Wizard'; + } + break; + + case 'visual_console_editor_wizard_services_tab': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Creaci.C3.B3n_-_Wizard_de_Servicios'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Creation_-_Service_Wizard'; + } + break; + + case 'visual_console_tab': + if ($es) { + $result .= 'Presentacion_datos/Mapas_visuales&printable=yes#Mapa_asociado'; + } else { + $result .= 'Data_Presentation/Visual_Maps&printable=yes#Associated_Map'; + } + break; + + case 'web_checks': + + break; + + case 'wmifield': + + break; + + case 'wmikey': + + break; + + case 'wmiquery': + + break; + + default: + + break; + } + + hd($result); + return $result; +} diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index d6e017a9c0..320f305aca 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1270,7 +1270,7 @@ function ui_print_help_icon($help_id, $return=false, $home_url='', $image='image { global $config; - // Do not display the help icon if help is disabled + // Do not display the help icon if help is disabled. if ($config['disable_help']) { return ''; } @@ -1283,13 +1283,15 @@ function ui_print_help_icon($help_id, $return=false, $home_url='', $image='image $home_url = '../../'.$home_url; } + $url = get_help_info($help_id); + $output = html_print_image( $image, true, [ 'class' => 'img_help', 'title' => __('Help'), - 'onclick' => "open_help ('".$help_id."','".$home_url."','".$config['id_user']."')", + 'onclick' => "open_help ('".$url."')", ], false, $is_relative && is_metaconsole() diff --git a/pandora_console/include/help/clippy/modules_not_learning_mode.php b/pandora_console/include/help/clippy/modules_not_learning_mode.php index 85dc5c1182..ff26b065f6 100755 --- a/pandora_console/include/help/clippy/modules_not_learning_mode.php +++ b/pandora_console/include/help/clippy/modules_not_learning_mode.php @@ -1,20 +1,30 @@ true, 'position' => 'left', - 'intro' => ''.''.''.''.'
'.__('Please note that you have your agent setup to do not add new modules coming from the data XML.').'
'.__('That means if you have a local plugin or add manually new modules to the configuration file, you won\'t have it in your agent, unless you first create manually in the interface (with the exact name and type as coming in the XML file).').'
'.__('You should use the "normal" mode (non learn) only when you don\'t intend to add more modules to the agent.').ui_print_help_icon('module_definition', true, '', 'images/help.png').'
', + 'intro' => '
'.__('Please note that you have your agent setup to do not add new modules coming from the data XML.').'
'.__('That means if you have a local plugin or add manually new modules to the configuration file, you won\'t have it in your agent, unless you first create manually in the interface (with the exact name and type as coming in the XML file).').'
'.__('You should use the "normal" mode (non learn) only when you don\'t intend to add more modules to the agent.').'
', ]; $return_tours['tours']['modules_not_learning_mode']['conf'] = []; $return_tours['tours']['modules_not_learning_mode']['conf']['autostart'] = false; diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index c30736cd8b..7b8523ad81 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -33,9 +33,9 @@ function winopeng_var(url, wid, width, height) { status = wid; } -function open_help(help_id, home_url, id_user) { +function open_help(url) { open( - home_url + "general/pandora_help.php?id=" + help_id + "&id_user=" + id_user, + url, "pandorahelp", "width=650,height=500,status=0,toolbar=0,menubar=0,scrollbars=1,location=0" ); diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index c4e98bc986..080e7ffbaf 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -65,8 +65,15 @@ if ($config['realtimestats'] == 0) { $updated_info = ''; } -// Header -ui_print_page_header(__('Group view'), 'images/group.png', false, '', false, $updated_time); +// Header. +ui_print_page_header( + __('Group view'), + 'images/group.png', + false, + 'group_view', + false, + $updated_time +); $total_agentes = 0; $monitor_ok = 0; diff --git a/pandora_console/operation/agentes/networkmap.dinamic.php b/pandora_console/operation/agentes/networkmap.dinamic.php index dd075647bb..3afd34728a 100644 --- a/pandora_console/operation/agentes/networkmap.dinamic.php +++ b/pandora_console/operation/agentes/networkmap.dinamic.php @@ -127,7 +127,7 @@ ui_print_page_header( io_safe_output($networkmap['name']), 'images/bricks.png', false, - 'network_map_enterprise', + 'network_map_enterprise_list', false, $buttons, false, diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index d0bdbd57ca..4ed526a404 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -198,7 +198,7 @@ ui_print_page_header( __('Networkmap'), 'images/bricks.png', false, - 'network_map_enterprise', + 'network_map_enterprise_edit', false ); diff --git a/pandora_console/operation/agentes/pandora_networkmap.php b/pandora_console/operation/agentes/pandora_networkmap.php index dbf7a80692..35eb712146 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.php +++ b/pandora_console/operation/agentes/pandora_networkmap.php @@ -634,7 +634,7 @@ switch ($tab) { __('Networkmap'), 'images/op_network.png', false, - 'network_map_enterprise', + 'network_map_enterprise_list', false ); diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 8c45719ba5..77f3d2c8a5 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -800,7 +800,7 @@ if ($networkmap === false) { __('Networkmap'), 'images/bricks.png', false, - 'network_map_enterprise', + 'network_map_enterprise_view', false ); ui_print_error_message(__('Not found networkmap.')); @@ -861,7 +861,7 @@ if ($networkmap === false) { $networkmap['name'], 'images/bricks.png', false, - 'network_map_enterprise', + 'network_map_enterprise_view', false, $buttons, false, diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 02a3887f39..447baa3556 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -62,7 +62,7 @@ if (! defined('METACONSOLE')) { break; } - ui_print_page_header(__('Monitor detail').$subpage, '', false, '', true, $buttons); + ui_print_page_header(__('Monitor detail').$subpage, '', false, 'monitor_detail_view', true, $buttons); if ($section == 'fields') { include_once $config['homedir'].'/godmode/agentes/status_monitor_custom_fields.php'; diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index a4d3e6c98e..9264cba0b3 100755 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -49,8 +49,15 @@ if ($config['realtimestats'] == 0) { $updated_info = ''; } -// Header -ui_print_page_header(__('Tactical view'), '', false, '', false, $updated_time); +// Header. +ui_print_page_header( + __('Tactical view'), + '', + false, + 'tactical_view', + false, + $updated_time +); // Currently this function makes loading this page is impossible. Change // and create new function. @@ -226,4 +233,4 @@ echo ''; } }); }); - \ No newline at end of file + diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 5578b9182f..46cfc69aec 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -1394,10 +1394,18 @@ foreach ($config['extensions'] as $extension) { } } -if ($tab == 'wux_console_tab') { - $help_header = 'wux_console'; -} else { - $help_header = ''; +switch ($tab) { + case 'wux_console_tab': + $help_header = 'wux_console_tab'; + break; + + case 'main': + $help_header = 'agent_'.$tab.'_tab'; + break; + + default: + $help_header = ''; + break; } ui_print_page_header( diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index bae4f9e06f..d15e624162 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -172,7 +172,7 @@ ui_print_page_header( __('SNMP Browser'), 'images/op_snmp.png', false, - '', + 'snmp_browser_view', false, [$link] ); diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index b2344c13ad..41a6b9c5d2 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -134,7 +134,7 @@ if (!is_metaconsole()) { $header_title = $header_title.' - '.$header_sub_title; } - ui_print_page_header($header_title, 'images/extensions.png', false, '', false, $tabs); + ui_print_page_header($header_title, 'images/extensions.png', false, 'tree_view', false, $tabs); } // ---------------------Tabs ------------------------------------------- diff --git a/pandora_console/operation/users/user_edit_header.php b/pandora_console/operation/users/user_edit_header.php index 4b329eee77..aac28b76f5 100644 --- a/pandora_console/operation/users/user_edit_header.php +++ b/pandora_console/operation/users/user_edit_header.php @@ -1,17 +1,32 @@