Voicemail: Added additional options for email notification (attach vm, download link, auto-play listen link). Also cleaned up email templates a little.

This commit is contained in:
Nate Jones 2015-02-24 08:09:01 +00:00
parent a3a623aa35
commit cbb39328f5
14 changed files with 893 additions and 809 deletions

File diff suppressed because it is too large Load Diff

View File

@ -181,7 +181,7 @@ else {
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$voicemail_mailto = $row["voicemail_mail_to"];
$voicemail_attach_file = $row["voicemail_attach_file"];
$voicemail_file = $row["voicemail_file"];
$voicemail_local_after_email = $row["voicemail_local_after_email"];
$voicemail_enabled = $row["voicemail_enabled"];
}
@ -200,7 +200,7 @@ else {
$ext->number_alias = $number_alias_new;
$ext->voicemail_password = $voicemail_password;
$ext->voicemail_mail_to = $voicemail_mailto;
$ext->voicemail_attach_file = $voicemail_attach_file;
$ext->voicemail_file = $voicemail_file;
$ext->voicemail_local_after_email = $voicemail_local_after_email;
$ext->voicemail_enabled = $voicemail_enabled;
$ext->description = $description;

View File

@ -96,7 +96,7 @@ else {
$voicemail_password = check_str($_POST["voicemail_password"]);
$voicemail_enabled = check_str($_POST["voicemail_enabled"]);
$voicemail_mail_to = check_str($_POST["voicemail_mail_to"]);
$voicemail_attach_file = check_str($_POST["voicemail_attach_file"]);
$voicemail_file = check_str($_POST["voicemail_file"]);
$voicemail_local_after_email = check_str($_POST["voicemail_local_after_email"]);
$user_context = check_str($_POST["user_context"]);
$range = check_str($_POST["range"]);
@ -280,31 +280,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//check for all required data
$msg = '';
if (strlen($extension) == 0) { $msg .= $text['message-required'].$text['label-extension']."<br>\n"; }
//if (strlen($number_alias) == 0) { $msg .= $text['message-required']."Number Alias<br>\n"; }
//if (strlen($voicemail_password) == 0) { $msg .= $text['message-required']."Voicemail Password<br>\n"; }
//if (strlen($accountcode) == 0) { $msg .= $text['message-required']."Account Code<br>\n"; }
//if (strlen($effective_caller_id_name) == 0) { $msg .= $text['message-required']."Effective Caller ID Name<br>\n"; }
//if (strlen($effective_caller_id_number) == 0) { $msg .= $text['message-required']."Effective Caller ID Number<br>\n"; }
//if (strlen($outbound_caller_id_name) == 0) { $msg .= $text['message-required']."Outbound Caller ID Name<br>\n"; }
//if (strlen($emergency_caller_id_name) == 0) { $msg .= $text['message-required']."Emergency Caller ID Name<br>\n"; }
//if (strlen($outbound_caller_id_number) == 0) { $msg .= $text['message-required']."Outbound Caller ID Number<br>\n"; }
//if (strlen($emergency_caller_id_number) == 0) { $msg .= $text['message-required']."Emergency Caller ID Number<br>\n"; }
//if (strlen($directory_full_name) == 0) { $msg .= $text['message-required']."Directory Full Name<br>\n"; }
//if (strlen($directory_visible) == 0) { $msg .= $text['message-required']."Directory Visible<br>\n"; }
//if (strlen($directory_exten_visible) == 0) { $msg .= $text['message-required']."Directory Extension Visible<br>\n"; }
//if (strlen($limit_max) == 0) { $msg .= $text['message-required']."Max Callsr<br>\n"; }
//if (strlen($limit_destination) == 0) { $msg .= $text['message-required']."Transfer Destination Number<br>\n"; }
//if (strlen($voicemail_mail_to) == 0) { $msg .= $text['message-required']."Voicemail Mail To<br>\n"; }
//if (strlen($voicemail_attach_file) == 0) { $msg .= $text['message-required']."Voicemail Attach File<br>\n"; }
//if (strlen($voicemail_local_after_email) == 0) { $msg .= $text['message-required']."VM Keep Local After Email<br>\n"; }
//if (strlen($user_context) == 0) { $msg .= $text['message-required']."User Context<br>\n"; }
//if (strlen($toll_allow) == 0) { $msg .= $text['message-required']."Toll Allow<br>\n"; }
//if (strlen($call_group) == 0) { $msg .= $text['message-required']."Call Group<br>\n"; }
//if (strlen($hold_music) == 0) { $msg .= $text['message-required']."Hold Music<br>\n"; }
//if (strlen($auth_acl) == 0) { $msg .= $text['message-required']."Auth ACL<br>\n"; }
//if (strlen($cidr) == 0) { $msg .= $text['message-required']."CIDR<br>\n"; }
//if (strlen($sip_force_contact) == 0) { $msg .= $text['message-required']."SIP Force Contact<br>\n"; }
//if (strlen($dial_string) == 0) { $msg .= $text['message-required']."Dial String<br>\n"; }
if (permission_exists('extension_enabled')) {
if (strlen($enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
}
@ -499,7 +474,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$ext->number_alias = $number_alias;
$ext->voicemail_password = $voicemail_password;
$ext->voicemail_mail_to = $voicemail_mail_to;
$ext->voicemail_attach_file = $voicemail_attach_file;
$ext->voicemail_file = $voicemail_file;
$ext->voicemail_local_after_email = $voicemail_local_after_email;
$ext->voicemail_enabled = $voicemail_enabled;
$ext->description = $description;
@ -634,7 +609,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$ext->number_alias = $number_alias;
$ext->voicemail_password = $voicemail_password;
$ext->voicemail_mail_to = $voicemail_mail_to;
$ext->voicemail_attach_file = $voicemail_attach_file;
$ext->voicemail_file = $voicemail_file;
$ext->voicemail_local_after_email = $voicemail_local_after_email;
$ext->voicemail_enabled = $voicemail_enabled;
$ext->description = $description;
@ -791,7 +766,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//$greeting_id = $row["greeting_id"];
$voicemail_mail_to = $row["voicemail_mail_to"];
$voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to);
$voicemail_attach_file = $row["voicemail_attach_file"];
$voicemail_file = $row["voicemail_file"];
$voicemail_local_after_email = $row["voicemail_local_after_email"];
$voicemail_enabled = $row["voicemail_enabled"];
}
@ -1507,25 +1482,16 @@ 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_file']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='voicemail_attach_file'>\n";
if ($voicemail_attach_file == "true") {
echo " <option value='true' selected >".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($voicemail_attach_file == "false") {
echo " <option value='false' selected >".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " <select class='formfld' name='voicemail_file'>\n";
echo " <option value=''>".$text['option-voicemail_file_listen']."</option>\n";
echo " <option value='link' ".(($voicemail_file == "link") ? "selected='selected'" : null).">".$text['option-voicemail_file_link']."</option>\n";
echo " <option value='attach' ".(($voicemail_file == "attach") ? "selected='selected'" : null).">".$text['option-voicemail_file_attach']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-voicemail_attach_file']."\n";
echo $text['description-voicemail_file']."\n";
echo "</td>\n";
echo "</tr>\n";

View File

@ -51,7 +51,7 @@
public $limit_destination;
public $voicemail_enabled;
public $voicemail_mail_to;
public $voicemail_attach_file;
public $voicemail_file;
public $voicemail_local_after_email;
public $user_context;
public $toll_allow;
@ -117,7 +117,7 @@
$sql .= "greeting_id, ";
}
$sql .= "voicemail_mail_to, ";
$sql .= "voicemail_attach_file, ";
$sql .= "voicemail_file, ";
$sql .= "voicemail_local_after_email, ";
$sql .= "voicemail_enabled, ";
$sql .= "voicemail_description ";
@ -129,7 +129,7 @@
$sql .= "'".$this->voicemail_id."', ";
$sql .= "'".$this->voicemail_password."', ";
$sql .= "'".$this->voicemail_mail_to."', ";
$sql .= "'".$this->voicemail_attach_file."', ";
$sql .= "'".$this->voicemail_file."', ";
$sql .= "'".$this->voicemail_local_after_email."', ";
$sql .= "'".$this->voicemail_enabled."', ";
$sql .= "'".$this->description."' ";
@ -142,7 +142,7 @@
$sql = "update v_voicemails set ";
$sql .= "voicemail_password = '".$this->voicemail_password."', ";
$sql .= "voicemail_mail_to = '".$this->voicemail_mail_to."', ";
$sql .= "voicemail_attach_file = '".$this->voicemail_attach_file."', ";
$sql .= "voicemail_file = '".$this->voicemail_file."', ";
$sql .= "voicemail_local_after_email = '".$this->voicemail_local_after_email."', ";
$sql .= "voicemail_enabled = '".$this->voicemail_enabled."', ";
$sql .= "voicemail_description = '".$this->description."' ";
@ -259,16 +259,12 @@
}
if (strlen($row['voicemail_mail_to']) > 0) {
$xml .= " <param name=\"vm-email-all-messages\" value=\"true\"/>\n";
switch ($row['voicemail_attach_file']) {
case "true":
switch ($row['voicemail_file']) {
case "attach":
$xml .= " <param name=\"vm-attach-file\" value=\"true\"/>\n";
break;
case "false":
$xml .= " <param name=\"vm-attach-file\" value=\"false\"/>\n";
break;
default:
$xml .= " <param name=\"vm-attach-file\" value=\"true\"/>\n";
$xml .= " <param name=\"vm-attach-file\" value=\"false\"/>\n";
}
switch ($row['voicemail_local_after_email']) {
case "true":

View File

@ -89,6 +89,11 @@
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_attach_file";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Choose whether to attach the file to the email.";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_file";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select a listening option to include with the email notification.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_local_after_email";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";

View File

@ -0,0 +1,37 @@
<?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-2015
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//proccess this only one time
if ($domains_processed == 1) {
//migrate existing attachment preferences to new column, where appropriate
$sql = "update v_voicemails set voicemail_file = 'attach' where voicemail_attach_file = 'true'";
$db->exec(check_sql($sql));
unset($sql);
}
?>

View File

@ -66,15 +66,35 @@
$text['description-voicemail_mail_to']['pt-pt'] = "Introduza o endereço de email para enviar o correio de voz.";
$text['description-voicemail_mail_to']['fr-fr'] = "Choisir un courriel lié à cette messagerie vocale.";
$text['label-voicemail_attach_file']['en-us'] = "Attach File";
$text['label-voicemail_attach_file']['es-cl'] = "Adjuntar archivo";
$text['label-voicemail_attach_file']['pt-pt'] = "Anexar Ficheiro";
$text['label-voicemail_attach_file']['fr-fr'] = "Fichier attaché";
$text['label-voicemail_file']['en-us'] = "Voicemail File";
$text['label-voicemail_file']['es-cl'] = "Correo de Voz Archivo";
$text['label-voicemail_file']['pt-pt'] = "Voicemail Arquivo";
$text['label-voicemail_file']['fr-fr'] = "Voicemail Fichier";
$text['description-voicemail_attach_file']['en-us'] = "Choose whether to attach the file to the email.";
$text['description-voicemail_attach_file']['es-cl'] = "Escoja si desea adjuntar un archivo";
$text['description-voicemail_attach_file']['pt-pt'] = "Escolha se pretende anexar o ficheiro de voz ao email.";
$text['description-voicemail_attach_file']['fr-fr'] = "Attacher le fichier audio au courriel.";
$text['option-voicemail_file_attach']['en-us'] = "Audio File Attachment";
$text['option-voicemail_file_attach']['es-cl'] = "Archivo Adjunto Audio";
$text['option-voicemail_file_attach']['pt-pt'] = "Anexo de arquivo de áudio";
$text['option-voicemail_file_attach']['fr-fr'] = "Audio File Attachment";
$text['option-voicemail_file_link']['en-us'] = "Download Link (No Login Required)";
$text['option-voicemail_file_link']['es-cl'] = "Enlace de descarga (No se requiere conexión)";
$text['option-voicemail_file_link']['pt-pt'] = "Link para download (Não é necessário login)";
$text['option-voicemail_file_link']['fr-fr'] = "Lien de téléchargement (Connexion non requise)";
$text['option-voicemail_file_listen']['en-us'] = "Listen Link (Login Required)";
$text['option-voicemail_file_listen']['es-cl'] = "Escuchar Link (Se requiere entrar)";
$text['option-voicemail_file_listen']['pt-pt'] = "Ouça Link (login requerido)";
$text['option-voicemail_file_listen']['fr-fr'] = "Écouter Link (Connexion requise)";
$text['description-voicemail_file']['en-us'] = "Select a listening option to include with the email notification.";
$text['description-voicemail_file']['es-cl'] = "Seleccione qué opción de escucha para incluir en la notificación de correo electrónico.";
$text['description-voicemail_file']['pt-pt'] = "Escolha qual opção de escuta para incluir com a notificação de e-mail.";
$text['description-voicemail_file']['fr-fr'] = "Sélectionnez quelle option écoute d'inclure à la notification par email.";
$text['label-voicemail_file_attached']['en-us'] = "Attached";
$text['label-voicemail_file_attached']['es-cl'] = "Adjunto";
$text['label-voicemail_file_attached']['pt-pt'] = "Ligado";
$text['label-voicemail_file_attached']['fr-fr'] = "Attaché";
$text['label-voicemail_local_after_email']['en-us'] = "Local After Email";
$text['label-voicemail_local_after_email']['es-cl'] = "Conservar después de enviar";

View File

@ -57,7 +57,7 @@ else {
$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_file = check_str($_POST["voicemail_file"]);
$voicemail_local_after_email = check_str($_POST["voicemail_local_after_email"]);
$voicemail_enabled = check_str($_POST["voicemail_enabled"]);
$voicemail_description = check_str($_POST["voicemail_description"]);
@ -119,16 +119,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
//if (strlen($voicemail_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-voicemail_uuid']."<br>\n"; }
//if (strlen($voicemail_id) == 0) { $msg .= $text['message-required']." ".$text['label-voicemail_id']."<br>\n"; }
//if (strlen($voicemail_password) == 0) { $msg .= $text['message-required']." ".$text['label-voicemail_password']."<br>\n"; }
//if (strlen($greeting_id) == 0) { $msg .= $text['message-required']." ".$text['label-greeting_id']."<br>\n"; }
//if (strlen($voicemail_mail_to) == 0) { $msg .= $text['message-required']." ".$text['label-voicemail_mail_to']."<br>\n"; }
//if (strlen($voicemail_attach_file) == 0) { $msg .= $text['message-required']." ".$text['label-voicemail_attach_file']."<br>\n"; }
//if (strlen($voicemail_local_after_email) == 0) { $msg .= $text['message-required']." ".$text['label-voicemail_local_after_email']."<br>\n"; }
//if (strlen($voicemail_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-voicemail_enabled']."<br>\n"; }
//if (strlen($voicemail_description) == 0) { $msg .= $text['message-required']." ".$text['label-voicemail_description']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
@ -155,7 +145,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "greeting_id, ";
}
$sql .= "voicemail_mail_to, ";
$sql .= "voicemail_attach_file, ";
$sql .= "voicemail_file, ";
$sql .= "voicemail_local_after_email, ";
$sql .= "voicemail_enabled, ";
$sql .= "voicemail_description ";
@ -170,7 +160,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "'".$greeting_id."', ";
}
$sql .= "'".$voicemail_mail_to."', ";
$sql .= "'".$voicemail_attach_file."', ";
$sql .= "'".$voicemail_file."', ";
$sql .= "'".$voicemail_local_after_email."', ";
$sql .= "'".$voicemail_enabled."', ";
$sql .= "'".$voicemail_description."' ";
@ -192,7 +182,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "greeting_id = null, ";
}
$sql .= "voicemail_mail_to = '".$voicemail_mail_to."', ";
$sql .= "voicemail_attach_file = '".$voicemail_attach_file."', ";
$sql .= "voicemail_file = '".$voicemail_file."', ";
$sql .= "voicemail_local_after_email = '".$voicemail_local_after_email."', ";
$sql .= "voicemail_enabled = '".$voicemail_enabled."', ";
$sql .= "voicemail_description = '".$voicemail_description."' ";
@ -273,7 +263,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$voicemail_password = $row["voicemail_password"];
$greeting_id = $row["greeting_id"];
$voicemail_mail_to = $row["voicemail_mail_to"];
$voicemail_attach_file = $row["voicemail_attach_file"];
$voicemail_file = $row["voicemail_file"];
$voicemail_local_after_email = $row["voicemail_local_after_email"];
$voicemail_enabled = $row["voicemail_enabled"];
$voicemail_description = $row["voicemail_description"];
@ -286,7 +276,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to);
//set defaults
if (strlen($voicemail_attach_file) == 0) { $voicemail_attach_file = "true"; }
if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = "true"; }
if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = "true"; }
@ -456,25 +445,16 @@ 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_file']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='voicemail_attach_file'>\n";
if ($voicemail_attach_file == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($voicemail_attach_file == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " </select>\n";
echo " <select class='formfld' name='voicemail_file'>\n";
echo " <option value=''>".$text['option-voicemail_file_listen']."</option>\n";
echo " <option value='link' ".(($voicemail_file == "link") ? "selected='selected'" : null).">".$text['option-voicemail_file_link']."</option>\n";
echo " <option value='attach' ".(($voicemail_file == "attach") ? "selected='selected'" : null).">".$text['option-voicemail_file_attach']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-voicemail_attach_file']."\n";
echo $text['description-voicemail_file']."\n";
echo "</td>\n";
echo "</tr>\n";

View File

@ -25,13 +25,15 @@
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('voicemail_message_view')) {
//access granted
}
else {
echo "access denied";
exit;
if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]) == "email")) {
require_once "resources/check_auth.php";
if (permission_exists('voicemail_message_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
}
//add multi-lingual support
@ -49,15 +51,17 @@ else {
$voicemail_id = check_str($_REQUEST["id"]);
$voicemail_uuid = check_str($_REQUEST["voicemail_uuid"]);
//require_once "resources/classes/voicemail.php";
$voicemail = new voicemail;
$voicemail->db = $db;
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
$voicemail->voicemail_id = $voicemail_id;
$voicemail->voicemail_uuid = $voicemail_uuid;
$voicemail->voicemail_message_uuid = $voicemail_message_uuid;
$result = $voicemail->message_download();
unset($voicemail);
header("Location: voicemail_edit.php?id=".$voicemail_uuid);
if ($voicemail_message_uuid != '' && $voicemail_id != '' && $voicemail_uuid != '') {
$voicemail = new voicemail;
$voicemail->db = $db;
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
$voicemail->voicemail_id = $voicemail_id;
$voicemail->voicemail_uuid = $voicemail_uuid;
$voicemail->voicemail_message_uuid = $voicemail_message_uuid;
$result = $voicemail->message_download();
unset($voicemail);
header("Location: voicemail_edit.php?id=".$voicemail_uuid);
}
exit;
}
@ -192,6 +196,11 @@ else {
echo "</table>";
echo "<br /><br />";
//autoplay message
if (check_str($_REQUEST["action"]) == "autoplay" && check_str($_REQUEST["uuid"]) != '') {
echo "<script>recording_play('".check_str($_REQUEST["uuid"])."');</script>";
}
//include the footer
require_once "resources/footer.php";
?>

View File

@ -81,7 +81,6 @@ else {
$sql .= "and (";
$sql .= " voicemail_id like '%".$search."%' ";
$sql .= " or voicemail_mail_to like '%".$search."%' ";
$sql .= " or voicemail_attach_file like '%".$search."%' ";
$sql .= " or voicemail_local_after_email like '%".$search."%' ";
$sql .= " or voicemail_enabled like '%".$search."%' ";
$sql .= " or voicemail_description like '%".$search."%' ";
@ -131,7 +130,6 @@ else {
$sql .= "and (";
$sql .= " voicemail_id like '%".$search."%' ";
$sql .= " or voicemail_mail_to like '%".$search."%' ";
$sql .= " or voicemail_attach_file like '%".$search."%' ";
$sql .= " or voicemail_local_after_email like '%".$search."%' ";
$sql .= " or voicemail_enabled like '%".$search."%' ";
$sql .= " or voicemail_description like '%".$search."%' ";
@ -174,7 +172,7 @@ else {
echo "<tr>\n";
echo th_order_by('voicemail_id', $text['label-voicemail_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_file', $text['label-voicemail_file_attached'], $order_by, $order);
echo th_order_by('voicemail_local_after_email', $text['label-voicemail_local_after_email'], $order_by, $order);
echo "<th>".$text['label-tools']."</th>\n";
echo th_order_by('voicemail_enabled', $text['label-voicemail_enabled'], $order_by, $order);
@ -199,7 +197,7 @@ else {
}
echo " </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]."'>".(($row['voicemail_file'] == 'attach') ? $text['label-true'] : $text['label-false'])."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['voicemail_local_after_email'])."&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";

View File

@ -45,7 +45,7 @@ require_once "resources/require.php";
//if the username is not provided then send to login.php
if (strlen(check_str($_REQUEST["username"])) == 0 && strlen(check_str($_REQUEST["key"])) == 0) {
$target_path = ($_REQUEST["path"] != '') ? $_REQUEST["path"] : $_SERVER["PHP_SELF"];
$target_path = ($_REQUEST["path"] != '') ? $_REQUEST["path"] : $_SERVER["REQUEST_URI"];
$_SESSION["message"] = "Invalid Username and/or Password";
header("Location: ".PROJECT_PATH."/login.php?path=".urlencode($target_path));
exit;

View File

@ -37,7 +37,7 @@
--voicemail_password = row["voicemail_password"];
--greeting_id = row["greeting_id"];
voicemail_mail_to = row["voicemail_mail_to"];
voicemail_attach_file = row["voicemail_attach_file"];
voicemail_file = row["voicemail_file"];
voicemail_local_after_email = row["voicemail_local_after_email"];
end);
@ -45,8 +45,8 @@
if (voicemail_local_after_email == nil) then
voicemail_local_after_email = "true";
end
if (voicemail_attach_file == nil) then
voicemail_attach_file = "true";
if (voicemail_file == nil) then
voicemail_file = "listen";
end
--require the email address to send the email
@ -113,6 +113,13 @@
body = body:gsub("${message_duration}", message_length_formatted);
body = body:gsub("${account}", id);
body = body:gsub("${domain_name}", domain_name);
if (voicemail_file == "attach") then
body = body:gsub("${message}", "Attached");
elseif (voicemail_file == "link") then
body = body:gsub("${message}", "<a href='https://"..domain_name.."/app/voicemails/voicemail_messages.php?action=download&type=vm&t=bin&id="..id.."&voicemail_uuid="..db_voicemail_uuid.."&uuid="..uuid.."&src=email'>Download</a>");
else
body = body:gsub("${message}", "<a href='https://"..domain_name.."/app/voicemails/voicemail_messages.php?action=autoplay&id="..db_voicemail_uuid.."&uuid="..uuid.."'>Listen</a>");
end
body = body:gsub(" ", "&nbsp;");
body = body:gsub("%s+", "");
body = body:gsub("&nbsp;", " ");
@ -123,7 +130,7 @@
body = trim(body);
--send the email
if (voicemail_attach_file == "true") then
if (voicemail_file == "attach") then
if (voicemail_local_after_email == "false") then
delete = "true";
else

View File

@ -1,35 +1,59 @@
<html>
<blockquote type="cite">
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#f3f3f3">
<tbody><tr><td valign="top" align="center">
<table width="486" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tbody><tr><td style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; right-bottom: 1px solid #e8e8e8;" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="middle" align="center" bgcolor="#ff9933" height="32" style="background-color: #ff9933; color: #ffffff; font-family: Arial; font-size: 14px;">
<strong>You Have a New Voice Message</strong> </td>
</tr><tr><td valign="top" style="padding-top: 17px; padding-left: 20px; padding-right: 20px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="21%" style="color: #333333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>From:</strong></td>
<td width="79%" style="color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${caller_id_number}</td>
</tr><tr><td style="color: #333333; font-family: Arial; font-size: 12px; padding-bottom: 11px;"><strong>Received:</strong></td>
<td style="color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 11px; text-align: left;">
${message_date}</td>
</tr><tr><td style="color: #333333; font-family: Arial; font-size: 12px; padding-bottom: 11px;"><strong>Length:</strong></td>
<td style="color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">${message_duration}</td>
</tr><tr><td style="color: #333333; font-family: Arial; font-size: 12px; padding-bottom: 11px;"><strong>To:</strong></td>
<td style="color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">${account}@${domain_name}</td>
</tr></tbody></table></td>
</tr><tr><td style="padding-left: 20px; padding-right: 20px; color: #666666; font-family: Arial; font-size: 12px;">
</td>
</tr><tr><td style="padding-left: 20px; padding-right: 20px; color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 20px;">
</td>
</tr><tr><td style="padding-left: 20px; padding-right: 20px; color: #666666; font-family: Arial; font-size: 12px; padding-top: 11px;">
To listen to this message, open the attachment.
<table width="400" border="0" cellspacing="0" cellpadding="0" align="center"
style="border: 1px solid #cbcfd5;-moz-border-radius: 4px;
-webkit-border-radius: 4px; border-radius: 4px;">
<tr>
<td valign="middle" align="center" bgcolor="#e5e9f0" style="background-color: #e5e9f0;
color: #000; font-family: Arial; font-size: 14px; padding: 7px;-moz-border-radius: 4px;
-webkit-border-radius: 4px; border-radius: 4px;">
<strong>New Voicemail</strong>
</td>
</tr>
</tbody></table></td>
</tr></tbody></table></td>
</tr></tbody></table></div>
</blockquote>
</html>
<tr>
<td valign="top" style="padding: 15px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>To</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${account}@${domain_name}
</td>
</tr>
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;" width="20%">
<strong>From</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;" width="80%">
${caller_id_number}
</td>
</tr>
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>Received</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${message_date}
</td>
</tr>
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>Message</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${message}
</td>
</tr>
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>Length</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${message_duration}
</td>
</tr>
</table>
</td>
</tr>
</table>
</html>

View File

@ -1,35 +1,59 @@
<html>
<blockquote type="cite">
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#f3f3f3">
<tbody><tr><td valign="top" align="center">
<table width="486" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tbody><tr><td style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; right-bottom: 1px solid #e8e8e8;" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="middle" align="center" bgcolor="#ff9933" height="32" style="background-color: #ff9933; color: #ffffff; font-family: Arial; font-size: 14px;">
<strong>You Have a New Voice Message</strong> </td>
</tr><tr><td valign="top" style="padding-top: 17px; padding-left: 20px; padding-right: 20px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="21%" style="color: #333333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>From:</strong></td>
<td width="79%" style="color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${caller_id_number}</td>
</tr><tr><td style="color: #333333; font-family: Arial; font-size: 12px; padding-bottom: 11px;"><strong>Received:</strong></td>
<td style="color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 11px; text-align: left;">
${message_date}</td>
</tr><tr><td style="color: #333333; font-family: Arial; font-size: 12px; padding-bottom: 11px;"><strong>Length:</strong></td>
<td style="color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">${message_duration}</td>
</tr><tr><td style="color: #333333; font-family: Arial; font-size: 12px; padding-bottom: 11px;"><strong>To:</strong></td>
<td style="color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">${account}@${domain_name}</td>
</tr></tbody></table></td>
</tr><tr><td style="padding-left: 20px; padding-right: 20px; color: #666666; font-family: Arial; font-size: 12px;">
</td>
</tr><tr><td style="padding-left: 20px; padding-right: 20px; color: #666666; font-family: Arial; font-size: 12px; padding-bottom: 20px;">
</td>
</tr><tr><td style="padding-left: 20px; padding-right: 20px; color: #666666; font-family: Arial; font-size: 12px; padding-top: 11px;">
To listen to this message, open the attachment.
<table width="400" border="0" cellspacing="0" cellpadding="0" align="center"
style="border: 1px solid #cbcfd5;-moz-border-radius: 4px;
-webkit-border-radius: 4px; border-radius: 4px;">
<tr>
<td valign="middle" align="center" bgcolor="#e5e9f0" style="background-color: #e5e9f0;
color: #000; font-family: Arial; font-size: 14px; padding: 7px;-moz-border-radius: 4px;
-webkit-border-radius: 4px; border-radius: 4px;">
<strong>New Voicemail</strong>
</td>
</tr>
</tbody></table></td>
</tr></tbody></table></td>
</tr></tbody></table></div>
</blockquote>
</html>
<tr>
<td valign="top" style="padding: 15px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>To</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${account}@${domain_name}
</td>
</tr>
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;" width="20%">
<strong>From</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;" width="80%">
${caller_id_number}
</td>
</tr>
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>Received</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${message_date}
</td>
</tr>
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>Message</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${message}
</td>
</tr>
<tr>
<td style="color: #333; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
<strong>Length</strong>
</td>
<td style="color: #666; font-family: Arial; font-size: 12px; padding-bottom: 11px;">
${message_duration}
</td>
</tr>
</table>
</td>
</tr>
</table>
</html>