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 "\n";
|
||||
}
|
||||
if (if_group("superadmin")) {
|
||||
echo " <select name='conference_center_greeting' class='formfld' onchange='changeToInput(this);'>\n";
|
||||
}
|
||||
else {
|
||||
echo " <select name='conference_center_greeting' class='formfld'>\n";
|
||||
}
|
||||
echo " <select name='conference_center_greeting' class='formfld' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null).">\n";
|
||||
echo " <option></option>\n";
|
||||
//recordings
|
||||
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)) {
|
||||
//this is a directory
|
||||
}
|
||||
else {
|
||||
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";
|
||||
}
|
||||
if (!is_dir($_SESSION['switch']['recordings']['dir']."/".$file)) {
|
||||
$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";
|
||||
if ($selected) { $tmp_selected = true; }
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
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
|
||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||
echo "<optgroup label='sounds'>\n";
|
||||
if (count($dir_array) > 0) {
|
||||
echo "<optgroup label='Sounds'>\n";
|
||||
foreach ($dir_array as $key => $value) {
|
||||
if (strlen($value) > 0) {
|
||||
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;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
} else {
|
||||
echo " <option value='$key'>$key</option>\n";
|
||||
}
|
||||
$selected = ($conference_center_greeting == $key) ? true : false;
|
||||
echo " <option value='".$key."' ".(($selected) ? "selected='selected'" : null).">".$key."</option>\n";
|
||||
if ($selected) { $tmp_selected = true; }
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//select
|
||||
if (strlen($conference_center_greeting) > 0) {
|
||||
if (if_group("superadmin")) {
|
||||
|
|
@ -441,9 +443,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo "<optgroup label='selected'>\n";
|
||||
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";
|
||||
} 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";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$conference_center_greeting."' selected='selected'>".$conference_center_greeting."</option>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ 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";
|
||||
|
|
@ -433,42 +433,50 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//recordings
|
||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
$tmp_selected = false;
|
||||
echo "<optgroup label='recordings'>\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";
|
||||
} elseif ($ivr_menu_greet_long == $file && strlen($ivr_menu_greet_long) > 0) {
|
||||
}
|
||||
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 {
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$file."'>".$file."</option>\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);
|
||||
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 {
|
||||
}
|
||||
else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\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";
|
||||
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}/") {
|
||||
|
|
@ -477,19 +485,22 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
if ($ivr_menu_greet_long == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo " <option value='$key'>$key</option>\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,7 +522,7 @@ 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";
|
||||
|
|
@ -520,42 +531,51 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//recordings
|
||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
$tmp_selected = false;
|
||||
echo "<optgroup label='recordings'>\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";
|
||||
} elseif ($ivr_menu_greet_short == $file && strlen($ivr_menu_greet_short) > 0) {
|
||||
}
|
||||
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 {
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$file."'>".$file."</option>\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);
|
||||
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 {
|
||||
}
|
||||
else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//sounds
|
||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||
echo "<optgroup label='sounds'>\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}/") {
|
||||
|
|
@ -564,21 +584,25 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
if ($ivr_menu_greet_short == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo " <option value='$key'>$key</option>\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,7 +862,7 @@ 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";
|
||||
|
|
@ -848,7 +872,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
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,25 +893,29 @@ 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);
|
||||
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 {
|
||||
}
|
||||
else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\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";
|
||||
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}/") {
|
||||
|
|
@ -896,19 +924,22 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
if ($ivr_menu_invalid_sound == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo " <option value='$key'>$key</option>\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";
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
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)) {
|
||||
|
|
@ -405,7 +405,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//sounds
|
||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||
echo " <optgroup label='sounds'>\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}/") {
|
||||
|
|
@ -421,6 +422,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
}
|
||||
}
|
||||
echo " </optgroup>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
|
|
|
|||
|
|
@ -1074,6 +1074,7 @@ function number_pad($number,$n) {
|
|||
}
|
||||
}
|
||||
}
|
||||
ksort($dir_array, SORT_STRING);
|
||||
closedir($dir_list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue