Merge branch '2423-Se_toman_como_data_las_graficas_boleanas-2' into 'develop'

2423 se toman como data las graficas boleanas 2

See merge request artica/pandorafms!1576
This commit is contained in:
nramon 2018-06-27 16:26:00 +02:00
commit dd3c498af1
2 changed files with 35 additions and 46 deletions

View File

@ -257,8 +257,16 @@ function grafico_modulo_sparse_data_chart (
);
}
else{
//all points(data)
if($params['zoom'] == 5){
//all points(data) and boolean
if( $params['zoom'] == 5 ||
$data_module_graph['id_module_type'] == 2 ||
$data_module_graph['id_module_type'] == 6 ||
$data_module_graph['id_module_type'] == 21 ||
$data_module_graph['id_module_type'] == 18 ||
$data_module_graph['id_module_type'] == 9 ||
$data_module_graph['id_module_type'] == 31 ||
$data_module_graph['id_module_type'] == 100 ){
$data = db_get_all_rows_filter (
'tagente_datos',
array ('id_agente_modulo' => (int)$agent_module_id,
@ -270,26 +278,6 @@ function grafico_modulo_sparse_data_chart (
$data_module_graph['history_db']
);
}
else{
if($data_module_graph['id_module_type'] == 2 ||
$data_module_graph['id_module_type'] == 6 ||
$data_module_graph['id_module_type'] == 21 ||
$data_module_graph['id_module_type'] == 18 ||
$data_module_graph['id_module_type'] == 9 ||
$data_module_graph['id_module_type'] == 31 ||
$data_module_graph['id_module_type'] == 100){
$data = db_get_all_rows_filter (
'tagente_datos',
array ('id_agente_modulo' => (int)$agent_module_id,
"utimestamp > '". $date_array['start_date']. "'",
"utimestamp < '". $date_array['final_date'] . "'",
'group' => "ROUND(utimestamp / $data_slice)",
'order' => 'utimestamp ASC'),
array ('ROUND(sum(datos)/count(datos)) as datos', 'min(utimestamp) as utimestamp'),
'AND',
$data_module_graph['history_db']
);
}
else{
$data = db_get_all_rows_filter (
'tagente_datos',
@ -304,7 +292,6 @@ function grafico_modulo_sparse_data_chart (
);
}
}
}
if($data === false){
$data = array();

View File

@ -296,6 +296,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$table->data[] = $data;
$table->rowclass[] = '';
if(!modules_is_boolean($id)){
$data = array();
$data[0] = __('Zoom');
$options = array ();
@ -308,6 +309,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true, false, false);
$table->data[] = $data;
$table->rowclass[] = '';
}
$data = array();
$data[0] = __('Time range');