Update destination_edit.php
This commit is contained in:
@@ -148,7 +148,7 @@
|
|||||||
//check for all required data
|
//check for all required data
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."<br>\n"; }
|
if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."<br>\n"; }
|
||||||
if (strlen($destination_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_number']."<br>\n"; }
|
//if (strlen($destination_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_number']."<br>\n"; }
|
||||||
if (strlen($destination_context) == 0) { $msg .= $text['message-required']." ".$text['label-destination_context']."<br>\n"; }
|
if (strlen($destination_context) == 0) { $msg .= $text['message-required']." ".$text['label-destination_context']."<br>\n"; }
|
||||||
if (strlen($destination_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."<br>\n"; }
|
if (strlen($destination_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."<br>\n"; }
|
||||||
|
|
||||||
@@ -194,14 +194,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//get the fax information
|
//get the fax information
|
||||||
if (strlen($fax_uuid) > 0) {
|
if (is_uuid($fax_uuid)) {
|
||||||
$sql = "select * from v_fax ";
|
$sql = "select * from v_fax ";
|
||||||
$sql .= "where fax_uuid = :fax_uuid ";
|
$sql .= "where fax_uuid = :fax_uuid ";
|
||||||
if (!permission_exists('destination_domain')) {
|
//if (!permission_exists('destination_domain')) {
|
||||||
$sql .= "and domain_uuid = :domain_uuid ";
|
// $sql .= "and domain_uuid = :domain_uuid ";
|
||||||
}
|
//}
|
||||||
$parameters['fax_uuid'] = $fax_uuid;
|
$parameters['fax_uuid'] = $fax_uuid;
|
||||||
$parameters['domain_uuid'] = $domain_uuid;
|
//$parameters['domain_uuid'] = $domain_uuid;
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$row = $database->select($sql, $parameters, 'row');
|
$row = $database->select($sql, $parameters, 'row');
|
||||||
if (is_array($row) && @sizeof($row) != 0) {
|
if (is_array($row) && @sizeof($row) != 0) {
|
||||||
@@ -218,6 +218,19 @@
|
|||||||
unset($sql, $parameters, $row);
|
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 empty then get new uuid
|
||||||
if (!is_uuid($dialplan_uuid)) {
|
if (!is_uuid($dialplan_uuid)) {
|
||||||
$dialplan_uuid = uuid();
|
$dialplan_uuid = uuid();
|
||||||
@@ -901,9 +914,14 @@
|
|||||||
echo " ".$text['label-destination_number']."\n";
|
echo " ".$text['label-destination_number']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "<td class='vtable' align='left'>\n";
|
echo "<td class='vtable' align='left'>\n";
|
||||||
echo " <input class='formfld' type='text' name='destination_number' maxlength='255' value=\"".escape($destination_number)."\" required='required'>\n";
|
if (permission_exists('destination_number')) {
|
||||||
echo "<br />\n";
|
echo " <input class='formfld' type='text' name='destination_number' maxlength='255' value=\"".escape($destination_number)."\" required='required'>\n";
|
||||||
echo $text['description-destination_number']."\n";
|
echo "<br />\n";
|
||||||
|
echo $text['description-destination_number']."\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo escape($destination_number)."\n";
|
||||||
|
}
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
@@ -1177,4 +1195,4 @@
|
|||||||
//include the footer
|
//include the footer
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user