Complete fixing the dialplan destination edit functionality so that it will not duplicate the dialplan details

This commit is contained in:
Mark Crane 2014-08-08 01:16:30 +00:00
parent d9f8952dac
commit e38e931446
1 changed files with 71 additions and 72 deletions

View File

@ -185,9 +185,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$dialplan["dialplan_order"] = "100";
$dialplan["dialplan_enabled"] = $destination_enabled;
$dialplan["dialplan_description"] = $destination_description;
$dialplan_detail_order = 10;
if (strlen($dialplan_uuid) == 0) {
//add the public condition
$y = 0;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $_SESSION['domain_uuid'];
@ -249,7 +248,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//increment the dialplan detail order
$dialplan_detail_order = $dialplan_detail_order + 10;
}
}
//add fax detection
if (strlen($fax_uuid) > 0) {
@ -336,10 +334,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
//delete the previous details
if(strlen($row["dialplan_detail_uuid"]) > 0){
if(strlen($dialplan_uuid) > 0) {
$sql = "delete from v_dialplan_details ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and dialplan_uuid = '".$row["dialplan_detail_uuid"]."' ";
$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
$db->exec(check_sql($sql));
unset($sql);
}
@ -352,6 +350,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
$orm->save($dialplan);
$dialplan_response = $orm->message;
//print_r($dialplan_response);
//synchronize the xml config
save_dialplan_xml();