diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 97f3326eed..334aec1df0 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -420,6 +420,12 @@ switch ($action) { $period = $item['period']; $order_uptodown = $item['order_uptodown']; $show_resume = $item['show_resume']; + break; + case 'availability': + $description = $item['description']; + $period = $item['period']; + $order_uptodown = $item['order_uptodown']; + $show_resume = $item['show_resume']; // HACK it is saved in show_graph field. // Show interfaces instead the modules $show_address_agent = $item['show_graph']; @@ -501,7 +507,8 @@ switch ($action) { break; } -$urlForm = $config['homeurl'] . 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport; +$urlForm = $config['homeurl'] . + 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport; echo '
'; html_print_input_hidden('id_item', $idItem); @@ -538,8 +545,8 @@ html_print_input_hidden('id_item', $idItem); - + '; if ($action == 'new') { html_print_submit_button(__('Create item'), 'create_item', false, 'class="sub wand"'); @@ -1173,7 +1180,8 @@ function print_SLA_list($width, $action, $idItem = null) { global $config; global $meta; - $report_item_type = db_get_value ('type', 'treport_content', 'id_rc', $idItem); + $report_item_type = db_get_value('type', 'treport_content', 'id_rc', + $idItem); ?> @@ -1325,9 +1333,10 @@ function print_SLA_list($width, $action, $idItem = null) { __('rate'), 'max' => __('max'), 'min' => __('min'), - 'sum' => __('sum'), - 'ava' => __('Avail')); + 'sum' => __('sum')); include_once($config['homedir'] . '/include/functions_html.php'); ?>
- - - - + + + + + + + + + + '; - $itemsGeneral = db_get_all_rows_filter('treport_content_item', array('id_report_content' => $idItem)); + $itemsGeneral = db_get_all_rows_filter( + 'treport_content_item', + array('id_report_content' => $idItem)); if ($itemsGeneral === false) { $itemsGeneral = array(); } + foreach ($itemsGeneral as $item) { $server_name = $item ['server_name']; // Metaconsole db connection @@ -1377,22 +1401,41 @@ function print_General_list($width, $action, $idItem = null) { continue; } } - $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); + $idAgent = db_get_value_filter( + 'id_agente', 'tagente_modulo', + array('id_agente_modulo' => $item['id_agent_module'])); + $nameAgent = agents_get_name ($idAgent); $nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); $server_name_element = ''; if ($meta && $server_name != '') - $server_name_element .= ' (' . $server_name . ')'; + $server_name_element .= ' (' . $server_name . ')'; - echo ' + + if ($type == "availability") { + echo ' - '; + } + else { + echo ' + + + + + '; + } + + if ($meta) { //Restore db connection metaconsole_restore_db(); @@ -1404,7 +1447,13 @@ function print_General_list($width, $action, $idItem = null) { - + + + @@ -1431,8 +1480,25 @@ function print_General_list($width, $action, $idItem = null) { ui_print_agent_autocomplete_input($params); ?> - - + + + + @@ -1805,7 +1871,13 @@ function addGeneralRow() { var idAgent = $("input[name=id_agent_general]").val(); var serverId = $("input[name=id_server]").val(); var idModule = $("#id_agent_module_general").val(); - var operation = $("#id_operation_module_general").val(); + var operation; + if ($("#id_operation_module_general").length) { + operation = $("#id_operation_module_general").val(); + } + else { + operation = ""; + } var nameModule = $("#id_agent_module_general :selected").text(); var nameOperation = $("#id_operation_module_general :selected").text(); @@ -1840,6 +1912,7 @@ function addGeneralRow() { nameModule = data; } }); + //Truncate nameOperation var params = []; params.push("truncate_text=1"); @@ -1855,6 +1928,7 @@ function addGeneralRow() { nameOperation = data; } }); + var params = []; params.push("add_general=1"); params.push("id=" + $("input[name=id_item]").val()); @@ -2205,7 +2279,6 @@ function chooseType() { $("#general_list").show(); $("#row_order_uptodown").show(); $("#row_show_resume").show(); - $("#row_show_address_agent").show(); $("#row_show_in_two_columns").show(); $("#row_last_value").show(); @@ -2214,6 +2287,14 @@ function chooseType() { $("input[name='last_value']").prop("checked", true); } break; + case 'availability': + $("#row_description").show(); + $("#row_period").show(); + $("#general_list").show(); + $("#row_order_uptodown").show(); + $("#row_show_address_agent").show(); + $("#row_show_in_two_columns").show(); + break; case 'group_report': $("#row_group").show(); $("#row_servers").show(); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 5547ffff3d..8f28978954 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -776,7 +776,8 @@ switch ($action) { break; case 'item_editor': $resultOperationDB = null; - $report = db_get_row_filter('treport', array('id_report' => $idReport)); + $report = db_get_row_filter('treport', + array('id_report' => $idReport)); $reportName = $report['name']; $idGroupReport = $report['id_group']; @@ -849,11 +850,19 @@ switch ($action) { $values['top_n_value'] = get_parameter('max_values'); $good_format = true; break; + case 'availability': + $good_format = true; + // HACK it is saved in show_graph field. + // Show interfaces instead the modules + $values['show_graph'] = + get_parameter('checkbox_show_address_agent'); + break; default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter('radiobutton_max_min_avg',0); $values['top_n_value'] = get_parameter('quantity'); $values['text'] = get_parameter('text'); + $values['show_graph'] = get_parameter('combo_graph_options'); $good_format = true; } @@ -885,7 +894,6 @@ switch ($action) { $values['order_uptodown'] = get_parameter ('radiobutton_order_uptodown'); $values['exception_condition'] = (int)get_parameter('exception_condition', 0); $values['exception_condition_value'] = get_parameter('exception_condition_value'); - $values['show_graph'] = get_parameter('combo_graph_options'); $values['id_module_group'] = get_parameter('combo_modulegroup'); $values['id_group'] = get_parameter ('combo_group'); $values['server_name'] = get_parameter ('server_name'); diff --git a/pandora_console/operation/reporting/reporting_xml.php b/pandora_console/operation/reporting/reporting_xml.php index 4454a8bace..bcfdaf1742 100644 --- a/pandora_console/operation/reporting/reporting_xml.php +++ b/pandora_console/operation/reporting/reporting_xml.php @@ -383,15 +383,15 @@ foreach ($contents as $content) { $data["module"] = io_safe_output_xml (db_get_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module'])); $data["agent"] = io_safe_output_xml (modules_get_agentmodule_agent_name ($content['id_agent_module'])); - html_debug_print($content, true); + $graph = db_get_row ("tgraph", "id_graph", $content['id_gs']); $data["title"] = __('Custom graph'); $data["objdata"] = array(); - html_debug_print($graph, true); + $result = db_get_all_rows_field_filter ("tgraph_source","id_graph",$content['id_gs']); $modules = array (); $weights = array (); - html_debug_print($result, true); + if ($result === false) { $result = array(); }
' . printSmallFont($nameAgent) . $server_name_element . ' ' . printSmallFont($nameModule) . '' . printSmallFont($operation[$item['operation']]) . ' ' . html_print_image("images/cross.png", true) . '
' . printSmallFont($nameAgent) . $server_name_element . '' . printSmallFont($nameModule) . '' . + printSmallFont($operation[$item['operation']]) . + ' + ' . html_print_image("images/cross.png", true) . ' +
+ + + +