2011-11-08 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php include/functions_forecast.php include/functions_reporting.php godmode/reporting/reporting_builder.preview.php: Fixed some warnings in this views. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5122 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
488135bba3
commit
b7acc90d78
|
@ -1,3 +1,11 @@
|
||||||
|
2011-11-08 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* include/functions_graph.php
|
||||||
|
include/functions_forecast.php
|
||||||
|
include/functions_reporting.php
|
||||||
|
godmode/reporting/reporting_builder.preview.php: Fixed some
|
||||||
|
warnings in this views.
|
||||||
|
|
||||||
2011-11-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
2011-11-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
* operation/gis_maps/render_view.php: Fixed fullscreen mode.
|
* operation/gis_maps/render_view.php: Fixed fullscreen mode.
|
||||||
|
|
|
@ -43,16 +43,15 @@ if ($report['private'] && ($report['id_user'] != $config['id_user'] && ! is_user
|
||||||
$date = (string) get_parameter ('date', date ('Y-m-j'));
|
$date = (string) get_parameter ('date', date ('Y-m-j'));
|
||||||
$time = (string) get_parameter ('time', date ('h:iA'));
|
$time = (string) get_parameter ('time', date ('h:iA'));
|
||||||
|
|
||||||
|
$datetime = strtotime ($date.' '.$time);
|
||||||
|
$report["datetime"] = $datetime;
|
||||||
|
|
||||||
// Calculations in order to modify init date of the report
|
// Calculations in order to modify init date of the report
|
||||||
$date_init_less = strtotime(date ('Y-m-j')) - 86400;
|
$date_init_less = strtotime(date ('Y-m-j')) - 86400;
|
||||||
$date_init = get_parameter('date_init', date ('Y-m-j', $date_init_less));
|
$date_init = get_parameter('date_init', date ('Y-m-j', $date_init_less));
|
||||||
$time_init = get_parameter('time_init', date ('h:iA'));
|
$time_init = get_parameter('time_init', date ('h:iA'));
|
||||||
$datetime_init = strtotime ($date_init.' '.$time_init);
|
$datetime_init = strtotime ($date_init.' '.$time_init);
|
||||||
$enable_init_date = get_parameter('enable_init_date', 0);
|
$enable_init_date = get_parameter('enable_init_date', 0);
|
||||||
$new_interval = $report['datetime'] - $datetime_init;
|
|
||||||
if ($new_interval != $content['period']) {
|
|
||||||
$content['period'] = $new_interval;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Standard header
|
// Standard header
|
||||||
|
|
||||||
|
@ -154,8 +153,6 @@ $(document).ready (function () {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$datetime = strtotime ($date.' '.$time);
|
|
||||||
$report["datetime"] = $datetime;
|
|
||||||
|
|
||||||
if ($datetime === false || $datetime == -1) {
|
if ($datetime === false || $datetime == -1) {
|
||||||
echo '<h3 class="error">'.__('Invalid date selected').'</h3>';
|
echo '<h3 class="error">'.__('Invalid date selected').'</h3>';
|
||||||
|
|
|
@ -42,6 +42,10 @@ function forecast_projection_graph($module_id, $period = 5184000, $prediction_pe
|
||||||
if (empty($module_data)){
|
if (empty($module_data)){
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
// Prevents bad behaviour over image error
|
||||||
|
else if (!is_array($module_data) and preg_match('/^<img(.)*$/', $module_data)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Data initialization
|
// Data initialization
|
||||||
$sum_obs = 0;
|
$sum_obs = 0;
|
||||||
|
@ -56,6 +60,7 @@ function forecast_projection_graph($module_id, $period = 5184000, $prediction_pe
|
||||||
$cont = 1;
|
$cont = 1;
|
||||||
$data = array();
|
$data = array();
|
||||||
$table->data = array();
|
$table->data = array();
|
||||||
|
|
||||||
// Creates data for calculation
|
// Creates data for calculation
|
||||||
foreach ($module_data as $utimestamp => $row) {
|
foreach ($module_data as $utimestamp => $row) {
|
||||||
if ($utimestamp == '') { continue; }
|
if ($utimestamp == '') { continue; }
|
||||||
|
|
|
@ -109,8 +109,13 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
||||||
// Check available data
|
// Check available data
|
||||||
if (count ($data) < $min_necessary) {
|
if (count ($data) < $min_necessary) {
|
||||||
if (!$graphic_type) {
|
if (!$graphic_type) {
|
||||||
|
if (!$projection){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else{
|
||||||
return fs_error_image ();
|
return fs_error_image ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
graphic_error ();
|
graphic_error ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2117,6 +2117,11 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
||||||
|
|
||||||
$output_projection = forecast_projection_graph($content['id_agent_module'], $content['period'], $content['top_n_value']);
|
$output_projection = forecast_projection_graph($content['id_agent_module'], $content['period'], $content['top_n_value']);
|
||||||
|
|
||||||
|
// If projection doesn't have data then don't draw graph
|
||||||
|
if ($output_projection == NULL){
|
||||||
|
$output_projection = false;
|
||||||
|
}
|
||||||
|
|
||||||
$modules = array($content['id_agent_module']);
|
$modules = array($content['id_agent_module']);
|
||||||
$weights = array();
|
$weights = array();
|
||||||
$data[0] = graphic_combined_module(
|
$data[0] = graphic_combined_module(
|
||||||
|
@ -2129,7 +2134,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
$graph["stacked"],
|
0,
|
||||||
$report["datetime"],
|
$report["datetime"],
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
|
|
Loading…
Reference in New Issue