mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge branch 'ent-11965-security-hardening-console-vistas-estaticas' into ent-12050-security-hardening-console-widget-dashboard
This commit is contained in:
commit
1e9e74ce92
@ -1070,6 +1070,7 @@ switch ($action) {
|
|||||||
case 'evolution':
|
case 'evolution':
|
||||||
$group = $item['id_group'];
|
$group = $item['id_group'];
|
||||||
$recursion = $item['recursion'];
|
$recursion = $item['recursion'];
|
||||||
|
$period = $item['period'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -5196,6 +5197,10 @@ echo "<div id='message_no_group' title='".__('Item Editor Information')."' clas
|
|||||||
echo "<p class='center bolder'>".__('Please select a group.').'</p>';
|
echo "<p class='center bolder'>".__('Please select a group.').'</p>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
|
echo "<div id='message_no_max_item' title='".__('Max items')."' class='invisible'>";
|
||||||
|
echo "<p class='center bolder'>".__('Please insert max item number.').'</p>';
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
ui_require_javascript_file(
|
ui_require_javascript_file(
|
||||||
'pandora_inventory',
|
'pandora_inventory',
|
||||||
ENTERPRISE_DIR.'/include/javascript/'
|
ENTERPRISE_DIR.'/include/javascript/'
|
||||||
@ -5529,7 +5534,7 @@ $(document).ready (function () {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'permissions_report':
|
case 'permissions_report':
|
||||||
if ($("#checkbox-select_by_group").prop("checked") && $("select#users_groups>option:selected").val() == undefined) {
|
if ($("#checkbox-select_by_group").prop("checked") && $("select#users_groups>option:selected").val() == undefined) {
|
||||||
dialog_message('#message_no_group');
|
dialog_message('#message_no_group');
|
||||||
return false;
|
return false;
|
||||||
@ -5539,6 +5544,30 @@ $(document).ready (function () {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'list_checks':
|
||||||
|
if ($("#text-text_agent").val() == '') {
|
||||||
|
dialog_message('#message_no_agent');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top_n_agents_sh':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top_n_checks_failed':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top_n_categories_checks':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -5609,13 +5638,14 @@ $(document).ready (function () {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#submit-edit_item").click(function () {
|
$("#button-edit_item").click(function () {
|
||||||
var type = $('#type').val();
|
var type = $('#type').val();
|
||||||
|
|
||||||
if($('#text-name').val() == ''){
|
if($('#text-name').val() == ''){
|
||||||
dialog_message('#message_no_name');
|
dialog_message('#message_no_name');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (type){
|
switch (type){
|
||||||
case 'agent_module':
|
case 'agent_module':
|
||||||
case 'agent_module_status':
|
case 'agent_module_status':
|
||||||
@ -5668,6 +5698,30 @@ $(document).ready (function () {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'list_checks':
|
||||||
|
if ($("#text-text_agent").val() == '') {
|
||||||
|
dialog_message('#message_no_agent');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top_n_agents_sh':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top_n_checks_failed':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top_n_categories_checks':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -7633,6 +7687,7 @@ function chooseType() {
|
|||||||
|
|
||||||
case 'evolution':
|
case 'evolution':
|
||||||
$("#row_group").show();
|
$("#row_group").show();
|
||||||
|
$('#row_period').show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2029,6 +2029,7 @@ switch ($action) {
|
|||||||
|
|
||||||
case 'evolution':
|
case 'evolution':
|
||||||
$values['id_group'] = get_parameter('combo_group');
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$values['period'] = get_parameter('period');
|
||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2061,6 +2062,7 @@ switch ($action) {
|
|||||||
|| ($values['type'] == 'event_report_agent')
|
|| ($values['type'] == 'event_report_agent')
|
||||||
|| ($values['type'] == 'agent_configuration')
|
|| ($values['type'] == 'agent_configuration')
|
||||||
|| ($values['type'] == 'group_configuration')
|
|| ($values['type'] == 'group_configuration')
|
||||||
|
|| ($values['type'] == 'list_checks')
|
||||||
) {
|
) {
|
||||||
$values['id_agent_module'] = '';
|
$values['id_agent_module'] = '';
|
||||||
} else {
|
} else {
|
||||||
@ -2947,6 +2949,7 @@ switch ($action) {
|
|||||||
|
|
||||||
case 'evolution':
|
case 'evolution':
|
||||||
$values['id_group'] = get_parameter('combo_group');
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$values['period'] = get_parameter('period');
|
||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -252,6 +252,18 @@ $hack_metaconsole = (is_metaconsole() === true) ? '../../' : '';
|
|||||||
echo $chart->render(true);
|
echo $chart->render(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'line_graph':
|
||||||
|
$params['pdf'] = true;
|
||||||
|
$params['options']['width'] = '100%';
|
||||||
|
$params['options']['height'] = 200;
|
||||||
|
$chart = get_build_setup_charts(
|
||||||
|
'LINE',
|
||||||
|
$params['options'],
|
||||||
|
$params['chart_data']
|
||||||
|
);
|
||||||
|
echo $chart->render(true);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'slicebar':
|
case 'slicebar':
|
||||||
// TO-DO Cambiar esto para que se pase por POST, NO SE PUEDE PASAR POR GET.
|
// TO-DO Cambiar esto para que se pase por POST, NO SE PUEDE PASAR POR GET.
|
||||||
$params['graph_data'] = json_decode(io_safe_output($config[$params['tokem_config']]), true);
|
$params['graph_data'] = json_decode(io_safe_output($config[$params['tokem_config']]), true);
|
||||||
|
@ -964,7 +964,8 @@ function reporting_make_reporting_data(
|
|||||||
case 'vul_by_cat':
|
case 'vul_by_cat':
|
||||||
$report['contents'][] = reporting_vul_by_categories(
|
$report['contents'][] = reporting_vul_by_categories(
|
||||||
$report,
|
$report,
|
||||||
$content
|
$content,
|
||||||
|
$type
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -985,7 +986,8 @@ function reporting_make_reporting_data(
|
|||||||
case 'evolution':
|
case 'evolution':
|
||||||
$report['contents'][] = reporting_evolution_hardening(
|
$report['contents'][] = reporting_evolution_hardening(
|
||||||
$report,
|
$report,
|
||||||
$content
|
$content,
|
||||||
|
$type
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -538,22 +538,31 @@ function reporting_evolution_graph($table, $item)
|
|||||||
/**
|
/**
|
||||||
* Function to print the agents scoring.
|
* Function to print the agents scoring.
|
||||||
*
|
*
|
||||||
* @param object $table Head table or false if it comes from pdf.
|
* @param object $table Head table or false if it comes from pdf.
|
||||||
* @param array $item Items data.
|
* @param array $item Items data.
|
||||||
|
* @param boolean $pdf If it comes from pdf.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function reporting_html_scoring($table, $item)
|
function reporting_html_scoring($table, $item, $pdf=0)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
$table->width = '99%';
|
||||||
|
$table->styleTable = 'border: 0px;';
|
||||||
|
$table->colspan[2][0] = 3;
|
||||||
$table1 = new stdClass();
|
$table1 = new stdClass();
|
||||||
$table1->width = '100%';
|
$table1->headstyle[0] = 'text-align: left';
|
||||||
$table1->class = 'databox filters';
|
$table1->headstyle[1] = 'text-align: left';
|
||||||
$table1->styleTable = 'border: 0px;';
|
$table1->headstyle[2] = 'text-align: left';
|
||||||
$table1->data[0][0] = '<b>'.__('Date').'</b>';
|
$table1->width = '99%';
|
||||||
$table1->data[0][1] = '<b>'.__('Agent').'</b>';
|
$table1->class = 'info_table';
|
||||||
$table1->data[0][2] = '<b>'.__('Score').'</b>';
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->rowclass[0] = '';
|
||||||
|
$table1->head[0] = '<b>'.__('Date').'</b>';
|
||||||
|
$table1->head[1] = '<b>'.__('Agent').'</b>';
|
||||||
|
$table1->head[2] = '<b>'.__('Score').'</b>';
|
||||||
|
|
||||||
$row = 1;
|
$row = 1;
|
||||||
foreach ($item['data'] as $key => $check) {
|
foreach ($item['data'] as $key => $check) {
|
||||||
$table1->data[$row][1] = date($config['date_format'], $check['date']);
|
$table1->data[$row][1] = date($config['date_format'], $check['date']);
|
||||||
@ -562,88 +571,161 @@ function reporting_html_scoring($table, $item)
|
|||||||
$row++;
|
$row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->colspan[2][0] = 3;
|
if ($pdf === 1) {
|
||||||
|
$table1->title = $item['title'];
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->titlestyle = 'text-align:left;';
|
||||||
|
}
|
||||||
|
|
||||||
$table->data[2][0] = html_print_table($table1, true);
|
$table->data[2][0] = html_print_table($table1, true);
|
||||||
|
|
||||||
|
if ($pdf === 1) {
|
||||||
|
return html_print_table($table1, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to print HTML checks filtered by agent and category.
|
* Function to print HTML checks filtered by agent and category.
|
||||||
*
|
*
|
||||||
* @param object $table Head table or false if it comes from pdf.
|
* @param object $table Head table or false if it comes from pdf.
|
||||||
* @param array $item Items data.
|
* @param array $item Items data.
|
||||||
|
* @param boolean $pdf If it comes from pdf.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function reporting_html_list_checks($table, $item)
|
function reporting_html_list_checks($table, $item, $pdf=0)
|
||||||
{
|
{
|
||||||
$table->rowclass[0] = '';
|
$table->width = '99%';
|
||||||
$table->colspan[0][1] = 2;
|
$table->styleTable = 'border: 0px;';
|
||||||
$table->align[3] = 'center';
|
$table->colspan[2][0] = 4;
|
||||||
$table->data[1][0] = '<b>'.__('Id').'</b>';
|
$table1 = new stdClass();
|
||||||
$table->data[1][1] = '<b>'.__('Title').'</b>';
|
$table1->width = '99%';
|
||||||
$table->data[1][2] = '<b>'.__('Category').'</b>';
|
$table1->headstyle[0] = 'text-align: left';
|
||||||
$table->data[1][3] = '<b>'.__('Status').'</b>';
|
$table1->headstyle[1] = 'text-align: left';
|
||||||
|
$table1->headstyle[2] = 'text-align: left';
|
||||||
|
$table1->class = 'info_table';
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->rowclass[0] = '';
|
||||||
|
$table1->head[0] = '<b>'.__('Id').'</b>';
|
||||||
|
$table1->head[1] = '<b>'.__('Title').'</b>';
|
||||||
|
$table1->head[2] = '<b>'.__('Category').'</b>';
|
||||||
|
$table1->head[3] = '<b>'.__('Status').'</b>';
|
||||||
|
|
||||||
$row = 2;
|
$row = 2;
|
||||||
foreach ($item['data'] as $key => $check) {
|
foreach ($item['data'] as $key => $check) {
|
||||||
$table->data[$row][0] = $check['id'];
|
$table1->data[$row][0] = $check['id'];
|
||||||
$table->data[$row][1] = $check['title'];
|
$table1->data[$row][1] = $check['title'];
|
||||||
$table->data[$row][2] = $check['category'];
|
$table1->data[$row][2] = $check['category'];
|
||||||
$table->data[$row][3] = $check['status'];
|
$table1->data[$row][3] = $check['status'];
|
||||||
$row++;
|
$row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($pdf === 1) {
|
||||||
|
$table1->title = $item['title'];
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->titlestyle = 'text-align:left;';
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[2][0] = html_print_table($table1, true);
|
||||||
|
if ($pdf === 1) {
|
||||||
|
return html_print_table($table1, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to print HTML top checks failed by category
|
* Function to print HTML top checks failed by category
|
||||||
*
|
*
|
||||||
* @param object $table Head table or false if it comes from pdf.
|
* @param object $table Head table or false if it comes from pdf.
|
||||||
* @param array $item Items data.
|
* @param array $item Items data.
|
||||||
|
* @param boolean $pdf If it comes from pdf.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function reporting_html_top_n_categories_checks($table, $item)
|
function reporting_html_top_n_categories_checks($table, $item, $pdf=0)
|
||||||
{
|
{
|
||||||
$table->rowclass[0] = '';
|
$table->width = '99%';
|
||||||
$table->data[1][0] = '<b>'.__('Id').'</b>';
|
$table->styleTable = 'border: 0px;';
|
||||||
$table->data[1][1] = '<b>'.__('Category').'</b>';
|
$table->colspan[2][0] = 3;
|
||||||
$table->data[1][2] = '<b>'.__('Total Failed').'</b>';
|
$table1 = new stdClass();
|
||||||
|
$table1->width = '99%';
|
||||||
|
$table1->headstyle[0] = 'text-align: left';
|
||||||
|
$table1->headstyle[1] = 'text-align: left';
|
||||||
|
$table1->headstyle[2] = 'text-align: left';
|
||||||
|
$table1->class = 'info_table';
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->rowclass[0] = '';
|
||||||
|
$table1->head[0] = '<b>'.__('Id').'</b>';
|
||||||
|
$table1->head[1] = '<b>'.__('Category').'</b>';
|
||||||
|
$table1->head[2] = '<b>'.__('Total Failed').'</b>';
|
||||||
|
|
||||||
$row = 2;
|
$row = 2;
|
||||||
foreach ($item['data'] as $key => $check) {
|
foreach ($item['data'] as $key => $check) {
|
||||||
$table->data[$row][0] = $check['id'];
|
$table1->data[$row][0] = $check['id'];
|
||||||
$table->data[$row][1] = $check['category'];
|
$table1->data[$row][1] = $check['category'];
|
||||||
$table->data[$row][2] = $check['total'];
|
$table1->data[$row][2] = $check['total'];
|
||||||
$row++;
|
$row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($pdf === 1) {
|
||||||
|
$table1->title = $item['title'];
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->titlestyle = 'text-align:left;';
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[2][0] = html_print_table($table1, true);
|
||||||
|
if ($pdf === 1) {
|
||||||
|
return html_print_table($table1, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to print HTML top checks failed.
|
* Function to print HTML top checks failed.
|
||||||
*
|
*
|
||||||
* @param object $table Head table or false if it comes from pdf.
|
* @param object $table Head table or false if it comes from pdf.
|
||||||
* @param array $item Items data.
|
* @param array $item Items data.
|
||||||
|
* @param boolean $pdf If it comes from pdf.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function reporting_html_top_n_checks_failed($table, $item)
|
function reporting_html_top_n_checks_failed($table, $item, $pdf=0)
|
||||||
{
|
{
|
||||||
global $config;
|
$table->width = '99%';
|
||||||
$table->rowclass[0] = '';
|
$table->styleTable = 'border: 0px;';
|
||||||
$table->data[1][1] = '<b>'.__('Title').'</b>';
|
$table->colspan[2][0] = 3;
|
||||||
$table->data[1][2] = '<b>'.__('Total Failed').'</b>';
|
$table1 = new stdClass();
|
||||||
$table->data[1][3] = '<b>'.__('Description').'</b>';
|
$table1->width = '99%';
|
||||||
|
$table1->headstyle[0] = 'text-align: left';
|
||||||
|
$table1->headstyle[2] = 'text-align: left';
|
||||||
|
$table1->class = 'info_table';
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->headstyle[1] = 'width: 10%; text-align: center;';
|
||||||
|
$table1->style[2] = 'text-align: center;';
|
||||||
|
$table1->rowclass[0] = '';
|
||||||
|
$table1->head[0] = '<b>'.__('Title').'</b>';
|
||||||
|
$table1->head[1] = '<b>'.__('Total Failed').'</b>';
|
||||||
|
$table1->head[2] = '<b>'.__('Description').'</b>';
|
||||||
|
|
||||||
$row = 2;
|
$row = 2;
|
||||||
foreach ($item['data'] as $key => $check) {
|
foreach ($item['data'] as $key => $check) {
|
||||||
$table->data[$row][1] = $check['title'];
|
$table1->data[$row][1] = $check['title'];
|
||||||
$table->data[$row][2] = $check['total'];
|
$table1->data[$row][2] = $check['total'];
|
||||||
$table->data[$row][3] = $check['description'];
|
$table1->data[$row][3] = $check['description'];
|
||||||
$row++;
|
$row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($pdf === 1) {
|
||||||
|
$table1->title = $item['title'];
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->titlestyle = 'text-align:left;';
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[2][0] = html_print_table($table1, true);
|
||||||
|
if ($pdf === 1) {
|
||||||
|
return html_print_table($table1, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -667,26 +749,46 @@ function reporting_vul_by_cat_graph($table, $item)
|
|||||||
/**
|
/**
|
||||||
* Function to print HTML top n agents from security hardening.
|
* Function to print HTML top n agents from security hardening.
|
||||||
*
|
*
|
||||||
* @param object $table Head table or false if it comes from pdf.
|
* @param object $table Head table or false if it comes from pdf.
|
||||||
* @param array $item Items data.
|
* @param array $item Items data.
|
||||||
|
* @param boolean $pdf If it comes from pdf.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function reporting_html_top_n_agents_sh($table, $item)
|
function reporting_html_top_n_agents_sh($table, $item, $pdf=0)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$table->rowclass[0] = '';
|
$table->width = '99%';
|
||||||
$table->data[1][0] = '<b>'.__('Agent').'</b>';
|
$table->styleTable = 'border: 0px;';
|
||||||
$table->data[1][1] = '<b>'.__('Last audit scan').'</b>';
|
$table->colspan[2][0] = 3;
|
||||||
$table->data[1][2] = '<b>'.__('Score').'</b>';
|
$table1 = new stdClass();
|
||||||
|
$table1->headstyle = [];
|
||||||
|
$table1->width = '99%';
|
||||||
|
$table1->class = 'info_table';
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->rowclass[0] = '';
|
||||||
|
$table1->head[0] = '<b>'.__('Agent').'</b>';
|
||||||
|
$table1->head[1] = '<b>'.__('Last audit scan').'</b>';
|
||||||
|
$table1->head[2] = '<b>'.__('Score').'</b>';
|
||||||
|
|
||||||
$row = 2;
|
$row = 2;
|
||||||
foreach ($item['data'] as $key => $agent) {
|
foreach ($item['data'] as $key => $agent) {
|
||||||
$table->data[$row][0] = $agent['alias'];
|
$table1->data[$row][0] = $agent['alias'];
|
||||||
$table->data[$row][1] = date($config['date_format'], $agent['utimestamp']);
|
$table1->data[$row][1] = date($config['date_format'], $agent['utimestamp']);
|
||||||
$table->data[$row][2] = $agent['datos'].' %';
|
$table1->data[$row][2] = $agent['datos'].' %';
|
||||||
$row++;
|
$row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($pdf === 1) {
|
||||||
|
$table1->title = $item['title'];
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->titlestyle = 'text-align:left;';
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[2][0] = html_print_table($table1, true);
|
||||||
|
if ($pdf === 1) {
|
||||||
|
return html_print_table($table, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -519,6 +519,26 @@ function line_graph(
|
|||||||
$chart_data,
|
$chart_data,
|
||||||
$options
|
$options
|
||||||
) {
|
) {
|
||||||
|
if (empty($chart_data) === true) {
|
||||||
|
if (isset($options['ttl']) === true
|
||||||
|
&& (int) $options['ttl'] === 2
|
||||||
|
) {
|
||||||
|
$options['base64'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return graph_nodata_image($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($options['ttl']) === true && (int) $options['ttl'] === 2) {
|
||||||
|
$params = [
|
||||||
|
'chart_data' => $chart_data,
|
||||||
|
'options' => $options,
|
||||||
|
'return_img_base_64' => true,
|
||||||
|
];
|
||||||
|
|
||||||
|
return generator_chart_to_pdf('line_graph', $params);
|
||||||
|
}
|
||||||
|
|
||||||
$chart = get_build_setup_charts('LINE', $options, $chart_data);
|
$chart = get_build_setup_charts('LINE', $options, $chart_data);
|
||||||
return $chart->render(true, true);
|
return $chart->render(true, true);
|
||||||
}
|
}
|
||||||
|
@ -97,29 +97,12 @@ $filename = (string) get_parameter('filename');
|
|||||||
|
|
||||||
$date_mode = get_parameter('date_mode', 'none');
|
$date_mode = get_parameter('date_mode', 'none');
|
||||||
|
|
||||||
$period = null;
|
$date_init = get_parameter('date_init', '');
|
||||||
switch ($date_mode) {
|
if (empty($date_init) === false) {
|
||||||
case 'none':
|
$date_end = get_parameter('date_end', time());
|
||||||
case 'end_time':
|
$period = ($date_end - $date_init);
|
||||||
// Get different date to search the report.
|
$date = date('Y-m-d', $date_end);
|
||||||
$date = (string) get_parameter('date', date('Y-m-j'));
|
$time = date('H:i:s', $date_end);
|
||||||
$time = (string) get_parameter('time', date('h:iA'));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'init_and_end_time':
|
|
||||||
// Get different date to search the report.
|
|
||||||
$date = (string) get_parameter('date', date('Y-m-j'));
|
|
||||||
$time = (string) get_parameter('time', date('h:iA'));
|
|
||||||
|
|
||||||
// Calculations in order to modify init date of the report
|
|
||||||
$date_init_less = (strtotime(date('Y-m-j')) - SECONDS_1DAY);
|
|
||||||
|
|
||||||
$date_init = get_parameter('date_init', date('Y-m-j', $date_init_less));
|
|
||||||
$time_init = get_parameter('time_init', date('h:iA'));
|
|
||||||
$datetime_init = strtotime($date_init.' '.$time_init);
|
|
||||||
|
|
||||||
$period = (strtotime($date.' '.$time) - $datetime_init);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user