Dialplan Edit: If action is bridge, and data is sofia/gateway/... initially show Gateway Name instead of UUID. UUID showed on click to edit.

This commit is contained in:
Nate Jones
2014-06-29 06:39:40 +00:00
parent 9aa619f9cb
commit 4a91e10444

View File

@@ -670,7 +670,22 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//data
echo "<td class='vtablerow' onclick=\"label_to_form('label_dialplan_detail_data_".$x."','dialplan_detail_data_".$x."');\" style='width: 100%;' nowrap='nowrap'>\n";
if ($element['hidden']) {
echo " <label id=\"label_dialplan_detail_data_".$x."\">".$dialplan_detail_data."</label>\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 " <label id=\"label_dialplan_detail_data_".$x."\">".$dialplan_detail_data_mod."</label>\n";
}
echo " <input id='dialplan_detail_data_".$x."' name='dialplan_details[".$x."][dialplan_detail_data]' class='formfld' type='text' style='width: 100%; ".$element['visibility']."' placeholder='' value=\"".htmlspecialchars($dialplan_detail_data)."\">\n";
echo "</td>\n";