diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php
index 90bd264dfe..ec0f72e5ec 100644
--- a/app/destinations/destination_edit.php
+++ b/app/destinations/destination_edit.php
@@ -148,7 +148,7 @@
//check for all required data
$msg = '';
if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."
\n"; }
- if (strlen($destination_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_number']."
\n"; }
+ //if (strlen($destination_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_number']."
\n"; }
if (strlen($destination_context) == 0) { $msg .= $text['message-required']." ".$text['label-destination_context']."
\n"; }
if (strlen($destination_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."
\n"; }
@@ -194,14 +194,14 @@
}
//get the fax information
- if (strlen($fax_uuid) > 0) {
+ if (is_uuid($fax_uuid)) {
$sql = "select * from v_fax ";
$sql .= "where fax_uuid = :fax_uuid ";
- if (!permission_exists('destination_domain')) {
- $sql .= "and domain_uuid = :domain_uuid ";
- }
+ //if (!permission_exists('destination_domain')) {
+ // $sql .= "and domain_uuid = :domain_uuid ";
+ //}
$parameters['fax_uuid'] = $fax_uuid;
- $parameters['domain_uuid'] = $domain_uuid;
+ //$parameters['domain_uuid'] = $domain_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
@@ -218,6 +218,19 @@
unset($sql, $parameters, $row);
}
+ //get the destination_number
+ if ($action == 'update' && !permission_exists('destination_number') && is_uuid($destination_uuid)) {
+ $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) {
+ $destination_number = $row["destination_number"];
+ }
+ unset($sql, $parameters, $row);
+ }
+
//if empty then get new uuid
if (!is_uuid($dialplan_uuid)) {
$dialplan_uuid = uuid();
@@ -901,9 +914,14 @@
echo " ".$text['label-destination_number']."\n";
echo "\n";
echo "