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:
parent
c92436fbca
commit
e1bce331bb
|
@ -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>
|
2009-10-06 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* include/functions_agents.php: add the function "getNextAgentContact"
|
* include/functions_agents.php: add the function "getNextAgentContact"
|
||||||
|
|
|
@ -192,11 +192,14 @@ foreach ($agents as $agent) {
|
||||||
|
|
||||||
$data[1] = print_os_icon ($agent["id_os"], false, true);
|
$data[1] = print_os_icon ($agent["id_os"], false, true);
|
||||||
|
|
||||||
if ($agent_info["interval"] > $agent["intervalo"]) {
|
//The interval we are thinking that it must be the agent interval in this
|
||||||
$data[2] = '<span class="green">'.$agent_info["interval"].'</span>';
|
//cell and it'snt the interval of modules.
|
||||||
} else {
|
// 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[2] = $agent["intervalo"];
|
||||||
}
|
|
||||||
|
|
||||||
$data[3] = print_group_icon ($agent["id_grupo"], true);
|
$data[3] = print_group_icon ($agent["id_grupo"], true);
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
// Load global vars
|
// Load global vars
|
||||||
require_once ("include/config.php");
|
require_once ("include/config.php");
|
||||||
|
|
||||||
|
require_once ("include/functions_agents.php");
|
||||||
|
|
||||||
if ($config['flash_charts']) {
|
if ($config['flash_charts']) {
|
||||||
require_once ("include/fgraph.php");
|
require_once ("include/fgraph.php");
|
||||||
}
|
}
|
||||||
|
@ -118,19 +121,7 @@ if ($agent["ultimo_contacto_remoto"] == "0000-00-00 00:00:00") {
|
||||||
echo '</td></tr>';
|
echo '</td></tr>';
|
||||||
|
|
||||||
// Next contact (agent)
|
// Next contact (agent)
|
||||||
$difference = get_system_time () - strtotime ($agent["ultimo_contacto"]);
|
$progress = getNextAgentContact($id_agente);
|
||||||
$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;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<tr><td class="datos"><b>'.__('Next agent contact').'</b></td>';
|
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>';
|
echo '<td class="datos f9" colspan="2"><img src="include/fgraph.php?tipo=progress&percent='.$progress.'&height=20&width=200"></td></tr>';
|
||||||
|
|
Loading…
Reference in New Issue