Merge branch '74-muestra-last-contact-en-rojo-no-deberia' into 'develop'

Functions_module now not use async modules to calc if last contact is major than…

See merge request !190
This commit is contained in:
Enrique Camargo 2017-02-21 18:59:14 +01:00
commit 1e88c6d457
2 changed files with 11 additions and 2 deletions

View File

@ -1442,8 +1442,7 @@ function agents_get_interval_status ($agent) {
$now = time ();
$diferencia = $now - $last_time;
$time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt'));
$min_interval = modules_get_agentmodule_mininterval($agent['id_agente']);
$min_interval = modules_get_agentmodule_mininterval_no_async($agent['id_agente']);
$return = $time;
if ($diferencia > ($min_interval["min_interval"] * 2))
$return = '<b><span style="color: #ff0000;">'.$time.'</span></b>';

View File

@ -2507,6 +2507,16 @@ function modules_get_agentmodule_mininterval($id_agent) {
return db_get_row_sql($sql);
}
function modules_get_agentmodule_mininterval_no_async($id_agent) {
$sql = 'SELECT MIN(tae.current_interval) AS min_interval
FROM tagente_estado tae
INNER JOIN tagente_modulo tam ON tae.id_agente_modulo = tam.id_agente_modulo
INNER JOIN ttipo_modulo ttm ON tam.id_tipo_modulo = ttm.id_tipo where ttm.nombre not like "async%" and tae.id_agente = '.$id_agent;
return db_get_row_sql($sql);
}
function get_same_modules ($agents, $modules) {
$modules_to_report = array();
if ($modules != "") {