mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Call Forward/Follow Me/DND: Update classes.
This commit is contained in:
@@ -136,7 +136,7 @@ if (!class_exists('bridges')) {
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//get current toggle state
|
||||
foreach($records as $x => $record) {
|
||||
foreach ($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$uuids[] = "'".$record['uuid']."'";
|
||||
}
|
||||
@@ -158,7 +158,7 @@ if (!class_exists('bridges')) {
|
||||
|
||||
//build update array
|
||||
$x = 0;
|
||||
foreach($states as $uuid => $state) {
|
||||
foreach ($states as $uuid => $state) {
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
|
||||
$array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
|
||||
$x++;
|
||||
@@ -205,7 +205,7 @@ if (!class_exists('bridges')) {
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//get checked records
|
||||
foreach($records as $x => $record) {
|
||||
foreach ($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$uuids[] = "'".$record['uuid']."'";
|
||||
}
|
||||
|
||||
@@ -202,8 +202,10 @@ include "root.php";
|
||||
if ($new_state == $this->toggle_values[0]) { //true
|
||||
$array[$this->table][$x]['do_not_disturb'] = $this->toggle_values[1]; //false
|
||||
$array[$this->table][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extension['follow_me_uuid'];
|
||||
$array['follow_me'][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
|
||||
if (is_uuid($extension['follow_me_uuid'])) {
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extension['follow_me_uuid'];
|
||||
$array['follow_me'][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
|
||||
}
|
||||
}
|
||||
|
||||
//increment counter
|
||||
|
||||
@@ -217,8 +217,10 @@ include "root.php";
|
||||
if ($array[$this->table][$x][$this->toggle_field] == $this->toggle_values[0]) { //true
|
||||
$array[$this->table][$x]['forward_all_enabled'] = $this->toggle_values[1]; //false
|
||||
$array[$this->table][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extension['follow_me_uuid'];
|
||||
$array['follow_me'][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
|
||||
if (is_uuid($extension['follow_me_uuid'])) {
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extension['follow_me_uuid'];
|
||||
$array['follow_me'][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
|
||||
}
|
||||
}
|
||||
|
||||
//increment counter
|
||||
|
||||
@@ -373,8 +373,10 @@ include "root.php";
|
||||
if ($new_state != $extension['state']) {
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
|
||||
$array[$this->table][$x][$this->toggle_field] = $new_state;
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extension['follow_me_uuid'];
|
||||
$array['follow_me'][$x]['follow_me_enabled'] = $new_state;
|
||||
if (is_uuid($extension['follow_me_uuid'])) {
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extension['follow_me_uuid'];
|
||||
$array['follow_me'][$x]['follow_me_enabled'] = $new_state;
|
||||
}
|
||||
}
|
||||
|
||||
//disable other features
|
||||
|
||||
@@ -586,8 +586,12 @@ if (!class_exists('extension')) {
|
||||
//build delete array
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
|
||||
$array['extension_users'][$x]['extension_uuid'] = $record['uuid'];
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extensions[$x]['follow_me_uuid'];
|
||||
$array['follow_me_destinations'][$x]['follow_me_uuid'] = $extensions[$x]['follow_me_uuid'];
|
||||
|
||||
//include follow me destinations, if exists
|
||||
if (is_uuid($extensions[$x]['follow_me_uuid'])) {
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extensions[$x]['follow_me_uuid'];
|
||||
$array['follow_me_destinations'][$x]['follow_me_uuid'] = $extensions[$x]['follow_me_uuid'];
|
||||
}
|
||||
|
||||
//include ring group destinations, if exists
|
||||
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/ring_groups/app_config.php")) {
|
||||
|
||||
Reference in New Issue
Block a user