diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6242b4c398..d8d845b914 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,24 @@ +2013-04-25 Miguel de Dios + + * extensions/agents_alerts.php, extensions/snmp_explorer.php, + extensions/insert_data.php, extensions/net_tools.php, + extensions/resource_exportation.php, extensions/system_info.php, + extensions/pandora_logs.php, extensions/agents_modules.php, + godmode/reporting/reporting_builder.item_editor.php, + godmode/servers/manage_recontask_form.php, + godmode/setup/gis_step_2.php, + godmode/massive/massive_standby_alerts.php, + godmode/massive/massive_operations.php, + godmode/massive/massive_add_action_alerts.php, + godmode/massive/massive_add_alerts.php, + godmode/massive/massive_delete_agents.php, + godmode/massive/massive_delete_action_alerts.php, + operation/users/user_edit.php, operation/events/events_list.php, + operation/integria_incidents/incident.list.php, + operation/integria_incidents/incident.workunits.php, + operation/tree.php, general/shortcut_bar.php: cleaned source code + style. + 2013-04-25 Miguel de Dios * general/shortcut_bar.php, general/main_menu.php, diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 8f16d30405..6fb26abba7 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -275,7 +275,7 @@ function print_alerts_summary_modal_window($id, $alerts) { $actionText = '
    '; foreach ($actions as $action) { $actionText .= '
  • ' . $action['name']; - if ($action["fires_min"] != $action["fires_max"]){ + if ($action["fires_min"] != $action["fires_max"]) { $actionText .= " (".$action["fires_min"] . " / ". $action["fires_max"] . ")"; } $actionText .= '

  • '; @@ -283,7 +283,7 @@ function print_alerts_summary_modal_window($id, $alerts) { $actionText .= '
'; } else { - if(!empty($actionDefault)) { + if (!empty($actionDefault)) { $actionText = db_get_sql ("SELECT name FROM talert_actions WHERE id = $actionDefault"). " (".__("Default") . ")"; } } diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index da20d119e0..b20b8ecba1 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -241,8 +241,8 @@ function mainAgentsModules() { } $match = false; - foreach($module['id'] as $module_id){ - if(!$match && array_key_exists($module_id,$agent_modules)) { + foreach ($module['id'] as $module_id) { + if (!$match && array_key_exists($module_id,$agent_modules)) { $status = modules_get_agentmodule_status($module_id); echo ""; $win_handle = dechex(crc32($module_id.$module["name"])); @@ -250,7 +250,7 @@ function mainAgentsModules() { $link ="winopeng('operation/agentes/stat_win.php?type=$graph_type&period=86400&id=".$module_id."&label=".base64_encode($module["name"])."&refresh=600','day_".$win_handle."')"; echo ''; - switch($status){ + switch ($status) { case 0: ui_print_status_image ('module_ok.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px')); break; diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php index 744da1be8d..4b72fca785 100644 --- a/pandora_console/extensions/insert_data.php +++ b/pandora_console/extensions/insert_data.php @@ -127,7 +127,7 @@ function mainInsertData() { } ui_print_error_message($msg); } - if($done > 0){ + if ($done > 0) { $msg = sprintf(__('Save agent (%s), module (%s) data xml.'), $agent['nombre'], $agentModule['nombre']); if($done > 1) { $msg .= " ($done)"; diff --git a/pandora_console/extensions/net_tools.php b/pandora_console/extensions/net_tools.php index bdc32a8cf0..58f214aaaf 100644 --- a/pandora_console/extensions/net_tools.php +++ b/pandora_console/extensions/net_tools.php @@ -164,7 +164,7 @@ function main_net_tools () { $int_max = exec ("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.1.0 "); - for ($ax=0; $ax < $int_max; $ax++){ + for ($ax=0; $ax < $int_max; $ax++) { $interface = exec ("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.2.$ax "); $estado = exec ("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.8.$ax "); echo "$interface$estado"; diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index 6bec5f5a6c..4c67c8033a 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -17,7 +17,7 @@ function view_logfile ($file_name) { global $config; - if (!file_exists($file_name)){ + if (!file_exists($file_name)) { echo "

".__("Cannot find file"). "(".$file_name; echo ")

"; } diff --git a/pandora_console/extensions/resource_exportation.php b/pandora_console/extensions/resource_exportation.php index fa4f3cff06..528f6c112b 100644 --- a/pandora_console/extensions/resource_exportation.php +++ b/pandora_console/extensions/resource_exportation.php @@ -248,7 +248,7 @@ function output_xml_visual_console($id) { echo "" . io_safe_output($visual_map['width']) . "\n"; $items = db_get_all_rows_field_filter('tlayout_data', 'id_layout', $visual_map['id']); if ($items === false) $items = array(); - foreach ($items as $item){ + foreach ($items as $item) { echo "\n"; echo "" . $item['id'] . "\n"; //OLD ID USE FOR parent item if (!empty($item['label'])) { diff --git a/pandora_console/extensions/snmp_explorer.php b/pandora_console/extensions/snmp_explorer.php index a56472dea9..3d5d9eb4e0 100755 --- a/pandora_console/extensions/snmp_explorer.php +++ b/pandora_console/extensions/snmp_explorer.php @@ -148,14 +148,14 @@ function snmp_explorer() { $errors = array(); $done = 0; - foreach($id_snmp as $id) { - if (isset($interfaces[$id]['ifName']) && $interfaces[$id]['ifName']['value'] != ""){ + foreach ($id_snmp as $id) { + if (isset($interfaces[$id]['ifName']) && $interfaces[$id]['ifName']['value'] != "") { $ifname = $interfaces[$id]['ifName']['value']; } - else if (isset($interfaces[$id]['ifDescr']) && $interfaces[$id]['ifDescr']['value'] != ""){ + else if (isset($interfaces[$id]['ifDescr']) && $interfaces[$id]['ifDescr']['value'] != "") { $ifname = $interfaces[$id]['ifDescr']['value']; } - foreach($modules as $module) { + foreach ($modules as $module) { $oid_array = explode('.',$module); $oid_array[count($oid_array)-1] = $id; $oid = implode('.',$oid_array); @@ -252,13 +252,13 @@ function snmp_explorer() { // Create the interface list for the interface $interfaces_list = array(); - foreach ($interfaces as $interface){ + foreach ($interfaces as $interface) { // Get the interface name, removing " " characters and avoid "blank" interfaces - if (isset($interface['ifName']) && $interface['ifName']['value'] != ""){ - $ifname = $interface['ifName']['value']; + if (isset($interface['ifName']) && $interface['ifName']['value'] != "") { + $ifname = $interface['ifName']['value']; } - else if (isset($interface['ifDescr']) && $interface['ifDescr']['value'] != ""){ - $ifname = $interface['ifDescr']['value']; + else if (isset($interface['ifDescr']) && $interface['ifDescr']['value'] != "") { + $ifname = $interface['ifDescr']['value']; } else { continue; @@ -432,45 +432,45 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) { $('#module').append ($('').html ("Loading...").attr ("value", 0)); jQuery.post ('ajax.php', - {"page" : "godmode/agentes/agent_manager", - "get_modules_json_for_multiple_snmp": 1, - "id_snmp[]": idSNMP, - "id_snmp_serialize": $("#hidden-id_snmp_serialize").val() - }, - function (data) { - $('#module').empty (); - c = 0; - jQuery.each (data, function (i, val) { - s = js_html_entity_decode(val); - $('#module').append ($('').html (s).attr ("value", i)); - $('#module').fadeIn ('normal'); - c++; - }); - if(c == 0){ - if (typeof($(document).data('text_for_module')) != 'undefined') { - $('#module').append ($('').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true)); - } - else { - if (typeof(data['any_text']) != 'undefined') { - $('#module').append ($('').html (data['any_text']).attr ("value", 0).attr('selected', true)); - } - else { - var anyText = $("#any_text").html(); //Trick for catch the translate text. - - if (anyText == null) { - anyText = 'Any'; - } - - $('#module').append ($('').html (anyText).attr ("value", 0).attr('selected', true)); - } - } - } - if (selected != undefined) - $('#module').attr ('value', selected); - $('#module').removeAttr('disabled'); - }, - "json" - ); + {"page" : "godmode/agentes/agent_manager", + "get_modules_json_for_multiple_snmp": 1, + "id_snmp[]": idSNMP, + "id_snmp_serialize": $("#hidden-id_snmp_serialize").val() + }, + function (data) { + $('#module').empty (); + c = 0; + jQuery.each (data, function (i, val) { + s = js_html_entity_decode(val); + $('#module').append ($('').html (s).attr ("value", i)); + $('#module').fadeIn ('normal'); + c++; + }); + + if (c == 0) { + if (typeof($(document).data('text_for_module')) != 'undefined') { + $('#module').append ($('').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true)); + } + else { + if (typeof(data['any_text']) != 'undefined') { + $('#module').append ($('').html (data['any_text']).attr ("value", 0).attr('selected', true)); + } + else { + var anyText = $("#any_text").html(); //Trick for catch the translate text. + + if (anyText == null) { + anyText = 'Any'; + } + + $('#module').append ($('').html (anyText).attr ("value", 0).attr('selected', true)); + } + } + } + if (selected != undefined) + $('#module').attr ('value', selected); + $('#module').removeAttr('disabled'); + }, + "json"); } /* ]]> */ diff --git a/pandora_console/extensions/system_info.php b/pandora_console/extensions/system_info.php index ba43a3f1dc..63dea7038d 100644 --- a/pandora_console/extensions/system_info.php +++ b/pandora_console/extensions/system_info.php @@ -168,7 +168,7 @@ function show_logfile($file_name, $numLines = 2000) { function logFilesLines($file_name, $numLines) { global $config; - if (!file_exists($file_name)){ + if (!file_exists($file_name)) { return ''; } else { diff --git a/pandora_console/general/shortcut_bar.php b/pandora_console/general/shortcut_bar.php index f269fd6570..480375ac84 100644 --- a/pandora_console/general/shortcut_bar.php +++ b/pandora_console/general/shortcut_bar.php @@ -309,8 +309,8 @@ echo ""; ); } else { - $('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900); - $('#shortcut_button').css({height: 40}).animate({ height: '22' }, 900); + $('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900); + $('#shortcut_button').css({height: 40}).animate({ height: '22' }, 900); jQuery.post ("ajax.php", {"page" : "general/shortcut_bar", "update_shortcut_state": 1, @@ -323,11 +323,12 @@ echo ""; }); }); - var id_user = $('#hidden-shortcut_id_user').val(); + var id_user = $('#hidden-shortcut_id_user').val(); function shortcut_check_alerts() { jQuery.post ("ajax.php", - {"page" : "operation/agentes/alerts_status", - "get_alert_fired": 1 + { + "page" : "operation/agentes/alerts_status", + "get_alert_fired": 1 }, function (data) { $('#shortcut_alerts_fired').text(data); diff --git a/pandora_console/godmode/massive/massive_add_action_alerts.php b/pandora_console/godmode/massive/massive_add_action_alerts.php index 40ec07295c..9da01691b2 100644 --- a/pandora_console/godmode/massive/massive_add_action_alerts.php +++ b/pandora_console/godmode/massive/massive_add_action_alerts.php @@ -188,7 +188,7 @@ $(document).ready (function () { update_alerts(); var recursion; - $("#checkbox-recursion").click(function (){ + $("#checkbox-recursion").click(function () { recursion = this.checked ? 1 : 0; $("#id_group").trigger("change"); }); diff --git a/pandora_console/godmode/massive/massive_add_alerts.php b/pandora_console/godmode/massive/massive_add_alerts.php index 706bf55d6a..3cdc61012d 100644 --- a/pandora_console/godmode/massive/massive_add_alerts.php +++ b/pandora_console/godmode/massive/massive_add_alerts.php @@ -62,7 +62,7 @@ function process_manage_add ($id_alert_template, $id_agents, $module_names) { } } - if(count($module_names) == 1 && $module_names[0] == '0'){ + if(count($module_names) == 1 && $module_names[0] == '0') { $modules_id = agents_common_modules ($id_agents, false, true); } diff --git a/pandora_console/godmode/massive/massive_delete_action_alerts.php b/pandora_console/godmode/massive/massive_delete_action_alerts.php index af8f4c78fa..6f47cb707d 100644 --- a/pandora_console/godmode/massive/massive_delete_action_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_action_alerts.php @@ -78,7 +78,7 @@ if ($delete) { foreach ($alerts_agent_modules as $alert_agent_module) { $agent_module_actions = alerts_get_alert_agent_module_actions ($alert_agent_module['id'], array('id','id_alert_action')); - foreach ($agent_module_actions as $agent_module_action){ + foreach ($agent_module_actions as $agent_module_action) { foreach ($actions as $action) { if ($agent_module_action['id_alert_action'] == $action) { $result = alerts_delete_alert_agent_module_action ($agent_module_action['id']); diff --git a/pandora_console/godmode/massive/massive_delete_agents.php b/pandora_console/godmode/massive/massive_delete_agents.php index 6b731c8689..bf382a2dde 100644 --- a/pandora_console/godmode/massive/massive_delete_agents.php +++ b/pandora_console/godmode/massive/massive_delete_agents.php @@ -135,7 +135,7 @@ ui_require_jquery_file ('pandora.controls');