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
``
This commit is contained in:
parent
8dd72afbd7
commit
8b96881a5d
|
|
@ -166,9 +166,11 @@ function get_call_activity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//reindex array using extension instead of auto-incremented value
|
//reindex array using extension instead of auto-incremented value
|
||||||
|
$result = array();
|
||||||
foreach ($array as $index => $subarray) {
|
foreach ($array as $index => $subarray) {
|
||||||
|
$extension = $subarray['extension'];
|
||||||
foreach ($subarray as $field => $value) {
|
foreach ($subarray as $field => $value) {
|
||||||
$array[$subarray['extension']][$field] = $array[$index][$field];
|
$result[$extension][$field] = $array[$index][$field];
|
||||||
unset($array[$index][$field]);
|
unset($array[$index][$field]);
|
||||||
}
|
}
|
||||||
unset($array[$subarray['extension']]['extension']);
|
unset($array[$subarray['extension']]['extension']);
|
||||||
|
|
@ -176,5 +178,5 @@ function get_call_activity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//return array
|
//return array
|
||||||
return $array;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue