Call Forward/Follow Me/DND: Update classes.

This commit is contained in:
Nate
2019-11-30 21:42:15 -07:00
parent 09f8287138
commit a6b06ee8a9
5 changed files with 21 additions and 11 deletions

View File

@@ -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']."'";
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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")) {