2016-04-26 03:30:23 +02:00
|
|
|
<?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>
|
2018-06-06 19:07:29 +02:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2018
|
2016-04-26 03:30:23 +02:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
2018-06-06 19:07:29 +02:00
|
|
|
|
|
|
|
|
//includes
|
|
|
|
|
require_once "root.php";
|
|
|
|
|
require_once "resources/require.php";
|
|
|
|
|
require_once "resources/check_auth.php";
|
2020-01-06 19:43:43 +01:00
|
|
|
require_once "resources/paging.php";
|
2018-06-06 19:07:29 +02:00
|
|
|
|
|
|
|
|
//check permissions
|
|
|
|
|
if (permission_exists('fax_file_view')) {
|
|
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2016-04-26 03:30:23 +02:00
|
|
|
|
|
|
|
|
//add multi-lingual support
|
|
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
|
|
|
|
|
|
|
|
|
//get variables used to control the order
|
2019-08-08 02:59:26 +02:00
|
|
|
$order_by = $_GET["order_by"];
|
|
|
|
|
$order = $_GET["order"];
|
2016-04-26 03:30:23 +02:00
|
|
|
|
|
|
|
|
//get fax extension
|
2019-08-08 02:59:26 +02:00
|
|
|
if (is_uuid($_GET["id"])) {
|
2018-12-18 02:49:02 +01:00
|
|
|
$fax_uuid = $_GET["id"];
|
2016-04-26 03:30:23 +02:00
|
|
|
if (if_group("superadmin") || if_group("admin")) {
|
|
|
|
|
//show all fax extensions
|
|
|
|
|
$sql = "select fax_name, fax_extension from v_fax ";
|
2019-08-08 02:59:26 +02:00
|
|
|
$sql .= "where domain_uuid = :domain_uuid ";
|
|
|
|
|
$sql .= "and fax_uuid = :fax_uuid ";
|
|
|
|
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$parameters['fax_uuid'] = $fax_uuid;
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//show only assigned fax extensions
|
|
|
|
|
$sql = "select fax_name, fax_extension from v_fax as f, v_fax_users as u ";
|
|
|
|
|
$sql .= "where f.fax_uuid = u.fax_uuid ";
|
2019-08-08 02:59:26 +02:00
|
|
|
$sql .= "and f.domain_uuid = :domain_uuid ";
|
|
|
|
|
$sql .= "and f.fax_uuid = :fax_uuid ";
|
|
|
|
|
$sql .= "and u.user_uuid = :user_uuid ";
|
|
|
|
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$parameters['fax_uuid'] = $fax_uuid;
|
|
|
|
|
$parameters['user_uuid'] = $_SESSION['user_uuid'];
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
2019-08-08 02:59:26 +02:00
|
|
|
$database = new database;
|
|
|
|
|
$row = $database->select($sql, $parameters, 'row');
|
|
|
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
2016-04-26 03:30:23 +02:00
|
|
|
//set database fields as variables
|
|
|
|
|
$fax_name = $row["fax_name"];
|
|
|
|
|
$fax_extension = $row["fax_extension"];
|
|
|
|
|
}
|
2019-08-08 02:59:26 +02:00
|
|
|
else {
|
|
|
|
|
if (!if_group("superadmin") && !if_group("admin")) {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $row);
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//set the fax directory
|
|
|
|
|
$fax_dir = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'];
|
|
|
|
|
|
|
|
|
|
//download the fax
|
|
|
|
|
if ($_GET['a'] == "download") {
|
|
|
|
|
session_cache_limiter('public');
|
|
|
|
|
//test to see if it is in the inbox or sent directory.
|
|
|
|
|
if ($_GET['type'] == "fax_inbox") {
|
2019-08-08 02:59:26 +02:00
|
|
|
if (file_exists($fax_dir.'/'.$_GET['ext'].'/inbox/'.$_GET['filename'])) {
|
|
|
|
|
$tmp_faxdownload_file = $fax_dir.'/'.$_GET['ext'].'/inbox/'.$_GET['filename'];
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if ($_GET['type'] == "fax_sent") {
|
2019-08-08 02:59:26 +02:00
|
|
|
if (file_exists($fax_dir.'/'.$_GET['ext'].'/sent/'.$_GET['filename'])) {
|
|
|
|
|
$tmp_faxdownload_file = $fax_dir.'/'.$_GET['ext'].'/sent/'.$_GET['filename'];
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
2019-08-08 02:59:26 +02:00
|
|
|
//let's see if we found it
|
2016-04-26 03:30:23 +02:00
|
|
|
if (strlen($tmp_faxdownload_file) > 0) {
|
|
|
|
|
$fd = fopen($tmp_faxdownload_file, "rb");
|
|
|
|
|
if ($_GET['t'] == "bin") {
|
|
|
|
|
header("Content-Type: application/force-download");
|
|
|
|
|
header("Content-Type: application/octet-stream");
|
|
|
|
|
header("Content-Description: File Transfer");
|
2019-08-08 02:59:26 +02:00
|
|
|
header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"');
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2019-08-08 02:59:26 +02:00
|
|
|
$file_ext = substr($_GET['filename'], -3);
|
2016-04-26 03:30:23 +02:00
|
|
|
if ($file_ext == "tif") {
|
2019-08-08 02:59:26 +02:00
|
|
|
header("Content-Type: image/tiff");
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
else if ($file_ext == "png") {
|
2019-08-08 02:59:26 +02:00
|
|
|
header("Content-Type: image/png");
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
else if ($file_ext == "jpg") {
|
2019-08-08 02:59:26 +02:00
|
|
|
header('Content-Type: image/jpeg');
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
else if ($file_ext == "pdf") {
|
2019-08-08 02:59:26 +02:00
|
|
|
header("Content-Type: application/pdf");
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
header('Accept-Ranges: bytes');
|
|
|
|
|
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
|
|
|
|
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // date in the past
|
2019-08-08 02:59:26 +02:00
|
|
|
header("Content-Length: ".filesize($tmp_faxdownload_file));
|
2016-04-26 03:30:23 +02:00
|
|
|
fpassthru($fd);
|
|
|
|
|
}
|
|
|
|
|
else {
|
2019-08-08 02:59:26 +02:00
|
|
|
echo $text['label-file'];
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//get the fax extension
|
|
|
|
|
if (strlen($fax_extension) > 0) {
|
|
|
|
|
//set the fax directories. example /usr/local/freeswitch/storage/fax/329/inbox
|
|
|
|
|
$dir_fax_inbox = $fax_dir.'/'.$fax_extension.'/inbox';
|
|
|
|
|
$dir_fax_sent = $fax_dir.'/'.$fax_extension.'/sent';
|
|
|
|
|
$dir_fax_temp = $fax_dir.'/'.$fax_extension.'/temp';
|
|
|
|
|
|
|
|
|
|
//make sure the directories exist
|
|
|
|
|
if (!is_dir($_SESSION['switch']['storage']['dir'])) {
|
2016-06-28 23:18:40 +02:00
|
|
|
event_socket_mkdir($_SESSION['switch']['storage']['dir']);
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
if (!is_dir($fax_dir.'/'.$fax_extension)) {
|
2016-06-28 23:18:40 +02:00
|
|
|
event_socket_mkdir($fax_dir.'/'.$fax_extension);
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
if (!is_dir($dir_fax_inbox)) {
|
2016-06-28 23:18:40 +02:00
|
|
|
event_socket_mkdir($dir_fax_inbox);
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
if (!is_dir($dir_fax_sent)) {
|
2016-06-28 23:18:40 +02:00
|
|
|
event_socket_mkdir($dir_fax_sent);
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
if (!is_dir($dir_fax_temp)) {
|
2016-06-28 23:18:40 +02:00
|
|
|
event_socket_mkdir($dir_fax_temp);
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//prepare to page the results
|
2019-08-08 02:59:26 +02:00
|
|
|
$sql = "select count(*) from v_fax_files ";
|
|
|
|
|
$sql .= "where fax_uuid = :fax_uuid ";
|
|
|
|
|
$sql .= "and domain_uuid = :domain_uuid ";
|
2016-04-26 03:30:23 +02:00
|
|
|
if ($_REQUEST['box'] == 'inbox') {
|
|
|
|
|
$sql .= "and fax_mode = 'rx' ";
|
|
|
|
|
}
|
|
|
|
|
if ($_REQUEST['box'] == 'sent') {
|
|
|
|
|
$sql .= "and fax_mode = 'tx' ";
|
|
|
|
|
}
|
2019-08-08 02:59:26 +02:00
|
|
|
$parameters['fax_uuid'] = $fax_uuid;
|
|
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
|
|
|
|
$database = new database;
|
|
|
|
|
$num_rows = $database->select($sql, $parameters, 'column');
|
2016-04-26 03:30:23 +02:00
|
|
|
|
|
|
|
|
//prepare to page the results
|
|
|
|
|
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
2019-11-20 17:05:10 +01:00
|
|
|
$param = "&id=".$fax_uuid."&box=".$_GET['box']."&order_by=".$_GET['order_by']."&order=".$_GET['order'];
|
2016-04-26 03:30:23 +02:00
|
|
|
$page = $_GET['page'];
|
|
|
|
|
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
|
|
|
|
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
|
|
|
|
$offset = $rows_per_page * $page;
|
|
|
|
|
|
|
|
|
|
//get the list
|
2019-08-08 02:59:26 +02:00
|
|
|
$sql = str_replace('count(*)', '*', $sql);
|
|
|
|
|
$sql .= order_by($order_by, $order, 'fax_date', 'desc');
|
|
|
|
|
$sql .= limit_offset($rows_per_page, $offset);
|
|
|
|
|
$database = new database;
|
|
|
|
|
$fax_files = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset($sql, $parameters, $num_rows);
|
2016-04-26 03:30:23 +02:00
|
|
|
|
2020-01-06 19:43:43 +01:00
|
|
|
//include header
|
|
|
|
|
if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) {
|
|
|
|
|
$document['title'] = $text['title-inbox'].": ".escape($fax_name)." (".escape($fax_extension).")";
|
|
|
|
|
}
|
|
|
|
|
if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) {
|
|
|
|
|
$document['title'] = $text['title-sent_faxes'].": ".escape($fax_name)." (".escape($fax_extension).")";
|
|
|
|
|
}
|
|
|
|
|
require_once "resources/header.php";
|
|
|
|
|
|
2016-04-26 03:30:23 +02:00
|
|
|
//show the header
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td align='left' valign='top'>\n";
|
|
|
|
|
if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) {
|
2018-08-31 22:34:27 +02:00
|
|
|
echo " <b>".$text['header-inbox'].": ".escape($fax_name)." (".escape($fax_extension).")</b>\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) {
|
2020-01-06 19:43:43 +01:00
|
|
|
echo " <b>".$text['header-sent_faxes'].": ".escape($fax_name)." (".escape($fax_extension).")</b>\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td width='70%' align='right' valign='top'>\n";
|
|
|
|
|
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='fax.php'\" value='".$text['button-back']."'>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<br>\n";
|
|
|
|
|
|
|
|
|
|
//show the table and content
|
|
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
|
2018-12-18 02:49:02 +01:00
|
|
|
//show the fax files
|
2016-04-26 03:30:23 +02:00
|
|
|
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2019-11-20 17:05:10 +01:00
|
|
|
echo th_order_by('fax_caller_id_name', $text['label-fax_caller_id_name'], $order_by, $order, "&id=".$fax_uuid."&box=".$_GET['box']."&page=".$_GET['page']);
|
|
|
|
|
echo th_order_by('fax_caller_id_number', $text['label-fax_caller_id_number'], $order_by, $order, "&id=".$fax_uuid."&box=".$_GET['box']."&page=".$_GET['page']);
|
2016-04-26 03:30:23 +02:00
|
|
|
if ($_REQUEST['box'] == 'sent') {
|
2019-11-20 17:05:10 +01:00
|
|
|
echo th_order_by('fax_destination', $text['label-fax_destination'], $order_by, $order, "&id=".$fax_uuid."&box=".$_GET['box']."&page=".$_GET['page']);
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
echo "<th width=''>".$text['table-file']."</th>\n";
|
|
|
|
|
echo "<th width='10%'>".$text['table-view']."</th>\n";
|
2019-11-20 17:05:10 +01:00
|
|
|
echo th_order_by('fax_date', $text['label-fax_date'], $order_by, $order, "&id=".$fax_uuid."&box=".$_GET['box']."&page=".$_GET['page']);
|
2016-04-26 03:30:23 +02:00
|
|
|
echo "<td style='width: 25px;' class='list_control_icons'> </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2019-08-08 02:59:26 +02:00
|
|
|
if (is_array($fax_files) && @sizeof($fax_files) != 0) {
|
2016-04-26 03:30:23 +02:00
|
|
|
foreach($fax_files as $row) {
|
|
|
|
|
$file = basename($row['fax_file_path']);
|
|
|
|
|
if (strtolower(substr($file, -3)) == "tif" || strtolower(substr($file, -3)) == "pdf") {
|
|
|
|
|
$file_name = substr($file, 0, (strlen($file) -4));
|
|
|
|
|
}
|
|
|
|
|
$file_ext = $row['fax_file_type'];
|
|
|
|
|
|
|
|
|
|
//decode the base64
|
|
|
|
|
if (strlen($row['fax_base64']) > 0) {
|
|
|
|
|
if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) {
|
|
|
|
|
if (!file_exists($dir_fax_inbox.'/'.$file)) {
|
|
|
|
|
file_put_contents($dir_fax_inbox.'/'.$file, base64_decode($row['fax_base64']));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) {
|
|
|
|
|
if (!file_exists($dir_fax_sent.'/'.$file)) {
|
|
|
|
|
//decode the base64
|
|
|
|
|
file_put_contents($dir_fax_sent.'/'.$file, base64_decode($row['fax_base64']));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//convert the tif to pdf
|
|
|
|
|
unset($dir_fax);
|
|
|
|
|
if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) {
|
|
|
|
|
if (!file_exists($dir_fax_inbox.'/'.$file_name.".pdf")) {
|
|
|
|
|
$dir_fax = $dir_fax_inbox;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) {
|
|
|
|
|
if (!file_exists($dir_fax_sent.'/'.$file_name.".pdf")) {
|
|
|
|
|
$dir_fax = $dir_fax_sent;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($dir_fax != '') {
|
|
|
|
|
chdir($dir_fax);
|
|
|
|
|
//get fax resolution (ppi, W & H)
|
|
|
|
|
$resp = exec("tiffinfo ".$file_name.".tif | grep 'Resolution:'");
|
|
|
|
|
$resp_array = explode(' ', trim($resp));
|
|
|
|
|
$ppi_w = (int) $resp_array[1];
|
|
|
|
|
$ppi_h = (int) $resp_array[2];
|
|
|
|
|
unset($resp_array);
|
|
|
|
|
$gs_r = $ppi_w.'x'.$ppi_h; //used by ghostscript
|
|
|
|
|
//get page dimensions/size (pixels/inches, W & H)
|
|
|
|
|
$resp = exec("tiffinfo ".$file_name.".tif | grep 'Image Width:'");
|
|
|
|
|
$resp_array = explode(' ', trim($resp));
|
|
|
|
|
$pix_w = $resp_array[2];
|
|
|
|
|
$pix_h = $resp_array[5];
|
|
|
|
|
unset($resp_array);
|
|
|
|
|
$gs_g = $pix_w.'x'.$pix_h; //used by ghostscript
|
|
|
|
|
$page_width = $pix_w / $ppi_w;
|
|
|
|
|
$page_height = $pix_h / $ppi_h;
|
|
|
|
|
if ($page_width > 8.4 && $page_height > 13) {
|
|
|
|
|
$page_width = 8.5;
|
|
|
|
|
$page_height = 14;
|
|
|
|
|
$page_size = 'legal';
|
|
|
|
|
}
|
|
|
|
|
else if ($page_width > 8.4 && $page_height < 12) {
|
|
|
|
|
$page_width = 8.5;
|
|
|
|
|
$page_height = 11;
|
|
|
|
|
$page_size = 'letter';
|
|
|
|
|
}
|
|
|
|
|
else if ($page_width < 8.4 && $page_height > 11) {
|
|
|
|
|
$page_width = 8.3;
|
|
|
|
|
$page_height = 11.7;
|
|
|
|
|
$page_size = 'a4';
|
|
|
|
|
}
|
|
|
|
|
//generate pdf (a work around, as tiff2pdf improperly inverts the colors)
|
|
|
|
|
$cmd_tif2pdf = "tiff2pdf -i -u i -p ".$page_size." -w ".$page_width." -l ".$page_height." -f -o ".$dir_fax_temp.'/'.$file_name.".pdf ".$dir_fax.'/'.$file_name.".tif";
|
|
|
|
|
//echo $cmd_tif2pdf."<br>";
|
|
|
|
|
exec($cmd_tif2pdf);
|
|
|
|
|
chdir($dir_fax_temp);
|
|
|
|
|
$cmd_pdf2tif = "gs -q -sDEVICE=tiffg3 -r".$gs_r." -g".$gs_g." -dNOPAUSE -sOutputFile=".$file_name."_temp.tif -- ".$file_name.".pdf -c quit";
|
|
|
|
|
//echo $cmd_pdf2tif."<br>";
|
|
|
|
|
exec($cmd_pdf2tif); //convert pdf to tif
|
|
|
|
|
@unlink($dir_fax_temp.'/'.$file_name.".pdf");
|
|
|
|
|
$cmd_tif2pdf = "tiff2pdf -i -u i -p ".$page_size." -w ".$page_width." -l ".$page_height." -f -o ".$dir_fax.'/'.$file_name.".pdf ".$dir_fax_temp.'/'.$file_name."_temp.tif";
|
|
|
|
|
//echo $cmd_tif2pdf."<br>";
|
|
|
|
|
exec($cmd_tif2pdf);
|
|
|
|
|
@unlink($dir_fax_temp.'/'.$file_name."_temp.tif");
|
|
|
|
|
}
|
|
|
|
|
echo "</td></tr>";
|
|
|
|
|
echo "<tr ".$tr_link.">\n";
|
2018-06-06 19:07:29 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['fax_caller_id_name'])." </td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape(format_phone($row['fax_caller_id_number']))." </td>\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
if ($_REQUEST['box'] == 'sent') {
|
2018-06-06 19:07:29 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape(format_phone($row['fax_destination']))." </td>\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
echo " <td class='".$row_style[$c]."' ondblclick=\"\">\n";
|
|
|
|
|
if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) {
|
2019-11-20 17:05:10 +01:00
|
|
|
echo " <a href=\"fax_files.php?id=".urlencode($fax_uuid)."&a=download&type=fax_inbox&t=bin&ext=".urlencode($fax_extension)."&filename=".urlencode($file)."\">\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) {
|
2019-11-20 17:05:10 +01:00
|
|
|
echo " <a href=\"fax_files.php?id=".urlencode($fax_uuid)."&a=download&type=fax_sent&t=bin&ext=".urlencode($fax_extension)."&filename=".urlencode($file)."\">\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
echo " $file_name";
|
|
|
|
|
echo " </a>";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='".$row_style[$c]."' ondblclick=''>\n";
|
|
|
|
|
if ($_REQUEST['box'] == 'inbox') {
|
|
|
|
|
$dir_fax = $dir_fax_inbox;
|
|
|
|
|
}
|
|
|
|
|
if ($_REQUEST['box'] == 'sent') {
|
|
|
|
|
$dir_fax = $dir_fax_sent;
|
|
|
|
|
}
|
|
|
|
|
if (file_exists($dir_fax.'/'.$file_name.".pdf")) {
|
|
|
|
|
if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) {
|
2019-11-20 17:05:10 +01:00
|
|
|
echo " <a href=\"fax_files.php?id=".urlencode($fax_uuid)."&a=download&type=fax_inbox&t=bin&ext=".urlencode($fax_extension)."&filename=".urlencode($file_name).".pdf\">PDF</a>\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) {
|
2019-11-20 17:05:10 +01:00
|
|
|
echo " <a href=\"fax_files.php?id=".urlencode($fax_uuid)."&a=download&type=fax_sent&t=bin&ext=".urlencode($fax_extension)."&filename=".urlencode($file_name).".pdf\">PDF</a>\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " \n";
|
|
|
|
|
}
|
2019-02-05 01:22:40 +01:00
|
|
|
$fax_date = ($_SESSION['domain']['time_format']['text'] == '12h') ? date("F d Y H:i", $row['fax_epoch']) : date("F d Y H:i", $row['fax_epoch']);
|
|
|
|
|
|
2016-04-26 03:30:23 +02:00
|
|
|
echo " </td>\n";
|
2019-02-05 01:22:40 +01:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$fax_date." </td>\n";
|
2016-04-26 03:30:23 +02:00
|
|
|
echo " <td style='width: 25px;' class='list_control_icons'>";
|
|
|
|
|
if (permission_exists('fax_file_delete')) {
|
2019-11-20 17:05:10 +01:00
|
|
|
echo "<a href='fax_file_delete.php?id=".urlencode($row['fax_file_uuid'])."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
2016-04-26 03:30:23 +02:00
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
$c = ($c) ? 0 : 1;
|
2019-08-08 02:59:26 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
unset($fax_files, $row);
|
2016-04-26 03:30:23 +02:00
|
|
|
|
|
|
|
|
//show the paging controls
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />";
|
|
|
|
|
|
|
|
|
|
echo "<div align='center'>".$paging_controls."</div>\n";
|
|
|
|
|
echo "<br /><br />";
|
|
|
|
|
|
|
|
|
|
//include the footer
|
|
|
|
|
require_once "resources/footer.php";
|
2018-06-06 19:07:29 +02:00
|
|
|
|
2017-10-20 10:36:15 +02:00
|
|
|
?>
|