Conference Center: Add ability to use a Phrase for the Greeting, resolving Issue 921 and Issue 818.
This commit is contained in:
parent
4477b452db
commit
25715dd290
|
|
@ -385,55 +385,57 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
echo "</script>\n";
|
echo "</script>\n";
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
if (if_group("superadmin")) {
|
echo " <select name='conference_center_greeting' class='formfld' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null).">\n";
|
||||||
echo " <select name='conference_center_greeting' class='formfld' onchange='changeToInput(this);'>\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo " <select name='conference_center_greeting' class='formfld'>\n";
|
|
||||||
}
|
|
||||||
echo " <option></option>\n";
|
echo " <option></option>\n";
|
||||||
//recordings
|
//recordings
|
||||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||||
$tmp_selected = false;
|
$tmp_selected = false;
|
||||||
$files = Array();
|
$files = Array();
|
||||||
echo "<optgroup label='recordings'>\n";
|
echo "<optgroup label='Recordings'>\n";
|
||||||
while($file = readdir($dh)) {
|
while ($file = readdir($dh)) {
|
||||||
if($file != "." && $file != ".." && $file[0] != '.') {
|
if ($file != "." && $file != ".." && $file[0] != '.') {
|
||||||
if(is_dir($_SESSION['switch']['recordings']['dir'] . "/" . $file)) {
|
if (!is_dir($_SESSION['switch']['recordings']['dir']."/".$file)) {
|
||||||
//this is a directory
|
$selected = ($conference_center_greeting == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($conference_center_greeting) > 0) ? true : false;
|
||||||
}
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' ".(($selected) ? "selected='selected'" : null).">".$file."</option>\n";
|
||||||
else {
|
if ($selected) { $tmp_selected = true; }
|
||||||
if ($conference_center_greeting == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($conference_center_greeting) > 0) {
|
|
||||||
$tmp_selected = true;
|
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected=\"selected\">".$file."</option>\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."'>".$file."</option>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
|
//phrases
|
||||||
|
$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);
|
||||||
|
if (count($result) > 0) {
|
||||||
|
echo "<optgroup label='Phrases'>\n";
|
||||||
|
foreach ($result as &$row) {
|
||||||
|
$selected = ($conference_center_greeting == "phrase:".$row["phrase_name"].".".$domain_uuid) ? true : false;
|
||||||
|
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' ".(($selected) ? "selected='selected'" : null).">".$row["phrase_name"]."</option>\n";
|
||||||
|
if ($selected) { $tmp_selected = true; }
|
||||||
|
}
|
||||||
|
unset ($prep_statement);
|
||||||
|
echo "</optgroup>\n";
|
||||||
|
}
|
||||||
//sounds
|
//sounds
|
||||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||||
echo "<optgroup label='sounds'>\n";
|
if (count($dir_array) > 0) {
|
||||||
foreach ($dir_array as $key => $value) {
|
echo "<optgroup label='Sounds'>\n";
|
||||||
if (strlen($value) > 0) {
|
foreach ($dir_array as $key => $value) {
|
||||||
if (substr($conference_center_greeting, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
if (strlen($value) > 0) {
|
||||||
$conference_center_greeting = substr($conference_center_greeting, 71);
|
if (substr($conference_center_greeting, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
||||||
}
|
$conference_center_greeting = substr($conference_center_greeting, 71);
|
||||||
if ($conference_center_greeting == $key) {
|
}
|
||||||
$tmp_selected = true;
|
$selected = ($conference_center_greeting == $key) ? true : false;
|
||||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
echo " <option value='".$key."' ".(($selected) ? "selected='selected'" : null).">".$key."</option>\n";
|
||||||
} else {
|
if ($selected) { $tmp_selected = true; }
|
||||||
echo " <option value='$key'>$key</option>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
|
||||||
//select
|
//select
|
||||||
if (strlen($conference_center_greeting) > 0) {
|
if (strlen($conference_center_greeting) > 0) {
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
|
|
@ -441,9 +443,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
echo "<optgroup label='selected'>\n";
|
echo "<optgroup label='selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$conference_center_greeting)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$conference_center_greeting)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$conference_center_greeting."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$conference_center_greeting."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
||||||
} elseif (substr($conference_center_greeting, -3) == "wav" || substr($conference_center_greeting, -3) == "mp3") {
|
}
|
||||||
|
else if (substr($conference_center_greeting, -3) == "wav" || substr($conference_center_greeting, -3) == "mp3") {
|
||||||
echo " <option value='".$conference_center_greeting."' selected='selected'>".$conference_center_greeting."</option>\n";
|
echo " <option value='".$conference_center_greeting."' selected='selected'>".$conference_center_greeting."</option>\n";
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo " <option value='".$conference_center_greeting."' selected='selected'>".$conference_center_greeting."</option>\n";
|
echo " <option value='".$conference_center_greeting."' selected='selected'>".$conference_center_greeting."</option>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
|
|
@ -451,7 +455,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
unset($tmp_selected);
|
unset($tmp_selected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo " </select>\n";
|
echo " </select>\n";
|
||||||
echo "<br />\n";
|
echo "<br />\n";
|
||||||
echo $text['description-greeting']."\n";
|
echo $text['description-greeting']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
|
|
|
||||||
|
|
@ -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";
|
echo "<select name='ivr_menu_greet_long' class='formfld' style='width: 400px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null).">\n";
|
||||||
//misc optgroup
|
//misc optgroup
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
echo "<optgroup label='misc'>\n";
|
echo "<optgroup label='Misc'>\n";
|
||||||
echo " <option value='phrase:'>phrase:</option>\n";
|
echo " <option value='phrase:'>phrase:</option>\n";
|
||||||
echo " <option value='say:'>say:</option>\n";
|
echo " <option value='say:'>say:</option>\n";
|
||||||
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
//recordings
|
//recordings
|
||||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||||
$tmp_selected = false;
|
$tmp_selected = false;
|
||||||
echo "<optgroup label='recordings'>\n";
|
if (count($recordings) > 0) {
|
||||||
foreach ($recordings as &$row) {
|
echo "<optgroup label='Recordings'>\n";
|
||||||
$name = $row["recording_name"];
|
foreach ($recordings as &$row) {
|
||||||
$file = $row["recording_filename"];
|
$name = $row["recording_name"];
|
||||||
if ($ivr_menu_greet_long == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_long) > 0) {
|
$file = $row["recording_filename"];
|
||||||
$tmp_selected = true;
|
if ($ivr_menu_greet_long == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_long) > 0) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
$tmp_selected = true;
|
||||||
} elseif ($ivr_menu_greet_long == $file && strlen($ivr_menu_greet_long) > 0) {
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
||||||
$tmp_selected = true;
|
}
|
||||||
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
else if ($ivr_menu_greet_long == $file && strlen($ivr_menu_greet_long) > 0) {
|
||||||
} else {
|
$tmp_selected = true;
|
||||||
echo " <option value='".$file."'>".$file."</option>\n";
|
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo " <option value='".$file."'>".$file."</option>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
|
||||||
}
|
}
|
||||||
//phrases
|
//phrases
|
||||||
echo "<optgroup label='phrases'>\n";
|
|
||||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
foreach ($result as &$row) {
|
if (count($result) > 0) {
|
||||||
if ($ivr_menu_greet_long == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
echo "<optgroup label='Phrases'>\n";
|
||||||
$tmp_selected = true;
|
foreach ($result as &$row) {
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
if ($ivr_menu_greet_long == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||||
} else {
|
$tmp_selected = true;
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
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
|
//sounds
|
||||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||||
echo "<optgroup label='sounds'>\n";
|
if (count($dir_array) > 0) {
|
||||||
foreach ($dir_array as $key => $value) {
|
echo "<optgroup label='Sounds'>\n";
|
||||||
if (strlen($value) > 0) {
|
foreach ($dir_array as $key => $value) {
|
||||||
if (substr($ivr_menu_greet_long, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
if (strlen($value) > 0) {
|
||||||
$ivr_menu_greet_long = substr($ivr_menu_greet_long, 71);
|
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;
|
if ($ivr_menu_greet_long == $key) {
|
||||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
$tmp_selected = true;
|
||||||
} else {
|
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||||
echo " <option value='$key'>$key</option>\n";
|
}
|
||||||
|
else {
|
||||||
|
echo " <option value='$key'>$key</option>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
|
||||||
//select
|
//select
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected) {
|
||||||
echo "<optgroup label='selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_long)) {
|
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";
|
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 " <option value='".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
|
|
@ -511,74 +522,87 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
echo " <option></option>\n";
|
echo " <option></option>\n";
|
||||||
//misc
|
//misc
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
echo "<optgroup label='misc'>\n";
|
echo "<optgroup label='Misc'>\n";
|
||||||
echo " <option value='phrase:'>phrase:</option>\n";
|
echo " <option value='phrase:'>phrase:</option>\n";
|
||||||
echo " <option value='say:'>say:</option>\n";
|
echo " <option value='say:'>say:</option>\n";
|
||||||
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
//recordings
|
//recordings
|
||||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||||
$tmp_selected = false;
|
$tmp_selected = false;
|
||||||
echo "<optgroup label='recordings'>\n";
|
if (count($recordings) > 0) {
|
||||||
foreach ($recordings as &$row) {
|
echo "<optgroup label='Recordings'>\n";
|
||||||
$name = $row["recording_name"];
|
foreach ($recordings as &$row) {
|
||||||
$file = $row["recording_filename"];
|
$name = $row["recording_name"];
|
||||||
if ($ivr_menu_greet_short == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_short) > 0) {
|
$file = $row["recording_filename"];
|
||||||
$tmp_selected = true;
|
if ($ivr_menu_greet_short == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_short) > 0) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
$tmp_selected = true;
|
||||||
} elseif ($ivr_menu_greet_short == $file && strlen($ivr_menu_greet_short) > 0) {
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
||||||
$tmp_selected = true;
|
}
|
||||||
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
else if ($ivr_menu_greet_short == $file && strlen($ivr_menu_greet_short) > 0) {
|
||||||
} else {
|
$tmp_selected = true;
|
||||||
echo " <option value='".$file."'>".$file."</option>\n";
|
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo " <option value='".$file."'>".$file."</option>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
|
||||||
}
|
}
|
||||||
//phrases
|
//phrases
|
||||||
echo "<optgroup label='phrases'>\n";
|
|
||||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
foreach ($result as &$row) {
|
if (count($result) > 0) {
|
||||||
if ($ivr_menu_greet_short == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
echo "<optgroup label='Phrases'>\n";
|
||||||
$tmp_selected = true;
|
foreach ($result as &$row) {
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
if ($ivr_menu_greet_short == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||||
} else {
|
$tmp_selected = true;
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
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);
|
unset ($prep_statement);
|
||||||
echo "</optgroup>\n";
|
|
||||||
//sounds
|
//sounds
|
||||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||||
echo "<optgroup label='sounds'>\n";
|
if (count($dir_array) > 0) {
|
||||||
foreach ($dir_array as $key => $value) {
|
echo "<optgroup label='Sounds'>\n";
|
||||||
if (strlen($value) > 0) {
|
foreach ($dir_array as $key => $value) {
|
||||||
if (substr($ivr_menu_greet_short, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
if (strlen($value) > 0) {
|
||||||
$ivr_menu_greet_short = substr($ivr_menu_greet_short, 71);
|
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;
|
if ($ivr_menu_greet_short == $key) {
|
||||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
$tmp_selected = true;
|
||||||
} else {
|
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||||
echo " <option value='$key'>$key</option>\n";
|
}
|
||||||
|
else {
|
||||||
|
echo " <option value='$key'>$key</option>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
|
||||||
//select
|
//select
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected && strlen($ivr_menu_greet_short) > 0) {
|
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)) {
|
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";
|
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";
|
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 " <option value='".$ivr_menu_greet_short."' selected='selected'>".$ivr_menu_greet_short."</option>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\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";
|
echo "<select name='ivr_menu_invalid_sound' class='formfld' style='width: 400px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null)." required='required'>\n";
|
||||||
//misc optgroup
|
//misc optgroup
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
echo "<optgroup label='misc'>\n";
|
echo "<optgroup label='Misc'>\n";
|
||||||
echo " <option value='phrase:'>phrase:</option>\n";
|
echo " <option value='phrase:'>phrase:</option>\n";
|
||||||
echo " <option value='say:'>say:</option>\n";
|
echo " <option value='say:'>say:</option>\n";
|
||||||
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
//recordings
|
//recordings
|
||||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||||
$tmp_selected = false;
|
$tmp_selected = false;
|
||||||
$files = Array();
|
$files = Array();
|
||||||
echo "<optgroup label='recordings'>\n";
|
echo "<optgroup label='Recordings'>\n";
|
||||||
while($file = readdir($dh)) {
|
while($file = readdir($dh)) {
|
||||||
if($file != "." && $file != ".." && $file[0] != '.') {
|
if($file != "." && $file != ".." && $file[0] != '.') {
|
||||||
if(is_dir($_SESSION['switch']['recordings']['dir'] . "/" . $file)) {
|
if(is_dir($_SESSION['switch']['recordings']['dir'] . "/" . $file)) {
|
||||||
|
|
@ -869,46 +893,53 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
//phrases
|
//phrases
|
||||||
echo "<optgroup label='phrases'>\n";
|
|
||||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
foreach ($result as &$row) {
|
if (count($result) > 0) {
|
||||||
if ($ivr_menu_invalid_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
echo "<optgroup label='Phrases'>\n";
|
||||||
$tmp_selected = true;
|
foreach ($result as &$row) {
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
if ($ivr_menu_invalid_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||||
} else {
|
$tmp_selected = true;
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
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
|
//sounds
|
||||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||||
echo "<optgroup label='sounds'>\n";
|
if (count($dir_array) > 0) {
|
||||||
foreach ($dir_array as $key => $value) {
|
echo "<optgroup label='Sounds'>\n";
|
||||||
if (strlen($value) > 0) {
|
foreach ($dir_array as $key => $value) {
|
||||||
if (substr($ivr_menu_invalid_sound, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
if (strlen($value) > 0) {
|
||||||
$ivr_menu_invalid_sound = substr($ivr_menu_invalid_sound, 71);
|
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;
|
if ($ivr_menu_invalid_sound == $key) {
|
||||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
$tmp_selected = true;
|
||||||
} else {
|
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||||
echo " <option value='$key'>$key</option>\n";
|
}
|
||||||
|
else {
|
||||||
|
echo " <option value='$key'>$key</option>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo "</optgroup>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
|
||||||
//select
|
//select
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected) {
|
||||||
echo "<optgroup label='selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_invalid_sound)) {
|
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";
|
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 " <option value='".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||||
$tmp_selected = false;
|
$tmp_selected = false;
|
||||||
$files = Array();
|
$files = Array();
|
||||||
echo " <optgroup label='recordings'>\n";
|
echo " <optgroup label='Recordings'>\n";
|
||||||
while($file = readdir($dh)) {
|
while($file = readdir($dh)) {
|
||||||
if($file != "." && $file != ".." && $file[0] != '.') {
|
if($file != "." && $file != ".." && $file[0] != '.') {
|
||||||
if(is_dir($_SESSION['switch']['recordings']['dir'] . "/" . $file)) {
|
if(is_dir($_SESSION['switch']['recordings']['dir'] . "/" . $file)) {
|
||||||
|
|
@ -405,22 +405,24 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
//sounds
|
//sounds
|
||||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||||
echo " <optgroup label='sounds'>\n";
|
if (count($dir_array) > 0) {
|
||||||
foreach ($dir_array as $key => $value) {
|
echo " <optgroup label='Sounds'>\n";
|
||||||
if (strlen($value) > 0) {
|
foreach ($dir_array as $key => $value) {
|
||||||
if (substr($ivr_menu_greet_long, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
if (strlen($value) > 0) {
|
||||||
$ivr_menu_greet_long = substr($ivr_menu_greet_long, 71);
|
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;
|
if ($ivr_menu_greet_long == $key) {
|
||||||
echo "<option value='$key' selected='selected'>$key</option>\n";
|
$tmp_selected = true;
|
||||||
}
|
echo "<option value='$key' selected='selected'>$key</option>\n";
|
||||||
else {
|
}
|
||||||
echo "<option value='$key'>$key</option>\n";
|
else {
|
||||||
|
echo "<option value='$key'>$key</option>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo " </optgroup>\n";
|
||||||
}
|
}
|
||||||
echo " </optgroup>\n";
|
|
||||||
echo " </select>\n";
|
echo " </select>\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " <td class='vtable'>\n";
|
echo " <td class='vtable'>\n";
|
||||||
|
|
|
||||||
|
|
@ -1074,6 +1074,7 @@ function number_pad($number,$n) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ksort($dir_array, SORT_STRING);
|
||||||
closedir($dir_list);
|
closedir($dir_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue