2009-10-06 Miguel de Dios <miguel.dedios@artica.es>

* operation/agentes/estado_generalagente.php,
	operation/agentes/estado_agente.php: change the intervals, and use the
	new function "getNextAgentContact" for interval in agent view.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2008 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2009-10-06 19:54:50 +00:00
parent c92436fbca
commit e1bce331bb
3 changed files with 18 additions and 18 deletions

View File

@ -1,3 +1,9 @@
2009-10-06 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php: change the intervals, and use the
new function "getNextAgentContact" for interval in agent view.
2009-10-06 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php: add the function "getNextAgentContact"

View File

@ -192,11 +192,14 @@ foreach ($agents as $agent) {
$data[1] = print_os_icon ($agent["id_os"], false, true);
if ($agent_info["interval"] > $agent["intervalo"]) {
$data[2] = '<span class="green">'.$agent_info["interval"].'</span>';
} else {
$data[2] = $agent["intervalo"];
}
//The interval we are thinking that it must be the agent interval in this
//cell and it'snt the interval of modules.
// if ($agent_info["interval"] > $agent["intervalo"]) {
// $data[2] = '<span class="green">'.$agent_info["interval"].'</span>';
// } else {
// $data[2] = $agent["intervalo"];
// }
$data[2] = $agent["intervalo"];
$data[3] = print_group_icon ($agent["id_grupo"], true);

View File

@ -17,6 +17,9 @@
// Load global vars
require_once ("include/config.php");
require_once ("include/functions_agents.php");
if ($config['flash_charts']) {
require_once ("include/fgraph.php");
}
@ -118,19 +121,7 @@ if ($agent["ultimo_contacto_remoto"] == "0000-00-00 00:00:00") {
echo '</td></tr>';
// Next contact (agent)
$difference = get_system_time () - strtotime ($agent["ultimo_contacto"]);
$sql = sprintf ("SELECT MAX(module_interval) FROM tagente_modulo WHERE id_agente = %d", $id_agente);
$max = (int) get_db_sql ($sql);
if ($max > 0) {
//First check if there is a maximum module interval
$progress = round ($difference / (($max * 2) / 100));
} elseif ($agent["intervalo"] > 0) {
//Then if there is a generic agent interval
$progress = round ($difference / (($agent["intervalo"] * 2) / 100));
} else {
//Otherwise there is no progress to be reported
$progress = -1;
}
$progress = getNextAgentContact($id_agente);
echo '<tr><td class="datos"><b>'.__('Next agent contact').'</b></td>';
echo '<td class="datos f9" colspan="2"><img src="include/fgraph.php?tipo=progress&percent='.$progress.'&height=20&width=200"></td></tr>';