From 954f56dd606b84c52299713a55d7d62dea3d3aad Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 27 Feb 2013 10:22:51 +0000 Subject: [PATCH] 2013-02-27 Miguel de Dios * include/javascript/pandora_modules.js, include/functions_api.php: improved the source code style. * operation/agentes/estado_generalagente.php: fixed the set name style for the agent. Fixes: #3606134 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7729 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++ pandora_console/include/functions_api.php | 32 ++++++++++--------- .../include/javascript/pandora_modules.js | 6 ++-- .../agentes/estado_generalagente.php | 8 ++--- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 41d86927bb..71021148c6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2013-02-27 Miguel de Dios + + * include/javascript/pandora_modules.js, include/functions_api.php: + improved the source code style. + + * operation/agentes/estado_generalagente.php: fixed the set name + style for the agent. + + Fixes: #3606134 + 2013-02-27 Miguel de Dios * godmode/agentes/module_manager_editor_common.php, diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index a1fdb5665b..6759a92ec9 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -3048,38 +3048,40 @@ function api_set_update_network_module_policy($id, $thrash1, $other, $thrash3) { return; } - if ($other['data'][0] == ""){ + if ($other['data'][0] == "") { returnError('error_update_network_module_policy', __('Error updating network module in policy. Id_policy_module cannot be left blank.')); - return; - } + return; + } // Check if the module exists $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module')); - + if ($module_policy === false) { returnError('error_update_network_module_policy', __('Error updating network module in policy. Module doesn\'t exists.')); - return; + return; } - if ($module_policy[0]['id_module'] != 2){ + if ($module_policy[0]['id_module'] != 2) { returnError('error_update_network_module_policy', __('Error updating network module in policy. Module type is not network type.')); - return; + return; } - - $fields_network_module = array('id','description', 'id_module_group', 'min', 'max', 'post_process', 'module_interval', - 'min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', - 'history_data', 'min_ff_event', 'disabled', 'tcp_port', 'snmp_community', 'snmp_oid', 'custom_id'); + + $fields_network_module = array('id','description', + 'id_module_group', 'min', 'max', 'post_process', + 'module_interval', 'min_warning', 'max_warning', 'str_warning', + 'min_critical', 'max_critical', 'str_critical', 'history_data', + 'min_ff_event', 'disabled', 'tcp_port', 'snmp_community', + 'snmp_oid', 'custom_id'); $cont = 0; - foreach ($fields_network_module as $field){ - if ($other['data'][$cont] != "" and $field != 'id'){ + foreach ($fields_network_module as $field) { + if ($other['data'][$cont] != "" and $field != 'id') { $values[$field] = $other['data'][$cont]; } $cont++; } - - + $result_update = enterprise_hook('policies_update_module', array($other['data'][0], $values, false)); diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 78760db3ab..3b3a7c07a0 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -8,11 +8,13 @@ function configure_modules_form () { if (id_modules_icmp.in_array (this.value)) { $("tr#simple-snmp_1, tr#simple-snmp_2, tr#advanced-tcp_send, tr#advanced-tcp_receive").hide (); $("#text-tcp_port").attr ("disabled", "1"); - } else if (id_modules_snmp.in_array (this.value)) { + } + else if (id_modules_snmp.in_array (this.value)) { $("tr#simple-snmp_1, tr#simple-snmp_2").show (); $("tr#advanced-tcp_send, tr#advanced-tcp_receive").hide (); $("#text-tcp_port").removeAttr ("disabled"); - } else if (id_modules_tcp.in_array (this.value)) { + } + else if (id_modules_tcp.in_array (this.value)) { $("tr#simple-snmp_1, tr#simple-snmp_2").hide (); $("tr#advanced-tcp_send, tr#advanced-tcp_receive").show (); $("#text-tcp_port").removeAttr ("disabled"); diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 82ad190393..c9672dade0 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -60,7 +60,7 @@ $table_agent->style[1] = 'width: 100px;'; $table_agent->style[2] = 'width: 16px;'; $data = array(); -$agent_name = ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase; font-size: medium;", true); +$agent_name = ui_print_agent_name ($agent["id_agente"], true, 500, "font-size: medium;", true); if ($agent['disabled']) { $agent_name = "" . $agent_name . "" . ui_print_help_tip(__('Disabled'), true); @@ -76,7 +76,7 @@ $data[0] = ui_print_group_icon ($agent["id_grupo"], true) . '  '; $data[0] .= $agent_name; $status_img = agents_tree_view_status_img ($agent["critical_count"], - $agent["warning_count"], $agent["unknown_count"]); + $agent["warning_count"], $agent["unknown_count"]); $data[1] = events_tiny_stats ($agent['total_count'], $agent['normal_count'], $agent['critical_count'], $agent['warning_count'], $agent['unknown_count'], true); $data[2] = str_replace('.png' ,'_ball.png', $status_img); @@ -86,7 +86,7 @@ $table_agent->rowclass[] = ''; $data = array(); $addresses = agents_get_addresses($id_agente); $address = agents_get_address($id_agente); -foreach($addresses as $k => $add) { +foreach ($addresses as $k => $add) { if($add == $address) { unset($addresses[$k]); } @@ -201,7 +201,7 @@ if ($config['activate_gis'] || $agent['url_address'] != '') { // Position Information if ($config['activate_gis']) { $dataPositionAgent = gis_get_data_last_position_agent($agent['id_agente']); - + $data[$col] = '' . __('Position (Long, Lat)') . ''; $col++;