From 8b96881a5d47068459e90153ec2f9aa9fcd4869e Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Wed, 9 Mar 2016 16:24:20 +0300 Subject: [PATCH] Fix. Use operator panel with short extension. Problem because if you have say 15 ext. and one of ext has say number `14` and extension `14` has index 15 in array. And php returns ```PHP $a = array('14' => 'string', 14 => 'number'); print($a['14']); // number `` --- .../resources/functions/get_call_activity.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/operator_panel/resources/functions/get_call_activity.php b/app/operator_panel/resources/functions/get_call_activity.php index fd3b224ca1..bc1da3b574 100644 --- a/app/operator_panel/resources/functions/get_call_activity.php +++ b/app/operator_panel/resources/functions/get_call_activity.php @@ -166,9 +166,11 @@ function get_call_activity() { } //reindex array using extension instead of auto-incremented value + $result = array(); foreach ($array as $index => $subarray) { + $extension = $subarray['extension']; foreach ($subarray as $field => $value) { - $array[$subarray['extension']][$field] = $array[$index][$field]; + $result[$extension][$field] = $array[$index][$field]; unset($array[$index][$field]); } unset($array[$subarray['extension']]['extension']); @@ -176,5 +178,5 @@ function get_call_activity() { } //return array - return $array; + return $result; }