From 39805c3f0c24cacb8dd7f8c13d97d0c0a971828c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 5 Mar 2019 18:29:42 +0100 Subject: [PATCH 1/2] removed old useless code Former-commit-id: d378a359085f9ad8d45f40bff6c280b456a86c33 --- pandora_console/include/functions_reporting_html.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 362120e0a1..5bbf71477e 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -549,10 +549,6 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0) foreach ($item['data'] as $sla) { if (isset($sla)) { - $the_first_men_time = get_agent_first_time( - io_safe_output($sla['agent']) - ); - // First_table. $row = []; $row[] = $sla['agent']; @@ -2964,10 +2960,6 @@ function reporting_html_availability($table, $item, $pdf=0) $table2->style[5] = 'text-align: right'; foreach ($item['data'] as $row) { - $the_first_men_time = get_agent_first_time( - io_safe_output($row['agent']) - ); - $table_row = []; $table_row[] = $row['agent']; $table_row[] = $row['availability_item']; From 174256ab7082646318c7e0b9afc755ec7bed9e3c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 26 Mar 2019 10:55:50 +0100 Subject: [PATCH 2/2] minor approach csv report Former-commit-id: a875a42dc53c85942dd8f80f0b5a0f788fb39ca5 --- pandora_console/include/functions_reporting_html.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 5bbf71477e..ea4ff5dcb6 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -3268,9 +3268,8 @@ function get_agent_first_time($agent_name) $id = agents_get_agent_id($agent_name, true); $utimestamp = db_get_all_rows_sql( - 'SELECT utimestamp FROM tagente_datos WHERE id_agente_modulo IN - (SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = '.$id.') - ORDER BY utimestamp ASC LIMIT 1' + 'SELECT min(utimestamp) FROM tagente_datos WHERE id_agente_modulo IN + (SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = '.$id.')' ); $utimestamp = $utimestamp[0]['utimestamp'];