From 75ee2e364a353ccbe9c7afc01e26000360f0ab20 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Fri, 5 Nov 2010 09:57:53 +0000 Subject: [PATCH] 2010-11-05 Sergio Martin * operation/search_agents.php: Fixed the last contact information in the agents search view for bug 3103501 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3534 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/operation/search_agents.php | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3f4e01341d..1ab54db89e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-11-05 Sergio Martin + + * operation/search_agents.php: Fixed the last contact + information in the agents search view for bug 3103501 + 2010-11-05 Sergio Martin * include/javascript/pandora_modules.js: Changed the enable diff --git a/pandora_console/operation/search_agents.php b/pandora_console/operation/search_agents.php index e4dd49624b..77d0974d0f 100755 --- a/pandora_console/operation/search_agents.php +++ b/pandora_console/operation/search_agents.php @@ -105,7 +105,7 @@ switch ($sortField) { $agents = false; if ($searchAgents) { - $sql = "SELECT id_agente, tagente.nombre, tagente.id_os, tagente.intervalo, tagente.id_grupo, tagente.disabled + $sql = "SELECT id_agente, tagente.ultimo_contacto, tagente.nombre, tagente.id_os, tagente.intervalo, tagente.id_grupo, tagente.disabled FROM tagente INNER JOIN tgrupo ON tgrupo.id_grupo = tagente.id_grupo @@ -206,7 +206,12 @@ else { else { $cellName = print_agent_name ($agent["id_agente"], true, "upper"); } - + + $last_time = strtotime ($agent["ultimo_contacto"]); + $now = time (); + $diferencia = $now - $last_time; + $time = print_timestamp ($last_time, true); + array_push($table->data, array( $cellName, print_os_icon ($agent["id_os"], false, true), @@ -215,7 +220,7 @@ else { $modulesCell, $agent_info["status_img"], $agent_info["alert_img"], - print_timestamp ($agent_info["last_contact"], true))); + ''.$time.'')); } echo "
";pagination ($totalAgents);