Destinations: Removed attempt to create a dialplan entry when no Action is selected. Resolves Issue 867.
This commit is contained in:
parent
0d9c51f753
commit
fe2c8ed41f
|
|
@ -99,8 +99,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
$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_caller_id_name) == 0) { $msg .= $text['message-required']." ".$text['label-destination_caller_id_name']."<br>\n"; }
|
|
||||||
//if (strlen($destination_caller_id_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_caller_id_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"; }
|
||||||
|
|
||||||
|
|
@ -146,6 +144,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
|
|
||||||
//add or update the dialplan if the destination number is set
|
//add or update the dialplan if the destination number is set
|
||||||
if ($add_dialplan) {
|
if ($add_dialplan) {
|
||||||
|
|
||||||
//get the array
|
//get the array
|
||||||
$dialplan_details = $_POST["dialplan_details"];
|
$dialplan_details = $_POST["dialplan_details"];
|
||||||
|
|
||||||
|
|
@ -363,7 +362,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
}
|
}
|
||||||
$orm->save($dialplan);
|
$orm->save($dialplan);
|
||||||
$dialplan_response = $orm->message;
|
$dialplan_response = $orm->message;
|
||||||
//print_r($dialplan_response);
|
|
||||||
|
|
||||||
//synchronize the xml config
|
//synchronize the xml config
|
||||||
save_dialplan_xml();
|
save_dialplan_xml();
|
||||||
|
|
@ -373,6 +371,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
$cache->delete("dialplan:".$destination_context);
|
$cache->delete("dialplan:".$destination_context);
|
||||||
|
|
||||||
} //add or update the dialplan if the destination number is set
|
} //add or update the dialplan if the destination number is set
|
||||||
|
else {
|
||||||
|
|
||||||
|
//remove empty dialplan details from POST array so doesn't attempt to insert below
|
||||||
|
unset($_POST["dialplan_details"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//get the destination_uuid
|
//get the destination_uuid
|
||||||
if (strlen($dialplan_response['uuid']) > 0) {
|
if (strlen($dialplan_response['uuid']) > 0) {
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ else {
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='destination_edit.php?id=".$row['destination_uuid']."'>".$row['destination_number']."</a></td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'><a href='destination_edit.php?id=".$row['destination_uuid']."'>".$row['destination_number']."</a></td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['destination_context']."</td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$row['destination_context']."</td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['destination_enabled'])."</td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['destination_enabled'])."</td>\n";
|
||||||
echo " <td valign='top' class='row_stylebg'>".$row['destination_description']."</td>\n";
|
echo " <td valign='top' class='row_stylebg'>".$row['destination_description']." </td>\n";
|
||||||
echo " <td class='list_control_icons'>";
|
echo " <td class='list_control_icons'>";
|
||||||
echo "<a href='destination_edit.php?id=".$row['destination_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
echo "<a href='destination_edit.php?id=".$row['destination_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||||
echo "<a href='destination_delete.php?id=".$row['destination_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
echo "<a href='destination_delete.php?id=".$row['destination_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue