Fix problem viewing status -> agent status on single tenant systems.

This commit is contained in:
Mark Crane
2013-07-29 22:52:11 +00:00
parent 028175388e
commit ff1993cda9
2 changed files with 40 additions and 48 deletions

View File

@@ -31,7 +31,7 @@ include "root.php";
public $domain_uuid;
public $domain_name;
public $extension_uuid;
private $extension;
public $extension;
public $enabled;
private $dial_string;
@@ -68,13 +68,23 @@ include "root.php";
//determine whether to update the dial string
$sql = "select * from v_extensions ";
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
$sql .= "and extension_uuid = '".$this->extension_uuid."' ";
if ($this->extension_uuid) > 0) {
$sql .= "and extension_uuid = '".$this->extension_uuid."' ";
}
else {
$sql .= "and extension = '".$this->extension."' ";
}
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
if (count($result) > 0) {
foreach ($result as &$row) {
$this->extension = $row["extension"];
if ($this->extension_uuid) == 0) {
$this->extension_uuid = $row["extension_uuid"];
}
if ($this->extension) == 0) {
$this->extension = $row["extension"];
}
}
}
unset ($prep_statement);