2013-10-10 Sergio Martin <sergio.martin@artica.es>
* include/functions_agents.php: Change the way of calculate next contact in main agent view to real next contact using only agent interval. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8886 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
9b6f00a1ff
commit
8c7a0b1ae8
|
@ -1,3 +1,9 @@
|
|||
2013-10-10 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_agents.php: Change the way of
|
||||
calculate next contact in main agent view to real
|
||||
next contact using only agent interval.
|
||||
|
||||
2013-10-10 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_tags.php,
|
||||
|
|
|
@ -633,24 +633,9 @@ function agents_get_next_contact($idAgent, $maxModules = false) {
|
|||
FROM tagente
|
||||
WHERE id_agente = " . $idAgent);
|
||||
|
||||
|
||||
$difference = get_system_time () - strtotime ($agent["ultimo_contacto"]);
|
||||
|
||||
|
||||
$max = $agent["intervalo"];
|
||||
if ($maxModules) {
|
||||
$sql = sprintf ("SELECT MAX(module_interval)
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = %d", $id_agente);
|
||||
$maxModules = (int) db_get_sql ($sql);
|
||||
if ($maxModules > 0)
|
||||
$max = $maxModules;
|
||||
}
|
||||
|
||||
if ($max > 0)
|
||||
return round ($difference / (($max * 2) / 100));
|
||||
else
|
||||
return false;
|
||||
return round ($difference / ($agent["intervalo"] / 100));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue