Conference Center: Add ability to use a Phrase for the Greeting, resolving Issue 921 and Issue 818.
This commit is contained in:
+133
-102
@@ -424,72 +424,83 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<select name='ivr_menu_greet_long' class='formfld' style='width: 400px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null).">\n";
|
||||
//misc optgroup
|
||||
if (if_group("superadmin")) {
|
||||
echo "<optgroup label='misc'>\n";
|
||||
echo "<optgroup label='Misc'>\n";
|
||||
echo " <option value='phrase:'>phrase:</option>\n";
|
||||
echo " <option value='say:'>say:</option>\n";
|
||||
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//recordings
|
||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
$tmp_selected = false;
|
||||
echo "<optgroup label='recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$name = $row["recording_name"];
|
||||
$file = $row["recording_filename"];
|
||||
if ($ivr_menu_greet_long == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_long) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
||||
} elseif ($ivr_menu_greet_long == $file && strlen($ivr_menu_greet_long) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
||||
} else {
|
||||
echo " <option value='".$file."'>".$file."</option>\n";
|
||||
if (count($recordings) > 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$name = $row["recording_name"];
|
||||
$file = $row["recording_filename"];
|
||||
if ($ivr_menu_greet_long == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_long) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
||||
}
|
||||
else if ($ivr_menu_greet_long == $file && strlen($ivr_menu_greet_long) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$file."'>".$file."</option>\n";
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//phrases
|
||||
echo "<optgroup label='phrases'>\n";
|
||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
if ($ivr_menu_greet_long == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||
} else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
||||
if (count($result) > 0) {
|
||||
echo "<optgroup label='Phrases'>\n";
|
||||
foreach ($result as &$row) {
|
||||
if ($ivr_menu_greet_long == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo "</optgroup>\n";
|
||||
//sounds
|
||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||
echo "<optgroup label='sounds'>\n";
|
||||
foreach ($dir_array as $key => $value) {
|
||||
if (strlen($value) > 0) {
|
||||
if (substr($ivr_menu_greet_long, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
||||
$ivr_menu_greet_long = substr($ivr_menu_greet_long, 71);
|
||||
}
|
||||
if ($ivr_menu_greet_long == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
} else {
|
||||
echo " <option value='$key'>$key</option>\n";
|
||||
if (count($dir_array) > 0) {
|
||||
echo "<optgroup label='Sounds'>\n";
|
||||
foreach ($dir_array as $key => $value) {
|
||||
if (strlen($value) > 0) {
|
||||
if (substr($ivr_menu_greet_long, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
||||
$ivr_menu_greet_long = substr($ivr_menu_greet_long, 71);
|
||||
}
|
||||
if ($ivr_menu_greet_long == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='$key'>$key</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
//select
|
||||
if (if_group("superadmin")) {
|
||||
if (!$tmp_selected) {
|
||||
echo "<optgroup label='selected'>\n";
|
||||
echo "<optgroup label='Selected'>\n";
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_long)) {
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
||||
} elseif (substr($ivr_menu_greet_long, -3) == "wav" || substr($ivr_menu_greet_long, -3) == "mp3") {
|
||||
}
|
||||
else if (substr($ivr_menu_greet_long, -3) == "wav" || substr($ivr_menu_greet_long, -3) == "mp3") {
|
||||
echo " <option value='".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
@@ -511,74 +522,87 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <option></option>\n";
|
||||
//misc
|
||||
if (if_group("superadmin")) {
|
||||
echo "<optgroup label='misc'>\n";
|
||||
echo "<optgroup label='Misc'>\n";
|
||||
echo " <option value='phrase:'>phrase:</option>\n";
|
||||
echo " <option value='say:'>say:</option>\n";
|
||||
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//recordings
|
||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
$tmp_selected = false;
|
||||
echo "<optgroup label='recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$name = $row["recording_name"];
|
||||
$file = $row["recording_filename"];
|
||||
if ($ivr_menu_greet_short == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_short) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
||||
} elseif ($ivr_menu_greet_short == $file && strlen($ivr_menu_greet_short) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
||||
} else {
|
||||
echo " <option value='".$file."'>".$file."</option>\n";
|
||||
if (count($recordings) > 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$name = $row["recording_name"];
|
||||
$file = $row["recording_filename"];
|
||||
if ($ivr_menu_greet_short == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_short) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
||||
}
|
||||
else if ($ivr_menu_greet_short == $file && strlen($ivr_menu_greet_short) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$file."'>".$file."</option>\n";
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//phrases
|
||||
echo "<optgroup label='phrases'>\n";
|
||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
if ($ivr_menu_greet_short == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||
} else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
||||
if (count($result) > 0) {
|
||||
echo "<optgroup label='Phrases'>\n";
|
||||
foreach ($result as &$row) {
|
||||
if ($ivr_menu_greet_short == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo "</optgroup>\n";
|
||||
|
||||
//sounds
|
||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||
echo "<optgroup label='sounds'>\n";
|
||||
foreach ($dir_array as $key => $value) {
|
||||
if (strlen($value) > 0) {
|
||||
if (substr($ivr_menu_greet_short, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
||||
$ivr_menu_greet_short = substr($ivr_menu_greet_short, 71);
|
||||
}
|
||||
if ($ivr_menu_greet_short == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
} else {
|
||||
echo " <option value='$key'>$key</option>\n";
|
||||
if (count($dir_array) > 0) {
|
||||
echo "<optgroup label='Sounds'>\n";
|
||||
foreach ($dir_array as $key => $value) {
|
||||
if (strlen($value) > 0) {
|
||||
if (substr($ivr_menu_greet_short, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
||||
$ivr_menu_greet_short = substr($ivr_menu_greet_short, 71);
|
||||
}
|
||||
if ($ivr_menu_greet_short == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='$key'>$key</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
//select
|
||||
if (if_group("superadmin")) {
|
||||
if (!$tmp_selected && strlen($ivr_menu_greet_short) > 0) {
|
||||
echo "<optgroup label='selected'>\n";
|
||||
echo "<optgroup label='Selected'>\n";
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_short)) {
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_short."' selected='selected'>".$ivr_menu_greet_short."</option>\n";
|
||||
} elseif (substr($ivr_menu_greet_short, -3) == "wav" || substr($ivr_menu_greet_short, -3) == "mp3") {
|
||||
}
|
||||
else if (substr($ivr_menu_greet_short, -3) == "wav" || substr($ivr_menu_greet_short, -3) == "mp3") {
|
||||
echo " <option value='".$ivr_menu_greet_short."' selected='selected'>".$ivr_menu_greet_short."</option>\n";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$ivr_menu_greet_short."' selected='selected'>".$ivr_menu_greet_short."</option>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
@@ -838,17 +862,17 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<select name='ivr_menu_invalid_sound' class='formfld' style='width: 400px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null)." required='required'>\n";
|
||||
//misc optgroup
|
||||
if (if_group("superadmin")) {
|
||||
echo "<optgroup label='misc'>\n";
|
||||
echo "<optgroup label='Misc'>\n";
|
||||
echo " <option value='phrase:'>phrase:</option>\n";
|
||||
echo " <option value='say:'>say:</option>\n";
|
||||
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//recordings
|
||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
$tmp_selected = false;
|
||||
$files = Array();
|
||||
echo "<optgroup label='recordings'>\n";
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
while($file = readdir($dh)) {
|
||||
if($file != "." && $file != ".." && $file[0] != '.') {
|
||||
if(is_dir($_SESSION['switch']['recordings']['dir'] . "/" . $file)) {
|
||||
@@ -869,46 +893,53 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//phrases
|
||||
echo "<optgroup label='phrases'>\n";
|
||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
if ($ivr_menu_invalid_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||
} else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
||||
if (count($result) > 0) {
|
||||
echo "<optgroup label='Phrases'>\n";
|
||||
foreach ($result as &$row) {
|
||||
if ($ivr_menu_invalid_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo "</optgroup>\n";
|
||||
//sounds
|
||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||
echo "<optgroup label='sounds'>\n";
|
||||
foreach ($dir_array as $key => $value) {
|
||||
if (strlen($value) > 0) {
|
||||
if (substr($ivr_menu_invalid_sound, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
||||
$ivr_menu_invalid_sound = substr($ivr_menu_invalid_sound, 71);
|
||||
}
|
||||
if ($ivr_menu_invalid_sound == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
} else {
|
||||
echo " <option value='$key'>$key</option>\n";
|
||||
if (count($dir_array) > 0) {
|
||||
echo "<optgroup label='Sounds'>\n";
|
||||
foreach ($dir_array as $key => $value) {
|
||||
if (strlen($value) > 0) {
|
||||
if (substr($ivr_menu_invalid_sound, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
||||
$ivr_menu_invalid_sound = substr($ivr_menu_invalid_sound, 71);
|
||||
}
|
||||
if ($ivr_menu_invalid_sound == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='$key'>$key</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
//select
|
||||
if (if_group("superadmin")) {
|
||||
if (!$tmp_selected) {
|
||||
echo "<optgroup label='selected'>\n";
|
||||
echo "<optgroup label='Selected'>\n";
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_invalid_sound)) {
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
||||
} elseif (substr($ivr_menu_invalid_sound, -3) == "wav" || substr($ivr_menu_invalid_sound, -3) == "mp3") {
|
||||
}
|
||||
else if (substr($ivr_menu_invalid_sound, -3) == "wav" || substr($ivr_menu_invalid_sound, -3) == "mp3") {
|
||||
echo " <option value='".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
|
||||
Reference in New Issue
Block a user