diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8f940ea684..39503a5f55 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2013-04-16 Miguel de Dios + + * godmode/agentes/module_manager_editor_network.php, + godmode/agentes/module_manager_editor_common.php, + include/javascript/pandora_modules.js: fixed the hidden fields for + tcp checks. + + Fixes: #3611054 + + * godmode/setup/setup_visuals.php: improved the source code style. + 2013-04-16 Mario Pulido * godmode/agentes/configurar_agente.php: Fixed helps view in Agent config diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index ade558c5d4..7955339b87 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -139,7 +139,9 @@ if (!empty($id_agent_module) && isset($id_agente)) { } $disabled_enable = 0; -$policy_link = db_get_value('policy_linked', 'tagente_modulo', 'id_agente_modulo', $id_agent_module); +$policy_link = db_get_value('policy_linked', 'tagente_modulo', + 'id_agente_modulo', $id_agent_module); + if ($policy_link != 0) { $disabled_enable = 1; } @@ -237,7 +239,8 @@ if (modules_is_string_type($id_module_type) || $edit) { } $table_simple->data[2][1] .= '
'.__('Inverse interval').''; -$table_simple->data[2][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true); +$table_simple->data[2][1] .= html_print_checkbox ("warning_inverse", 1, + $warning_inverse, true); $table_simple->data[2][2] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true); $table_simple->data[2][3] = ''; diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 8f2fd17920..5d0077e0fe 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -33,8 +33,9 @@ if (strstr($page, "policy_modules") === false) { if ($config['enterprise_installed']) { $disabledBecauseInPolicy = policies_is_module_in_policy($id_agent_module) && policies_is_module_linked($id_agent_module); } - else + else { $disabledBecauseInPolicy = false; + } if ($disabledBecauseInPolicy) $disabledTextBecauseInPolicy = 'disabled = "disabled"'; } @@ -113,13 +114,13 @@ $data[0] = __('TCP send') . ' ' . ui_print_help_icon ("tcp_send", true); $data[1] = html_print_textarea ('tcp_send', 2, 65, $tcp_send, $disabledTextBecauseInPolicy, true); $table_advanced->colspan['tcp_send'][1] = 3; -push_table_advanced ($data, 'tcp_send'); +push_table_simple ($data, 'tcp_send'); $data[0] = __('TCP receive'); $data[1] = html_print_textarea ('tcp_rcv', 2, 65, $tcp_rcv, $disabledTextBecauseInPolicy, true); $table_advanced->colspan['tcp_receive'][1] = 3; -push_table_advanced ($data, 'tcp_receive'); +push_table_simple ($data, 'tcp_receive'); if ($id_module_type >= 15 && $id_module_type <= 18) { /* SNMP */ @@ -207,25 +208,25 @@ $(document).ready (function () { }); $("#select_snmp_oid").click ( - function () { - $(this).css ("width", "auto"); - $(this).css ("min-width", "180px"); - }); + function () { + $(this).css ("width", "auto"); + $(this).css ("min-width", "180px"); + }); $("#select_snmp_oid").blur (function () { $(this).css ("width", "180px"); }); $("#id_module_type").click ( - function () { - $(this).css ("width", "auto"); - $(this).css ("min-width", "180px"); - }); + function () { + $(this).css ("width", "auto"); + $(this).css ("min-width", "180px"); + }); $("#id_module_type").blur (function () { $(this).css ("width", "180px"); }); - + // Keep elements in the form and the SNMP browser synced $('#text-ip_target').keyup(function() { $('#text-target_ip').val($(this).val()); @@ -243,11 +244,11 @@ $(document).ready (function () { // Show the SNMP browser window function snmpBrowserWindow () { - + // Keep elements in the form and the SNMP browser synced $('#text-target_ip').val($('#text-ip_target').val()); $('#text-community').val($('#text-snmp_community').val()); - + $("#snmp_browser_container").show().dialog ({ title: '', resizable: true, diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 6961b7c8f9..818c4ec0e9 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -96,7 +96,7 @@ $units = array( SECONDS_1DAY => __('days'), SECONDS_1MONTH => __('months'), SECONDS_1YEAR => __('years')); - + $table->data[$row][1] = __('Add new custom value to intervals') . ': '; $table->data[$row][1] .= html_print_input_text ('interval_value', '', '', 5, 5, true); $table->data[$row][1] .= html_print_select ($units, 'interval_unit', 1, "", '', '', true, false, false); @@ -298,7 +298,7 @@ $(document).ready (function () { function changeIcons() { icon = $("#gis_default_icon :selected").val(); - + $("#icon_without_status").attr("src", "images/spinner.png"); $("#icon_default").attr("src", "images/spinner.png"); $("#icon_ok").attr("src", "images/spinner.png"); diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 49d475fc85..ef2d6bbdee 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -6,21 +6,23 @@ var id_modules_snmp = Array (15, 16, 17, 18); function configure_modules_form () { $("#id_module_type").change (function () { 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 (); + $("tr#simple-snmp_1, tr#simple-snmp_2, tr#simple-tcp_send, tr#simple-tcp_receive").hide (); $("#text-tcp_port").attr ("disabled", "1"); } 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 (); + $("tr#simple-tcp_send, tr#simple-tcp_receive").hide (); $("#text-tcp_port").removeAttr ("disabled"); } 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 (); + $("tr#simple-tcp_send, tr#simple-tcp_receive").show (); $("#text-tcp_port").removeAttr ("disabled"); } }); + $("#id_module_type").trigger("change"); + $("#local_component_group").change (function () { var $select = $("#local_component").hide ();