Update app_defaults.php

This commit is contained in:
FusionPBX 2018-03-31 11:09:20 -06:00 committed by GitHub
parent ea003f8849
commit c53108ca5b
1 changed files with 32 additions and 2 deletions

View File

@ -17,11 +17,41 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2015 Portions created by the Initial Developer are Copyright (C) 2018
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
*/ */
?> if ($domains_processed == 1) {
//list the missing call center queue and agent uuids
$sql = "select t.call_center_tier_uuid, t.call_center_queue_uuid, t.call_center_agent_uuid, t.queue_name, t.agent_name, d.domain_name, ";
$sql .= "(select call_center_queue_uuid from v_call_center_queues where replace(queue_name, ' ', '-') = t.queue_name and domain_uuid = t.domain_uuid) as queue_uuid, ";
$sql .= "(select call_center_agent_uuid from v_call_center_agents where agent_name = t.agent_name and domain_uuid = t.domain_uuid) as agent_uuid ";
$sql .= "from v_call_center_tiers as t, v_domains as d ";
$sql .= "where t.domain_uuid = d.domain_uuid ";
$sql .= "and (t.call_center_queue_uuid is null or t.call_center_agent_uuid is null) ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$tiers = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($tiers as &$row) {
if ($row['call_center_queue_uuid'] == null && $row['queue_uuid'] != null) {
$sql = "update v_call_center_tiers set call_center_queue_uuid = '".$row['queue_uuid']."' ";
$sql .= "where call_center_tier_uuid = '".$row['call_center_tier_uuid']."' ";
$db->exec(check_sql($sql));
unset($sql);
}
if ($row['call_center_agent_uuid'] == null && $row['agent_uuid'] != null) {
$sql = "update v_call_center_tiers set call_center_agent_uuid = '".$row['agent_uuid']."' ";
$sql .= "where call_center_tier_uuid = '".$row['call_center_tier_uuid']."' ";
$db->exec(check_sql($sql));
unset($sql);
}
}
}
?>