From fe8300655dae703ecba65a96df026483f9efe7c6 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 27 Jan 2016 13:08:11 +0100 Subject: [PATCH] Cleaned source code. --- .../realtime_graphs/realtime_graphs.js | 16 ++++++++-------- pandora_console/general/main_menu.php | 4 ++-- pandora_console/include/functions_api.php | 4 ++-- pandora_console/include/functions_events.php | 2 +- pandora_console/include/graphs/pandora.d3.js | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.js b/pandora_console/extensions/realtime_graphs/realtime_graphs.js index 0d2b651313..8a8b686bb9 100644 --- a/pandora_console/extensions/realtime_graphs/realtime_graphs.js +++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.js @@ -34,7 +34,7 @@ var data = []; var id = $('.graph').attr('id'); var plot = $.plot("#" + id, data, options); - + var refresh = parseInt($('#refresh').val()); var incremental = $('#checkbox-incremental').is(':checked'); @@ -67,7 +67,7 @@ function refresh_graph () { success: function(serie) { var timestamp = serie.data[0][0]; data = plot.getData(); - if (data.length == 0) { + if (data.length == 0) { for(i = 0; i < max_data_plot; i ++) { step = i * (refresh/1000); serie.data.unshift([timestamp-step, 0]); @@ -84,12 +84,12 @@ function refresh_graph () { if (incremental) { var last_item = parseInt(data[0].data.length)-1; - var last_value = data[0].data[last_item][1]; + var last_value = data[0].data[last_item][1]; var current_value = serie.data[0][1]; serie.data[0][1] = current_value - last_inc; - + last_inc = current_value; // Incremental is always positive @@ -111,7 +111,7 @@ $('#graph').change(function() { $('#refresh').change(function() { var refresh = parseInt($('#refresh').val()); - + // Stop and start the Timeout clearTimeout(to); to = window.setTimeout(refresh_graph, refresh); @@ -153,7 +153,7 @@ function setOID () { $('.ui-dialog-titlebar-close').trigger('click'); } -$('#checkbox-incremental').change(function() { +$('#checkbox-incremental').change(function() { incremental = $('#checkbox-incremental').is(':checked'); clearGraph(); }); @@ -173,13 +173,13 @@ function setOnIncremental() { function clearGraph() { data = plot.getData(); - if (data.length == 0) { + if (data.length == 0) { return; } for(i = 0; i < data[0].data.length; i ++) { data[0].data[i][1] = 0; } - + $.plot("#" + id, data, options); } diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 50b75a70c2..51a08a7e50 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -318,7 +318,7 @@ $(document).ready( function() { $('li.menu_icon').removeClass( " no_hidden_menu"); $('ul.submenu').css('left', '44px'); $('div#title_menu').hide(); - }); + }); $('div.menu>ul>li>ul>li>ul>li>a').click(function() { openTime = 4000; if( typeof(table_hover) != 'undefined') @@ -329,7 +329,7 @@ $(document).ready( function() { $('li.menu_icon').removeClass( " no_hidden_menu"); $('ul.submenu').css('left', '44px'); $('div#title_menu').hide(); - }); + }); }); diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 4b293696df..875eca8096 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1226,7 +1226,7 @@ function api_get_custom_field_id($t1, $t2, $other, $returnType) { } $name = $other["data"][0]; - $id = db_get_value ('id_field', 'tagent_custom_fields', 'name', $name); + $id = db_get_value ('id_field', 'tagent_custom_fields', 'name', $name); $data['type'] = "string"; $data["data"] = $id; @@ -1734,7 +1734,7 @@ function api_get_policy_modules($thrash1, $thrash2, $other, $thrash3) { if ($other['data'][0] == "") { returnError('error_policy_modules', 'Error retrieving policy modules. Id_policy cannot be left blank.'); - return; + return; } $policies = enterprise_hook('policies_get_modules_api', diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 00a3dc38fb..1f26c53889 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -632,7 +632,7 @@ function events_comment ($id_event, $comment = '', $action = 'Added comment', $m case 'oracle': $sql_validation = "UPDATE $event_table SET user_comment='" . $comment . "' || user_comment) - WHERE id_evento in (" . implode(',', $id_event) . ")"; + WHERE id_evento in (" . implode(',', $id_event) . ")"; $ret = db_process_sql($sql_validation); break; diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index 4facb204cf..fb21778c1e 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -1093,7 +1093,7 @@ function Gauge(placeholderName, configuration) } var point1 = this.valueToPoint(major, 0.7); - var point2 = this.valueToPoint(major, 0.85); + var point2 = this.valueToPoint(major, 0.85); this.body.append("svg:line") .attr("x1", point1.x) @@ -1249,5 +1249,5 @@ function Gauge(placeholderName, configuration) } // initialization - this.configure(configuration); + this.configure(configuration); } \ No newline at end of file