From 873f431f803df028f55ae89b7c794441df3cddf3 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 29 May 2024 17:09:18 -0600 Subject: [PATCH] Operator Panel prevent warnings - Prevent PHP Warnings - Save vertical space by removing extra br tags - Important to fit as many extensions on the page as possible for mid-sized businesses. --- .../resources/content.php | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/app/basic_operator_panel/resources/content.php b/app/basic_operator_panel/resources/content.php index 68c40cdd75..341a59e444 100644 --- a/app/basic_operator_panel/resources/content.php +++ b/app/basic_operator_panel/resources/content.php @@ -60,7 +60,7 @@ if (is_array($activity)) { } if (!empty($groups)) { $groups = array_unique($groups); - sort($groups); + sort($groups); } //get the valet info @@ -242,6 +242,11 @@ if (is_array($activity)) { ) { continue; } } + //set the default values + $call_name = ''; + $call_number = ''; + $dir_icon = ''; + //check if feature code being called $format_number = (!empty($ext['dest']) && substr($ext['dest'], 0, 1) == '*') ? false : true; @@ -293,14 +298,20 @@ if (is_array($activity)) { else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'inbound') { //valet park $ext_state = 'active'; + if (!empty($ext['dest'])) { + if (!empty($activity[$ext['dest']])) { $call_name = $activity[$ext['dest']]['effective_caller_id_name']; - $call_number = format_phone($ext['dest']); + } + } + $call_number = format_phone($ext['dest']); } else if ($ext['state'] == 'CS_SOFT_EXECUTE' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') { //valet park $ext_state = 'active'; - $call_name = $activity[$ext['dest']]['effective_caller_id_name']; - $call_number = format_phone($ext['dest']); + if (empty($ext['dest']) && empty($activity[$ext['dest']])) { + $call_name = $activity[$ext['dest'] ?? '']['effective_caller_id_name']; + } + $call_number = format_phone($ext['dest'] ?? ''); } else if ($ext['state'] == 'CS_CONSUME_MEDIA' || $ext['state'] == 'CS_EXCHANGE_MEDIA') { if ($ext['state'] == 'CS_CONSUME_MEDIA' && $ext['callstate'] == 'RINGING' && $ext['direction'] == 'outbound') { @@ -336,7 +347,7 @@ if (is_array($activity)) { } } } - if ($found_count > 0) { + if ($found_count > 0) { //determine block style by state (if any) and register status $css_class = !empty($ext_state) ? "op_ext op_state_".$ext_state : "op_ext"; } @@ -481,7 +492,7 @@ if (is_array($activity)) { if (empty($ext['variable_bridge_uuid']) && $ext_state == 'ringing') { $call_identifier_hangup_uuid = $ext['uuid']; } - else if ($dir_icon == 'outbound') { + elseif ($dir_icon == 'outbound') { $call_identifier_hangup_uuid = $ext['uuid']; } else { @@ -648,11 +659,10 @@ if (sizeof($user_extensions) > 0) { if (sizeof($grouped_extensions) > 0) { //alphabetical order ksort($grouped_extensions); - + //loop through the groups foreach ($grouped_extensions as $group => $extensions) { echo "
".ucwords(escape($group))."
\n"; - echo "

\n"; echo "
\n"; foreach ($extensions as $ext_block) { echo $ext_block; @@ -663,8 +673,7 @@ if (sizeof($grouped_extensions) > 0) { //show the other extensions if (sizeof($other_extensions) > 0) { - echo "
".$text['label-other_extensions']."
\n"; - echo "

\n"; + //echo "
".$text['label-other_extensions']."
\n"; echo "
\n"; foreach ($other_extensions as $ext_block) { echo $ext_block;