2014-05-27 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2014-05-27 08:57:20 +00:00
parent e6b7b04b33
commit 6119b2e4a6
4 changed files with 42 additions and 23 deletions

View File

@ -1,3 +1,9 @@
2014-05-27 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager.php,
operation/agentes/estado_monitores.php, general/main_menu.php: fixed
the PHP warnings.
2014-05-26 Miguel de Dios <miguel.dedios@artica.es> 2014-05-26 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_networkmap.php: added the generate networkmap * include/functions_networkmap.php: added the generate networkmap

View File

@ -26,6 +26,7 @@ if (isset ($config["autohidden_menu"]) && $config["autohidden_menu"]) {
$autohidden_menu = 1; $autohidden_menu = 1;
} }
$menu_container_id = '';
if ($autohidden_menu) { if ($autohidden_menu) {
$menu_container_id = 'menu_container'; $menu_container_id = 'menu_container';
} }

View File

@ -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'); $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"]) { switch ($config["dbtype"]) {
case "postgresql": case "postgresql":
if ($config['paginate_module']) { if ($paginate_module) {
$limit_sql = " LIMIT $limit OFFSET $offset "; $limit_sql = " LIMIT $limit OFFSET $offset ";
} else { }
else {
$limit_sql = ''; $limit_sql = '';
} }
case "mysql": case "mysql":
if ($config['paginate_module']) { if ($paginate_module) {
if(!isset($limit_sql)) { if (!isset($limit_sql)) {
$limit_sql = " LIMIT $offset, $limit "; $limit_sql = " LIMIT $offset, $limit ";
} }
} else { }
else {
$limit_sql = ''; $limit_sql = '';
} }
$sql = sprintf("SELECT %s $sql = sprintf("SELECT %s
@ -449,7 +455,7 @@ switch ($config["dbtype"]) {
break; break;
case "oracle": case "oracle":
$set = array(); $set = array();
if ($config['paginate_module']) { if ($paginate_module) {
$set['limit'] = $limit; $set['limit'] = $limit;
$set['offset'] = $offset; $set['offset'] = $offset;
} }
@ -484,7 +490,7 @@ $url = "?" .
"&sort=" . $sort . "&" . "&sort=" . $sort . "&" .
"search_string=" . urlencode($search_string); "search_string=" . urlencode($search_string);
if ($config['paginate_module']) { if ($paginate_module) {
ui_pagination($total_modules, $url); ui_pagination($total_modules, $url);
} }

View File

@ -36,7 +36,7 @@ if (is_ajax ()) {
return; return;
} }
$get_relations_tooltip = (bool) get_parameter ('get_relations_tooltip', 0); $get_relations_tooltip = (bool) get_parameter ('get_relations_tooltip', 0);
if ($get_relations_tooltip) { if ($get_relations_tooltip) {
@ -53,7 +53,7 @@ if (is_ajax ()) {
if (empty($relations)) if (empty($relations))
return; return;
$table_relations = new stdClass(); $table_relations = new stdClass();
$table_relations->id = 'module_' . $id_agente_modulo . '_relations'; $table_relations->id = 'module_' . $id_agente_modulo . '_relations';
$table_relations->width = '98%'; $table_relations->width = '98%';
@ -65,15 +65,16 @@ if (is_ajax ()) {
$table_relations->head[0] = __("Relationship information"); $table_relations->head[0] = __("Relationship information");
$table_relations->head_colspan[0] = 4; $table_relations->head_colspan[0] = 4;
$table_relations->data = array(); $table_relations->data = array();
foreach ($relations as $relation) { foreach ($relations as $relation) {
if ($relation['module_a'] == $id_agente_modulo) { if ($relation['module_a'] == $id_agente_modulo) {
$id_module = $relation['module_b']; $id_module = $relation['module_b'];
} else { }
else {
$id_module = $relation['module_a']; $id_module = $relation['module_a'];
} }
$id_agent = modules_get_agentmodule_agent($id_module); $id_agent = modules_get_agentmodule_agent($id_module);
$data = array(); $data = array();
$data[0] = __('Agent'); $data[0] = __('Agent');
$data[1] = ui_print_agent_name ($id_agent, true); $data[1] = ui_print_agent_name ($id_agent, true);
@ -317,9 +318,14 @@ if ($monitors_change_filter) {
else { else {
$limit = " LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0); $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); $modules = db_get_all_rows_sql ($sql . $limit);
} else { }
else {
$modules = db_get_all_rows_sql ($sql); $modules = db_get_all_rows_sql ($sql);
} }
if (empty ($modules)) { if (empty ($modules)) {
@ -683,13 +689,13 @@ else {
"status_filter_monitor=" . $status_filter_monitor . "&" . "status_filter_monitor=" . $status_filter_monitor . "&" .
"status_text_monitor=" . $status_text_monitor; "status_text_monitor=" . $status_text_monitor;
if ($config['paginate_module']) { if ($paginate_module) {
ui_pagination ($count_modules, $url); ui_pagination ($count_modules, $url);
} }
html_print_table ($table); html_print_table ($table);
if ($config['paginate_module']) { if ($paginate_module) {
ui_pagination ($count_modules, $url); ui_pagination ($count_modules, $url);
} }
} }
@ -733,9 +739,9 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
var server_name = ''; var server_name = '';
var extra_parameters = ''; var extra_parameters = '';
if (period == -1) { if (period == -1) {
period = $('#period').val(); period = $('#period').val();
var selection_mode = $('input[name=selection_mode]:checked').val(); var selection_mode = $('input[name=selection_mode]:checked').val();
var date_from = $('#text-date_from').val(); var date_from = $('#text-date_from').val();
var time_from = $('#text-time_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() { function datetime_picker_callback() {
$("#text-time_from, #text-time_to").timepicker({ $("#text-time_from, #text-time_to").timepicker({
showSecond: true, showSecond: true,
timeFormat: '<?php echo TIME_FORMAT_JS; ?>', timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
@ -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) { function refresh_pagination_callback (module_id, id_agent, server_name) {
$(".binary_dialog").click( function() { $(".binary_dialog").click( function() {
var classes = $(this).attr('class'); var classes = $(this).attr('class');
classes = classes.split(' '); classes = classes.split(' ');
var offset_class = classes[2]; var offset_class = classes[2];
offset_class = offset_class.split('_'); offset_class = offset_class.split('_');
var offset = offset_class[1]; var offset = offset_class[1];
var period = $('#period').val(); var period = $('#period').val();
show_module_detail_dialog(module_id, id_agent, server_name, offset, period); show_module_detail_dialog(module_id, id_agent, server_name, offset, period);
return false; return false;
}); });