Voicemails: Initial GUI for adding IVR-style menu options to the voicemail system.

Devices: Minor visual adjustment.
IVR Menu: Minor visual and language adjustments.
This commit is contained in:
Nate Jones
2015-02-15 04:54:32 +00:00
parent 0f0b40e6aa
commit 151d2db735
11 changed files with 684 additions and 178 deletions

View File

@@ -59,7 +59,7 @@ else {
echo " </td>\n";
echo " <td align='right' nowrap='nowrap' valign='top'>\n";
echo " <form method='get' action=''>\n";
echo " <input type='button' class='btn' alt='".$text['button-back']."' onclick=\"document.location='devices.php'\" value='".$text['button-back']."'>\n";
echo " <input type='button' class='btn' alt='".$text['button-back']."' onclick=\"document.location='devices.php'\" value='".$text['button-back']."'>&nbsp;&nbsp;&nbsp;&nbsp;";
echo " <input type='text' class='txt' style='width: 150px' name='search' value='".$search."'>";
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
echo " </form>\n";

View File

@@ -59,7 +59,7 @@ else {
echo " <td align='right' nowrap='nowrap' valign='top'>\n";
echo " <form method='get' action=''>\n";
if (permission_exists('device_profile_view')) {
echo " <input type='button' class='btn' value='".$text['button-profiles']."' onclick=\"document.location.href='device_profiles.php';\">";
echo " <input type='button' class='btn' value='".$text['button-profiles']."' onclick=\"document.location.href='device_profiles.php';\">&nbsp;&nbsp;&nbsp;&nbsp;";
}
echo " <input type='text' class='txt' style='width: 150px' name='search' value='$search'>";
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";

View File

@@ -141,10 +141,12 @@
$text['label-tts_voice']['fr-fr'] = "Voix TTS";
$text['label-comfirm_attempts']['en-us'] = "Confirm Attempts";
$text['label-comfirm_attempts']['es-cl'] = "confirme intentos";
$text['label-comfirm_attempts']['pt-pt'] = "Confirmar Tentativas";
$text['label-comfirm_attempts']['fr-fr'] = "Essais de Confirmation";
$text['label-inter-digit_timeout']['en-us'] = "Inter-Digit Timeout";
$text['label-inter-digit_timeout']['es-cl'] = "Inter-Digit Tiempo de espera";
$text['label-inter-digit_timeout']['pt-pt'] = "Timeout Entre-Dígitos";
$text['label-inter-digit_timeout']['fr-fr'] = "Timeout Inter-Digit";
@@ -183,6 +185,11 @@
$text['label-options']['pt-pt'] = "Opções";
$text['label-options']['fr-fr'] = "Options";
$text['description-options']['en-us'] = "Define caller options for the IVR menu.";
$text['description-options']['es-cl'] = "Definir opções de chamadas para o menu IVR.";
$text['description-options']['pt-pt'] = "Definir opções de chamadas para o menu IVR.";
$text['description-options']['fr-fr'] = "Définir les options de l'appelant pour le menu IVR.";
$text['label-destination']['en-us'] = "Destination";
$text['label-destination']['es-cl'] = "Destino";
$text['label-destination']['pt-pt'] = "Destino";
@@ -349,6 +356,7 @@
$text['button-advanced']['fr-fr'] = "Afficher les paramètres avancés";
$text['button-back']['en-us'] = "Back";
$text['button-back']['es-cl'] = "espalda";
$text['button-back']['pt-pt'] = "Voltar";
$text['button-back']['fr-fr'] = "Retour";

View File

@@ -316,32 +316,29 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "}\n";
echo "</script>";
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo " <td align='left' width='30%' nowrap='nowrap' align='left'><b>".$text['header-ivr_menu']."</b></td>\n";
echo " <td width='70%' align='right'>\n";
echo " <td align='left' valign='top'>";
echo " <b>".$text['header-ivr_menu']."</b>";
echo " <br><br>";
echo " ".$text['description-ivr_menu'];
echo " <br><br>";
echo " </td>\n";
echo " <td align='right' nowrap='nowrap' valign='top'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='ivr_menus.php'\" value='".$text['button-back']."'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"if (confirm('".$text['confirm-copy']."')){window.location='ivr_menu_copy.php?id=".$ivr_menu_uuid."';}\" value='".$text['button-copy']."'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td colspan='2' align='left'>".$text['description-ivr_menu']."</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<form method='post' name='frm' action=''>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-name'].":\n";
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-name']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_name' maxlength='255' value=\"$ivr_menu_name\" required='required'>\n";
echo "<br />\n";
echo $text['description-name']."\n";
@@ -350,7 +347,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-extension'].":\n";
echo " ".$text['label-extension']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_extension' maxlength='255' value='$ivr_menu_extension' required='required'>\n";
@@ -361,7 +358,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-greet_long'].":\n";
echo " ".$text['label-greet_long']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
@@ -489,17 +486,11 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-greet_short'].":\n";
echo " ".$text['label-greet_short']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo "\n";
if (if_group("superadmin")) {
echo "<select name='ivr_menu_greet_short' class='formfld' style='width: 400px;' onchange='changeToInput(this);'>\n";
}
else {
echo "<select name='ivr_menu_greet_short' class='formfld' style='width: 400px;'>\n";
}
echo "<select name='ivr_menu_greet_short' class='formfld' style='width: 400px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null).">\n";
echo " <option></option>\n";
//misc
if (if_group("superadmin")) {
@@ -590,7 +581,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
echo " <tr>";
echo " <td class='vncell' valign='top'>".$text['label-options'].":</td>";
echo " <td class='vncell' valign='top'>".$text['label-options']."</td>";
echo " <td class='vtable' align='left'>";
echo " <table width='59%' border='0' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
@@ -642,9 +633,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " </tr>\n";
}
}
unset($sql, $result);
unset($sql, $result);
for ($c = 0; $c < 1; $c++) {
for ($c = 0; $c < 1; $c++) {
echo " <tr>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:70px' type='text' name='ivr_menu_options[".$c."][ivr_menu_option_digits]' maxlength='255' value='$ivr_menu_option_digits'>\n";
@@ -686,14 +677,14 @@ for ($c = 0; $c < 1; $c++) {
}
echo " </table>\n";
echo " ".$text['description-destinations']."\n";
echo " ".$text['description-options']."\n";
echo " <br />\n";
echo " </td>";
echo " </tr>";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-timeout'].":\n";
echo " ".$text['label-timeout']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ivr_menu_timeout' maxlength='255' min='1' step='1' value='$ivr_menu_timeout' required='required'>\n";
@@ -704,7 +695,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-exit_action'].":\n";
echo " ".$text['label-exit_action']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
//switch_select_destination(select_type, select_label, select_name, select_value, select_style, action);
@@ -716,7 +707,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-direct_dial'].":\n";
echo " ".$text['label-direct_dial']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='ivr_menu_direct_dial'>\n";
@@ -740,7 +731,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-ring_back'].":\n";
echo " ".$text['label-ring_back']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
@@ -803,7 +794,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-caller_id_name_prefix'].":\n";
echo " ".$text['label-caller_id_name_prefix']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_cid_prefix' maxlength='255' value=\"$ivr_menu_cid_prefix\">\n";
@@ -830,7 +821,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td width=\"30%\" class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-invalid_sound'].":\n";
echo " ".$text['label-invalid_sound']."\n";
echo "</td>\n";
echo "<td width=\"70%\" class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_invalid_sound' maxlength='255' value=\"$ivr_menu_invalid_sound\" required='required'>\n";
@@ -841,7 +832,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-exit_sound'].":\n";
echo " ".$text['label-exit_sound']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_exit_sound' maxlength='255' value=\"$ivr_menu_exit_sound\">\n";
@@ -852,7 +843,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-comfirm_macro'].":\n";
echo " ".$text['label-comfirm_macro']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_confirm_macro' maxlength='255' value=\"$ivr_menu_confirm_macro\">\n";
@@ -863,7 +854,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-comfirm_key'].":\n";
echo " ".$text['label-comfirm_key']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_confirm_key' maxlength='255' value=\"$ivr_menu_confirm_key\">\n";
@@ -874,7 +865,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-tts_engine'].":\n";
echo " ".$text['label-tts_engine']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_tts_engine' maxlength='255' value=\"$ivr_menu_tts_engine\">\n";
@@ -885,7 +876,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-tts_voice'].":\n";
echo " ".$text['label-tts_voice']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_tts_voice' maxlength='255' value=\"$ivr_menu_tts_voice\">\n";
@@ -896,7 +887,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-comfirm_attempts'].":\n";
echo " ".$text['label-comfirm_attempts']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ivr_menu_confirm_attempts' maxlength='255' min='1' step='1' value='$ivr_menu_confirm_attempts' required='required'>\n";
@@ -907,7 +898,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-inter-digit_timeout'].":\n";
echo " ".$text['label-inter-digit_timeout']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ivr_menu_inter_digit_timeout' maxlength='255' min='1' step='1' value='$ivr_menu_inter_digit_timeout' required='required'>\n";
@@ -918,7 +909,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-max_failures'].":\n";
echo " ".$text['label-max_failures']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ivr_menu_max_failures' maxlength='255' min='0' step='1' value='$ivr_menu_max_failures' required='required'>\n";
@@ -929,7 +920,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-max_timeouts'].":\n";
echo " ".$text['label-max_timeouts']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ivr_menu_max_timeouts' maxlength='255' min='0' step='1' value='$ivr_menu_max_timeouts' required='required'>\n";
@@ -940,7 +931,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-digit_length'].":\n";
echo " ".$text['label-digit_length']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ivr_menu_digit_len' maxlength='255' min='1' step='1' value='$ivr_menu_digit_len' required='required'>\n";
@@ -957,7 +948,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width=\"30%\" class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-enabled'].":\n";
echo " ".$text['label-enabled']."\n";
echo "</td>\n";
echo "<td width=\"70%\" class='vtable' align='left'>\n";
echo " <select class='formfld' name='ivr_menu_enabled'>\n";
@@ -981,7 +972,7 @@ for ($c = 0; $c < 1; $c++) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-description'].":\n";
echo " ".$text['label-description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ivr_menu_description' maxlength='255' value=\"$ivr_menu_description\">\n";
@@ -998,12 +989,10 @@ for ($c = 0; $c < 1; $c++) {
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "<br>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
//include the footer
require_once "resources/footer.php";

View File

@@ -61,6 +61,8 @@
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
@@ -109,6 +111,8 @@
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_message_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
@@ -144,7 +148,7 @@
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "message_status";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Voicemail message status";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Voicemail message status";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "message_priority";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
@@ -159,6 +163,8 @@
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_destination_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
@@ -183,4 +189,49 @@
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "voicemail_uuid";
$z++;
$y = 3; //table array index
$z = 0; //field array index
$apps[$x]['db'][$y]['table'] = "v_voicemail_options";
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_option_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_voicemails";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "voicemail_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "voicemail_option_digits";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "voicemail_option_action";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "voicemail_option_param";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "voicemail_option_order";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "voicemail_option_description";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
?>

View File

@@ -16,6 +16,16 @@
$text['description-voicemail']['pt-pt'] = "Definições do Correio de Voz";
$text['description-voicemail']['fr-fr'] = "Configuration messagerie.";
$text['title-voicemail_option']['en-us'] = "Voicemail Option";
$text['title-voicemail_option']['es-cl'] = "Opción de correo de voz";
$text['title-voicemail_option']['pt-pt'] = "Voicemail Opção";
$text['title-voicemail_option']['fr-fr'] = "Option de messagerie vocale";
$text['header-voicemail_option']['en-us'] = "Voicemail Option";
$text['header-voicemail_option']['es-cl'] = "Opción de correo de voz";
$text['header-voicemail_option']['pt-pt'] = "Voicemail Opção";
$text['header-voicemail_option']['fr-fr'] = "Option de messagerie vocale";
$text['label-voicemail_id']['en-us'] = "Voicemail ID";
$text['label-voicemail_id']['es-cl'] = "ID de correo de voz";
$text['label-voicemail_id']['pt-pt'] = "ID de Correio de Voz";
@@ -102,9 +112,9 @@
$text['label-voicemail_description']['fr-fr'] = "Description";
$text['description-voicemail_description']['en-us'] = "Enter the description.";
$text['description-voicemail_description']['es-cl'] = "Ingrese una descripción";
$text['description-voicemail_description']['pt-pt'] = "Introduza a descrição";
$text['description-voicemail_description']['fr-fr'] = "";
$text['description-voicemail_description']['es-cl'] = "Ingrese una descripción.";
$text['description-voicemail_description']['pt-pt'] = "Introduza a descrição.";
$text['description-voicemail_description']['fr-fr'] = "Entrez la description.";
$text['label-count']['en-us'] = "Count";
$text['label-count']['es-cl'] = "Conteo";
@@ -156,6 +166,36 @@
$text['label-greetings']['pt-pt'] = "Saudações";
$text['label-greetings']['fr-fr'] = "Salutations";
$text['label-description']['en-us'] = "Description";
$text['label-description']['es-cl'] = "Descripción";
$text['label-description']['pt-pt'] = "Descrição";
$text['label-description']['fr-fr'] = "Description";
$text['label-option']['en-us'] = "Option";
$text['label-option']['es-cl'] = "Opción";
$text['label-option']['pt-pt'] = "Opção";
$text['label-option']['fr-fr'] = "Option";
$text['label-options']['en-us'] = "Options";
$text['label-options']['es-cl'] = "Opciones";
$text['label-options']['pt-pt'] = "Opções";
$text['label-options']['fr-fr'] = "Options";
$text['description-options']['en-us'] = "Define caller options for the voicemail greeting.";
$text['description-options']['es-cl'] = "Definir opciones del llamador para el saludo del correo de voz.";
$text['description-options']['pt-pt'] = "Definir opções de chamadas para a saudação de correio de voz.";
$text['description-options']['fr-fr'] = "Définir les options de l'appelant pour le message d'accueil.";
$text['label-destination']['en-us'] = "Destination";
$text['label-destination']['es-cl'] = "Destino";
$text['label-destination']['pt-pt'] = "Destino";
$text['label-destination']['fr-fr'] = "Destination";
$text['label-order']['en-us'] = "Order";
$text['label-order']['es-cl'] = "Orden";
$text['label-order']['pt-pt'] = "Ordem";
$text['label-order']['fr-fr'] = "Ordre";
$text['button-greetings']['en-us'] = "Greetings";
$text['button-greetings']['es-cl'] = "Bienvenida";
$text['button-greetings']['pt-pt'] = "Saudações";

View File

@@ -55,6 +55,7 @@ else {
$voicemail_id = check_str($_POST["voicemail_id"]);
$voicemail_password = check_str($_POST["voicemail_password"]);
$greeting_id = check_str($_POST["greeting_id"]);
$voicemail_options = $_POST["voicemail_options"];
$voicemail_mail_to = check_str($_POST["voicemail_mail_to"]);
$voicemail_attach_file = check_str($_POST["voicemail_attach_file"]);
$voicemail_local_after_email = check_str($_POST["voicemail_local_after_email"]);
@@ -62,6 +63,8 @@ else {
$voicemail_description = check_str($_POST["voicemail_description"]);
//remove the space
$voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to);
echo "<pre>"; print_r($voicemail_options); echo "</pre>";
}
//unassign the voicemail id copy from the voicemail id
@@ -159,51 +162,100 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'$domain_uuid', ";
$sql .= "'".$domain_uuid."', ";
$sql .= "'".uuid()."', ";
$sql .= "'$voicemail_id', ";
$sql .= "'$voicemail_password', ";
$sql .= "'".$voicemail_id."', ";
$sql .= "'".$voicemail_password."', ";
if (strlen($greeting_id) > 0) {
$sql .= "'$greeting_id', ";
$sql .= "'".$greeting_id."', ";
}
$sql .= "'$voicemail_mail_to', ";
$sql .= "'$voicemail_attach_file', ";
$sql .= "'$voicemail_local_after_email', ";
$sql .= "'$voicemail_enabled', ";
$sql .= "'$voicemail_description' ";
$sql .= "'".$voicemail_mail_to."', ";
$sql .= "'".$voicemail_attach_file."', ";
$sql .= "'".$voicemail_local_after_email."', ";
$sql .= "'".$voicemail_enabled."', ";
$sql .= "'".$voicemail_description."' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION["message"] = $text['message-add'];
header("Location: voicemails.php");
return;
} //if ($action == "add")
if ($action == "update" && permission_exists('voicemail_edit')) {
$sql = "update v_voicemails set ";
$sql .= "voicemail_id = '$voicemail_id', ";
$sql .= "voicemail_password = '$voicemail_password', ";
$sql .= "voicemail_id = '".$voicemail_id."', ";
$sql .= "voicemail_password = '".$voicemail_password."', ";
if (strlen($greeting_id) > 0) {
$sql .= "greeting_id = '$greeting_id', ";
$sql .= "greeting_id = '".$greeting_id."', ";
}
else {
$sql .= "greeting_id = null, ";
}
$sql .= "voicemail_mail_to = '$voicemail_mail_to', ";
$sql .= "voicemail_attach_file = '$voicemail_attach_file', ";
$sql .= "voicemail_local_after_email = '$voicemail_local_after_email', ";
$sql .= "voicemail_enabled = '$voicemail_enabled', ";
$sql .= "voicemail_description = '$voicemail_description' ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and voicemail_uuid = '$voicemail_uuid'";
$sql .= "voicemail_mail_to = '".$voicemail_mail_to."', ";
$sql .= "voicemail_attach_file = '".$voicemail_attach_file."', ";
$sql .= "voicemail_local_after_email = '".$voicemail_local_after_email."', ";
$sql .= "voicemail_enabled = '".$voicemail_enabled."', ";
$sql .= "voicemail_description = '".$voicemail_description."' ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and voicemail_uuid = '".$voicemail_uuid."'";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION["message"] = $text['message-update'];
header("Location: voicemail_edit.php?id=".$voicemail_uuid);
return;
} //if ($action == "update")
// add voicemail options
if (sizeof($voicemail_options) > 0) {
foreach ($voicemail_options as $index => $voicemail_option) {
if ($voicemail_option['voicemail_option_digits'] == '' || $voicemail_option['voicemail_option_param'] == '') { unset($voicemail_options[$index]); }
}
}
if (sizeof($voicemail_options) > 0) {
$sql = "insert into v_voicemail_options ";
$sql .= "( ";
$sql .= "voicemail_option_uuid, ";
$sql .= "voicemail_uuid, ";
$sql .= "domain_uuid, ";
$sql .= "voicemail_option_digits, ";
$sql .= "voicemail_option_action, ";
$sql .= "voicemail_option_param, ";
$sql .= "voicemail_option_order, ";
$sql .= "voicemail_option_description ";
$sql .= ") ";
$sql .= "values ";
foreach ($voicemail_options as $index => $voicemail_option) {
$voicemail_option_uuid = uuid();
//seperate the action and the param
$option_array = explode(":", $voicemail_option["voicemail_option_param"]);
$voicemail_option['voicemail_option_action'] = array_shift($option_array);
$voicemail_option['voicemail_option_param'] = join(':', $option_array);
//continue building insert query
$sql_record[$index] = "( ";
$sql_record[$index] .= "'".$voicemail_option_uuid."', ";
$sql_record[$index] .= "'".$voicemail_uuid."', ";
$sql_record[$index] .= "'".$domain_uuid."', ";
$sql_record[$index] .= "'".trim($voicemail_option['voicemail_option_digits'])."', ";
$sql_record[$index] .= "'".trim($voicemail_option['voicemail_option_action'])."', ";
$sql_record[$index] .= "'".trim($voicemail_option['voicemail_option_param'])."', ";
$sql_record[$index] .= $voicemail_option['voicemail_option_order'].", ";
$sql_record[$index] .= "'".trim($voicemail_option['voicemail_option_description'])."' ";
$sql_record[$index] .= ") ";
}
$sql .= implode(",", $sql_record);
$db->exec(check_sql($sql));
unset($sql);
}
//redirect user
if ($action == 'add') {
header("Location: voicemails.php");
}
else if ($action == "update") {
header("Location: voicemail_edit.php?id=".$voicemail_uuid);
}
exit;
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
@@ -211,8 +263,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$voicemail_uuid = check_str($_GET["id"]);
$sql = "select * from v_voicemails ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and voicemail_uuid = '$voicemail_uuid' ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and voicemail_uuid = '".$voicemail_uuid."' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
@@ -240,20 +292,17 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "resources/header.php";
$document['title'] = $text['title-voicemail'];
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['title-voicemail']."</b></td>\n";
echo "<td width='70%' align='right'>\n";
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'>";
echo " <b>".$text['title-voicemail']."</b>";
echo " <br><br>";
echo "</td>\n";
echo "<td width='70%' align='right' valign='top'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"javascript:history.back();\" value='".$text['button-back']."'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo "</td>\n";
@@ -261,7 +310,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-voicemail_id'].":\n";
echo " ".$text['label-voicemail_id']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='voicemail_id' maxlength='255' value='$voicemail_id'>\n";
@@ -272,7 +321,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-voicemail_password'].":\n";
echo " ".$text['label-voicemail_password']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='password' name='voicemail_password' id='password' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" autocomplete='off' maxlength='50' value=\"$voicemail_password\">\n";
@@ -283,7 +332,7 @@ 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_id']."\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";
@@ -292,9 +341,111 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n";
echo "</tr>\n";
echo " <tr>";
echo " <td class='vncell' valign='top'>".$text['label-options']."</td>";
echo " <td class='vtable' align='left'>";
echo " <table width='59%' border='0' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vtable'>".$text['label-option']."</td>\n";
echo " <td class='vtable'>".$text['label-destination']."</td>\n";
echo " <td class='vtable'>".$text['label-order']."</td>\n";
echo " <td class='vtable'>".$text['label-description']."</td>\n";
echo " <td></td>\n";
echo " </tr>\n";
if (strlen($voicemail_uuid) > 0) {
$sql = "select * from v_voicemail_options ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and voicemail_uuid = '".$voicemail_uuid."' ";
$sql .= "order by voicemail_option_digits, voicemail_option_order asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
foreach($result as $field) {
$voicemail_option_param = $field['voicemail_option_param'];
if (strlen(trim($voicemail_option_param)) == 0) {
$voicemail_option_param = $field['voicemail_option_action'];
}
$voicemail_option_param = str_replace("menu-", "", $voicemail_option_param);
$voicemail_option_param = str_replace("XML", "", $voicemail_option_param);
$voicemail_option_param = str_replace("transfer", "", $voicemail_option_param);
$voicemail_option_param = str_replace("bridge", "", $voicemail_option_param);
$voicemail_option_param = str_replace($_SESSION['domain_name'], "", $voicemail_option_param);
$voicemail_option_param = str_replace("\${domain_name}", "", $voicemail_option_param);
$voicemail_option_param = str_replace("\${domain}", "", $voicemail_option_param);
$voicemail_option_param = ucfirst(trim($voicemail_option_param));
echo " <tr>\n";
echo " <td class='vtable'>\n";
echo " ".$field['voicemail_option_digits'];
echo " </td>\n";
echo " <td class='vtable'>\n";
echo " ".$voicemail_option_param."&nbsp;\n";
echo " </td>\n";
echo " <td class='vtable'>\n";
echo " ".$field['voicemail_option_order']."&nbsp;\n";
echo " </td>\n";
echo " <td class='vtable'>\n";
echo " ".$field['voicemail_option_description']."&nbsp;\n";
echo " </td>\n";
echo " <td class='list_control_icons'>";
echo "<a href='voicemail_option_edit.php?id=".$field['voicemail_option_uuid']."&voicemail_uuid=".$field['voicemail_uuid']."' alt='".$text['button-edit']."'>".$v_link_label_edit."</a>";
echo "<a href='voicemail_option_delete.php?id=".$field['voicemail_option_uuid']."&voicemail_uuid=".$field['voicemail_uuid']."&a=delete' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
echo " </td>\n";
echo " </tr>\n";
}
}
unset($sql, $result);
for ($c = 0; $c < 1; $c++) {
echo " <tr>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:70px' type='text' name='voicemail_options[".$c."][voicemail_option_digits]' maxlength='255' value='".$voicemail_option_digits."'>\n";
echo "</td>\n";
echo "<td class='vtable' align='left' nowrap='nowrap'>\n";
$tmp_select_value = '';
switch_select_destination("ivr", $voicemail_options_label, 'voicemail_options['.$c.'][voicemail_option_param]', $tmp_select_value, "width:175px", $voicemail_option_action);
unset($tmp_select_value);
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='voicemail_options[".$c."][voicemail_option_order]' class='formfld' style='width:55px'>\n";
//echo " <option></option>\n";
if (strlen(htmlspecialchars($voicemail_option_order))> 0) {
echo " <option selected='yes' value='".htmlspecialchars($voicemail_option_order)."'>".htmlspecialchars($voicemail_option_order)."</option>\n";
}
$i=0;
while($i<=999) {
if (strlen($i) == 1) {
echo " <option value='00$i'>00$i</option>\n";
}
if (strlen($i) == 2) {
echo " <option value='0$i'>0$i</option>\n";
}
if (strlen($i) == 3) {
echo " <option value='$i'>$i</option>\n";
}
$i++;
}
echo " </select>\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:100px' type='text' name='voicemail_options[".$c."][voicemail_option_description]' maxlength='255' value=\"".$voicemail_option_description."\">\n";
echo "</td>\n";
echo " <td>\n";
echo " <input type='submit' class='btn' value=\"".$text['button-add']."\">\n";
echo " </td>\n";
echo " </tr>\n";
}
echo " </table>\n";
echo " ".$text['description-options']."\n";
echo " <br />\n";
echo " </td>";
echo " </tr>";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-voicemail_mail_to'].":\n";
echo " ".$text['label-voicemail_mail_to']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='voicemail_mail_to' maxlength='255' value=\"$voicemail_mail_to\">\n";
@@ -305,7 +456,7 @@ 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-voicemail_attach_file'].":\n";
echo " ".$text['label-voicemail_attach_file']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='voicemail_attach_file'>\n";
@@ -329,7 +480,7 @@ 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-voicemail_local_after_email'].":\n";
echo " ".$text['label-voicemail_local_after_email']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='voicemail_local_after_email'>\n";
@@ -353,10 +504,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <tr>";
echo " <td class='vncell' valign='top'>".$text['label-forward_destinations'].":</td>";
echo " <td class='vncell' valign='top'>".$text['label-forward_destinations']."</td>";
echo " <td class='vtable'>";
echo " <table width='52%'>\n";
$sql = "
select
v.voicemail_id,
@@ -376,22 +526,26 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
foreach($result as $field) {
echo " <tr>\n";
echo " <td class='vtable'>".$field['voicemail_id']."</td>\n";
echo " <td>\n";
echo " <a href='voicemail_edit.php?id=".$voicemail_uuid."&voicemail_destination_uuid=".$field['voicemail_destination_uuid']."&a=delete' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo " </tr>\n";
$voicemail_uuid_copied[] = $field['voicemail_uuid_copy'];
if ($result_count > 0) {
echo " <table width='52%'>\n";
foreach($result as $field) {
echo " <tr>\n";
echo " <td class='vtable'>".$field['voicemail_id']."</td>\n";
echo " <td>\n";
echo " <a href='voicemail_edit.php?id=".$voicemail_uuid."&voicemail_destination_uuid=".$field['voicemail_destination_uuid']."&a=delete' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo " </tr>\n";
$voicemail_uuid_copied[] = $field['voicemail_uuid_copy'];
}
echo " </table>\n";
echo " <br />\n";
}
echo " </table>\n";
if (sizeof($voicemail_uuid_copied) > 0) {
// modify sql to remove already copied voicemail uuids from the list
$sql_mod = " and v.voicemail_uuid not in ('".implode("','", $voicemail_uuid_copied)."') ";
}
echo " <br />\n";
$sql = "
select
v.voicemail_id,
@@ -425,7 +579,7 @@ 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-voicemail_enabled'].":\n";
echo " ".$text['label-voicemail_enabled']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='voicemail_enabled'>\n";
@@ -449,7 +603,7 @@ 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-voicemail_description'].":\n";
echo " ".$text['label-voicemail_description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='voicemail_description' maxlength='255' value=\"$voicemail_description\">\n";
@@ -465,17 +619,13 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$http_referer = parse_url($_SERVER["HTTP_REFERER"]);
echo " <input type='hidden' name='referer_path' value='".$http_referer['path']."'>\n";
echo " <input type='hidden' name='referer_query' value='".$http_referer['query']."'>\n";
echo " <br>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
//include the footer
require_once "resources/footer.php";
?>

View File

@@ -80,21 +80,15 @@ else {
require_once "resources/paging.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"center\">\n";
echo " <br />";
echo "<table width='100%' border='0'>\n";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
echo " <tr>\n";
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-voicemail_messages']."</b></td>\n";
echo " <td width='50%' align='right'>&nbsp;</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
echo " ".$text['description-voicemail_message']."<br />\n";
echo " </td>\n";
echo " <td width='50%' align='left' nowrap='nowrap' valign='top'>";
echo " <b>".$text['title-voicemail_messages']."</b>";
echo " <br><br>";
echo " ".$text['description-voicemail_message'];
echo " <br><br>";
echO " </td>\n";
echo " <td width='50%' align='right' valign='top'>&nbsp;</td>\n";
echo " </tr>\n";
echo "</table>\n";
@@ -103,19 +97,16 @@ else {
$row_style["1"] = "row_style1";
$row_style["2"] = "row_style2";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
//set the table header
$table_header = "<tr>\n";
$table_header .= th_order_by('created_epoch', $text['label-created_epoch'], $order_by, $order);
//$table_header .= th_order_by('read_epoch', $text['label-read_epoch'], $order_by, $order);
$table_header .= th_order_by('caller_id_name', $text['label-caller_id_name'], $order_by, $order);
$table_header .= th_order_by('caller_id_number', $text['label-caller_id_number'], $order_by, $order);
$table_header .= "<th>".$text['label-tools']."</th>\n";
$table_header .= th_order_by('message_length', $text['label-message_length'], $order_by, $order, null, "style='text-align: right;'");
$table_header .= "<th style='text-align: right;'>".$text['label-message_size']."</th>\n";
//$table_header .= th_order_by('message_priority', $text['label-message_priority'], $order_by, $order);
$table_header .= "<td align='right' width='21'>\n";
$table_header .= " &nbsp;\n";
$table_header .= "</td>\n";
@@ -128,7 +119,10 @@ else {
if ($previous_voicemail_id != $field['voicemail_id']) {
echo "<tr>\n";
echo " <td colspan='3' align='left'>\n";
echo " <br /><br /><br /><br />\n";
echo " <br>";
if ($previous_voicemail_id != '') {
echo " <br /><br /><br />\n";
}
echo " <b>".$text['label-mailbox'].": ".$field['voicemail_id']." </b><br />&nbsp;\n";
echo " </td>\n";
echo " <td colspan='3' valign='bottom' align='right'>\n";
@@ -149,7 +143,6 @@ else {
echo "<td valign='top' class='".$row_style[$c]."' style=\"".$style."\" nowrap=\"nowrap\">";
echo " ".$row['created_date'];
echo "</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['read_epoch']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".$row['caller_id_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".$row['caller_id_number']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style["2"]." tr_link_void'>";
@@ -166,9 +159,7 @@ else {
echo "<a href=\"voicemail_messages.php?action=download&type=vm&t=bin&id=".$row['voicemail_id']."&voicemail_uuid=".$row['voicemail_uuid']."&uuid=".$row['voicemail_message_uuid']."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\">".$row['message_length_label']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".$row['message_status']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\">".$row['file_size_label']."</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['message_priority']."&nbsp;</td>\n";
echo " <td class='list_control_icon'>\n";
if (permission_exists('voicemail_message_delete')) {
echo " <a href='voicemail_message_delete.php?voicemail_uuid=".$row['voicemail_uuid']."&id=".$row['voicemail_message_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
@@ -199,13 +190,6 @@ else {
echo "</tr>\n";
echo "</table>";
echo "</div>";
echo "<br /><br />";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br /><br />";
//include the footer

View File

@@ -0,0 +1,60 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('voicemail_delete')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//set the http values as variables
if (count($_GET)>0) {
$voicemail_option_uuid = check_str($_GET["id"]);
$voicemail_uuid = check_str($_GET["voicemail_uuid"]);
}
//delete the voicemail option
if (strlen($voicemail_option_uuid) > 0) {
$sql = "delete from v_voicemail_options ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and voicemail_option_uuid = '".$voicemail_option_uuid."' ";
$db->exec(check_sql($sql));
unset($sql);
}
//redirect the user
$_SESSION['message'] = $text['message-delete'];
header('Location: voicemail_edit.php?id='.$voicemail_uuid);
?>

View File

@@ -0,0 +1,244 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('voicemail_add') || permission_exists('voicemail_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
$voicemail_option_uuid = check_str($_REQUEST["id"]);
}
//get the menu id
if (strlen($_GET["voicemail_uuid"]) > 0) {
$voicemail_uuid = check_str($_GET["voicemail_uuid"]);
}
//get the http post variables and set them to php variables
if (count($_POST)>0) {
$voicemail_uuid = check_str($_POST["voicemail_uuid"]);
$voicemail_option_digits = check_str($_POST["voicemail_option_digits"]);
$voicemail_option_action = check_str($_POST["voicemail_option_action"]);
$voicemail_option_param = check_str($_POST["voicemail_option_param"]);
$voicemail_option_order = check_str($_POST["voicemail_option_order"]);
$voicemail_option_description = check_str($_POST["voicemail_option_description"]);
//set the default voicemail_option_action
if (strlen($voicemail_option_action) == 0) {
$voicemail_option_action = "menu-exec-app";
}
//seperate the action and the param
$options_array = explode(":", $voicemail_option_param);
$voicemail_option_action = array_shift($options_array);
$voicemail_option_param = join(':', $options_array);
}
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = '';
$voicemail_option_uuid = check_str($_POST["voicemail_option_uuid"]);
//check for all required data
if (strlen($voicemail_option_digits) == 0) { $msg .= $text['message-required'].$text['label-option']."<br>\n"; }
if (strlen($voicemail_option_order) == 0) { $msg .= $text['message-required'].$text['label-order']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//update the database
if ($_POST["persistformvar"] != "true") {
if (permission_exists('voicemail_edit')) {
$sql = "update v_voicemail_options set ";
$sql .= "voicemail_option_digits = '".$voicemail_option_digits."', ";
$sql .= "voicemail_option_action = '".$voicemail_option_action."', ";
$sql .= "voicemail_option_param = '".$voicemail_option_param."', ";
$sql .= "voicemail_option_order = ".$voicemail_option_order.", ";
$sql .= "voicemail_option_description = '".$voicemail_option_description."' ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and voicemail_option_uuid = '".$voicemail_option_uuid."' ";
$db->exec(check_sql($sql));
unset($sql);
//redirect the user
$_SESSION['message'] = $text['message-update'];
header('Location: voicemail_edit.php?id='.$voicemail_uuid);
return;
}
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$voicemail_option_uuid = $_GET["id"];
$sql = "select * from v_voicemail_options ";
$sql .= "where voicemail_option_uuid = '".$voicemail_option_uuid."' ";
$sql .= "and 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) {
$domain_uuid = $row["domain_uuid"];
$voicemail_uuid = $row["voicemail_uuid"];
$voicemail_option_digits = trim($row["voicemail_option_digits"]);
$voicemail_option_action = $row["voicemail_option_action"];
$voicemail_option_param = $row["voicemail_option_param"];
//if admin show only the param
if (if_group("admin")) {
$voicemail_options_label = $voicemail_option_param;
}
//if superadmin show both the action and param
if (if_group("superadmin")) {
$voicemail_options_label = $voicemail_option_action.':'.$voicemail_option_param;
}
$voicemail_option_order = $row["voicemail_option_order"];
$voicemail_option_description = $row["voicemail_option_description"];
break; //limit to 1 row
}
unset ($prep_statement);
}
//send the content to the browser
require_once "resources/header.php";
$document['title'] = $text['title-voicemail_option'];
echo "<form method='post' name='frm' action=''>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' align='left' valign='top'>";
echo " <b>".$text['header-voicemail_option']."</b>";
echo " <br><br>";
echo "</td>\n";
echo "<td width='70%' align='right' nowrap='nowrap' valign='top'>";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='voicemail_edit.php?id=".$voicemail_uuid."'\" value='".$text['button-back']."'>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-option']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='voicemail_option_digits' maxlength='255' value='$voicemail_option_digits'>\n";
echo "<br />\n";
echo $text['description-option']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-destination']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$tmp_select_value = '';
if (strlen($voicemail_option_action.$voicemail_option_param) > 0) {
$tmp_select_value = $voicemail_option_action.':'.$voicemail_option_param;
}
switch_select_destination("ivr", $voicemail_options_label, "voicemail_option_param", $tmp_select_value, "width: 350px;", $voicemail_option_action);
unset($tmp_select_value);
echo "<br />\n";
echo $text['description-destination']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-order']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='voicemail_option_order' class='formfld'>\n";
$i=0;
while($i<=999) {
$selected = ($voicemail_option_order == $i) ? "selected" : null;
if (strlen($i) == 1) {
echo " <option value='00$i' ".$selected.">00$i</option>\n";
}
if (strlen($i) == 2) {
echo " <option value='0$i' ".$selected.">0$i</option>\n";
}
if (strlen($i) == 3) {
echo " <option value='$i' ".$selected.">$i</option>\n";
}
$i++;
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-order']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='voicemail_option_description' maxlength='255' value=\"".$voicemail_option_description."\">\n";
echo "<br />\n";
echo $text['description-description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
echo " <input type='hidden' name='voicemail_uuid' value='$voicemail_uuid'>\n";
echo " <input type='hidden' name='voicemail_option_uuid' value='$voicemail_option_uuid'>\n";
echo " <br>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>\n";
echo "</form>\n";
require_once "resources/footer.php";
?>

View File

@@ -57,26 +57,20 @@ else {
require_once "resources/paging.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"center\">\n";
echo " <br />";
echo "<table width='100%' border='0'>\n";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
echo " <tr>\n";
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-voicemails']."</b></td>\n";
echo " <form method='get' action=''>\n";
echo " <td width='30%' align='right'>\n";
echo " <input type='text' class='txt' style='width: 150px' name='search' value='$search'>";
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
echo " </td>\n";
echo " </form>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
echo " ".$text['description-voicemail']."<br /><br />\n";
echo " <td width='50%' align='left' nowrap='nowrap' valign='top'>";
echo " <b>".$text['title-voicemails']."</b>";
echo " <br /><br />";
echo " ".$text['description-voicemail'];
echo " <br /><br />";
echo " </td>\n";
echo " <td width='30%' align='right' valign='top'>\n";
echo " <form method='get' action=''>\n";
echo " <input type='text' class='txt' style='width: 150px' name='search' value='".$search."'>";
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
echo " </form>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
@@ -176,16 +170,12 @@ else {
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('voicemail_id', $text['label-voicemail_id'], $order_by, $order);
//echo th_order_by('voicemail_password', $text['label-voicemail_password'], $order_by, $order);
//echo th_order_by('greeting_id', $text['label-greeting_id'], $order_by, $order);
echo th_order_by('voicemail_mail_to', $text['label-voicemail_mail_to'], $order_by, $order);
echo th_order_by('voicemail_attach_file', $text['label-voicemail_attach_file'], $order_by, $order);
echo th_order_by('voicemail_local_after_email', $text['label-voicemail_local_after_email'], $order_by, $order);
//echo "<th>".$text['label-count']."</th>\n";
echo "<th>".$text['label-tools']."</th>\n";
echo th_order_by('voicemail_enabled', $text['label-voicemail_enabled'], $order_by, $order);
echo th_order_by('voicemail_description', $text['label-voicemail_description'], $order_by, $order);
@@ -208,12 +198,9 @@ else {
echo $row['voicemail_id'];
}
echo " </td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['voicemail_password']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['greeting_id']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['voicemail_mail_to']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['voicemail_attach_file'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['voicemail_local_after_email'])."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;</td>\n";
echo " <td valign='middle' class='".$row_style[$c]."' style='white-space: nowrap;'>\n";
echo " <a href='voicemail_messages.php?id=".$row['voicemail_uuid']."'>".$text['label-view']."</a>&nbsp;&nbsp;\n";
echo " <a href='".PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$row['voicemail_id']."'>".$text['label-greetings']."</a>\n";
@@ -251,13 +238,6 @@ else {
echo "</tr>\n";
echo "</table>";
echo "</div>";
echo "<br /><br />";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br /><br />";
//include the footer