From 1d1340743526b03e2ebe9793bd9efbf60be35328 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 27 May 2014 08:57:20 +0000 Subject: [PATCH] 2014-05-27 Miguel de Dios * godmode/agentes/module_manager.php, operation/agentes/estado_monitores.php, general/main_menu.php: fixed the PHP warnings. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10014 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 +++ pandora_console/general/main_menu.php | 1 + .../godmode/agentes/module_manager.php | 20 ++++++---- .../operation/agentes/estado_monitores.php | 38 +++++++++++-------- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2fc5624f6a..79892bb0a9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2014-05-27 Miguel de Dios + + * godmode/agentes/module_manager.php, + operation/agentes/estado_monitores.php, general/main_menu.php: fixed + the PHP warnings. + 2014-05-26 Miguel de Dios * include/functions_networkmap.php: added the generate networkmap diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 79170dcd31..73130c5e20 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -26,6 +26,7 @@ if (isset ($config["autohidden_menu"]) && $config["autohidden_menu"]) { $autohidden_menu = 1; } +$menu_container_id = ''; if ($autohidden_menu) { $menu_container_id = 'menu_container'; } diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 3221b1655c..3f270ec5e6 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -425,19 +425,25 @@ $basic_where = sprintf("(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descrip $where_tags = tags_get_acl_tags($config['id_user'], 0, 'AR', 'module_condition', 'AND', 'tagente_modulo'); +$paginate_module = false; +if (isset($config['paginate_module'])) + $paginate_module = $config['paginate_module']; + switch ($config["dbtype"]) { case "postgresql": - if ($config['paginate_module']) { + if ($paginate_module) { $limit_sql = " LIMIT $limit OFFSET $offset "; - } else { + } + else { $limit_sql = ''; } case "mysql": - if ($config['paginate_module']) { - if(!isset($limit_sql)) { + if ($paginate_module) { + if (!isset($limit_sql)) { $limit_sql = " LIMIT $offset, $limit "; } - } else { + } + else { $limit_sql = ''; } $sql = sprintf("SELECT %s @@ -449,7 +455,7 @@ switch ($config["dbtype"]) { break; case "oracle": $set = array(); - if ($config['paginate_module']) { + if ($paginate_module) { $set['limit'] = $limit; $set['offset'] = $offset; } @@ -484,7 +490,7 @@ $url = "?" . "&sort=" . $sort . "&" . "search_string=" . urlencode($search_string); -if ($config['paginate_module']) { +if ($paginate_module) { ui_pagination($total_modules, $url); } diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 9963053fa5..311a208ce2 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -36,7 +36,7 @@ if (is_ajax ()) { return; } - + $get_relations_tooltip = (bool) get_parameter ('get_relations_tooltip', 0); if ($get_relations_tooltip) { @@ -53,7 +53,7 @@ if (is_ajax ()) { if (empty($relations)) return; - + $table_relations = new stdClass(); $table_relations->id = 'module_' . $id_agente_modulo . '_relations'; $table_relations->width = '98%'; @@ -65,15 +65,16 @@ if (is_ajax ()) { $table_relations->head[0] = __("Relationship information"); $table_relations->head_colspan[0] = 4; $table_relations->data = array(); - + foreach ($relations as $relation) { if ($relation['module_a'] == $id_agente_modulo) { $id_module = $relation['module_b']; - } else { + } + else { $id_module = $relation['module_a']; } $id_agent = modules_get_agentmodule_agent($id_module); - + $data = array(); $data[0] = __('Agent'); $data[1] = ui_print_agent_name ($id_agent, true); @@ -317,9 +318,14 @@ if ($monitors_change_filter) { else { $limit = " LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0); } -if ($config['paginate_module']) { +$paginate_module = false; +if (isset($config['paginate_module'])) + $paginate_module = $config['paginate_module']; + +if ($paginate_module) { $modules = db_get_all_rows_sql ($sql . $limit); -} else { +} +else { $modules = db_get_all_rows_sql ($sql); } if (empty ($modules)) { @@ -683,13 +689,13 @@ else { "status_filter_monitor=" . $status_filter_monitor . "&" . "status_text_monitor=" . $status_text_monitor; - if ($config['paginate_module']) { + if ($paginate_module) { ui_pagination ($count_modules, $url); } html_print_table ($table); - if ($config['paginate_module']) { + if ($paginate_module) { ui_pagination ($count_modules, $url); } } @@ -733,9 +739,9 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri var server_name = ''; var extra_parameters = ''; if (period == -1) { - + period = $('#period').val(); - + var selection_mode = $('input[name=selection_mode]:checked').val(); var date_from = $('#text-date_from').val(); var time_from = $('#text-time_from').val(); @@ -773,7 +779,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri }); } function datetime_picker_callback() { - + $("#text-time_from, #text-time_to").timepicker({ showSecond: true, timeFormat: '', @@ -793,15 +799,15 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri function refresh_pagination_callback (module_id, id_agent, server_name) { $(".binary_dialog").click( function() { - + var classes = $(this).attr('class'); classes = classes.split(' '); var offset_class = classes[2]; offset_class = offset_class.split('_'); - var offset = offset_class[1]; - + var offset = offset_class[1]; + var period = $('#period').val(); - + show_module_detail_dialog(module_id, id_agent, server_name, offset, period); return false; });