Voicemail: Provide a select box to choose a Greeting, instead of requesting the Greeting ID to be entered.

This commit is contained in:
reliberate 2016-02-25 12:06:45 -07:00
parent bfb38eec0d
commit 42e531d31a
2 changed files with 706 additions and 687 deletions

View File

@ -341,16 +341,16 @@ $text['label-greetings']['uk'] = "Привітання";
$text['label-greetings']['de-at'] = "Begrüßung";
$text['label-greetings']['he'] = "";
$text['label-greeting_id']['en-us'] = "Greeting ID";
$text['label-greeting_id']['es-cl'] = "ID de bienvenida";
$text['label-greeting_id']['pt-pt'] = "ID de Saudação";
$text['label-greeting_id']['fr-fr'] = "ID d'accueil";
$text['label-greeting_id']['pt-br'] = "ID de saudação";
$text['label-greeting_id']['pl'] = "ID Powitania";
$text['label-greeting_id']['sv-se'] = "Hälsning ID";
$text['label-greeting_id']['uk'] = "ID привітання";
$text['label-greeting_id']['de-at'] = "Begrüßung ID";
$text['label-greeting_id']['he'] = "";
$text['label-greeting']['en-us'] = "Greeting";
$text['label-greeting']['es-cl'] = "ID de bienvenida";
$text['label-greeting']['pt-pt'] = "ID de Saudação";
$text['label-greeting']['fr-fr'] = "ID d'accueil";
$text['label-greeting']['pt-br'] = "ID de saudação";
$text['label-greeting']['pl'] = "ID Powitania";
$text['label-greeting']['sv-se'] = "Hälsning ID";
$text['label-greeting']['uk'] = "ID привітання";
$text['label-greeting']['de-at'] = "Begrüßung ID";
$text['label-greeting']['he'] = "";
$text['label-forward_destinations']['en-us'] = "Forward Destinations";
$text['label-forward_destinations']['es-cl'] = "Destinos Adelante";
@ -605,16 +605,16 @@ $text['description-message_length']['uk'] = "Довжина";
$text['description-message_length']['de-at'] = "Länge";
$text['description-message_length']['he'] = "";
$text['description-greeting_id']['en-us'] = "Enter the Greeting ID";
$text['description-greeting_id']['es-cl'] = "Ingrese el ID de bienvenida";
$text['description-greeting_id']['pt-pt'] = "Introduza o ID da Saudação";
$text['description-greeting_id']['fr-fr'] = "Choisir le numéro de message vocal de salutation.";
$text['description-greeting_id']['pt-br'] = "Insira o ID da saudação";
$text['description-greeting_id']['pl'] = "Wprowadź ID powitania";
$text['description-greeting_id']['sv-se'] = "Ange Hälsningens ID";
$text['description-greeting_id']['uk'] = "Введіть ID привітання";
$text['description-greeting_id']['de-at'] = "Geben Sie die Begrüßungs ID an.";
$text['description-greeting_id']['he'] = "";
$text['description-greeting']['en-us'] = "Select the desired Greeting.";
$text['description-greeting']['es-cl'] = "Ingrese el ID de bienvenida";
$text['description-greeting']['pt-pt'] = "Introduza o ID da Saudação";
$text['description-greeting']['fr-fr'] = "Choisir le numéro de message vocal de salutation.";
$text['description-greeting']['pt-br'] = "Insira o ID da saudação";
$text['description-greeting']['pl'] = "Wprowadź ID powitania";
$text['description-greeting']['sv-se'] = "Ange Hälsningens ID";
$text['description-greeting']['uk'] = "Введіть ID привітання";
$text['description-greeting']['de-at'] = "Geben Sie die Begrüßungs ID an.";
$text['description-greeting']['he'] = "";
$text['description-forward_destinations']['en-us'] = "Forward voicemail messages to additional destinations.";
$text['description-forward_destinations']['es-cl'] = "Reenviar mensajes de voz a destinos adicionales.";

View File

@ -286,6 +286,17 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = "true"; }
if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = "true"; }
//get the greetings list
$sql = "select * from v_voicemail_greetings ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and voicemail_id = '".$voicemail_id."' ";
$sql .= "order by greeting_name asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$greetings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$greeting_count = count($greetings);
unset ($prep_statement, $sql);
//show the header
require_once "resources/header.php";
$document['title'] = $text['title-voicemail'];
@ -328,12 +339,20 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-greeting_id']."\n";
echo " ".$text['label-greeting']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='greeting_id' maxlength='255' value='$greeting_id'>\n";
echo " <select class='formfld' name='greeting_id'>\n";
echo " <option value=''></option>\n";
if ($greeting_count > 0) {
foreach ($greetings as $greeting) {
$selected = ($greeting['id'] == $greeting_id) ? 'selected' : null;
echo "<option value='".$greeting['id']."' ".$selected.">".$greeting['greeting_name']."</option>\n";
}
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-greeting_id']."\n";
echo $text['description-greeting']."\n";
echo "</td>\n";
echo "</tr>\n";