";
@@ -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 .= "