Working in the enterprise feature dynamic reports.

This commit is contained in:
mdtrooper 2015-06-22 16:22:48 +02:00
parent 447c4ccd6d
commit afecb459c5
3 changed files with 35 additions and 24 deletions
pandora_console

View File

@ -95,20 +95,19 @@ function reporting_get_name($id_report) {
return db_get_value('name', 'treport', 'id_report', $id_report); return db_get_value('name', 'treport', 'id_report', $id_report);
} }
function reporting_make_reporting_data($id_report, $date, $time, function reporting_make_reporting_data($report = null, $id_report,
$period = null, $type = 'dinamic', $force_width_chart = null, $date, $time, $period = null, $type = 'dinamic',
$force_height_chart = null) { $force_width_chart = null, $force_height_chart = null) {
global $config; global $config;
$return = array(); $return = array();
if (!empty($report)) {
$contents = $report['contents'];
}
else {
$report = db_get_row ('treport', 'id_report', $id_report); $report = db_get_row ('treport', 'id_report', $id_report);
$report["group"] = $report['id_group'];
$report["group_name"] = groups_get_name ($report['id_group']);
$report['contents'] = array();
$datetime = strtotime($date . ' ' . $time);
$report["datetime"] = $datetime;
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
@ -124,6 +123,14 @@ function reporting_make_reporting_data($id_report, $date, $time,
"id_report", $id_report, '"order"'); "id_report", $id_report, '"order"');
break; break;
} }
}
$datetime = strtotime($date . ' ' . $time);
$report["datetime"] = $datetime;
$report["group"] = $report['id_group'];
$report["group_name"] = groups_get_name ($report['id_group']);
$report['contents'] = array();
if ($contents === false) { if ($contents === false) {
return reporting_check_structure_report($report); return reporting_check_structure_report($report);
} }

View File

@ -176,7 +176,8 @@ $table->size[0] = '60px';
$table->colspan[0][1] = 2; $table->colspan[0][1] = 2;
$table->style[0] = 'text-align:center;'; $table->style[0] = 'text-align:center;';
$table->data = array (); $table->data = array ();
$table->data[0][0] = html_print_image("images/reporting32.png", true, array("width" => "32", "height" => "32")); $table->data[0][0] = html_print_image("images/reporting32.png", true,
array("width" => "32", "height" => "32"));
if (defined("METACONSOLE")) { if (defined("METACONSOLE")) {
if ($report['description'] != '') { if ($report['description'] != '') {
$table->data[0][1] = '<div style="">' . __("Description: ") . $report['description'] . '</div>'; $table->data[0][1] = '<div style="">' . __("Description: ") . $report['description'] . '</div>';
@ -215,7 +216,8 @@ else {
} }
$table->data[0][1] .= '<div style="text-align:right; width:100%; margin-right:50px">'.__('Set initial date') . html_print_checkbox('enable_init_date', 1, $enable_init_date, true); $table->data[0][1] .= '<div style="text-align:right; width:100%; margin-right:50px">'.__('Set initial date') . html_print_checkbox('enable_init_date', 1, $enable_init_date, true);
$html_enterprise = enterprise_hook('reporting_print_button_PDF', array($id_report)); $html_enterprise = enterprise_hook('reporting_print_button_PDF',
array($id_report));
if ($html_enterprise !== ENTERPRISE_NOT_HOOK) { if ($html_enterprise !== ENTERPRISE_NOT_HOOK) {
$table->data[0][1] .= $html_enterprise; $table->data[0][1] .= $html_enterprise;
} }
@ -245,7 +247,9 @@ if ($enable_init_date) {
} }
} }
$report = reporting_make_reporting_data($id_report, $date, $time, $period, 'dinamic'); $report = reporting_make_reporting_data(null, $id_report, $date, $time,
$period, 'dinamic');
html_debug_print($report);
reporting_html_print_report($report); reporting_html_print_report($report);
echo "<br>"; echo "<br>";

View File

@ -120,7 +120,7 @@ switch ($date_mode) {
} }
$report = reporting_make_reporting_data($id_report, $date, $time, $report = reporting_make_reporting_data(null, $id_report, $date, $time,
$period, 'static'); $period, 'static');
//------- Removed the unused fields ------------------------------------ //------- Removed the unused fields ------------------------------------