mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 09:03:49 +00:00
Update app_defaults.php
This commit is contained in:
@@ -26,29 +26,31 @@
|
||||
|
||||
//process this only one time
|
||||
if ($domains_processed == 1) {
|
||||
//select ring groups with an empty context
|
||||
$sql = "select * from v_ring_groups where ring_group_context is null ";
|
||||
$ring_groups = $database->select($sql, null, 'all');
|
||||
if (is_array($ring_groups)) {
|
||||
//get the domain list
|
||||
$sql = "select * from v_domains ";
|
||||
$database = new database;
|
||||
$domains = $database->select($sql, null, 'all');
|
||||
|
||||
//update the ring group context
|
||||
foreach ($ring_groups as $row) {
|
||||
foreach ($domains as $domain) {
|
||||
if ($row['domain_uuid'] == $domain['domain_uuid']) {
|
||||
$sql = "update v_ring_groups set ring_group_context = :domain_name \n";
|
||||
$sql .= "where ring_group_uuid = :ring_group_uuid \n";
|
||||
$parameters['domain_name'] = $domain['domain_name'];
|
||||
$parameters['ring_group_uuid'] = $row['ring_group_uuid'];
|
||||
$message = $database->execute($sql, null);
|
||||
unset($parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
//select ring groups with an empty context
|
||||
$sql = "select * from v_ring_groups where ring_group_context is null ";
|
||||
$ring_groups = $database->select($sql, null, 'all');
|
||||
if (is_array($ring_groups)) {
|
||||
//get the domain list
|
||||
$sql = "select * from v_domains ";
|
||||
$database = new database;
|
||||
$domains = $database->select($sql, null, 'all');
|
||||
|
||||
//update the ring group context
|
||||
foreach ($ring_groups as $row) {
|
||||
foreach ($domains as $domain) {
|
||||
if ($row['domain_uuid'] == $domain['domain_uuid']) {
|
||||
$sql = "update v_ring_groups set ring_group_context = :domain_name \n";
|
||||
$sql .= "where ring_group_uuid = :ring_group_uuid \n";
|
||||
$parameters['domain_name'] = $domain['domain_name'];
|
||||
$parameters['ring_group_uuid'] = $row['ring_group_uuid'];
|
||||
$message = $database->execute($sql, null);
|
||||
unset($parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user