Working in the enterprise feature dynamic reports.
This commit is contained in:
parent
447c4ccd6d
commit
afecb459c5
|
@ -95,35 +95,42 @@ function reporting_get_name($id_report) {
|
|||
return db_get_value('name', 'treport', 'id_report', $id_report);
|
||||
}
|
||||
|
||||
function reporting_make_reporting_data($id_report, $date, $time,
|
||||
$period = null, $type = 'dinamic', $force_width_chart = null,
|
||||
$force_height_chart = null) {
|
||||
function reporting_make_reporting_data($report = null, $id_report,
|
||||
$date, $time, $period = null, $type = 'dinamic',
|
||||
$force_width_chart = null, $force_height_chart = null) {
|
||||
|
||||
global $config;
|
||||
|
||||
$return = array();
|
||||
|
||||
$report = db_get_row ('treport', 'id_report', $id_report);
|
||||
if (!empty($report)) {
|
||||
$contents = $report['contents'];
|
||||
}
|
||||
else {
|
||||
$report = db_get_row ('treport', 'id_report', $id_report);
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$contents = db_get_all_rows_field_filter ("treport_content",
|
||||
"id_report", $id_report, "`order`");
|
||||
break;
|
||||
case "postgresql":
|
||||
$contents = db_get_all_rows_field_filter ("treport_content",
|
||||
"id_report", $id_report, '"order"');
|
||||
break;
|
||||
case "oracle":
|
||||
$contents = db_get_all_rows_field_filter ("treport_content",
|
||||
"id_report", $id_report, '"order"');
|
||||
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();
|
||||
$datetime = strtotime($date . ' ' . $time);
|
||||
$report["datetime"] = $datetime;
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$contents = db_get_all_rows_field_filter ("treport_content",
|
||||
"id_report", $id_report, "`order`");
|
||||
break;
|
||||
case "postgresql":
|
||||
$contents = db_get_all_rows_field_filter ("treport_content",
|
||||
"id_report", $id_report, '"order"');
|
||||
break;
|
||||
case "oracle":
|
||||
$contents = db_get_all_rows_field_filter ("treport_content",
|
||||
"id_report", $id_report, '"order"');
|
||||
break;
|
||||
}
|
||||
if ($contents === false) {
|
||||
return reporting_check_structure_report($report);
|
||||
}
|
||||
|
|
|
@ -176,7 +176,8 @@ $table->size[0] = '60px';
|
|||
$table->colspan[0][1] = 2;
|
||||
$table->style[0] = 'text-align:center;';
|
||||
$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 ($report['description'] != '') {
|
||||
$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);
|
||||
$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) {
|
||||
$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);
|
||||
|
||||
echo "<br>";
|
||||
|
|
|
@ -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');
|
||||
|
||||
//------- Removed the unused fields ------------------------------------
|
||||
|
|
Loading…
Reference in New Issue