mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-27 18:55:42 +00:00
Fax Server: Add option for Download Link on received fax notifications, instead of attachment.
This commit is contained in:
@@ -536,6 +536,11 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "fax_file";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_email_connection_type";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "IMAP or POP3 connection.";
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
$array['email_templates'][$x]['template_body'] .= "Extension: \${fax_extension}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "Messages: \${fax_messages} <br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "\${fax_file_warning}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "\${fax_file_message}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "</body>\n";
|
||||
$array['email_templates'][$x]['template_body'] .= "</html>\n";
|
||||
$array['email_templates'][$x]['template_type'] = "html";
|
||||
@@ -58,6 +59,7 @@
|
||||
$array['email_templates'][$x]['template_body'] .= "Extension: \${fax_extension}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "Messages: \${fax_messages} <br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "\${fax_file_warning}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "\${fax_file_message}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "</body>\n";
|
||||
$array['email_templates'][$x]['template_body'] .= "</html>\n";
|
||||
$array['email_templates'][$x]['template_type'] = "html";
|
||||
@@ -139,6 +141,7 @@
|
||||
$array['email_templates'][$x]['template_body'] .= "Nebenstelle: \${fax_extension}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "Nachrichten: \${fax_messages} <br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "\${fax_file_warning}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "\${fax_file_message}<br>";
|
||||
$array['email_templates'][$x]['template_body'] .= "</body>\n";
|
||||
$array['email_templates'][$x]['template_body'] .= "</html>\n";
|
||||
$array['email_templates'][$x]['template_type'] = "html";
|
||||
|
||||
@@ -5096,4 +5096,56 @@ $text['fax-active_status_fail']['zh-cn'] = "失败";
|
||||
$text['fax-active_status_fail']['ja-jp'] = "失敗";
|
||||
$text['fax-active_status_fail']['ko-kr'] = "실패하다";
|
||||
|
||||
?>
|
||||
$text['option-attachment']['en-us'] = "Attachment";
|
||||
$text['option-attachment']['en-gb'] = "Attachment";
|
||||
$text['option-attachment']['ar-eg'] = "مرفق";
|
||||
$text['option-attachment']['de-at'] = "Anhang";
|
||||
$text['option-attachment']['de-ch'] = "Anhang";
|
||||
$text['option-attachment']['de-de'] = "Anhang";
|
||||
$text['option-attachment']['el-gr'] = "Επισύναψη";
|
||||
$text['option-attachment']['es-cl'] = "Adjunto";
|
||||
$text['option-attachment']['es-mx'] = "Adjunto";
|
||||
$text['option-attachment']['fr-ca'] = "Pièce Jointe";
|
||||
$text['option-attachment']['fr-fr'] = "Pièce Jointe";
|
||||
$text['option-attachment']['he-il'] = "הִתקַשְׁרוּת";
|
||||
$text['option-attachment']['it-it'] = "Attaccamento";
|
||||
$text['option-attachment']['nl-nl'] = "Toevoeging";
|
||||
$text['option-attachment']['pl-pl'] = "Załącznik";
|
||||
$text['option-attachment']['pt-br'] = "Anexo";
|
||||
$text['option-attachment']['pt-pt'] = "Anexo";
|
||||
$text['option-attachment']['ro-ro'] = "Atașament";
|
||||
$text['option-attachment']['ru-ru'] = "Вложение";
|
||||
$text['option-attachment']['sv-se'] = "Anknytning";
|
||||
$text['option-attachment']['uk-ua'] = "вкладення";
|
||||
$text['option-attachment']['tr-tr'] = "EK";
|
||||
$text['option-attachment']['zh-cn'] = "依恋";
|
||||
$text['option-attachment']['ja-jp'] = "付属品";
|
||||
$text['option-attachment']['ko-kr'] = "부착";
|
||||
|
||||
$text['option-download_link']['en-us'] = "Download Link (Login Required)";
|
||||
$text['option-download_link']['en-gb'] = "Download Link (Login Required)";
|
||||
$text['option-download_link']['ar-eg'] = "رابط التحميل (يتطلب تسجيل الدخول)";
|
||||
$text['option-download_link']['de-at'] = "Download-Link (Anmeldung erforderlich)";
|
||||
$text['option-download_link']['de-ch'] = "Download-Link (Anmeldung erforderlich)";
|
||||
$text['option-download_link']['de-de'] = "Download-Link (Anmeldung erforderlich)";
|
||||
$text['option-download_link']['el-gr'] = "Σύνδεσμος λήψης (Απαιτείται σύνδεση)";
|
||||
$text['option-download_link']['es-cl'] = "Enlace de descarga (se requiere iniciar sesión)";
|
||||
$text['option-download_link']['es-mx'] = "Enlace de descarga (se requiere iniciar sesión)";
|
||||
$text['option-download_link']['fr-ca'] = "Lien de téléchargement (connexion requise)";
|
||||
$text['option-download_link']['fr-fr'] = "Lien de téléchargement (connexion requise)";
|
||||
$text['option-download_link']['he-il'] = "קישור להורדה (נדרשת כניסה)";
|
||||
$text['option-download_link']['it-it'] = "Link per il download (richiesto login)";
|
||||
$text['option-download_link']['nl-nl'] = "Downloadlink (inloggen vereist)";
|
||||
$text['option-download_link']['pl-pl'] = "Link do pobrania (wymagane zalogowanie)";
|
||||
$text['option-download_link']['pt-br'] = "Link para download (é necessário fazer login)";
|
||||
$text['option-download_link']['pt-pt'] = "Link para download (login necessário)";
|
||||
$text['option-download_link']['ro-ro'] = "Link de descărcare (autentificare obligatorie)";
|
||||
$text['option-download_link']['ru-ru'] = "Ссылка для скачивания (требуется вход в систему)";
|
||||
$text['option-download_link']['sv-se'] = "Nedladdningslänk (inloggning krävs)";
|
||||
$text['option-download_link']['uk-ua'] = "Посилання для завантаження (потрібно ввійти)";
|
||||
$text['option-download_link']['tr-tr'] = "İndirme Bağlantısı (Giriş Gereklidir)";
|
||||
$text['option-download_link']['zh-cn'] = "下载链接(需要登录)";
|
||||
$text['option-download_link']['ja-jp'] = "ダウンロードリンク(ログインが必要です)";
|
||||
$text['option-download_link']['ko-kr'] = "다운로드 링크 (로그인 필요)";
|
||||
|
||||
?>
|
||||
@@ -119,6 +119,7 @@
|
||||
$fax_destination_number = $_POST["fax_destination_number"];
|
||||
$fax_prefix = $_POST["fax_prefix"];
|
||||
$fax_email = implode(',',array_filter($_POST["fax_email"] ?? []));
|
||||
$fax_file = $_POST["fax_file"];
|
||||
$fax_email_connection_type = $_POST["fax_email_connection_type"];
|
||||
$fax_email_connection_host = $_POST["fax_email_connection_host"];
|
||||
$fax_email_connection_port = $_POST["fax_email_connection_port"];
|
||||
@@ -332,6 +333,7 @@
|
||||
$array['fax'][0]['fax_name'] = $fax_name;
|
||||
if (permission_exists('fax_email')) {
|
||||
$array['fax'][0]['fax_email'] = $fax_email;
|
||||
$array['fax'][0]['fax_file'] = $fax_file;
|
||||
}
|
||||
if (permission_exists('fax_caller_id_name')) {
|
||||
$array['fax'][0]['fax_caller_id_name'] = $fax_caller_id_name;
|
||||
@@ -426,6 +428,7 @@
|
||||
$fax_prefix = $row["fax_prefix"];
|
||||
$fax_name = $row["fax_name"];
|
||||
$fax_email = $row["fax_email"];
|
||||
$fax_file = $row["fax_file"];
|
||||
$fax_caller_id_name = $row["fax_caller_id_name"];
|
||||
$fax_caller_id_number = $row["fax_caller_id_number"];
|
||||
$fax_toll_allow = $row["fax_toll_allow"];
|
||||
@@ -602,7 +605,7 @@
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo "<table border='0' cellpadding='2' cellspacing='0'>\n";
|
||||
$x = 0;
|
||||
foreach($fax_emails as $email) {
|
||||
foreach ($fax_emails as $email) {
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
echo " <input class='formfld' type=\"text\" name=\"fax_email[".$x."]\" maxlength='255' style=\"width: 90%;\"value=\"".escape($email)."\">\n";
|
||||
@@ -618,6 +621,20 @@
|
||||
echo " ".$text['description-email']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".($text['label-email_fax_file'] ?? 'Fax File')."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='fax_file' id='fax_file'>\n";
|
||||
echo " <option value='attach' ".(empty($fax_file) || $fax_fax_file == 'attach' ? "selected='selected'" : null).">".$text['option-attachment']."</option>\n";
|
||||
echo " <option value='link' ".($fax_file == "link" ? "selected='selected'" : null).">".$text['option-download_link']."</option>\n";
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo ($text['description-email_fax_file'] ?? 'Select a fax file option.')."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
if (permission_exists('fax_caller_id_name')) {
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
}
|
||||
|
||||
//download the fax
|
||||
if (isset($fax_dir) && !empty($_GET['a']) && $_GET['a'] == "download") {
|
||||
if (isset($fax_dir) && !empty($_GET['a']) && ($_GET['a'] == "download" || $_GET['a'] == 'download_link')) {
|
||||
|
||||
//sanitize the values that are used in the file name and path
|
||||
$fax_extension = preg_replace('/[^0-9]/', '', $_GET['ext']);
|
||||
@@ -158,6 +158,7 @@
|
||||
$fax->order_by = $_GET['order_by'] ?? '';
|
||||
$fax->order = $_GET['order'] ?? '';
|
||||
$fax->box = $_GET['box'] ?? '';
|
||||
$fax->download = $_GET['a'] == 'download_link' ? true : false;
|
||||
$fax->fax_file_toggle($fax_files);
|
||||
unset($fax, $fax_files);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ if (!class_exists('fax')) {
|
||||
public $box;
|
||||
public $order_by;
|
||||
public $order;
|
||||
public $download;
|
||||
|
||||
/**
|
||||
* declare private variables
|
||||
@@ -668,11 +669,13 @@ if (!class_exists('fax')) {
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: fax_files.php?order_by='.urlencode($this->order_by).'&order='.urlencode($this->order).'&id='.urlencode($this->fax_uuid).'&box='.urlencode($this->box));
|
||||
exit;
|
||||
if (empty($this->download) || $this->download == false) {
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: fax_files.php?order_by='.urlencode($this->order_by).'&order='.urlencode($this->order).'&id='.urlencode($this->fax_uuid).'&box='.urlencode($this->box));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//toggle multiple records
|
||||
|
||||
@@ -214,28 +214,6 @@
|
||||
fax_file_name = array[count(array)];
|
||||
end
|
||||
|
||||
--fax to email
|
||||
cmd = quote(shell_esc(php_dir).."/"..shell_esc(php_bin)).." "..quote(shell_esc(document_root).."/secure/fax_to_email.php").." ";
|
||||
cmd = cmd .. "email="..quote(shell_esc(fax_email)).." ";
|
||||
cmd = cmd .. "extension="..quote(shell_esc(fax_extension)).." ";
|
||||
cmd = cmd .. "name="..quote(shell_esc(fax_file)).." ";
|
||||
cmd = cmd .. "messages=" .. quote("result:"..shell_esc(fax_result_text).." sender:"..shell_esc(fax_remote_station_id).." pages:"..shell_esc(fax_document_total_pages)).." ";
|
||||
cmd = cmd .. "domain="..quote(shell_esc(domain_name)).." ";
|
||||
cmd = cmd .. "caller_id_name=" .. quote(shell_esc(caller_id_name) or '') .. " ";
|
||||
cmd = cmd .. "caller_id_number=" .. quote(shell_esc(caller_id_number) or '') .. " ";
|
||||
if #fax_forward_number > 0 then
|
||||
cmd = cmd .. "fax_relay=true ";
|
||||
else
|
||||
cmd = cmd .. "fax_relay=false ";
|
||||
end
|
||||
if #fax_prefix > 0 then
|
||||
cmd = cmd .. "fax_prefix=true ";
|
||||
else
|
||||
cmd = cmd .. "fax_prefix=false ";
|
||||
end
|
||||
freeswitch.consoleLog("notice", "[fax] command: " .. cmd .. "\n");
|
||||
os.execute(cmd);
|
||||
|
||||
--add to fax logs
|
||||
sql = "insert into v_fax_logs ";
|
||||
sql = sql .. "(";
|
||||
@@ -421,6 +399,29 @@
|
||||
end
|
||||
end
|
||||
|
||||
--fax to email
|
||||
cmd = quote(shell_esc(php_dir).."/"..shell_esc(php_bin)).." "..quote(shell_esc(document_root).."/secure/fax_to_email.php").." ";
|
||||
cmd = cmd .. "email="..quote(shell_esc(fax_email)).." ";
|
||||
cmd = cmd .. "extension="..quote(shell_esc(fax_extension)).." ";
|
||||
cmd = cmd .. "name="..quote(shell_esc(fax_file)).." ";
|
||||
cmd = cmd .. "messages=" .. quote("Result: "..shell_esc(fax_result_text)..", Sender: "..shell_esc(fax_remote_station_id)..", Pages:"..shell_esc(fax_document_total_pages)).." ";
|
||||
cmd = cmd .. "domain="..quote(shell_esc(domain_name)).." ";
|
||||
cmd = cmd .. "caller_id_name=" .. quote(shell_esc(caller_id_name) or '') .. " ";
|
||||
cmd = cmd .. "caller_id_number=" .. quote(shell_esc(caller_id_number) or '') .. " ";
|
||||
cmd = cmd .. "fax_file_uuid=" .. quote(shell_esc(uuid)) .. " ";
|
||||
if #fax_forward_number > 0 then
|
||||
cmd = cmd .. "fax_relay=true ";
|
||||
else
|
||||
cmd = cmd .. "fax_relay=false ";
|
||||
end
|
||||
if #fax_prefix > 0 then
|
||||
cmd = cmd .. "fax_prefix=true ";
|
||||
else
|
||||
cmd = cmd .. "fax_prefix=false ";
|
||||
end
|
||||
freeswitch.consoleLog("notice", "[fax] command: " .. cmd .. "\n");
|
||||
os.execute(cmd);
|
||||
|
||||
--add to the fax queue when the fax_forward_number is set
|
||||
if (fax_forward_number ~= nil) then
|
||||
sql = "insert into v_fax_queue ";
|
||||
|
||||
Reference in New Issue
Block a user