From a476b79a1bc07499236f88e9275220c10b665808 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 4 Mar 2010 20:02:29 +0000 Subject: [PATCH] 2010-03-04 Sancho Lerena * install.php: Fixed a bad render in IE. * operation/agentes/estado_agente.php: Fixed general view of agents. When show agents without modules, never display it's date because was taking from the most recept module, instead of data from agent itself. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2475 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ pandora_console/install.php | 4 ++-- .../operation/agentes/estado_agente.php | 20 ++++++++++++++++--- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 56d92cb65d..ca0d61f51d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2010-03-04 Sancho Lerena + + * install.php: Fixed a bad render in IE. + + * operation/agentes/estado_agente.php: Fixed general view of agents. + When show agents without modules, never display it's date because was + taking from the most recept module, instead of data from agent itself. +: 2010-03-04 Pablo de la ConcepciĆ³n * godmode/gis_maps/configure_gis_map.php: Change help link. diff --git a/pandora_console/install.php b/pandora_console/install.php index 8cdd474786..bf95cd21fd 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -267,11 +267,11 @@ function install_step1_licence() { } else { echo "
"; - echo ""; echo "

"; - echo ""; + echo ""; } echo ""; diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index b399c9d951..0ea6794a9d 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -130,6 +130,7 @@ if (! empty ($agent_names)) { array ('id_agente', 'id_grupo', 'id_os', + 'ultimo_contacto', 'intervalo'));} if (empty ($agents)) { @@ -218,9 +219,22 @@ foreach ($agents as $agent) { $data[5] = $agent_info["status_img"]; $data[6] = $agent_info["alert_img"]; - - $data[7] = print_timestamp ($agent_info["last_contact"], true); - + + + $last_time = strtotime ($agent["ultimo_contacto"]); + $now = time (); + $diferencia = $now - $last_time; + $time = print_timestamp ($last_time, true); + $style = ''; + if ($diferencia > ($agent["intervalo"] * 2)) + $data[7] = ''.$time.''; + else + $data[7] = $time; + + // This old code was returning "never" on agents without modules, BAD !! + // And does not print outdated agents in red. WRONG !!!! + // $data[7] = print_timestamp ($agent_info["last_contact"], true); + array_push ($table->data, $data); }