Call center prevent orphan data when deleting the call center queue make sure it deletes the associated tiers.

This commit is contained in:
Mark Crane
2012-09-27 16:54:10 +00:00
parent 7e009cf30b
commit 014ca639d7
3 changed files with 13 additions and 13 deletions

View File

@@ -39,8 +39,7 @@ if (count($_GET)>0) {
}
//get the agent details
$sql = "";
$sql .= "select * from v_call_center_agents ";
$sql = "select * from v_call_center_agents ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_agent_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
@@ -63,8 +62,7 @@ if (count($_GET)>0) {
//delete the agent from the db
if (strlen($id)>0) {
$sql = "";
$sql .= "delete from v_call_center_agents ";
$sql = "delete from v_call_center_agents ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_agent_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
@@ -82,4 +80,3 @@ if (count($_GET)>0) {
return;
?>

View File

@@ -47,22 +47,28 @@ if (strlen($id) > 0) {
$prep_statement = $db->prepare($sql);
$prep_statement->execute();
while($row = $prep_statement->fetch(PDO::FETCH_ASSOC)) {
$queue_name = $row['queue_name'];
$dialplan_uuid = $row['dialplan_uuid'];
}
//delete the tier from the database
$sql = "delete from v_call_center_tiers ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and queue_name = '$queue_name' ";
$db->query($sql);
unset($sql);
//delete the call center queue
$sql = "delete from v_call_center_queues ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$db->query($sql);
unset($sql);
//delete the dialplan entry
$sql = "delete from v_dialplans ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
//echo $sql."<br>\n";
$db->query($sql);
unset($sql);
@@ -70,7 +76,6 @@ if (strlen($id) > 0) {
$sql = "delete from v_dialplan_details ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
//echo $sql."<br>\n";
$db->query($sql);
unset($sql);

View File

@@ -40,8 +40,7 @@ else {
}
//get the agent details
$sql = "";
$sql .= "select * from v_call_center_tiers ";
$sql = "select * from v_call_center_tiers ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_tier_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
@@ -68,8 +67,7 @@ else {
//delete the tier from the database
if (strlen($id)>0) {
$sql = "";
$sql .= "delete from v_call_center_tiers ";
$sql = "delete from v_call_center_tiers ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_tier_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));