diff --git a/app/operator_panel/app_languages.php b/app/operator_panel/app_languages.php index de86341a78..ef22d0586b 100644 --- a/app/operator_panel/app_languages.php +++ b/app/operator_panel/app_languages.php @@ -50,4 +50,19 @@ $text['label-status_do_not_disturb']['pt-pt'] = "Não Perturbar"; $text['label-status_do_not_disturb']['fr-fr'] = "Ne pas déranger"; + $text['label-eavesdrop']['en-us'] = "Eavesdrop"; + $text['label-eavesdrop']['es-cl'] = "Escuchar"; + $text['label-eavesdrop']['pt-pt'] = "Bisbilhotar"; + $text['label-eavesdrop']['fr-fr'] = "Espionner"; + + $text['label-kill']['en-us'] = "Kill"; + $text['label-kill']['es-cl'] = "Finalizar Llamada"; + $text['label-kill']['pt-pt'] = "Chamada Final"; + $text['label-kill']['fr-fr'] = "Tuer Appel"; + + $text['button-all']['en-us'] = "All"; + $text['button-all']['es-cl'] = "Todos"; + $text['button-all']['pt-pt'] = "Tudo"; + $text['button-all']['fr-fr'] = "Tous"; + ?> \ No newline at end of file diff --git a/app/operator_panel/index.php b/app/operator_panel/index.php index 8f2e700ddd..ead8a4f1a5 100644 --- a/app/operator_panel/index.php +++ b/app/operator_panel/index.php @@ -93,7 +93,7 @@ require_once "resources/header.php"; var url = source_url; url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value; url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value; - url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').options[document.getElementById('group').selectedIndex].value : ''); + url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : ''); "; -echo " "; -echo " "; if (sizeof($groups) > 0) { - echo $text['label-call_group']." "; - echo " \n"; + echo ""; + echo " "; + echo " "; + echo " "; + echo "
"; + echo " "; + echo " ".$text['label-call_group']."  "; + if (sizeof($groups) > 5) { + //show select box + echo " \n"; + } + else { + //show buttons + echo " "; + foreach ($groups as $group) { + echo " "; + } + } + echo "
"; } -echo " "; -echo " "; -echo ""; echo "".$text['title-operator_panel'].""; echo "


"; @@ -142,38 +153,47 @@ foreach ($activity as $extension => $ext) { } //determine extension draggable state - if (!in_array($extension, $_SESSION['user']['extensions'])) { - if ($ext_state == "ringing") { - if ($_GET['vd_ext_from'] == '' && $dir_icon == 'inbound') { - $draggable = true; // selectable - is ringing and not outbound so can transfer away the call (can set as vd_ext_from) + if (permission_exists('operator_panel_manage')) { + if (!in_array($extension, $_SESSION['user']['extensions'])) { + //other extension + if ($ext_state == "ringing") { + if ($_GET['vd_ext_from'] == '' && $dir_icon == 'inbound') { + $draggable = true; // selectable - is ringing and not outbound so can transfer away the call (can set as vd_ext_from) + } + else { + $draggable = false; // unselectable - is ringing so can't send a call to the ext (can't set as vd_ext_to) + } + } + else if ($ext_state == 'active') { + $draggable = false; // unselectable - on a call already so can't transfer or send a call to the ext (can't set as vd_ext_from or vd_ext_to) + } + else { // idle + if ($_GET['vd_ext_from'] == '') { + $draggable = false; // unselectable - is idle, but can't initiate a call from the ext as is not assigned to user (can't set as vd_ext_from) + } + else { + $draggable = true; // selectable - is idle, so can transfer a call in to ext (can set as vd_ext_to). + } + } + } + else { + //user extension + if ($ext['uuid'] != '' && $ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') { + $draggable = false; + } + else if ($ext_state == 'ringing' && $ext['variable_call_direction'] == 'local') { + $draggable = false; + } + else if ($ext_state != '' && !$format_number) { + $draggable = false; } else { - $draggable = false; // unselectable - is ringing so can't send a call to the ext (can't set as vd_ext_to) + $draggable = true; } } - else if ($ext_state == 'active') { - $draggable = false; // unselectable - on a call already so can't transfer or send a call to the ext (can't set as vd_ext_from or vd_ext_to) - } - else { // idle - if ($_GET['vd_ext_from'] == '') { - $draggable = false; // unselectable - is idle, but can't initiate a call from the ext as is not assigned to user (can't set as vd_ext_from) - } - else { - $draggable = true; // selectable - is idle, so can transfer a call in to ext (can set as vd_ext_to). - } - } - } - else if ($ext['uuid'] != '' && $ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') { - $draggable = false; - } - else if ($ext_state == 'ringing' && $ext['variable_call_direction'] == 'local') { - $draggable = false; - } - else if ($ext_state != '' && !$format_number) { - $draggable = false; } else { - $draggable = true; + $draggable = false; } //determine extension (user) status @@ -209,7 +229,7 @@ foreach ($activity as $extension => $ext) { $block .= " "; $block .= " "; if ($dir_icon != '') { - $block .= " "; + $block .= " "; } $block .= " "; if ($ext['effective_caller_id_name'] != '' && $ext['effective_caller_id_name'] != $extension) { @@ -222,8 +242,13 @@ foreach ($activity as $extension => $ext) { if ($ext_state != '') { $block .= " "; $block .= "
"; - $block .= " ".$ext['call_length'].""; - if (in_array($extension, $_SESSION['user']['extensions'])) { + $block .= " ".$ext['call_length']."
"; + //eavesdrop + if (permission_exists('operator_panel_eavesdrop') && $ext_state == 'active' && !in_array($extension, $_SESSION['user']['extensions'])) { + $block .= ""; + } + //kill + if (in_array($extension, $_SESSION['user']['extensions']) || permission_exists('operator_panel_kill')) { if ($ext['variable_bridge_uuid'] == '' && $ext_state == 'ringing') { $call_identifier_kill = $ext['uuid']; } @@ -233,7 +258,7 @@ foreach ($activity as $extension => $ext) { else { $call_identifier_kill = $call_identifier; } - $block .= "
"; + $block .= ""; } $block .= "
"; $block .= " ".$call_name."
".$call_number; diff --git a/app/operator_panel/resources/images/eavesdrop.png b/app/operator_panel/resources/images/eavesdrop.png new file mode 100644 index 0000000000..af19bfe813 Binary files /dev/null and b/app/operator_panel/resources/images/eavesdrop.png differ