From 1747103a6629abb400693f8a70926968286f9d0e Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Tue, 7 Apr 2015 17:03:39 +0000 Subject: [PATCH] Operator Panel: Adjustments to correctly display the user status of the extensions assigned to the current user. --- app/operator_panel/index_inc.php | 3 ++- .../resources/functions/get_call_activity.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/operator_panel/index_inc.php b/app/operator_panel/index_inc.php index bd96d4370a..7358e00771 100644 --- a/app/operator_panel/index_inc.php +++ b/app/operator_panel/index_inc.php @@ -267,7 +267,8 @@ foreach ($activity as $extension => $ext) { } //determine extension (user) status - switch ($ext['user_status']) { + $ext_status = (in_array($extension, $_SESSION['user']['extensions'])) ? $ext_user_status[$_SESSION['user_uuid']] : $ext_user_status[$ext['user_uuid']]; + switch ($ext_status) { case "Available" : $status_icon = "available"; $status_hover = $text['label-status_available']; diff --git a/app/operator_panel/resources/functions/get_call_activity.php b/app/operator_panel/resources/functions/get_call_activity.php index 3a4ab0bb8c..08c7e8ef66 100644 --- a/app/operator_panel/resources/functions/get_call_activity.php +++ b/app/operator_panel/resources/functions/get_call_activity.php @@ -1,6 +1,7 @@ fetchAll(PDO::FETCH_NAMED); unset ($prep_statement, $sql); + //store extension status by user uuid + foreach($extensions as &$row) { + if ($row['user_uuid'] != '') { + $ext_user_status[$row['user_uuid']] = $row['user_status']; + unset($row['user_uuid'], $row['user_status']); + } + } + //send the command $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) {