Add conference center to the destination select list. Hide the older conferences if there are no conferences in the database.
This commit is contained in:
parent
adf0a07a03
commit
090764151b
|
|
@ -599,6 +599,47 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
|
||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|
||||||
|
//list conference centers
|
||||||
|
$sql = "select * from v_conference_centers ";
|
||||||
|
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||||
|
$sql .= "order by conference_center_name asc ";
|
||||||
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
|
$prep_statement->execute();
|
||||||
|
$x = 0;
|
||||||
|
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
if (count($result) > 0) {
|
||||||
|
if ($select_type == "dialplan" || $select_type == "ivr") {
|
||||||
|
echo "<optgroup label='Conference Centers'>\n";
|
||||||
|
}
|
||||||
|
foreach ($result as &$row) {
|
||||||
|
$name = $row["conference_center_name"];
|
||||||
|
$extension = $row["conference_center_extension"];
|
||||||
|
$description = $row["conference_center_description"];
|
||||||
|
if ("execute_extension ".$extension." XML ".$_SESSION['context'] == $select_value || "execute_extension:".$extension." XML ".$_SESSION['context'] == $select_value) {
|
||||||
|
if ($select_type == "ivr") {
|
||||||
|
echo " <option value='menu-exec-app:execute_extension $extension XML ".$_SESSION['context']."' selected='selected'>".$name." ".$description."</option>\n";
|
||||||
|
}
|
||||||
|
if ($select_type == "dialplan") {
|
||||||
|
echo " <option value='execute_extension:$extension XML ".$_SESSION['context']."' selected='selected'>".$name." ".$description."</option>\n";
|
||||||
|
}
|
||||||
|
$selection_found = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ($select_type == "ivr") {
|
||||||
|
echo " <option value='menu-exec-app:execute_extension $extension XML ".$_SESSION['context']."'>".$name." ".$description."</option>\n";
|
||||||
|
}
|
||||||
|
if ($select_type == "dialplan") {
|
||||||
|
echo " <option value='execute_extension:".$extension." XML ".$_SESSION['context']."'>".$name." ".$description."</option>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$x++;
|
||||||
|
}
|
||||||
|
if ($select_type == "dialplan" || $select_type == "ivr") {
|
||||||
|
echo "</optgroup>\n";
|
||||||
|
}
|
||||||
|
unset ($prep_statement);
|
||||||
|
}
|
||||||
|
|
||||||
//list conferences
|
//list conferences
|
||||||
$sql = "select * from v_conferences ";
|
$sql = "select * from v_conferences ";
|
||||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||||
|
|
@ -607,6 +648,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$x = 0;
|
$x = 0;
|
||||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
if (count($result) > 0) {
|
||||||
if ($select_type == "dialplan" || $select_type == "ivr") {
|
if ($select_type == "dialplan" || $select_type == "ivr") {
|
||||||
echo "<optgroup label='Conferences'>\n";
|
echo "<optgroup label='Conferences'>\n";
|
||||||
}
|
}
|
||||||
|
|
@ -637,6 +679,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
}
|
||||||
|
|
||||||
//list destinations
|
//list destinations
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue