From 3e6ebe7d97baf893625ea3c1c7a9e459b8752641 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 1 May 2014 03:30:33 +0000 Subject: [PATCH] Only add the dialplan for dialplan -> destinations of the action is set --- app/destinations/destination_edit.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 5e47b2b3d0..b4bcbac31b 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -194,13 +194,15 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } //save the dialplan - $orm = new orm; - $orm->name('dialplans'); - if (isset($dialplan["dialplan_uuid"])) { - $orm->uuid($dialplan["dialplan_uuid"]); + if (count($dialplan["dialplan_details"]) > 0) { + $orm = new orm; + $orm->name('dialplans'); + if (isset($dialplan["dialplan_uuid"])) { + $orm->uuid($dialplan["dialplan_uuid"]); + } + $orm->save($dialplan); + $dialplan_response = $orm->message; } - $orm->save($dialplan); - $dialplan_response = $orm->message; //get the destination_uuid if (strlen($dialplan_response['uuid']) > 0) {