Update destination_edit.php

This commit is contained in:
FusionPBX
2017-04-05 00:55:16 -06:00
committed by GitHub
parent 6cc945bb5f
commit 803d0c4772

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2016
Portions created by the Initial Developer are Copyright (C) 2008-2017
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -114,6 +114,9 @@
$_POST["destination_uuid"] = $destination_uuid;
}
//set the default context
if ($destination_type =="outbound" && strlen($destination_context) == 0) { $destination_context = $_SESSION['domain_name']; }
//check for all required data
$msg = '';
if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."<br>\n"; }
@@ -274,7 +277,7 @@
//delete previous fax detection settings
$sql = "delete from v_dialplan_details ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
$sql .= "and (";
$sql .= " dialplan_detail_data like '%tone_detect%' ";
@@ -351,7 +354,7 @@
$sql = "delete from v_dialplan_details ";
$sql .= "where dialplan_uuid = '".$dialplan_uuid."' ";
if (!permission_exists('destination_domain')) {
$sql .= "and domain_uuid = '".$domain_uuid."' ";
$sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
}
//echo $sql."<br><br>";
$db->exec(check_sql($sql));
@@ -502,6 +505,8 @@
//set the defaults
if (strlen($destination_type) == 0) { $destination_type = 'inbound'; }
if (strlen($destination_context) == 0) { $destination_context = 'public'; }
if ($destination_type =="outbound" && $destination_context == "public") { $destination_context = $_SESSION['domain_name']; }
if ($destination_type =="outbound" && strlen($destination_context) == 0) { $destination_context = $_SESSION['domain_name']; }
//show the header
require_once "resources/header.php";
@@ -525,7 +530,6 @@
echo " if (document.getElementById('tr_buy')) { document.getElementById('tr_buy').style.display = 'none'; }\n";
echo " if (document.getElementById('tr_carrier')) { document.getElementById('tr_carrier').style.display = 'none'; }\n";
echo " document.getElementById('tr_account_code').style.display = 'none';\n";
echo " document.getElementById('destination_context').value = '".$_SESSION['domain_name']."'";
echo " }\n";
echo " else if (dir == 'inbound') {\n";
echo " if (document.getElementById('tr_caller_id_name')) { document.getElementById('tr_caller_id_name').style.display = ''; }\n";