diff --git a/app/destinations/destination_delete.php b/app/destinations/destination_delete.php deleted file mode 100644 index 49c7bb30e0..0000000000 --- a/app/destinations/destination_delete.php +++ /dev/null @@ -1,102 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2008-2019 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ - -//includes - require_once "root.php"; - require_once "resources/require.php"; - require_once "resources/check_auth.php"; - -//check permissions - if (permission_exists('destination_delete')) { - //access granted - } - else { - echo "access denied"; - exit; - } - -//add multi-lingual support - $language = new text; - $text = $language->get(); - -//get the id - $destination_uuid = $_GET["id"]; - -//if valid id - if (is_uuid($destination_uuid)) { - - //get the dialplan uuid and context - $sql = "select * from v_destinations "; - $sql .= "where destination_uuid = :destination_uuid "; - $parameters['destination_uuid'] = $destination_uuid; - $database = new database; - $row = $database->select($sql, $parameters, 'row'); - if (is_array($row) && @sizeof($row) != 0) { - if (permission_exists('destination_domain')) { - $domain_uuid = $row["domain_uuid"]; - } - $dialplan_uuid = $row["dialplan_uuid"]; - $destination_context = $row["destination_context"]; - } - unset($sql, $parameters, $row); - - //add the dialplan permission - $p = new permissions; - $p->add('dialplan_delete', 'temp'); - $p->add('dialplan_detail_delete', 'temp'); - - //delete the destination and related dialplan - if (is_uuid($dialplan_uuid)) { - $array['dialplans'][]['dialplan_uuid'] = $dialplan_uuid; - $array['dialplan_details'][]['dialplan_uuid'] = $dialplan_uuid; - } - $array['destinations'][]['destination_uuid'] = $destination_uuid; - $database = new database; - $database->app_name = 'destinations'; - $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; - $database->delete($array); - $message = $database->message; - - //remove the temporary permission - $p->delete('dialplan_delete', 'temp'); - $p->delete('dialplan_detail_delete', 'temp'); - - //synchronize the xml config - save_dialplan_xml(); - - //clear the cache - $cache = new cache; - $cache->delete("dialplan:".$destination_context); - - //set message - message::add($text['message-delete']); - } - -//redirect - header("Location: destinations.php"); - exit; - -?> diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index eae2ac5f83..d22ab12a59 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -990,15 +990,12 @@ echo " ".$text['label-detail_action']."\n"; echo "\n"; echo "\n"; - echo " \n"; $x = 0; $order = 10; if (is_array($dialplan_details) && @sizeof($dialplan_details) != 0) { foreach($dialplan_details as $row) { if ($row["dialplan_detail_tag"] != "condition") { if ($row["dialplan_detail_tag"] == "action" && $row["dialplan_detail_type"] == "set" && strpos($row["dialplan_detail_data"], "accountcode") == 0) { continue; } //exclude set:accountcode actions - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo $destination->select('dialplan', 'dialplan_details['.$x.'][dialplan_detail_data]', $detail_action)."
\n"; } $order = $order + 10; $x++; } } unset($dialplan_details, $row); - echo "
\n"; if (strlen($row['dialplan_detail_uuid']) > 0) { echo " \n"; } @@ -1008,21 +1005,13 @@ $label = explode("XML", $data); $divider = ($row['dialplan_detail_type'] != '') ? ":" : null; $detail_action = $row['dialplan_detail_type'].$divider.$row['dialplan_detail_data']; - echo $destination->select('dialplan', 'dialplan_details['.$x.'][dialplan_detail_data]', $detail_action); - echo " "; - if (strlen($row['destination_uuid']) > 0) { - echo " ".$v_link_label_delete."\n"; - } - echo "
\n"; echo "\n"; echo "\n"; }