From c1aebc39a35395bf2dd8606d45b88607b84f4655 Mon Sep 17 00:00:00 2001 From: fusionate Date: Thu, 15 Jun 2023 23:44:59 +0000 Subject: [PATCH] Outbound Routes - Add: Integrate new Enabled toggle. --- .../dialplan_outbound_add.php | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/app/dialplan_outbound/dialplan_outbound_add.php b/app/dialplan_outbound/dialplan_outbound_add.php index 0ccd3283bd..7a05d9cfaa 100644 --- a/app/dialplan_outbound/dialplan_outbound_add.php +++ b/app/dialplan_outbound/dialplan_outbound_add.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2022 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -98,7 +98,7 @@ if ($gateway_type == "gateway") { $gateway_array = explode(":",$gateway); $gateway_uuid = $gateway_array[0]; - $gateway_name = $gateway_array[1]; + $gateway_name = $gateway_array[1] ?? null; } else { $gateway_name = ''; @@ -171,10 +171,8 @@ $gateway_3_name = ''; } //set additional variables - $dialplan_enabled = $_POST["dialplan_enabled"]; + $dialplan_enabled = $_POST["dialplan_enabled"] ?? 'true'; $dialplan_description = $_POST["dialplan_description"]; - //set default to enabled - if (empty($dialplan_enabled)) { $dialplan_enabled = "true"; } } //process the http form values @@ -189,6 +187,7 @@ } //check for all required data + $msg = ''; if (empty($gateway)) { $msg .= $text['message-provide'].": ".$text['label-gateway-name']."
\n"; } //if (empty($gateway_2)) { $msg .= "Please provide: Alternat 1
\n"; } //if (empty($gateway_3)) { $msg .= "Please provide: Alternat 2
\n"; } @@ -1305,22 +1304,19 @@ function type_onchange(dialplan_detail_type) { echo "\n"; echo " ".$text['label-enabled']."\n"; echo "\n"; - echo "\n"; - echo " \n"; + echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } - if (!empty($dialplan_enabled) && $dialplan_enabled == "false") { - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; echo "
\n"; echo $text['description-enabled']."\n"; echo "\n"; @@ -1350,4 +1346,4 @@ function type_onchange(dialplan_detail_type) { //show the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file