diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php
index ce9024e9e0..fc6f9467a6 100644
--- a/app/destinations/destination_edit.php
+++ b/app/destinations/destination_edit.php
@@ -64,10 +64,19 @@ else {
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
- $msg = '';
- if ($action == "update") {
- $destination_uuid = check_str($_POST["destination_uuid"]);
- }
+ //get the uuid
+ if ($action == "update") {
+ $destination_uuid = check_str($_POST["destination_uuid"]);
+ }
+
+ //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_caller_id_name) == 0) { $msg .= $text['message-required']." ".$text['label-destination_caller_id_name']."
\n"; }
+ //if (strlen($destination_caller_id_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_caller_id_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"; }
//check for duplicates
$sql = "select count(*) as num_rows from v_destinations ";
@@ -81,15 +90,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
}
- //check for all required data
- //if (strlen($dialplan_uuid) == 0) { $msg .= "Please provide: Dialplan UUID
\n"; }
- //if (strlen($destination_type) == 0) { $msg .= "Please provide: Name
\n"; }
- //if (strlen($destination_number) == 0) { $msg .= "Please provide: Extension
\n"; }
- //if (strlen($destination_caller_id_name) == 0) { $msg .= "Please provide: Caller ID Name
\n"; }
- //if (strlen($destination_caller_id_number) == 0) { $msg .= "Please provide: Caller ID Number
\n"; }
- //if (strlen($destination_context) == 0) { $msg .= "Please provide: Context
\n"; }
- //if (strlen($destination_enabled) == 0) { $msg .= "Please provide: Enabled
\n"; }
- //if (strlen($destination_description) == 0) { $msg .= "Please provide: Description
\n"; }
+ //show the message
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";