Fixed errors on sum report uncompressed checkbox

This commit is contained in:
Luis Calvo 2019-07-15 11:56:57 +02:00
parent a1e2693d4b
commit ef9502a552
5 changed files with 10 additions and 6 deletions

View File

@ -153,6 +153,7 @@ $checks_in_ok_status = true;
$unknown_checks = true;
$agent_max_value = true;
$agent_min_value = true;
$uncompressed_module = true;
switch ($action) {
case 'new':
@ -811,7 +812,6 @@ switch ($action) {
break;
}
$urlForm = $config['homeurl'].'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action='.$actionParameter.'&id_report='.$idReport;
echo '<form action="'.$urlForm.'" method="post">';
@ -2782,7 +2782,7 @@ $class = 'databox filters';
</td>
<td style="">
<?php
html_print_checkbox('uncompressed_module', 1, false, false, false, '', false);
html_print_checkbox('uncompressed_module', 1, $item['uncompressed_module'], false, false, '', false);
?>
</td>
</tr>

View File

@ -520,6 +520,7 @@ function db_get_sql($sql, $field=0, $search_history_db=false)
* Get all the result rows using an SQL statement.
*
* @param string SQL statement to execute.
global $config;
* @param bool If want to search in history database also
* @param bool If want to use cache (true by default)
*

View File

@ -4879,7 +4879,8 @@ function reporting_value($report, $content, $type, $pdf=false)
$value = reporting_get_agentmodule_data_sum(
$content['id_agent_module'],
$content['period'],
$report['datetime']
$report['datetime'],
$content['uncompressed_module']
);
if (!$config['simple_module_value']) {
$formated_value = $value;
@ -10648,6 +10649,7 @@ function reporting_get_agentmodule_data_min($id_agent_module, $period=0, $date=0
* @param int Agent module id to get the sumatory.
* @param int Period of time to check (in seconds)
* @param int Top date to check the values. Default current time.
* @param boolean Show uncompressed data from module
*
* @return float The sumatory of the module values in the interval.
*/
@ -10694,7 +10696,7 @@ function reporting_get_agentmodule_data_sum(
// Incremental modules are treated differently
$module_inc = is_module_inc($module_name);
if ($uncompressed_module) {
if (!$uncompressed_module) {
// Get module data
$interval_data = db_get_all_rows_sql(
'
@ -10739,7 +10741,7 @@ function reporting_get_agentmodule_data_sum(
break;
}
if ($uncompressed_module) {
if (!$uncompressed_module) {
$total += $data['datos'];
} else if (!$module_inc) {
foreach ($data['data'] as $val) {

View File

@ -17,7 +17,7 @@ global $config;
check_login();
enterprise_hook('open_meta_frame');
hd($_POST);
$id_report = (int) get_parameter('id');
if (! $id_report) {

View File

@ -1455,6 +1455,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`current_month` TINYINT(1) DEFAULT '1',
`failover_mode` tinyint(1) DEFAULT '1',
`failover_type` tinyint(1) DEFAULT '1',
`uncompressed_module` TINYINT DEFAULT '1',
PRIMARY KEY(`id_rc`),
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
ON UPDATE CASCADE ON DELETE CASCADE