mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 03:19:05 +02:00
Working in the refactoring the code of reports (text).
This commit is contained in:
parent
803c03956d
commit
bc791ad3be
@ -168,12 +168,37 @@ function reporting_make_reporting_data($id_report, $date, $time,
|
|||||||
$force_width_chart,
|
$force_width_chart,
|
||||||
$force_height_chart);
|
$force_height_chart);
|
||||||
break;
|
break;
|
||||||
|
case 'text':
|
||||||
|
$report['contents'][] = reporting_text(
|
||||||
|
$report,
|
||||||
|
$content);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return reporting_check_structure_report($report);
|
return reporting_check_structure_report($report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function reporting_text($report, $content) {
|
||||||
|
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$return = array();
|
||||||
|
$return['type'] = 'text';
|
||||||
|
|
||||||
|
if (empty($content['name'])) {
|
||||||
|
$content['name'] = __('Text');
|
||||||
|
}
|
||||||
|
|
||||||
|
$return['title'] = $content['name'];
|
||||||
|
$return["description"] = $content["description"];
|
||||||
|
$return["date"] = reporting_get_date_text();
|
||||||
|
|
||||||
|
$return["data"] = html_entity_decode($content['text']);
|
||||||
|
|
||||||
|
return reporting_check_structure_content($return);
|
||||||
|
}
|
||||||
|
|
||||||
function reporting_sql($report, $content) {
|
function reporting_sql($report, $content) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
@ -137,6 +137,9 @@ function reporting_html_print_report($report, $mini = false) {
|
|||||||
case 'custom_graph':
|
case 'custom_graph':
|
||||||
reporting_html_custom_graph($table, $item);
|
reporting_html_custom_graph($table, $item);
|
||||||
break;
|
break;
|
||||||
|
case 'text':
|
||||||
|
reporting_html_text($table, $item);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['type'] == 'agent_module')
|
if ($item['type'] == 'agent_module')
|
||||||
@ -149,6 +152,12 @@ function reporting_html_print_report($report, $mini = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function reporting_html_text(&$table, $item) {
|
||||||
|
$table->colspan['data']['cell'] = 3;
|
||||||
|
$table->cellstyle['data']['cell'] = 'text-align: left;';
|
||||||
|
$table->data['data']['cell'] = $item['data'];
|
||||||
|
}
|
||||||
|
|
||||||
function reporting_html_general(&$table, $item) {
|
function reporting_html_general(&$table, $item) {
|
||||||
|
|
||||||
if (!empty($item["data"])) {
|
if (!empty($item["data"])) {
|
||||||
@ -4057,26 +4066,6 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'text':
|
|
||||||
if (empty($item_title)) {
|
|
||||||
$item_title = __('Text');
|
|
||||||
}
|
|
||||||
reporting_header_content($mini, $content, $report, $table, $item_title,
|
|
||||||
"", "");
|
|
||||||
|
|
||||||
$next_row = 1;
|
|
||||||
|
|
||||||
if ($content["description"] != ""){
|
|
||||||
$data_desc = array();
|
|
||||||
$data_desc[0] = $content["description"];
|
|
||||||
array_push ($table->data, $data_desc);
|
|
||||||
$table->colspan[$next_row][0] = 3;
|
|
||||||
$next_row++;
|
|
||||||
}
|
|
||||||
$data[0] = html_entity_decode($content['text']);
|
|
||||||
array_push($table->data, $data);
|
|
||||||
$table->colspan[$next_row][0] = 3;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'sql_graph_vbar':
|
case 'sql_graph_vbar':
|
||||||
case 'sql_graph_hbar':
|
case 'sql_graph_hbar':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user