From c7b0698aa22a24b3925ce3994f894b979821895d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 9 Mar 2012 11:47:56 +0000 Subject: [PATCH] 2012-03-09 Miguel de Dios * include/javascript/pandora.js, extensions/snmp_explorer.php, operation/users/user_edit.php, godmode/agentes/module_manager_editor_network.php, godmode/setup/setup_auth.php, godmode/gis_maps/configure_gis_map.php, godmode/massive/massive_edit_modules.php, godmode/modules/manage_network_components_form.php, godmode/reporting/visual_console_builder.editor.js: fixed enable a widget in javascript (because the new jquery library is more html standar). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5732 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 ++ pandora_console/extensions/snmp_explorer.php | 2 +- .../agentes/module_manager_editor_network.php | 2 +- .../godmode/gis_maps/configure_gis_map.php | 21 ++- .../godmode/massive/massive_edit_modules.php | 10 +- .../manage_network_components_form.php | 144 +++++++++--------- .../visual_console_builder.editor.js | 2 +- pandora_console/godmode/setup/setup_auth.php | 10 +- pandora_console/include/javascript/pandora.js | 10 +- pandora_console/operation/users/user_edit.php | 1 - 10 files changed, 110 insertions(+), 103 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0308c71983..28089f3150 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2012-03-09 Miguel de Dios + + * include/javascript/pandora.js, extensions/snmp_explorer.php, + operation/users/user_edit.php, + godmode/agentes/module_manager_editor_network.php, + godmode/setup/setup_auth.php, godmode/gis_maps/configure_gis_map.php, + godmode/massive/massive_edit_modules.php, + godmode/modules/manage_network_components_form.php, + godmode/reporting/visual_console_builder.editor.js: fixed enable a widget in + javascript (because the new jquery library is more html standar). + 2012-03-09 Sergio Martin * include/graphs/flot/pandora.flot.js: Fixed a xAxis bad diff --git a/pandora_console/extensions/snmp_explorer.php b/pandora_console/extensions/snmp_explorer.php index 434f5af406..4fc1568a88 100755 --- a/pandora_console/extensions/snmp_explorer.php +++ b/pandora_console/extensions/snmp_explorer.php @@ -474,7 +474,7 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) { } if (selected != undefined) $('#module').attr ('value', selected); - $('#module').attr ('disabled', 0); + $('#module').removeAttr('disabled'); }, "json" ); diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 70882b81b6..a2e15043fa 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -203,7 +203,7 @@ $(document).ready (function () { $("#simple-field_snmpv3_row2").css("display", "none"); $("#simple-field_snmpv3_row3").css("display", "none"); $("input[name=active_snmp_v3]").val(0); - $("input[name=snmp_community]").attr("disabled", false); + $("input[name=snmp_community]").removeAttr('disabled'); } }); diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index 8fb99b43ec..0d1209ad2d 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -530,9 +530,9 @@ function refreshMapView() { arrayControls = null; arrayControls = Array('Navigation', 'PanZoom', 'MousePosition'); - - - //TODO read too from field forms user. + + + /*TODO read too from field forms user.*/ inital_zoom = mapConnection['default_zoom_level']; num_levels_zoom = mapConnection['num_zoom_levels']; center_latitude = mapConnection['initial_latitude']; @@ -580,7 +580,7 @@ $("#text_id_agent").autocomplete( $("#text_id_agent").result ( function () { - $("#button-add_agent").attr('disabled', false); + $("#button-add_agent").removeAttr('disabled'); } ); @@ -780,7 +780,7 @@ function deleteConnectionMap(idConnectionMap) { } } - checked = $("#radiobtn0001", $("#map_connection_" + idConnectionMap)).attr('checked') + checked = $("#radiobtn0001", $("#map_connection_" + idConnectionMap)).attr('checked'); $("#map_connection_" + idConnectionMap).remove(); if (checked) { @@ -868,7 +868,7 @@ function fillOrderField() { } function upLayer(idLayer) { - var toUpIndex = null + var toUpIndex = null; var toDownIndex = null; for (var index in layerList) { @@ -896,12 +896,11 @@ function upLayer(idLayer) { } function downLayer(idLayer) { - var toUpIndex = null + var toUpIndex = null; var toDownIndex = null; - var found = false - + var found = false; + for (var index in layerList) { - //int because in the object array there are method as string if (isInt(index)) { if (layerList[index] == idLayer) { @@ -916,7 +915,7 @@ function downLayer(idLayer) { } } } - + if (toUpIndex != null) { layerToUp = "#layer_item_" + layerList[toUpIndex]; layerToDown = "#layer_item_" + layerList[toDownIndex]; diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 66b90fc966..bddc1349ba 100644 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -411,7 +411,7 @@ $(document).ready (function () { else { $("#module").html(''); $("#module_name").html(''); - $('input[type=checkbox]').attr('disabled', false); + $('input[type=checkbox]').removeAttr('disabled'); $(".select_modules_row_2").css('display', ''); } @@ -491,7 +491,7 @@ $(document).ready (function () { $(".select_agents_row_2").css('display', ''); if($('#id_agents option:selected').val() == undefined) { $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide (); - } + } } } } @@ -524,12 +524,12 @@ $(document).ready (function () { else { $("#module").html(''); $("#id_agents").html(''); - $('input[type=checkbox]').attr('disabled', false); + $('input[type=checkbox]').removeAttr('disabled'); $(".select_agents_row_2").css('display', ''); } $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide (); - + jQuery.post ("ajax.php", {"page" : "operation/agentes/ver_agente", "get_agents_group_json" : 1, @@ -548,8 +548,6 @@ $(document).ready (function () { ); } ); - - }); /* ]]> */ diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index b41d23ce54..1f7b91dc6f 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -313,23 +313,23 @@ function type_change () { $(document).ready (function () { if ($("#snmp_version").value == "3"){ - $("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_auth_user]").attr("disabled", false); + $("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_auth_user]").removeAttr('disabled'); $("input[name=snmp3_auth_pass]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_auth_pass]").attr("disabled", false); + $("input[name=snmp3_auth_pass]").removeAttr('disabled'); $("#snmp3_privacy_method").css({backgroundColor: '#fff'}); - $("#snmp3_privacy_method").attr("disabled", false); + $("#snmp3_privacy_method").removeAttr('disabled'); $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_privacy_pass]").attr("disabled", false); + $("input[name=snmp3_privacy_pass]").removeAttr('disabled'); $("#snmp3_auth_method").css({backgroundColor: '#fff'}); - $("#snmp3_auth_method").attr("disabled", false); + $("#snmp3_auth_method").removeAttr('disabled'); $("#snmp3_security_level").css({backgroundColor: '#fff'}); - $("#snmp3_security_level").attr("disabled", false); + $("#snmp3_security_level").removeAttr('disabled'); $("input[name=active_snmp_v3]").val(1); $("input[name=snmp_community]").css({backgroundColor: '#ddd'}); @@ -359,80 +359,28 @@ $(document).ready (function () { $("input[name=active_snmp_v3]").val(0); $("input[name=snmp_community]").css({backgroundColor: '#fff'}); - $("input[name=snmp_community]").attr("disabled", false); + $("input[name=snmp_community]").removeAttr('disabled'); } $("#snmp_version").change(function () { if (this.value == "3") { $("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_auth_user]").attr("disabled", false); + $("input[name=snmp3_auth_user]").removeAttr('disabled'); $("input[name=snmp3_auth_pass]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_auth_pass]").attr("disabled", false); + $("input[name=snmp3_auth_pass]").removeAttr('disabled'); $("#snmp3_privacy_method").css({backgroundColor: '#fff'}); - $("#snmp3_privacy_method").attr("disabled", false); + $("#snmp3_privacy_method").removeAttr('disabled'); $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_privacy_pass]").attr("disabled", false); + $("input[name=snmp3_privacy_pass]").removeAttr('disabled'); $("#snmp3_auth_method").css({backgroundColor: '#fff'}); - $("#snmp3_auth_method").attr("disabled", false); + $("#snmp3_auth_method").removeAttr('disabled'); $("#snmp3_security_level").css({backgroundColor: '#fff'}); - $("#snmp3_security_level").attr("disabled", false); - - $("input[name=active_snmp_v3]").val(1); - $("input[name=snmp_community]").css({backgroundColor: '#ddd'}); - $("input[name=snmp_community]").attr("disabled",true); - } - else { - $("input[name=snmp3_auth_user]").val(""); - $("input[name=snmp3_auth_user]").css({backgroundColor: '#ddd'}); - $("input[name=snmp3_auth_user]").attr("disabled", true); - - $("input[name=snmp3_auth_pass]").val(""); - $("input[name=snmp3_auth_pass]").css({backgroundColor: '#ddd'}); - $("input[name=snmp3_auth_pass]").attr("disabled", true); - - $("#snmp3_privacy_method").css({backgroundColor: '#ddd'}); - $("#snmp3_privacy_method").attr("disabled", true); - - $("input[name=snmp3_privacy_pass]").val(""); - $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#ddd'}); - $("input[name=snmp3_privacy_pass]").attr("disabled", true); - - $("#snmp3_auth_method").css({backgroundColor: '#ddd'}); - $("#snmp3_auth_method").attr("disabled", true); - - $("#snmp3_security_level").css({backgroundColor: '#ddd'}); - $("#snmp3_security_level").attr("disabled", true); - - $("input[name=active_snmp_v3]").val(0); - $("input[name=snmp_community]").css({backgroundColor: '#fff'}); - $("input[name=snmp_community]").attr("disabled", false); - } - }); - - $("#type"). change(function () { - if ($("#snmp_version").value == "3") { - $("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_auth_user]").attr("disabled", false); - - $("input[name=snmp3_auth_pass]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_auth_pass]").attr("disabled", false); - - $("#snmp3_privacy_method").css({backgroundColor: '#fff'}); - $("#snmp3_privacy_method").attr("disabled", false); - - $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#fff'}); - $("input[name=snmp3_privacy_pass]").attr("disabled", false); - - $("#snmp3_auth_method").css({backgroundColor: '#fff'}); - $("#snmp3_auth_method").attr("disabled", false); - - $("#snmp3_security_level").css({backgroundColor: '#fff'}); - $("#snmp3_security_level").attr("disabled", false); + $("#snmp3_security_level").removeAttr('disabled'); $("input[name=active_snmp_v3]").val(1); $("input[name=snmp_community]").css({backgroundColor: '#ddd'}); @@ -446,23 +394,75 @@ $(document).ready (function () { $("input[name=snmp3_auth_pass]").val(""); $("input[name=snmp3_auth_pass]").css({backgroundColor: '#ddd'}); $("input[name=snmp3_auth_pass]").attr("disabled", true); - + $("#snmp3_privacy_method").css({backgroundColor: '#ddd'}); $("#snmp3_privacy_method").attr("disabled", true); - + $("input[name=snmp3_privacy_pass]").val(""); $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#ddd'}); $("input[name=snmp3_privacy_pass]").attr("disabled", true); - + $("#snmp3_auth_method").css({backgroundColor: '#ddd'}); $("#snmp3_auth_method").attr("disabled", true); - + $("#snmp3_security_level").css({backgroundColor: '#ddd'}); $("#snmp3_security_level").attr("disabled", true); - + $("input[name=active_snmp_v3]").val(0); $("input[name=snmp_community]").css({backgroundColor: '#fff'}); - $("input[name=snmp_community]").attr("disabled", false); + $("input[name=snmp_community]").removeAttr('disabled'); + } + }); + + $("#type"). change(function () { + if ($("#snmp_version").value == "3") { + $("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_auth_user]").removeAttr('disabled'); + + $("input[name=snmp3_auth_pass]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_auth_pass]").removeAttr('disabled'); + + $("#snmp3_privacy_method").css({backgroundColor: '#fff'}); + $("#snmp3_privacy_method").removeAttr('disabled'); + + $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_privacy_pass]").removeAttr('disabled'); + + $("#snmp3_auth_method").css({backgroundColor: '#fff'}); + $("#snmp3_auth_method").removeAttr('disabled'); + + $("#snmp3_security_level").css({backgroundColor: '#fff'}); + $("#snmp3_security_level").removeAttr('disabled'); + + $("input[name=active_snmp_v3]").val(1); + $("input[name=snmp_community]").css({backgroundColor: '#ddd'}); + $("input[name=snmp_community]").attr("disabled",true); + } + else { + $("input[name=snmp3_auth_user]").val(""); + $("input[name=snmp3_auth_user]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_auth_user]").attr("disabled", true); + + $("input[name=snmp3_auth_pass]").val(""); + $("input[name=snmp3_auth_pass]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_auth_pass]").attr("disabled", true); + + $("#snmp3_privacy_method").css({backgroundColor: '#ddd'}); + $("#snmp3_privacy_method").attr("disabled", true); + + $("input[name=snmp3_privacy_pass]").val(""); + $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_privacy_pass]").attr("disabled", true); + + $("#snmp3_auth_method").css({backgroundColor: '#ddd'}); + $("#snmp3_auth_method").attr("disabled", true); + + $("#snmp3_security_level").css({backgroundColor: '#ddd'}); + $("#snmp3_security_level").attr("disabled", true); + + $("input[name=active_snmp_v3]").val(0); + $("input[name=snmp_community]").css({backgroundColor: '#fff'}); + $("input[name=snmp_community]").removeAttr('disabled'); } }); }); diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 8887312c4d..b2813f6b72 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1309,7 +1309,7 @@ function activeToolboxButton(id, active) { $("input." + id + "[name=button_toolbox2]").removeAttr('disabled'); } else { - $("input." + id + "[name=button_toolbox2]").attr('disabled', 'disabled'); + $("input." + id + "[name=button_toolbox2]").attr('disabled', true); } } diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index 35c051fab5..70ebc6c106 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -108,7 +108,6 @@ echo ''; $(".remote").css("display", ""); } $("." + auth_method).css('display', ''); - } function enable_profile_options () { @@ -118,10 +117,11 @@ echo ''; $("#default_remote_profile").attr("disabled", true); $("#default_remote_group").attr("disabled", true); $("#text-autocreate_blacklist").attr("disabled", true); - } else { - $("#default_remote_profile").attr("disabled", false); - $("#default_remote_group").attr("disabled", false); - $("#text-autocreate_blacklist").attr("disabled", false); + } + else { + $("#default_remote_profile").removeAttr('disabled'); + $("#default_remote_group").removeAttr('disabled'); + $("#text-autocreate_blacklist").removeAttr('disabled'); } } diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index d992a082e8..c4a88c1080 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -102,7 +102,7 @@ function agent_changed (event, id_agent, selected) { }); if (selected != undefined) $('#module').attr ('value', selected); - $('#module').attr ('disabled', 0); + $('#module').removeAttr('disabled'); }, "json" ); @@ -205,7 +205,7 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) { }); if (selected != undefined) $('#module').attr ('value', selected); - $('#module').attr ('disabled', 0); + $('#module').removeAttr('disabled'); }, "json" ); @@ -263,7 +263,7 @@ function agent_changed_by_multiple_agents_with_alerts (event, id_agent, selected }); if (selected != undefined) $('#module').attr ('value', selected); - $('#module').attr ('disabled', 0); + $('#module').removeAttr('disabled'); }, "json" ); @@ -321,7 +321,7 @@ function module_changed_by_multiple_modules (event, id_module, selected) { }); if (selected != undefined) $('#agents').attr ('value', selected); - $('#agents').attr ('disabled', 0); + $('#agents').removeAttr('disabled'); }, "json" ); @@ -379,7 +379,7 @@ function agent_changed_by_multiple_agents_id (event, id_agent, selected) { }); if (selected != undefined) $('#module').attr ('value', selected); - $('#module').attr ('disabled', 0); + $('#module').removeAttr('disabled'); }, "json" ); diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index f2c5559980..05d95adec4 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -271,7 +271,6 @@ echo html_print_input_text ('data_section', $user_info["data_section"], '', 60, echo ''; - echo '
'; if (!$config["user_can_update_info"]) { echo ''.__('You can not change your user info from Pandora FMS under the current authentication scheme').'';