diff --git a/app/basic_operator_panel/resources/content.php b/app/basic_operator_panel/resources/content.php
index e71a5d7492..1fe82ce8c8 100644
--- a/app/basic_operator_panel/resources/content.php
+++ b/app/basic_operator_panel/resources/content.php
@@ -168,6 +168,11 @@ echo " ";
echo "";
echo "
";
+// Define the arrays to ensure no errors are omitted below with the sizeof operators
+$user_extensions = array();
+$grouped_extensions = array();
+$other_extensions = array();
+
if (is_array($activity)) foreach ($activity as $extension => $ext) {
unset($block);
@@ -453,42 +458,49 @@ if (is_array($activity)) foreach ($activity as $extension => $ext) {
if (in_array($extension, $_SESSION['user']['extensions'])) {
$user_extensions[] = $block;
- }
- else {
+ } elseif (!empty($ext['call_group'])) {
+ $grouped_extensions[$ext['call_group']][] = $block;
+ } else {
$other_extensions[] = $block;
}
}
-
-if (is_array($user_extensions) && @sizeof($user_extensions) > 0) {
+if (sizeof($user_extensions) > 0) {
echo "
| ";
if (is_array($user_extensions)) foreach ($user_extensions as $ext_block) {
echo $ext_block;
}
- echo " |
";
+ echo "
";
}
-if ($_REQUEST['group'] != '') {
- if (is_array($user_extensions) && @sizeof($user_extensions) > 0) { echo "
"; }
- echo "".ucwords(escape($_REQUEST['group']))."";
- echo "
";
-}
-else if (is_array($user_extensions) && @sizeof($user_extensions) > 0) {
- echo "
";
- echo "".$text['label-other_extensions']."";
- echo "
";
+if (sizeof($grouped_extensions) > 0) {
+ // Ensure alphabetical order
+ ksort($grouped_extensions);
+ foreach ($grouped_extensions as $group => $extensions) {
+ echo "".ucwords(escape($group))."";
+ echo "
";
+ echo "| ";
+ foreach ($extensions as $ext_block) {
+ echo $ext_block;
+ }
+ echo " |
";
+ }
}
if (sizeof($other_extensions) > 0) {
+ echo "".$text['label-other_extensions']."";
+ echo "
";
echo "| ";
- if (is_array($other_extensions)) foreach ($other_extensions as $ext_block) {
+ foreach ($other_extensions as $ext_block) {
echo $ext_block;
}
echo " |
";
}
-else {
+
+if (sizeof($other_extensions) + sizeof($grouped_extensions) < 1) {
echo $text['label-no_extensions_found'];
}
+
echo "
";
/*