From afa4935d36c4b5e14358e644ab28ff5231b89c70 Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Fri, 27 Oct 2017 11:14:37 +1100 Subject: [PATCH] Fixed bug: Cases not unassigning when calls in case_queue --- endwork.php | 2 +- functions/functions.operator.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/endwork.php b/endwork.php index 432f130a..95e56111 100644 --- a/endwork.php +++ b/endwork.php @@ -63,7 +63,7 @@ if (ALLOW_OPERATOR_EXTENSION_SELECT && VOIP_ENABLED) //unassign extension $operator_id = get_operator_id(); - if (get_case_id($operator_id) == false && is_voip_enabled($operator_id)) + if (get_case_id($operator_id,false) == false && is_voip_enabled($operator_id)) { $sql = "UPDATE `extension` SET current_operator_id = NULL diff --git a/functions/functions.operator.php b/functions/functions.operator.php index 496ac17c..986b695d 100644 --- a/functions/functions.operator.php +++ b/functions/functions.operator.php @@ -590,7 +590,7 @@ function get_case_id($operator_id, $create = false) $sq = $db->GetRow($sql); - if (isset($rnc['next_case_id']) && !empty($rnc['next_case_id'])) + if ($create && isset($rnc['next_case_id']) && !empty($rnc['next_case_id'])) { $case_id = $rnc['next_case_id']; @@ -617,7 +617,7 @@ function get_case_id($operator_id, $create = false) } } - else if (isset($sq['case_id']) && !empty($sq['case_id'])) + else if ($create && isset($sq['case_id']) && !empty($sq['case_id'])) { $case_id = $sq['case_id']; $case_queue_id = $sq['case_queue_id'];