From 4a91e1044448972a5399c5ee68d5b6ee8ba4fa64 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Sun, 29 Jun 2014 06:39:40 +0000 Subject: [PATCH] Dialplan Edit: If action is bridge, and data is sofia/gateway/... initially show Gateway Name instead of UUID. UUID showed on click to edit. --- app/dialplan/dialplan_edit.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/dialplan/dialplan_edit.php b/app/dialplan/dialplan_edit.php index e3b5771578..a5c23af242 100644 --- a/app/dialplan/dialplan_edit.php +++ b/app/dialplan/dialplan_edit.php @@ -670,7 +670,22 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //data echo "\n"; if ($element['hidden']) { - echo " \n"; + if ($dialplan_detail_type == 'bridge') { + // parse out gateway uuid + $bridge_statement = explode('/', $dialplan_detail_data); + if ($bridge_statement[0] == 'sofia' && $bridge_statement[1] == 'gateway') { + $gateway_uuid = $bridge_statement[2]; + } + // retrieve gateway name from db + $sql = "select gateway from v_gateways where gateway_uuid = '".$gateway_uuid."' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + if (count($result) > 0) { $gateway_name = $result[0]['gateway']; } + unset ($prep_statement, $sql); + } + $dialplan_detail_data_mod = ($gateway_name != '') ? str_replace($gateway_uuid, $gateway_name, $dialplan_detail_data) : $dialplan_detail_data; + echo " \n"; } echo " \n"; echo "\n";