Fix. Display correct gateway name in URI on `Fax Active` page

This commit is contained in:
Alexey Melnichuk 2016-03-23 14:02:33 +03:00
parent b14dbab82a
commit f7b7da0dd4
2 changed files with 19 additions and 0 deletions

View File

@ -48,6 +48,18 @@ else {
$fax_uuid = check_str($_REQUEST["id"]);
}
//load gateways into a session variable
$sql = "select gateway_uuid, domain_uuid, gateway from v_gateways where enabled = 'true'";
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as $row) {
$_SESSION['gateways'][$row['gateway_uuid']] = $row['gateway'];
}
}
unset($sql, $prep_statement, $result, $row);
//show the header
$document['title'] = $text['title'];
require_once "resources/header.php";

View File

@ -202,6 +202,13 @@ HERE;
$task_files .= '<br/>&nbsp;' . basename($row['greeting']);
}
//replace gateway uuid with name
if (sizeof($_SESSION['gateways']) > 0) {
foreach ($_SESSION['gateways'] as $gateway_uuid => $gateway_name) {
$fax_uri = str_replace($gateway_uuid, $gateway_name, $fax_uri);
}
}
echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>" . $fax_server . "&nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>" . $task_enabled . "&nbsp;</td>\n";