From 551a21ed86a0fbf569f9b2ac50cd874d462f9fce Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 3 Jun 2019 13:11:00 +0200 Subject: [PATCH] Next contact fixes --- pandora_console/operation/agentes/ver_agente.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 3c77623522..16288b64cb 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -75,11 +75,16 @@ if (is_ajax()) { ); $progress = agents_get_next_contact($id_agente); + $last_contact = ($d['intervalo'] * (100 - $progress) / 100); + + if ($progress < 0 || $progress > 100) { + $progress = 100; + } echo json_encode( [ 'progress' => $progress, - 'last_contact' => ($d['intervalo'] * (100 - $progress) / 100), + 'last_contact' => $last_contact, ] ); }