Change some styles in the code of report editor for to made more easy the comparation with the template report editor

This commit is contained in:
mdtrooper 2015-04-28 14:26:19 +02:00
parent 713d6991be
commit 402165fd11

View File

@ -29,6 +29,13 @@ $meta = false;
if (($config['metaconsole'] == 1) && (defined('METACONSOLE'))) { if (($config['metaconsole'] == 1) && (defined('METACONSOLE'))) {
$meta = true; $meta = true;
} }
$show_graph_options = Array(); $show_graph_options = Array();
$show_graph_options[0] = __('Only table'); $show_graph_options[0] = __('Only table');
$show_graph_options[1] = __('Table & Graph'); $show_graph_options[1] = __('Table & Graph');
@ -125,6 +132,7 @@ switch ($action) {
// If we are creating a new report item then clean interface and display creation view // If we are creating a new report item then clean interface and display creation view
$type = get_parameter('type', 'SLA'); $type = get_parameter('type', 'SLA');
switch ($type) { switch ($type) {
case 'SLA_monthly': case 'SLA_monthly':
case 'SLA_services': case 'SLA_services':
@ -136,6 +144,7 @@ switch ($action) {
case 'availability': case 'availability':
$get_data_editor = true; $get_data_editor = true;
break; break;
default: default:
$actionParameter = 'save'; $actionParameter = 'save';
$action = 'new'; $action = 'new';
@ -179,6 +188,7 @@ switch ($action) {
$idAgentModule = $item['id_agent_module']; $idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
break; break;
case 'simple_graph': case 'simple_graph':
$only_avg = isset($style['only_avg']) ? (bool) $style['only_avg'] : true; $only_avg = isset($style['only_avg']) ? (bool) $style['only_avg'] : true;
// The break hasn't be forgotten. // The break hasn't be forgotten.
@ -197,6 +207,7 @@ switch ($action) {
// HACK it is saved in show_graph field. // HACK it is saved in show_graph field.
$time_compare_overlapped = $item['show_graph']; $time_compare_overlapped = $item['show_graph'];
break; break;
case 'prediction_date': case 'prediction_date':
$description = $item['description']; $description = $item['description'];
$idAgentModule = $item['id_agent_module']; $idAgentModule = $item['id_agent_module'];
@ -482,6 +493,7 @@ switch ($action) {
$idAgent = $es['id_agents']; $idAgent = $es['id_agents'];
$idAgentModule = $inventory_modules; $idAgentModule = $inventory_modules;
break; break;
case 'inventory_changes': case 'inventory_changes':
$period = $item['period']; $period = $item['period'];
$description = $item['description']; $description = $item['description'];
@ -489,12 +501,15 @@ switch ($action) {
$inventory_modules = $es['inventory_modules']; $inventory_modules = $es['inventory_modules'];
$id_agents = $es['id_agents']; $id_agents = $es['id_agents'];
break; break;
case 'agent_configuration': case 'agent_configuration':
$idAgent = $item['id_agent']; $idAgent = $item['id_agent'];
break; break;
case 'group_configuration': case 'group_configuration':
$group = $item['id_group']; $group = $item['id_group'];
break; break;
case 'netflow_area': case 'netflow_area':
case 'netflow_pie': case 'netflow_pie':
case 'netflow_data': case 'netflow_data':
@ -517,6 +532,7 @@ switch ($action) {
break; break;
} }
$urlForm = $config['homeurl'] . $urlForm = $config['homeurl'] .
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport; 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport;
@ -528,10 +544,12 @@ html_print_input_hidden('id_item', $idItem);
<table style="" class="databox" id="" border="0" cellpadding="4" cellspacing="4" width="98%"> <table style="" class="databox" id="" border="0" cellpadding="4" cellspacing="4" width="98%">
<tbody> <tbody>
<tr id="row_type" style="" class="datos"> <tr id="row_type" style="" class="datos">
<td style="vertical-align: top; width: 220px;"><?php echo __('Type'); ?></td> <td style="vertical-align: top; width: 220px;">
<?php echo __('Type'); ?>
</td>
<td style=""> <td style="">
<?php <?php
if ($action == 'new') { if ($action == 'new') {
html_print_select(reports_get_report_types(false, true), 'type', $type, 'chooseType();', '', ''); html_print_select(reports_get_report_types(false, true), 'type', $type, 'chooseType();', '', '');
} }
else { else {
@ -545,6 +563,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_name" style="" class="datos"> <tr id="row_name" style="" class="datos">
<td style="vertical-align: top;"> <td style="vertical-align: top;">
<?php echo __('Name'); ?> <?php echo __('Name'); ?>
@ -555,6 +574,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_netflow_filter" style="" class="datos"> <tr id="row_netflow_filter" style="" class="datos">
<td><?php echo __('Filter');?></td> <td><?php echo __('Filter');?></td>
<td> <td>
@ -573,6 +593,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_description" style="" class="datos"> <tr id="row_description" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Description'); ?></td> <td style="vertical-align: top;"><?php echo __('Description'); ?></td>
<td style=""> <td style="">
@ -581,6 +602,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_period" style="" class="datos"> <tr id="row_period" style="" class="datos">
<td style="vertical-align: top;"> <td style="vertical-align: top;">
<?php <?php
@ -589,7 +611,8 @@ html_print_input_hidden('id_item', $idItem);
</td> </td>
<td style=""> <td style="">
<?php <?php
html_print_extended_select_for_time ('period', $period, '', '', '0', 10); html_print_extended_select_for_time('period', $period,
'', '', '0', 10);
?> ?>
</td> </td>
</tr> </tr>
@ -618,8 +641,10 @@ html_print_input_hidden('id_item', $idItem);
<td style=""> <td style="">
<?php <?php
html_print_extended_select_for_time ('resolution', $resolution, '', '', '0', 10); html_print_extended_select_for_time ('resolution', $resolution, '', '', '0', 10);
?></td> ?>
</td>
</tr> </tr>
<tr id="row_period1" style="" class="datos"> <tr id="row_period1" style="" class="datos">
<td style="vertical-align: top;"> <td style="vertical-align: top;">
<?php <?php
@ -652,12 +677,14 @@ html_print_input_hidden('id_item', $idItem);
</tr> </tr>
<tr id="row_interval" style="" class="datos"> <tr id="row_interval" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Data range') . ui_print_help_icon('prediction_date', true); ?></td> <td style="vertical-align: top;"><?php echo __('Data range') . ui_print_help_icon('prediction_date', true); ?></td>
<td><?php <td>
<?php
echo __('Max') . "&nbsp;"; echo __('Max') . "&nbsp;";
html_print_input_text('max_interval', $max_interval, '', 5, 10); html_print_input_text('max_interval', $max_interval, '', 5, 10);
echo "&nbsp;" . __('Min') . "&nbsp;"; echo "&nbsp;" . __('Min') . "&nbsp;";
html_print_input_text('min_interval', $min_interval, '', 5, 10); html_print_input_text('min_interval', $min_interval, '', 5, 10);
?></td> ?>
</td>
</tr> </tr>
<tr id="row_only_display_wrong" style="" class="datos"> <tr id="row_only_display_wrong" style="" class="datos">
<td><?php echo __('Only display wrong SLAs');?></td> <td><?php echo __('Only display wrong SLAs');?></td>
@ -738,6 +765,8 @@ html_print_input_hidden('id_item', $idItem);
</table> </table>
</td> </td>
</tr> </tr>
<tr id="row_group" style="" class="datos"> <tr id="row_group" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Group');?></td> <td style="vertical-align: top;"><?php echo __('Group');?></td>
<td style=""> <td style="">
@ -757,6 +786,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_agent" style="" class="datos"> <tr id="row_agent" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Agent'); ?></td> <td style="vertical-align: top;"><?php echo __('Agent'); ?></td>
<td style=""> <td style="">
@ -807,8 +837,13 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_module" style="" class="datos"> <tr id="row_module" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Module'); ?></td> <td style="vertical-align: top;">
<?php
echo __('Module');
?>
</td>
<td style="max-width: 180px"> <td style="max-width: 180px">
<?php <?php
if ($idAgent) { if ($idAgent) {
@ -850,6 +885,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_agent_multi" style="" class="datos"> <tr id="row_agent_multi" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Agents'); ?></td> <td style="vertical-align: top;"><?php echo __('Agents'); ?></td>
<td> <td>
@ -865,6 +901,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_module_multi" style="" class="datos"> <tr id="row_module_multi" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Modules'); ?></td> <td style="vertical-align: top;"><?php echo __('Modules'); ?></td>
<td> <td>
@ -880,6 +917,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_date" style="" class="datos"> <tr id="row_date" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Date'); ?></td> <td style="vertical-align: top;"><?php echo __('Date'); ?></td>
<td style="max-width: 180px"> <td style="max-width: 180px">
@ -897,6 +935,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_custom_graph" style="" class="datos"> <tr id="row_custom_graph" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Custom graph'); ?></td> <td style="vertical-align: top;"><?php echo __('Custom graph'); ?></td>
<td style=""> <td style="">
@ -956,14 +995,19 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_text" style="" class="datos"> <tr id="row_text" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Text'); ?></td> <td style="vertical-align: top;"><?php echo __('Text'); ?></td>
<td style=""><?php html_print_textarea('text', 5, 25, $text); ?></td> <td style=""><?php html_print_textarea('text', 5, 25, $text); ?></td>
</tr> </tr>
<tr id="row_custom" style="" class="datos"> <tr id="row_custom" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Custom SQL template'); ?></td> <td style="vertical-align: top;"><?php echo __('Custom SQL template'); ?></td>
<td style=""><?php html_print_select_from_sql('SELECT id, name FROM treport_custom_sql', 'id_custom', $idCustom, 'chooseSQLquery()', '--', '0'); ?></td> <td style=""><?php html_print_select_from_sql('SELECT id, name FROM treport_custom_sql', 'id_custom', $idCustom, 'chooseSQLquery()', '--', '0'); ?></td>
</tr> </tr>
<tr id="row_query" style="" class="datos"> <tr id="row_query" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('SQL query'); ?></td> <td style="vertical-align: top;"><?php echo __('SQL query'); ?></td>
<td style="" id="sql_entry"> <td style="" id="sql_entry">
@ -973,6 +1017,7 @@ html_print_input_hidden('id_item', $idItem);
</td> </td>
<td style="" id="sql_example"></td> <td style="" id="sql_example"></td>
</tr> </tr>
<?php <?php
if ($meta) { if ($meta) {
?> ?>
@ -987,10 +1032,12 @@ html_print_input_hidden('id_item', $idItem);
<?php <?php
} }
?> ?>
<tr id="row_header" style="" class="datos"> <tr id="row_header" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Serialized header') . ui_print_help_tip(__("The separator character is |"), true);?></td> <td style="vertical-align: top;"><?php echo __('Serialized header') . ui_print_help_tip(__("The separator character is |"), true);?></td>
<td style=""><?php html_print_input_text('header', $header, '', 90, 250); ?></td> <td style=""><?php html_print_input_text('header', $header, '', 90, 250); ?></td>
</tr> </tr>
<tr id="row_url" style="" class="datos"> <tr id="row_url" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('URL'); ?></td> <td style="vertical-align: top;"><?php echo __('URL'); ?></td>
<td style=""><?php html_print_input_text('url', $url, '', 90, 250); ?></td> <td style=""><?php html_print_input_text('url', $url, '', 90, 250); ?></td>
@ -1023,14 +1070,17 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_quantity" style="" class="datos"> <tr id="row_quantity" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Quantity (n)'); ?></td> <td style="vertical-align: top;"><?php echo __('Quantity (n)'); ?></td>
<td style=""><?php html_print_input_text('quantity', $top_n_value, '', 5, 5); ?></td> <td style=""><?php html_print_input_text('quantity', $top_n_value, '', 5, 5); ?></td>
</tr> </tr>
<tr id="row_max_values" style="" class="datos"> <tr id="row_max_values" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Max. values'); ?></td> <td style="vertical-align: top;"><?php echo __('Max. values'); ?></td>
<td style=""><?php html_print_input_text('max_values', $max_values, '', 5, 5); ?></td> <td style=""><?php html_print_input_text('max_values', $max_values, '', 5, 5); ?></td>
</tr> </tr>
<tr id="row_max_min_avg" style="" class="datos"> <tr id="row_max_min_avg" style="" class="datos">
<td><?php echo __('Display');?></td> <td><?php echo __('Display');?></td>
<td> <td>
@ -1044,6 +1094,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_time_compare_overlapped" style="" class="datos"> <tr id="row_time_compare_overlapped" style="" class="datos">
<td><?php echo __('Time compare (Overlapped)');?></td> <td><?php echo __('Time compare (Overlapped)');?></td>
<td> <td>
@ -1052,6 +1103,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_only_avg" style="" class="datos"> <tr id="row_only_avg" style="" class="datos">
<td><?php echo __('Only average');?></td> <td><?php echo __('Only average');?></td>
<td><?php html_print_checkbox('only_avg', 1, $only_avg);?></td> <td><?php html_print_checkbox('only_avg', 1, $only_avg);?></td>
@ -1062,7 +1114,9 @@ html_print_input_hidden('id_item', $idItem);
</tr> </tr>
<tr id="row_exception_condition" style="" class="datos"> <tr id="row_exception_condition" style="" class="datos">
<td><?php echo __('Condition');?></td> <td><?php echo __('Condition');?></td>
<td><?php <td>
<?php
$list_exception_condition = array( $list_exception_condition = array(
REPORT_EXCEPTION_CONDITION_EVERYTHING => __('Everything'), REPORT_EXCEPTION_CONDITION_EVERYTHING => __('Everything'),
REPORT_EXCEPTION_CONDITION_GE => __('Greater or equal (>=)'), REPORT_EXCEPTION_CONDITION_GE => __('Greater or equal (>=)'),
@ -1076,7 +1130,9 @@ html_print_input_hidden('id_item', $idItem);
); );
html_print_select($list_exception_condition, 'exception_condition', $exception_condition); html_print_select($list_exception_condition, 'exception_condition', $exception_condition);
/*echo ;
/*
echo __('Everything');
html_print_radio_button ('radiobutton_exception_condition', 0, '', $exception_condition); html_print_radio_button ('radiobutton_exception_condition', 0, '', $exception_condition);
echo __('>='); echo __('>=');
html_print_radio_button ('radiobutton_exception_condition', 1, '', $exception_condition); html_print_radio_button ('radiobutton_exception_condition', 1, '', $exception_condition);
@ -1086,13 +1142,16 @@ html_print_input_hidden('id_item', $idItem);
html_print_radio_button ('radiobutton_exception_condition', 3, '', $exception_condition); html_print_radio_button ('radiobutton_exception_condition', 3, '', $exception_condition);
echo __('Not OK'); echo __('Not OK');
html_print_radio_button ('radiobutton_exception_condition', 4, '', $exception_condition); html_print_radio_button ('radiobutton_exception_condition', 4, '', $exception_condition);
*/?></td> */
?>
</td>
</tr> </tr>
<tr id="row_show_graph" style="" class="datos"> <tr id="row_show_graph" style="" class="datos">
<td><?php echo __('Show graph');?></td> <td><?php echo __('Show graph');?></td>
<td><?php html_print_select ($show_graph_options, 'combo_graph_options', $show_graph);?></td> <td><?php html_print_select ($show_graph_options, 'combo_graph_options', $show_graph);?></td>
</tr> </tr>
<tr id="row_show_address_agent" style="" class="datos"> <tr id="row_show_address_agent" style="" class="datos">
<td> <td>
<?php <?php
@ -1107,6 +1166,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_show_resume" style="" class="datos"> <tr id="row_show_resume" style="" class="datos">
<td><?php echo __('Show resume') . ui_print_help_tip(__('Show a resume table with max, min, average of total modules on the report bottom'), true);?></td> <td><?php echo __('Show resume') . ui_print_help_tip(__('Show a resume table with max, min, average of total modules on the report bottom'), true);?></td>
<td> <td>
@ -1131,7 +1191,7 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
</tr>
<tr id="row_event_graphs" style="" class="datos"> <tr id="row_event_graphs" style="" class="datos">
<td><?php echo __('Event graphs'); ?></td> <td><?php echo __('Event graphs'); ?></td>
<td> <td>
@ -1161,15 +1221,18 @@ html_print_input_hidden('id_item', $idItem);
</span> </span>
</td> </td>
</tr> </tr>
<tr id="row_show_in_two_columns" style="" class="datos"> <tr id="row_show_in_two_columns" style="" class="datos">
<td><?php echo __('Show in two columns');?></td> <td><?php echo __('Show in two columns');?></td>
<td><?php html_print_checkbox('show_in_two_columns', 1, $show_in_two_columns, false, <td><?php html_print_checkbox('show_in_two_columns', 1, $show_in_two_columns, false,
false, 'if ($(\'input[name=show_in_two_columns]\').is(\':checked\')) $(\'input[name=show_in_landscape]\').attr(\'checked\', false);');?></td> false, 'if ($(\'input[name=show_in_two_columns]\').is(\':checked\')) $(\'input[name=show_in_landscape]\').attr(\'checked\', false);');?></td>
</tr> </tr>
<tr id="row_sort" style="" class="datos"> <tr id="row_sort" style="" class="datos">
<td><?php echo __('Order') . ui_print_help_tip(__('SLA items sorted by fulfillment value'), true);?></td> <td><?php echo __('Order') . ui_print_help_tip(__('SLA items sorted by fulfillment value'), true);?></td>
<td><?php html_print_select ($show_sort_options, 'combo_sla_sort_options', $sla_sorted_by, '', __('None'), 0); ?></td> <td><?php html_print_select ($show_sort_options, 'combo_sla_sort_options', $sla_sorted_by, '', __('None'), 0); ?></td>
</tr> </tr>
<tr id="row_show_in_landscape" style="" class="datos"> <tr id="row_show_in_landscape" style="" class="datos">
<td><?php echo __('Show in landscape');?></td> <td><?php echo __('Show in landscape');?></td>
<td> <td>
@ -1180,6 +1243,9 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_filter_search" style="" class="datos"> <tr id="row_filter_search" style="" class="datos">
<td><?php echo __('Free search');?></td> <td><?php echo __('Free search');?></td>
<td> <td>
@ -1208,6 +1274,7 @@ echo '</form>';
ui_include_time_picker(); ui_include_time_picker();
ui_require_javascript_file('pandora'); ui_require_javascript_file('pandora');
if ($enterpriseEnable) { if ($enterpriseEnable) {
reporting_enterprise_text_box(); reporting_enterprise_text_box();
} }
@ -1255,13 +1322,15 @@ function print_SLA_list($width, $action, $idItem = null) {
foreach ($itemsSLA as $item) { foreach ($itemsSLA as $item) {
$server_name = $item ['server_name']; $server_name = $item ['server_name'];
// Metaconsole db connection // Metaconsole db connection
if ($meta && $server_name != '') { if ($meta && ($server_name != '')) {
$connection = metaconsole_get_connection($server_name); $connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
//ui_print_error_message ("Error connecting to ".$server_name); //ui_print_error_message ("Error connecting to ".$server_name);
continue; continue;
} }
} }
$idAgent = db_get_value_filter('id_agente', $idAgent = db_get_value_filter('id_agente',
'tagente_modulo', 'tagente_modulo',
array('id_agente_modulo' => $item['id_agent_module'])); array('id_agente_modulo' => $item['id_agent_module']));
@ -1291,6 +1360,7 @@ function print_SLA_list($width, $action, $idItem = null) {
<a href="javascript: deleteSLARow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a> <a href="javascript: deleteSLARow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a>
</td>'; </td>';
echo '</tr>'; echo '</tr>';
if ($meta) { if ($meta) {
//Restore db connection //Restore db connection
metaconsole_restore_db(); metaconsole_restore_db();
@ -1310,11 +1380,13 @@ function print_SLA_list($width, $action, $idItem = null) {
<td class="sla_list_sla_min_col sla_min"></td> <td class="sla_list_sla_min_col sla_min"></td>
<td class="sla_list_sla_max_col sla_max"></td> <td class="sla_list_sla_max_col sla_max"></td>
<td class="sla_list_sla_limit_col sla_limit"></td> <td class="sla_list_sla_limit_col sla_limit"></td>
<td class="sla_list_action_col" style="text-align: center;"> <td class="sla_list_action_col" style="text-align: center;">
<a class="delete_button" href="javascript: deleteSLARow(0);"><?php html_print_image("images/cross.png", false); ?></a> <a class="delete_button" href="javascript: deleteSLARow(0);"><?php html_print_image("images/cross.png", false); ?></a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
<tr id="sla_form" style="" class="datos"> <tr id="sla_form" style="" class="datos">
<td class="sla_list_agent_col"> <td class="sla_list_agent_col">
@ -1359,7 +1431,10 @@ function print_SLA_list($width, $action, $idItem = null) {
<td class="sla_list_sla_min_col"><input name="sla_min" id="text-sla_min" size="10" maxlength="10" type="text"></td> <td class="sla_list_sla_min_col"><input name="sla_min" id="text-sla_min" size="10" maxlength="10" type="text"></td>
<td class="sla_list_sla_max_col"><input name="sla_max" id="text-sla_max" size="10" maxlength="10" type="text"></td> <td class="sla_list_sla_max_col"><input name="sla_max" id="text-sla_max" size="10" maxlength="10" type="text"></td>
<td class="sla_list_sla_limit_col"><input name="sla_limit" id="text-sla_limit" size="10" maxlength="10" type="text"></td> <td class="sla_list_sla_limit_col"><input name="sla_limit" id="text-sla_limit" size="10" maxlength="10" type="text"></td>
<td class="sla_list_action_col" style="text-align: center;"><a href="javascript: addSLARow();"><?php html_print_image("images/disk.png", false); ?></a></td>
<td class="sla_list_action_col" style="text-align: center;">
<a href="javascript: addSLARow();"><?php html_print_image("images/disk.png", false); ?></a>
</td>
</tr> </tr>
</tbody> </tbody>
<?php <?php
@ -1416,7 +1491,11 @@ function print_General_list($width, $action, $idItem = null, $type = 'general')
case 'new': case 'new':
?> ?>
<tr id="general_template" style="" class="datos"> <tr id="general_template" style="" class="datos">
<td colspan="3"><?php echo __('Please save the report to start adding items into the list.');?></td> <td colspan="3">
<?php
echo __('Please save the report to start adding items into the list.');
?>
</td>
</tr> </tr>
<?php <?php
break; break;
@ -1434,13 +1513,15 @@ function print_General_list($width, $action, $idItem = null, $type = 'general')
foreach ($itemsGeneral as $item) { foreach ($itemsGeneral as $item) {
$server_name = $item ['server_name']; $server_name = $item ['server_name'];
// Metaconsole db connection // Metaconsole db connection
if ($meta && $server_name != '') { if ($meta && ($server_name != '')) {
$connection = metaconsole_get_connection($server_name); $connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
//ui_print_error_message ("Error connecting to ".$server_name); //ui_print_error_message ("Error connecting to ".$server_name);
continue; continue;
} }
} }
$idAgent = db_get_value_filter( $idAgent = db_get_value_filter(
'id_agente', 'tagente_modulo', 'id_agente', 'tagente_modulo',
array('id_agente_modulo' => $item['id_agent_module'])); array('id_agente_modulo' => $item['id_agent_module']));
@ -1483,6 +1564,7 @@ function print_General_list($width, $action, $idItem = null, $type = 'general')
} }
echo '</tbody>'; echo '</tbody>';
?> ?>
<tbody id="general_template"> <tbody id="general_template">
<tr id="row" style="display: none;" class="datos"> <tr id="row" style="display: none;" class="datos">
<td class="agent_name"></td> <td class="agent_name"></td>
@ -1497,6 +1579,7 @@ function print_General_list($width, $action, $idItem = null, $type = 'general')
<td style="text-align: center;"><a class="delete_button" href="javascript: deleteGeneralRow(0);"><?php html_print_image("images/cross.png", false); ?></a></td> <td style="text-align: center;"><a class="delete_button" href="javascript: deleteGeneralRow(0);"><?php html_print_image("images/cross.png", false); ?></a></td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
<tr id="general_form" style="" class="datos"> <tr id="general_form" style="" class="datos">
<td> <td>
@ -1542,6 +1625,7 @@ function print_General_list($width, $action, $idItem = null, $type = 'general')
<td style="text-align: center;"><a href="javascript: addGeneralRow();"><?php html_print_image("images/disk.png", false); ?></a></td> <td style="text-align: center;"><a href="javascript: addGeneralRow();"><?php html_print_image("images/disk.png", false); ?></a></td>
</tr> </tr>
</tbody> </tbody>
<?php <?php
break; break;
default: default:
@ -1720,11 +1804,11 @@ function chooseSQLquery() {
if (idCustom == 0) { if (idCustom == 0) {
$("#sql_example").css('display', 'none'); $("#sql_example").css('display', 'none');
$("#sql_entry").css('display', ''); $("#sql_entry").show();
$("#sql_example").html(''); $("#sql_example").html('');
} }
else { else {
$("#sql_example").css('display', ''); $("#sql_example").show();
$("#sql_entry").css('display', 'none'); $("#sql_entry").css('display', 'none');
var params1 = []; var params1 = [];
@ -2039,6 +2123,7 @@ function chooseType() {
$("#row_order_uptodown").hide(); $("#row_order_uptodown").hide();
$("#row_show_resume").hide(); $("#row_show_resume").hide();
$("#row_show_address_agent").hide(); $("#row_show_address_agent").hide();
$("#row_show_graph").hide(); $("#row_show_graph").hide();
$("#row_max_min_avg").hide(); $("#row_max_min_avg").hide();
$("#row_only_avg").hide(); $("#row_only_avg").hide();
@ -2098,6 +2183,7 @@ function chooseType() {
$("#row_filter_search").show(); $("#row_filter_search").show();
break; break;
case 'simple_graph': case 'simple_graph':
$("#row_time_compare_overlapped").show(); $("#row_time_compare_overlapped").show();
$("#row_only_avg").show(); $("#row_only_avg").show();
@ -2112,6 +2198,7 @@ function chooseType() {
$("#row_show_in_landscape").show(); $("#row_show_in_landscape").show();
$("#row_time_compare_overlapped").show(); $("#row_time_compare_overlapped").show();
break; break;
case 'projection_graph': case 'projection_graph':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2121,6 +2208,7 @@ function chooseType() {
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_show_in_landscape").show(); $("#row_show_in_landscape").show();
break; break;
case 'prediction_date': case 'prediction_date':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2129,6 +2217,7 @@ function chooseType() {
$("#row_interval").show(); $("#row_interval").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'custom_graph': case 'custom_graph':
case 'automatic_custom_graph': case 'automatic_custom_graph':
$("#row_description").show(); $("#row_description").show();
@ -2137,6 +2226,7 @@ function chooseType() {
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_show_in_landscape").show(); $("#row_show_in_landscape").show();
break; break;
case 'SLA': case 'SLA':
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
@ -2147,6 +2237,7 @@ function chooseType() {
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_sort").show(); $("#row_sort").show();
break; break;
case 'SLA_monthly': case 'SLA_monthly':
$("#row_description").show(); $("#row_description").show();
$("#sla_list").show(); $("#sla_list").show();
@ -2154,6 +2245,7 @@ function chooseType() {
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_sort").show(); $("#row_sort").show();
break; break;
case 'SLA_services': case 'SLA_services':
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
@ -2169,6 +2261,7 @@ function chooseType() {
$(".sla_list_sla_limit_col").hide(); $(".sla_list_sla_limit_col").hide();
$("#sla_list").show(); $("#sla_list").show();
break; break;
case 'monitor_report': case 'monitor_report':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2176,6 +2269,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'avg_value': case 'avg_value':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2183,6 +2277,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'max_value': case 'max_value':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2190,6 +2285,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'min_value': case 'min_value':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2197,6 +2293,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'sumatory': case 'sumatory':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2204,17 +2301,20 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'agent_detailed': case 'agent_detailed':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'text': case 'text':
$("#row_description").show(); $("#row_description").show();
$("#row_text").show(); $("#row_text").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'sql': case 'sql':
$("#row_description").show(); $("#row_description").show();
$("#row_query").show(); $("#row_query").show();
@ -2224,6 +2324,7 @@ function chooseType() {
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'sql_graph_pie': case 'sql_graph_pie':
$("#row_description").show(); $("#row_description").show();
$("#row_query").show(); $("#row_query").show();
@ -2231,6 +2332,7 @@ function chooseType() {
$("#row_show_in_landscape").show(); $("#row_show_in_landscape").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'sql_graph_hbar': case 'sql_graph_hbar':
$("#row_description").show(); $("#row_description").show();
$("#row_query").show(); $("#row_query").show();
@ -2238,6 +2340,7 @@ function chooseType() {
$("#row_show_in_landscape").show(); $("#row_show_in_landscape").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'sql_graph_vbar': case 'sql_graph_vbar':
$("#row_description").show(); $("#row_description").show();
$("#row_query").show(); $("#row_query").show();
@ -2245,10 +2348,12 @@ function chooseType() {
$("#row_show_in_landscape").show(); $("#row_show_in_landscape").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'url': case 'url':
$("#row_description").show(); $("#row_description").show();
$("#row_url").show(); $("#row_url").show();
break; break;
case 'database_serialized': case 'database_serialized':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2259,6 +2364,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'TTRT': case 'TTRT':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2266,6 +2372,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'TTO': case 'TTO':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2273,6 +2380,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'MTBF': case 'MTBF':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2280,6 +2388,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'MTTR': case 'MTTR':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2287,6 +2396,7 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'alert_report_module': case 'alert_report_module':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2294,18 +2404,21 @@ function chooseType() {
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'alert_report_group': case 'alert_report_group':
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_group").show(); $("#row_group").show();
break; break;
case 'alert_report_agent': case 'alert_report_agent':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'event_report_agent': case 'event_report_agent':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2321,6 +2434,7 @@ function chooseType() {
$('#agent_autocomplete').hide(); $('#agent_autocomplete').hide();
$('#agent_autocomplete_events').show(); $('#agent_autocomplete_events').show();
break; break;
case 'event_report_module': case 'event_report_module':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();
@ -2336,6 +2450,7 @@ function chooseType() {
$('#agent_autocomplete').hide(); $('#agent_autocomplete').hide();
$('#agent_autocomplete_events').show(); $('#agent_autocomplete_events').show();
break; break;
case 'general': case 'general':
$("#row_description").show(); $("#row_description").show();
$("#row_group_by_agent").show(); $("#row_group_by_agent").show();
@ -2351,6 +2466,7 @@ function chooseType() {
$("input[name='last_value']").prop("checked", true); $("input[name='last_value']").prop("checked", true);
} }
break; break;
case 'availability': case 'availability':
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
@ -2360,16 +2476,19 @@ function chooseType() {
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_show_resume").show(); $("#row_show_resume").show();
break; break;
case 'group_report': case 'group_report':
$("#row_group").show(); $("#row_group").show();
$("#row_servers").show(); $("#row_servers").show();
$("#row_description").show(); $("#row_description").show();
break; break;
case 'network_interfaces_report': case 'network_interfaces_report':
$("#row_group").show(); $("#row_group").show();
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
break; break;
case 'top_n': case 'top_n':
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
@ -2381,6 +2500,7 @@ function chooseType() {
$("#row_show_graph").show(); $("#row_show_graph").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
break; break;
case 'exception': case 'exception':
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
@ -2398,11 +2518,13 @@ function chooseType() {
$("input[name='last_value']").prop("checked", true); $("input[name='last_value']").prop("checked", true);
} }
break; break;
case 'agent_module': case 'agent_module':
$("#row_description").show(); $("#row_description").show();
$("#row_group").show(); $("#row_group").show();
$("#row_module_group").show(); $("#row_module_group").show();
break; break;
case 'inventory_changes': case 'inventory_changes':
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
@ -2417,8 +2539,8 @@ function chooseType() {
$("#combo_group").change(function() { $("#combo_group").change(function() {
updateAgents($(this).val()); updateAgents($(this).val());
}); });
break; break;
case 'inventory': case 'inventory':
$("#row_description").show(); $("#row_description").show();
$("#row_group").show(); $("#row_group").show();
@ -2427,10 +2549,21 @@ function chooseType() {
$("#row_date").show(); $("#row_date").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#id_agents").change(agent_changed_by_multiple_agents_inventory);
$("#id_agents")
.change(agent_changed_by_multiple_agents_inventory);
$("#id_agents").trigger('change'); $("#id_agents").trigger('change');
$("#row_servers").show();
<?php
if ($meta) {
?>
$("#row_servers").show();
<?php
}
?>
$("#combo_group").change(function() { $("#combo_group").change(function() {
$('#hidden-date_selected').val(''); $('#hidden-date_selected').val('');
@ -2449,14 +2582,18 @@ function chooseType() {
if (!$("#hidden-date_selected").val()) if (!$("#hidden-date_selected").val())
updateInventoryDates(); updateInventoryDates();
break; break;
case 'inventory_changes': case 'inventory_changes':
break; break;
case 'agent_configuration': case 'agent_configuration':
$("#row_agent").show(); $("#row_agent").show();
break; break;
case 'group_configuration': case 'group_configuration':
$("#row_group").show(); $("#row_group").show();
break; break;
case 'netflow_area': case 'netflow_area':
$("#row_netflow_filter").show(); $("#row_netflow_filter").show();
$("#row_description").show(); $("#row_description").show();
@ -2465,6 +2602,7 @@ function chooseType() {
$("#row_resolution").show(); $("#row_resolution").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'netflow_pie': case 'netflow_pie':
$("#row_netflow_filter").show(); $("#row_netflow_filter").show();
$("#row_description").show(); $("#row_description").show();
@ -2473,6 +2611,7 @@ function chooseType() {
$("#row_resolution").show(); $("#row_resolution").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'netflow_data': case 'netflow_data':
$("#row_netflow_filter").show(); $("#row_netflow_filter").show();
$("#row_description").show(); $("#row_description").show();
@ -2481,6 +2620,7 @@ function chooseType() {
$("#row_resolution").show(); $("#row_resolution").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'netflow_summary': case 'netflow_summary':
$("#row_netflow_filter").show(); $("#row_netflow_filter").show();
$("#row_description").show(); $("#row_description").show();
@ -2488,6 +2628,7 @@ function chooseType() {
$("#row_resolution").show(); $("#row_resolution").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'netflow_statistics': case 'netflow_statistics':
$("#row_netflow_filter").show(); $("#row_netflow_filter").show();
$("#row_description").show(); $("#row_description").show();
@ -2496,6 +2637,9 @@ function chooseType() {
$("#row_resolution").show(); $("#row_resolution").show();
$("#row_servers").show(); $("#row_servers").show();
break; break;
case 'automatic_graph':
break;
} }
} }
@ -2513,4 +2657,4 @@ function set_last_value_period() {
$("#row_period").show(); $("#row_period").show();
} }
} }
</script> </script>