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,
@ -271,38 +279,17 @@ function grafico_modulo_sparse_data_chart (
);
}
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',
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 ('sum(datos)/count(datos) as datos', 'min(utimestamp) as utimestamp'),
'AND',
$data_module_graph['history_db']
);
}
$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 ('sum(datos)/count(datos) as datos', 'min(utimestamp) as utimestamp'),
'AND',
$data_module_graph['history_db']
);
}
}

View File

@ -296,18 +296,20 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = __('Zoom');
$options = array ();
$options[$zoom] = 'x' . $zoom;
$options[1] = 'x1';
$options[2] = 'x2';
$options[3] = 'x3';
$options[4] = 'x4';
$options[5] = __('full');
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true, false, false);
$table->data[] = $data;
$table->rowclass[] = '';
if(!modules_is_boolean($id)){
$data = array();
$data[0] = __('Zoom');
$options = array ();
$options[$zoom] = 'x' . $zoom;
$options[1] = 'x1';
$options[2] = 'x2';
$options[3] = 'x3';
$options[4] = 'x4';
$options[5] = __('full');
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true, false, false);
$table->data[] = $data;
$table->rowclass[] = '';
}
$data = array();
$data[0] = __('Time range');